Example usage for com.amazonaws.services.datapipeline.model ValidationError getErrors

List of usage examples for com.amazonaws.services.datapipeline.model ValidationError getErrors

Introduction

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

Prototype


public java.util.List<String> getErrors() 

Source Link

Document

A description of the validation error.

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  .jav a2 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.");
    }
}