Example usage for com.amazonaws Request setAWSRequestMetrics

List of usage examples for com.amazonaws Request setAWSRequestMetrics

Introduction

In this page you can find the example usage for com.amazonaws Request setAWSRequestMetrics.

Prototype

void setAWSRequestMetrics(AWSRequestMetrics metrics);

Source Link

Document

Bind the request metrics to the request.

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 {//from w  ww . j  a  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 {/*from   ww  w . j a  va 2s. com*/
        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 {//from  w  ww . j  a  v a2  s  .  c  om
        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 {/*from  www. java2 s.  co  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 {/*from   w w  w  . j  a v  a  2  s .  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);
    }
}