Example usage for com.amazonaws.services.datapipeline.model ValidationWarning getWarnings

List of usage examples for com.amazonaws.services.datapipeline.model ValidationWarning getWarnings

Introduction

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

Prototype


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

Source Link

Document

A description of the validation warning.

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   w  w w. ja  va2 s  .  co  m
    }

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