Example usage for com.amazonaws.services.ec2.model DryRunResult getMessage

List of usage examples for com.amazonaws.services.ec2.model DryRunResult getMessage

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model DryRunResult getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the message included in the service response.

Usage

From source file:org.xmlsh.aws.util.AWSEC2Command.java

License:BSD License

protected <X extends AmazonWebServiceRequest> int dryRun(DryRunSupportedRequest<X> request)
        throws XMLStreamException, InvalidArgumentException, SaxonApiException, CoreException, IOException {

    DryRunResult<X> result;

    try {//from  w  w w  . ja  va  2  s  .c  o  m
        result = this.getAWSClient().dryRun(request);
    } catch (AmazonServiceException e) {
        if (e.isRetryable())
            throw e;
        return super.handleException(e);
    } catch (AmazonClientException e) {
        if (e.getCause() instanceof AmazonServiceException)
            return super.handleException((AmazonServiceException) e.getCause());
        return super.handleException(e);
    }

    startResult();
    startElement("dry-run");
    attribute("success", result.isSuccessful());
    if (!result.isSuccessful())
        textElement("message", result.getMessage());

    endElement();
    endResult();
    return 0;

}