Example usage for com.amazonaws.services.route53 AmazonRoute53 getChange

List of usage examples for com.amazonaws.services.route53 AmazonRoute53 getChange

Introduction

In this page you can find the example usage for com.amazonaws.services.route53 AmazonRoute53 getChange.

Prototype

GetChangeResult getChange(GetChangeRequest getChangeRequest);

Source Link

Document

Returns the current status of a change batch request.

Usage

From source file:org.ofbiz.tenant.amazonaws.AwsServices.java

License:Apache License

/**
 * get Amazon Rout53 resource record set change
 * @param ctx//from w  w  w.  j  a  v a2  s .  c  om
 * @param context
 * @return
 */
public static Map<String, Object> getAmazonRoute53ResourceRecordSetChange(DispatchContext ctx,
        Map<String, Object> context) {
    String changeId = (String) context.get("changeId");

    try {
        AmazonRoute53 route53 = AwsFactory.getAmazonRoute53();
        GetChangeRequest request = new GetChangeRequest(changeId);
        GetChangeResult getChangeResult = route53.getChange(request);
        ChangeInfo changeInfo = getChangeResult.getChangeInfo();
        String status = changeInfo.getStatus();
        Date submittedDate = changeInfo.getSubmittedAt();
        String comment = changeInfo.getComment();
        Map<String, Object> results = ServiceUtil.returnSuccess();
        results.put("changeId", changeId);
        results.put("status", status);
        results.put("submittedDate", submittedDate);
        results.put("comment", comment);
        return results;
    } catch (Exception e) {
        Debug.logError(e, module);
        return ServiceUtil.returnError(e.getMessage());
    }
}