Example usage for com.amazonaws.http ExecutionContext getAwsRequestMetrics

List of usage examples for com.amazonaws.http ExecutionContext getAwsRequestMetrics

Introduction

In this page you can find the example usage for com.amazonaws.http ExecutionContext getAwsRequestMetrics.

Prototype

public AWSRequestMetrics getAwsRequestMetrics() 

Source Link

Usage

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 {//  w w w  .  j  ava 2s. c o  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 {/*from   w  w w. ja  v  a  2s  .  c  o 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 {/* w  w  w . j  a  va2s. 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);
    }
}

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

License:Open Source License

@Override
public GetImpersonationTokenResult getImpersonationToken(
        final GetImpersonationTokenRequest getImpersonationTokenRequest)
        throws AmazonServiceException, AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(getImpersonationTokenRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<GetImpersonationTokenRequest> request = null;
    Response<GetImpersonationTokenResult> response = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {//www .  j a  v a2s  .  c o m
        request = new GetImpersonationTokenRequestMarshaller().marshall(getImpersonationTokenRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        response = invoke(request, new GetImpersonationTokenResultStaxUnmarshaller(), executionContext);
        return response.getAwsResponse();
    } finally {
        endClientExecution(awsRequestMetrics, request, response);
    }
}

From source file:com.github.sjones4.youcan.youtwo.YouTwoClient.java

License:Open Source License

public DescribeInstanceTypesResult describeInstanceTypes(
        DescribeInstanceTypesRequest describeInstanceTypesRequest) throws AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(describeInstanceTypesRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<DescribeInstanceTypesRequest> request = null;
    Response<DescribeInstanceTypesResult> response = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {// www.j  a  v a2s. co  m
        request = new DescribeInstanceTypesRequestMarshaller().marshall(describeInstanceTypesRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        response = invoke(request, new DescribeInstanceTypesResultStaxUnmarshaller(), executionContext);
        return response.getAwsResponse();
    } finally {
        endClientExecution(awsRequestMetrics, request, response);
    }
}