Examples of ValidatorResult


Examples of com.mimer.ws.validateSQL.ValidatorResult

         final StringBuffer results = new StringBuffer(1024);
         while (qt.hasQuery())
         {
            // TODO: When message are can have some text in red (error)
            // and some normal then put out errors in red.
            ValidatorResult rc = val.validate(qt.nextQuery());
            results.append(rc.getData());
         }
         _results = results.toString().trim();

      }
      catch (Throwable th)
View Full Code Here

Examples of com.sun.enterprise.admin.util.ValidatorResult

        }
    }

    void assertValid(Object object, String name, Validator validator)
    { 
        final ValidatorResult result = validator.validate(object);

        if (!result.isValid())
        {
            final String msg  = "Validation failed for " + name +
                                            ": " + result.getString();
            toss(msg);
        }
    }
View Full Code Here

Examples of org.apache.airavata.model.error.ValidatorResult

    public ValidationResults validateExperiment(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID) throws OrchestratorException,LaunchValidationException {
        org.apache.airavata.model.error.ValidationResults validationResults = new org.apache.airavata.model.error.ValidationResults();
        validationResults.setValidationState(true); // initially making it to success, if atleast one failed them simply mark it failed.
        if (this.orchestratorConfiguration.isEnableValidation()) {
            List<String> validatorClzzez = this.orchestratorContext.getOrchestratorConfiguration().getValidatorClasses();
            ValidatorResult vResult = null;
            for (String validator : validatorClzzez) {
                try {
                    Class<? extends JobMetadataValidator> vClass = Class.forName(validator.trim()).asSubclass(JobMetadataValidator.class);
                    JobMetadataValidator jobMetadataValidator = vClass.newInstance();
                    vResult = jobMetadataValidator.validate(experiment, workflowNodeDetail, taskID);
                    if (vResult.isResult()) {
                        logger.info("Validation of " + validator + " is SUCCESSFUL");
                    } else {
                        logger.error("Validation of " + validator + " is FAILED:[error]" + vResult.getErrorDetails());
                        //todo we need to store this message to registry
                        validationResults.setValidationState(false);
                        // we do not return immediately after the first failure
                    }
                } catch (ClassNotFoundException e) {
                    logger.error("Error loading the validation class: ", validator, e);
                    vResult = new ValidatorResult();
                    vResult.setResult(false);
                    vResult.setErrorDetails("Error loading the validation class: " + e.getMessage());
                    validationResults.setValidationState(false);
                } catch (InstantiationException e) {
                    logger.error("Error loading the validation class: ", validator, e);
                    vResult = new ValidatorResult();
                    vResult.setResult(false);
                    vResult.setErrorDetails("Error loading the validation class: " + e.getMessage());
                    validationResults.setValidationState(false);
                } catch (IllegalAccessException e) {
                    logger.error("Error loading the validation class: ", validator, e);
                    vResult = new ValidatorResult();
                    vResult.setResult(false);
                    vResult.setErrorDetails("Error loading the validation class: " + e.getMessage());
                    validationResults.setValidationState(false);
                }
                validationResults.addToValidationResultList(vResult);
            }
        }
View Full Code Here

Examples of org.apache.airavata.model.error.ValidatorResult

import org.apache.airavata.orchestrator.core.validator.JobMetadataValidator;

public class SecondValidator implements JobMetadataValidator {
    public ValidatorResult validate(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID) {
        if(taskID.getTaskID() == null) {
            ValidatorResult validatorResult = new ValidatorResult(false);
            validatorResult.setErrorDetails("No taskID is set, so Validation failed");
            return validatorResult;
        }
        return new ValidatorResult(true);
    }
View Full Code Here

Examples of org.apache.airavata.model.error.ValidatorResult

    private final static Logger logger = LoggerFactory.getLogger(TestValidator.class);

    public ValidatorResult validate(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID) {
        if (experiment.getProjectID() == null) {
            logger.error("Project ID is not set");
            ValidatorResult validatorResult = new ValidatorResult(false);
            validatorResult.setErrorDetails("Project ID is not set");
            return validatorResult;
        } else if (experiment.getExperimentID() == null) {
            logger.error("This experiment is wrong, no experimentID set");
             ValidatorResult validatorResult = new ValidatorResult(false);
            validatorResult.setErrorDetails("This experiment is wrong, no experimentID set");
            return validatorResult;
        }
        return new ValidatorResult(true);
    }
View Full Code Here

Examples of org.apache.airavata.model.error.ValidatorResult

    public ValidationResults validateExperiment(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID) throws OrchestratorException,LaunchValidationException {
        org.apache.airavata.model.error.ValidationResults validationResults = new org.apache.airavata.model.error.ValidationResults();
        validationResults.setValidationState(true); // initially making it to success, if atleast one failed them simply mark it failed.
        if (this.orchestratorConfiguration.isEnableValidation()) {
            List<String> validatorClzzez = this.orchestratorContext.getOrchestratorConfiguration().getValidatorClasses();
            ValidatorResult vResult = null;
            for (String validator : validatorClzzez) {
                try {
                    Class<? extends JobMetadataValidator> vClass = Class.forName(validator.trim()).asSubclass(JobMetadataValidator.class);
                    JobMetadataValidator jobMetadataValidator = vClass.newInstance();
                    vResult = jobMetadataValidator.validate(experiment, workflowNodeDetail, taskID);
                    if (vResult.isResult()) {
                        logger.info("Validation of " + validator + " is SUCCESSFUL");
                    } else {
                        logger.error("Validation of " + validator + " is FAILED:[error]" + vResult.getErrorDetails());
                        //todo we need to store this message to registry
                        validationResults.setValidationState(false);
                        // we do not return immediately after the first failure
                    }
                } catch (ClassNotFoundException e) {
                    logger.error("Error loading the validation class: ", validator, e);
                    vResult = new ValidatorResult();
                    vResult.setResult(false);
                    vResult.setErrorDetails("Error loading the validation class: " + e.getMessage());
                    validationResults.setValidationState(false);
                } catch (InstantiationException e) {
                    logger.error("Error loading the validation class: ", validator, e);
                    vResult = new ValidatorResult();
                    vResult.setResult(false);
                    vResult.setErrorDetails("Error loading the validation class: " + e.getMessage());
                    validationResults.setValidationState(false);
                } catch (IllegalAccessException e) {
                    logger.error("Error loading the validation class: ", validator, e);
                    vResult = new ValidatorResult();
                    vResult.setResult(false);
                    vResult.setErrorDetails("Error loading the validation class: " + e.getMessage());
                    validationResults.setValidationState(false);
                }
                validationResults.addToValidationResultList(vResult);
            }
        }
View Full Code Here

Examples of org.apache.airavata.model.error.ValidatorResult

    public ValidatorResult validate(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID) {
        boolean result = false;
        if (experiment.getUserConfigurationData().isAiravataAutoSchedule()) {
            logger.error("We dont' support auto scheduling at this point, We will simply use user data as it is");
        }
        return new ValidatorResult(true);
    }
View Full Code Here

Examples of org.apache.airavata.model.error.ValidatorResult

public class ExperimentStatusValidator implements JobMetadataValidator {
    private static Logger log = LoggerFactory.getLogger(ExperimentStatusValidator.class);

    public ValidatorResult validate(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID) {
        String error = "During the validation step experiment status should be CREATED, But this experiment status is : ";
        ValidatorResult validatorResult = new ValidatorResult();
        if (!experiment.getExperimentStatus().getExperimentState().equals(ExperimentState.CREATED)) {
            error += experiment.getExperimentStatus().getExperimentState().toString();
            log.error(error);
            validatorResult.setErrorDetails(error);
            validatorResult.setResult(false);;
            return validatorResult;
        }
        validatorResult.setResult(true);
        return validatorResult;
    }
View Full Code Here

Examples of org.apache.commons.validator.ValidatorResult

            // Look up the formatted name of the field from the Field arg0
            String prettyFieldName = propertyName; //apps.getString(field.getArg(0).getKey());

            // Get the result of validating the property.
            ValidatorResult result = results.getValidatorResult(propertyName);

            // Get all the actions run against the property, and iterate over
            // their names.
            Map actionMap = result.getActionMap();
            Iterator keys = actionMap.keySet().iterator();
            while (keys.hasNext())
            {
                String actName = (String) keys.next();

                // Get the Action for that name.
                ValidatorAction action = resources.getValidatorAction(actName);

                // If the result is valid, print PASSED, otherwise print FAILED
                System.out.println(propertyName + "[" + actName + "] ("
                        + (result.isValid(actName) ? "PASSED" : "FAILED") + ")");

                //If the result failed, format the Action's message against the
                // formatted field name
                if (!result.isValid(actName))
                {
                    success = false;
                    String message = "invalid field"; // apps.getString(action.getMsg());
                    if (actName.equals("doubleRange"))
                    {
View Full Code Here

Examples of org.apache.commons.validator.ValidatorResult

            // Look up the formatted name of the field from the Field arg0
            String prettyFieldName = propertyName; //apps.getString(field.getArg(0).getKey());

            // Get the result of validating the property.
            ValidatorResult result = results.getValidatorResult(propertyName);

            // Get all the actions run against the property, and iterate over
            // their names.
            Map actionMap = result.getActionMap();
            Iterator keys = actionMap.keySet().iterator();
            while (keys.hasNext())
            {
                String actName = (String) keys.next();

                // Get the Action for that name.
                ValidatorAction action = resources.getValidatorAction(actName);

                // If the result is valid, print PASSED, otherwise print FAILED
                System.out.println(propertyName + "[" + actName + "] ("
                        + (result.isValid(actName) ? "PASSED" : "FAILED") + ")");

                //If the result failed, format the Action's message against the
                // formatted field name
                if (!result.isValid(actName))
                {
                    success = false;
                    String message = "invalid field"; // apps.getString(action.getMsg());
                    if (actName.equals("doubleRange"))
                    {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.