Example usage for com.amazonaws.services.datapipeline.model ValidatePipelineDefinitionResult getValidationErrors

List of usage examples for com.amazonaws.services.datapipeline.model ValidatePipelineDefinitionResult getValidationErrors

Introduction

In this page you can find the example usage for com.amazonaws.services.datapipeline.model ValidatePipelineDefinitionResult getValidationErrors.

Prototype


public java.util.List<ValidationError> getValidationErrors() 

Source Link

Document

Any validation errors that were found.

Usage

From source file:com.shazam.dataengineering.pipelinebuilder.DeploymentAction.java

License:Apache License

private void validateNewPipeline(String pipelineId, DataPipelineClient client) throws DeploymentException {
    AWSProxy proxy = new AWSProxy(client);
    ValidatePipelineDefinitionResult validation = proxy.validatePipeline(pipelineId, pipelineObject);

    List<ValidationError> errors = validation.getValidationErrors();
    List<ValidationWarning> warnings = validation.getValidationWarnings();

    for (ValidationError error : errors) {
        for (String errorMessage : error.getErrors()) {
            clientMessages.add("[ERROR] " + errorMessage);
        }/*from   ww  w .  ja  v  a 2  s . c om*/
    }

    for (ValidationWarning warning : warnings) {
        for (String warningMessage : warning.getWarnings()) {
            clientMessages.add("[WARN] " + warningMessage);
        }
    }

    if (validation.isErrored()) {
        clientMessages.add("[ERROR] Critical errors detected in validation.");
        throw new DeploymentException();
    } else {
        clientMessages.add("[INFO] No critical errors for the pipeline detected in validation.");
    }
}