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.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 {//from w  ww.  j av a2s. 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 void deleteAccount(final DeleteAccountRequest deleteAccountRequest) throws AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(deleteAccountRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<DeleteAccountRequest> request = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {//w w  w. j  av  a 2  s. c  om
        request = new DeleteAccountRequestMarshaller().marshall(deleteAccountRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        invoke(request, null, executionContext);
    } finally {
        endClientExecution(awsRequestMetrics, request, null);
    }
}

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 {/* w  w  w  .  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 void putAccountPolicy(final PutAccountPolicyRequest putAccountPolicyRequest)
        throws AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(putAccountPolicyRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<PutAccountPolicyRequest> request = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {//  www  .j a  v  a  2 s .  co m
        request = new PutAccountPolicyRequestMarshaller().marshall(putAccountPolicyRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        invoke(request, null, executionContext);
    } finally {
        endClientExecution(awsRequestMetrics, request, null);
    }
}

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

License:Open Source License

@Override
public void deleteAccountPolicy(final DeleteAccountPolicyRequest deleteAccountPolicyRequest)
        throws AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(deleteAccountPolicyRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<DeleteAccountPolicyRequest> request = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {/*from  ww w  . j  av a2s. co  m*/
        request = new DeleteAccountPolicyRequestMarshaller().marshall(deleteAccountPolicyRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        invoke(request, null, executionContext);
    } finally {
        endClientExecution(awsRequestMetrics, request, null);
    }
}

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 {/*from w  w w  .  jav 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 w  w w.j a va2  s  .  c o  m
        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 {/*from ww w.j a  v  a2s. co m*/
        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 {// ww w.  j  a va  2 s . 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  . ja  v  a2  s . co 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);
    }
}