Example usage for com.amazonaws Response getAwsResponse

List of usage examples for com.amazonaws Response getAwsResponse

Introduction

In this page you can find the example usage for com.amazonaws Response getAwsResponse.

Prototype

public T getAwsResponse() 

Source Link

Usage

From source file:com.github.sjones4.youcan.youare.YouAreClient.java

License:Open Source License

@Override
public CreateAccountResult createAccount(final CreateAccountRequest createAccountRequest)
        throws AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(createAccountRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<CreateAccountRequest> request = null;
    Response<CreateAccountResult> response = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {//ww  w . j  a v a 2s. c  o  m
        request = new CreateAccountRequestMarshaller().marshall(createAccountRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        response = invoke(request, new CreateAccountResultStaxUnmarshaller(), executionContext);
        return response.getAwsResponse();
    } finally {
        endClientExecution(awsRequestMetrics, request, response);
    }
}

From source file:com.github.sjones4.youcan.youare.YouAreClient.java

License:Open Source License

@Override
public ListAccountsResult listAccounts(final ListAccountsRequest listAccountsRequest)
        throws AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(listAccountsRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<ListAccountsRequest> request = null;
    Response<ListAccountsResult> response = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {//from  w ww .j a  v a 2s. c  o  m
        request = new ListAccountsRequestMarshaller().marshall(listAccountsRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        response = invoke(request, new ListAccountsResultStaxUnmarshaller(), executionContext);
        return response.getAwsResponse();
    } finally {
        endClientExecution(awsRequestMetrics, request, response);
    }
}

From source file:com.github.sjones4.youcan.youare.YouAreClient.java

License:Open Source License

@Override
public ListAccountPoliciesResult listAccountPolicies(
        final ListAccountPoliciesRequest listAccountPoliciesRequest) throws AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(listAccountPoliciesRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<ListAccountPoliciesRequest> request = null;
    Response<ListAccountPoliciesResult> response = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {//w  w  w .  j  av a  2 s  .  c om
        request = new ListAccountPoliciesRequestMarshaller().marshall(listAccountPoliciesRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        response = invoke(request, new ListAccountPoliciesResultStaxUnmarshaller(), executionContext);
        return response.getAwsResponse();
    } finally {
        endClientExecution(awsRequestMetrics, request, response);
    }
}

From source file:com.github.sjones4.youcan.youare.YouAreClient.java

License:Open Source License

@Override
public GetAccountPolicyResult getAccountPolicy(final GetAccountPolicyRequest getAccountPolicyRequest)
        throws AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(getAccountPolicyRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<GetAccountPolicyRequest> request = null;
    Response<GetAccountPolicyResult> response = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {/*from   ww  w. ja  v  a  2  s.  com*/
        request = new GetAccountPolicyRequestMarshaller().marshall(getAccountPolicyRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        response = invoke(request, new GetAccountPolicyResultStaxUnmarshaller(), executionContext);
        return response.getAwsResponse();
    } finally {
        endClientExecution(awsRequestMetrics, request, response);
    }
}

From source file:com.github.sjones4.youcan.youconfig.YouConfigClient.java

License:Open Source License

@Override
public DescribeComponentsResult describeComponents(final DescribeComponentsRequest describeComponentsRequest)
        throws AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(describeComponentsRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<DescribeComponentsRequest> request = null;
    Response<DescribeComponentsResult> response = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {// w w w  .  j  a v  a 2s .  c  om
        request = new DescribeComponentsRequestMarshaller().marshall(describeComponentsRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        response = invoke(request, new DescribeComponentsResultStaxUnmarshaller(), executionContext);
        return response.getAwsResponse();
    } finally {
        endClientExecution(awsRequestMetrics, request, response);
    }
}

From source file:com.github.sjones4.youcan.youprop.YouPropClient.java

License:Open Source License

@Override
public DescribePropertiesResult describeProperties(final DescribePropertiesRequest describePropertiesRequest)
        throws AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(describePropertiesRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<DescribePropertiesRequest> request = null;
    Response<DescribePropertiesResult> response = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {/*w w  w.  j a  v  a  2s.c  o m*/
        request = new DescribePropertiesRequestMarshaller().marshall(describePropertiesRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        response = invoke(request, new DescribePropertiesResultStaxUnmarshaller(), executionContext);
        return response.getAwsResponse();
    } finally {
        endClientExecution(awsRequestMetrics, request, response);
    }
}

From source file:com.github.sjones4.youcan.youprop.YouPropClient.java

License:Open Source License

@Override
public ModifyPropertyValueResult modifyPropertyValue(final ModifyPropertyValueRequest modifyPropertyRequest)
        throws AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(modifyPropertyRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<ModifyPropertyValueRequest> request = null;
    Response<ModifyPropertyValueResult> response = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {//from   w  w w  . j ava2s  . c  o m
        request = new ModifyPropertyValueRequestMarshaller().marshall(modifyPropertyRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        response = invoke(request, new ModifyPropertyValueResultStaxUnmarshaller(), executionContext);
        return response.getAwsResponse();
    } finally {
        endClientExecution(awsRequestMetrics, request, response);
    }
}

From source file:com.github.sjones4.youcan.youserv.YouServClient.java

License:Open Source License

@Override
public DescribeServicesResult describeServices(final DescribeServicesRequest describeServicesRequest)
        throws AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(describeServicesRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<DescribeServicesRequest> request = null;
    Response<DescribeServicesResult> response = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {/* ww w . ja v  a  2  s  .co  m*/
        request = new DescribeServicesRequestMarshaller().marshall(describeServicesRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        response = invoke(request, new DescribeServicesResultStaxUnmarshaller(), executionContext);
        return response.getAwsResponse();
    } finally {
        endClientExecution(awsRequestMetrics, request, response);
    }
}

From source file:com.github.sjones4.youcan.youserv.YouServClient.java

License:Open Source License

@Override
public DescribeServiceCertificatesResult describeServiceCertificates(
        final DescribeServiceCertificatesRequest describeServiceCertificatesRequest)
        throws AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(describeServiceCertificatesRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<DescribeServiceCertificatesRequest> request = null;
    Response<DescribeServiceCertificatesResult> response = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {/*  w  w w  . j  a  v a  2 s  .co  m*/
        request = new DescribeServiceCertificatesRequestMarshaller()
                .marshall(describeServiceCertificatesRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        response = invoke(request, new DescribeServiceCertificatesResultStaxUnmarshaller(), executionContext);
        return response.getAwsResponse();
    } finally {
        endClientExecution(awsRequestMetrics, request, response);
    }
}

From source file:com.github.sjones4.youcan.youtoken.YouTokenClient.java

License:Open Source License

@Override
public GetAccessTokenResult getAccessToken(final GetAccessTokenRequest getAccessTokenRequest)
        throws AmazonServiceException, AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(getAccessTokenRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<GetAccessTokenRequest> request = null;
    Response<GetAccessTokenResult> response = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {/*  www.  j ava  2 s  .  c o  m*/
        request = new GetAccessTokenRequestMarshaller().marshall(getAccessTokenRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        response = invoke(request, new GetAccessTokenResultStaxUnmarshaller(), executionContext);
        return response.getAwsResponse();
    } finally {
        endClientExecution(awsRequestMetrics, request, response);
    }
}