Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.cloudtrail;
 
 import java.net.*;
 import java.util.*;
 
 
 
Client for accessing AWSCloudTrail. All service calls made using this client are blocking, and will not return until the service call completes.

AWS CloudTrail

This is the CloudTrail API Reference. It provides descriptions of actions, data types, common parameters, and common errors for CloudTrail.

CloudTrail is a web service that records AWS API calls for your AWS account and delivers log files to an Amazon S3 bucket. The recorded information includes the identity of the user, the start time of the AWS API call, the source IP address, the request parameters, and the response elements returned by the service.

NOTE: As an alternative to using the API, you can use one of the AWS SDKs, which consist of libraries and sample code for various programming languages and platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient way to create programmatic access to AWSCloudTrail. For example, the SDKs take care of cryptographically signing requests, managing errors, and retrying requests automatically. For information about the AWS SDKs, including how to download and install them, see the Tools for Amazon Web Services page.

See the CloudTrail User Guide for information about the data that is included with each AWS API call listed in the log files.

 
 public class AWSCloudTrailClient extends AmazonWebServiceClient implements AWSCloudTrail {

    
Provider for AWS credentials.
 
 
     private static final Log log = LogFactory.getLog(AWSCloudTrail.class);

    
List of exception unmarshallers for all AWSCloudTrail exceptions.
 
     protected List<JsonErrorUnmarshallerjsonErrorUnmarshallers;

    
Constructs a new client to invoke service methods on AWSCloudTrail. A credentials provider chain will be used that searches for credentials in this order:
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • Instance profile credentials delivered through the Amazon EC2 metadata service

All service calls made using this new client object are blocking, and will not return until the service call completes.

 
     public AWSCloudTrailClient() {
         this(new DefaultAWSCredentialsProviderChain(), new ClientConfiguration());
    }

    
Constructs a new client to invoke service methods on AWSCloudTrail. A credentials provider chain will be used that searches for credentials in this order:
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • Instance profile credentials delivered through the Amazon EC2 metadata service

All service calls made using this new client object are blocking, and will not return until the service call completes.

Parameters:
clientConfiguration The client configuration options controlling how this client connects to AWSCloudTrail (ex: proxy settings, retry counts, etc.).
See also:
com.amazonaws.auth.DefaultAWSCredentialsProviderChain
    public AWSCloudTrailClient(ClientConfiguration clientConfiguration) {
        this(new DefaultAWSCredentialsProviderChain(), clientConfiguration);
    }

    
Constructs a new client to invoke service methods on AWSCloudTrail using the specified AWS account credentials.

All service calls made using this new client object are blocking, and will not return until the service call completes.

Parameters:
awsCredentials The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
    public AWSCloudTrailClient(AWSCredentials awsCredentials) {
        this(awsCredentialsnew ClientConfiguration());
    }

    
Constructs a new client to invoke service methods on AWSCloudTrail using the specified AWS account credentials and client configuration options.

All service calls made using this new client object are blocking, and will not return until the service call completes.

Parameters:
awsCredentials The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
clientConfiguration The client configuration options controlling how this client connects to AWSCloudTrail (ex: proxy settings, retry counts, etc.).
    public AWSCloudTrailClient(AWSCredentials awsCredentialsClientConfiguration clientConfiguration) {
        super(adjustClientConfiguration(clientConfiguration));
        
        this. = new StaticCredentialsProvider(awsCredentials);
        
        init();
    }

    
Constructs a new client to invoke service methods on AWSCloudTrail using the specified AWS account credentials provider.

All service calls made using this new client object are blocking, and will not return until the service call completes.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
    public AWSCloudTrailClient(AWSCredentialsProvider awsCredentialsProvider) {
        this(awsCredentialsProvidernew ClientConfiguration());
    }

    
Constructs a new client to invoke service methods on AWSCloudTrail using the specified AWS account credentials provider and client configuration options.

All service calls made using this new client object are blocking, and will not return until the service call completes.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
clientConfiguration The client configuration options controlling how this client connects to AWSCloudTrail (ex: proxy settings, retry counts, etc.).
    public AWSCloudTrailClient(AWSCredentialsProvider awsCredentialsProviderClientConfiguration clientConfiguration) {
        this(awsCredentialsProviderclientConfigurationnull);
    }

    
Constructs a new client to invoke service methods on AWSCloudTrail using the specified AWS account credentials provider, client configuration options and request metric collector.

All service calls made using this new client object are blocking, and will not return until the service call completes.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
clientConfiguration The client configuration options controlling how this client connects to AWSCloudTrail (ex: proxy settings, retry counts, etc.).
requestMetricCollector optional request metric collector
    public AWSCloudTrailClient(AWSCredentialsProvider awsCredentialsProvider,
            ClientConfiguration clientConfiguration,
            RequestMetricCollector requestMetricCollector) {
        super(adjustClientConfiguration(clientConfiguration), requestMetricCollector);
        
        this. = awsCredentialsProvider;
        
        init();
    }
    private void init() {
        
        
        // calling this.setEndPoint(...) will also modify the signer accordingly
        this.setEndpoint("cloudtrail.us-east-1.amazonaws.com");
        
        HandlerChainFactory chainFactory = new HandlerChainFactory();
        .addAll(chainFactory.newRequestHandlerChain(
                "/com/amazonaws/services/cloudtrail/request.handlers"));
        .addAll(chainFactory.newRequestHandler2Chain(
                "/com/amazonaws/services/cloudtrail/request.handler2s"));
    }
        ClientConfiguration config = orig;
        
        return config;
    }

    

Returns a JSON-formatted list of information about the specified trail. Fields include information on delivery errors, Amazon SNS and Amazon S3 errors, and start and stop logging times for each trail.

Parameters:
getTrailStatusRequest Container for the necessary parameters to execute the GetTrailStatus service method on AWSCloudTrail.
Returns:
The response from the GetTrailStatus service method, as returned by AWSCloudTrail.
Throws:
com.amazonaws.services.cloudtrail.model.InvalidTrailNameException
com.amazonaws.services.cloudtrail.model.TrailNotFoundException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSCloudTrail indicating either a problem with the data in the request, or a server side issue.
    public GetTrailStatusResult getTrailStatus(GetTrailStatusRequest getTrailStatusRequest) {
        ExecutionContext executionContext = createExecutionContext(getTrailStatusRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(.);
        Request<GetTrailStatusRequestrequest = null;
        Response<GetTrailStatusResultresponse = null;
        
        try {
            awsRequestMetrics.startEvent(.);
            try {
                request = new GetTrailStatusRequestMarshaller().marshall(super.beforeMarshalling(getTrailStatusRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
            } finally {
                awsRequestMetrics.endEvent(.);
            }
            Unmarshaller<GetTrailStatusResultJsonUnmarshallerContextunmarshaller =
                new GetTrailStatusResultJsonUnmarshaller();
            JsonResponseHandler<GetTrailStatusResultresponseHandler =
                new JsonResponseHandler<GetTrailStatusResult>(unmarshaller);
            response = invoke(requestresponseHandlerexecutionContext);
            return response.getAwsResponse();
        } finally {
            
            endClientExecution(awsRequestMetricsrequestresponse);
        }
    }

    

Deletes a trail.

Parameters:
deleteTrailRequest Container for the necessary parameters to execute the DeleteTrail service method on AWSCloudTrail.
Returns:
The response from the DeleteTrail service method, as returned by AWSCloudTrail.
Throws:
com.amazonaws.services.cloudtrail.model.InvalidTrailNameException
com.amazonaws.services.cloudtrail.model.TrailNotFoundException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSCloudTrail indicating either a problem with the data in the request, or a server side issue.
    public DeleteTrailResult deleteTrail(DeleteTrailRequest deleteTrailRequest) {
        ExecutionContext executionContext = createExecutionContext(deleteTrailRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(.);
        Request<DeleteTrailRequestrequest = null;
        Response<DeleteTrailResultresponse = null;
        
        try {
            awsRequestMetrics.startEvent(.);
            try {
                request = new DeleteTrailRequestMarshaller().marshall(super.beforeMarshalling(deleteTrailRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
            } finally {
                awsRequestMetrics.endEvent(.);
            }
            Unmarshaller<DeleteTrailResultJsonUnmarshallerContextunmarshaller =
                new DeleteTrailResultJsonUnmarshaller();
            JsonResponseHandler<DeleteTrailResultresponseHandler =
                new JsonResponseHandler<DeleteTrailResult>(unmarshaller);
            response = invoke(requestresponseHandlerexecutionContext);
            return response.getAwsResponse();
        } finally {
            
            endClientExecution(awsRequestMetricsrequestresponse);
        }
    }

    

Looks up API activity events captured by CloudTrail that create, update, or delete resources in your account. Events for a region can be looked up for the times in which you had CloudTrail turned on in that region during the last seven days. Lookup supports five different attributes: time range (defined by a start time and end time), user name, event name, resource type, and resource name. All attributes are optional. The maximum number of attributes that can be specified in any one lookup request are time range and one other attribute. The default number of results returned is 10, with a maximum of 50 possible. The response includes a token that you can use to get the next page of results.

IMPORTANT:The rate of lookup requests is limited to one per second per account. If this limit is exceeded, a throttling error occurs.

IMPORTANT:Events that occurred during the selected time range will not be available for lookup if CloudTrail logging was not enabled when the events occurred.

Parameters:
lookupEventsRequest Container for the necessary parameters to execute the LookupEvents service method on AWSCloudTrail.
Returns:
The response from the LookupEvents service method, as returned by AWSCloudTrail.
Throws:
com.amazonaws.services.cloudtrail.model.InvalidMaxResultsException
com.amazonaws.services.cloudtrail.model.InvalidNextTokenException
com.amazonaws.services.cloudtrail.model.InvalidLookupAttributesException
com.amazonaws.services.cloudtrail.model.InvalidTimeRangeException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSCloudTrail indicating either a problem with the data in the request, or a server side issue.
    public LookupEventsResult lookupEvents(LookupEventsRequest lookupEventsRequest) {
        ExecutionContext executionContext = createExecutionContext(lookupEventsRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(.);
        Request<LookupEventsRequestrequest = null;
        Response<LookupEventsResultresponse = null;
        
        try {
            awsRequestMetrics.startEvent(.);
            try {
                request = new LookupEventsRequestMarshaller().marshall(super.beforeMarshalling(lookupEventsRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
            } finally {
                awsRequestMetrics.endEvent(.);
            }
            Unmarshaller<LookupEventsResultJsonUnmarshallerContextunmarshaller =
                new LookupEventsResultJsonUnmarshaller();
            JsonResponseHandler<LookupEventsResultresponseHandler =
                new JsonResponseHandler<LookupEventsResult>(unmarshaller);
            response = invoke(requestresponseHandlerexecutionContext);
            return response.getAwsResponse();
        } finally {
            
            endClientExecution(awsRequestMetricsrequestresponse);
        }
    }

    

From the command line, use create-subscription .

Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket.

    public CreateTrailResult createTrail(CreateTrailRequest createTrailRequest) {
        ExecutionContext executionContext = createExecutionContext(createTrailRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(.);
        Request<CreateTrailRequestrequest = null;
        Response<CreateTrailResultresponse = null;
        
        try {
            awsRequestMetrics.startEvent(.);
            try {
                request = new CreateTrailRequestMarshaller().marshall(super.beforeMarshalling(createTrailRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
            } finally {
                awsRequestMetrics.endEvent(.);
            }
            Unmarshaller<CreateTrailResultJsonUnmarshallerContextunmarshaller =
                new CreateTrailResultJsonUnmarshaller();
            JsonResponseHandler<CreateTrailResultresponseHandler =
                new JsonResponseHandler<CreateTrailResult>(unmarshaller);
            response = invoke(requestresponseHandlerexecutionContext);
            return response.getAwsResponse();
        } finally {
            
            endClientExecution(awsRequestMetricsrequestresponse);
        }
    }

    

From the command line, use update-subscription .

Updates the settings that specify delivery of log files. Changes to a trail do not require stopping the CloudTrail service. Use this action to designate an existing bucket for log delivery. If the existing bucket has previously been a target for CloudTrail log files, an IAM policy exists for the bucket.

    public UpdateTrailResult updateTrail(UpdateTrailRequest updateTrailRequest) {
        ExecutionContext executionContext = createExecutionContext(updateTrailRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(.);
        Request<UpdateTrailRequestrequest = null;
        Response<UpdateTrailResultresponse = null;
        
        try {
            awsRequestMetrics.startEvent(.);
            try {
                request = new UpdateTrailRequestMarshaller().marshall(super.beforeMarshalling(updateTrailRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
            } finally {
                awsRequestMetrics.endEvent(.);
            }
            Unmarshaller<UpdateTrailResultJsonUnmarshallerContextunmarshaller =
                new UpdateTrailResultJsonUnmarshaller();
            JsonResponseHandler<UpdateTrailResultresponseHandler =
                new JsonResponseHandler<UpdateTrailResult>(unmarshaller);
            response = invoke(requestresponseHandlerexecutionContext);
            return response.getAwsResponse();
        } finally {
            
            endClientExecution(awsRequestMetricsrequestresponse);
        }
    }

    

Retrieves settings for the trail associated with the current region for your account.

Parameters:
describeTrailsRequest Container for the necessary parameters to execute the DescribeTrails service method on AWSCloudTrail.
Returns:
The response from the DescribeTrails service method, as returned by AWSCloudTrail.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSCloudTrail indicating either a problem with the data in the request, or a server side issue.
    public DescribeTrailsResult describeTrails(DescribeTrailsRequest describeTrailsRequest) {
        ExecutionContext executionContext = createExecutionContext(describeTrailsRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(.);
        Request<DescribeTrailsRequestrequest = null;
        Response<DescribeTrailsResultresponse = null;
        
        try {
            awsRequestMetrics.startEvent(.);
            try {
                request = new DescribeTrailsRequestMarshaller().marshall(super.beforeMarshalling(describeTrailsRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
            } finally {
                awsRequestMetrics.endEvent(.);
            }
            Unmarshaller<DescribeTrailsResultJsonUnmarshallerContextunmarshaller =
                new DescribeTrailsResultJsonUnmarshaller();
            JsonResponseHandler<DescribeTrailsResultresponseHandler =
                new JsonResponseHandler<DescribeTrailsResult>(unmarshaller);
            response = invoke(requestresponseHandlerexecutionContext);
            return response.getAwsResponse();
        } finally {
            
            endClientExecution(awsRequestMetricsrequestresponse);
        }
    }

    

Suspends the recording of AWS API calls and log file delivery for the specified trail. Under most circumstances, there is no need to use this action. You can update a trail without stopping it first. This action is the only way to stop recording.

Parameters:
stopLoggingRequest Container for the necessary parameters to execute the StopLogging service method on AWSCloudTrail.
Returns:
The response from the StopLogging service method, as returned by AWSCloudTrail.
Throws:
com.amazonaws.services.cloudtrail.model.InvalidTrailNameException
com.amazonaws.services.cloudtrail.model.TrailNotFoundException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSCloudTrail indicating either a problem with the data in the request, or a server side issue.
    public StopLoggingResult stopLogging(StopLoggingRequest stopLoggingRequest) {
        ExecutionContext executionContext = createExecutionContext(stopLoggingRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(.);
        Request<StopLoggingRequestrequest = null;
        Response<StopLoggingResultresponse = null;
        
        try {
            awsRequestMetrics.startEvent(.);
            try {
                request = new StopLoggingRequestMarshaller().marshall(super.beforeMarshalling(stopLoggingRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
            } finally {
                awsRequestMetrics.endEvent(.);
            }
            Unmarshaller<StopLoggingResultJsonUnmarshallerContextunmarshaller =
                new StopLoggingResultJsonUnmarshaller();
            JsonResponseHandler<StopLoggingResultresponseHandler =
                new JsonResponseHandler<StopLoggingResult>(unmarshaller);
            response = invoke(requestresponseHandlerexecutionContext);
            return response.getAwsResponse();
        } finally {
            
            endClientExecution(awsRequestMetricsrequestresponse);
        }
    }

    

Starts the recording of AWS API calls and log file delivery for a trail.

Parameters:
startLoggingRequest Container for the necessary parameters to execute the StartLogging service method on AWSCloudTrail.
Returns:
The response from the StartLogging service method, as returned by AWSCloudTrail.
Throws:
com.amazonaws.services.cloudtrail.model.InvalidTrailNameException
com.amazonaws.services.cloudtrail.model.TrailNotFoundException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSCloudTrail indicating either a problem with the data in the request, or a server side issue.
    public StartLoggingResult startLogging(StartLoggingRequest startLoggingRequest) {
        ExecutionContext executionContext = createExecutionContext(startLoggingRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(.);
        Request<StartLoggingRequestrequest = null;
        Response<StartLoggingResultresponse = null;
        
        try {
            awsRequestMetrics.startEvent(.);
            try {
                request = new StartLoggingRequestMarshaller().marshall(super.beforeMarshalling(startLoggingRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
            } finally {
                awsRequestMetrics.endEvent(.);
            }
            Unmarshaller<StartLoggingResultJsonUnmarshallerContextunmarshaller =
                new StartLoggingResultJsonUnmarshaller();
            JsonResponseHandler<StartLoggingResultresponseHandler =
                new JsonResponseHandler<StartLoggingResult>(unmarshaller);
            response = invoke(requestresponseHandlerexecutionContext);
            return response.getAwsResponse();
        } finally {
            
            endClientExecution(awsRequestMetricsrequestresponse);
        }
    }

    

Looks up API activity events captured by CloudTrail that create, update, or delete resources in your account. Events for a region can be looked up for the times in which you had CloudTrail turned on in that region during the last seven days. Lookup supports five different attributes: time range (defined by a start time and end time), user name, event name, resource type, and resource name. All attributes are optional. The maximum number of attributes that can be specified in any one lookup request are time range and one other attribute. The default number of results returned is 10, with a maximum of 50 possible. The response includes a token that you can use to get the next page of results.

IMPORTANT:The rate of lookup requests is limited to one per second per account. If this limit is exceeded, a throttling error occurs.

IMPORTANT:Events that occurred during the selected time range will not be available for lookup if CloudTrail logging was not enabled when the events occurred.

Returns:
The response from the LookupEvents service method, as returned by AWSCloudTrail.
Throws:
com.amazonaws.services.cloudtrail.model.InvalidMaxResultsException
com.amazonaws.services.cloudtrail.model.InvalidNextTokenException
com.amazonaws.services.cloudtrail.model.InvalidLookupAttributesException
com.amazonaws.services.cloudtrail.model.InvalidTimeRangeException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSCloudTrail indicating either a problem with the data in the request, or a server side issue.
        return lookupEvents(new LookupEventsRequest());
    }
    
    

Retrieves settings for the trail associated with the current region for your account.

Returns:
The response from the DescribeTrails service method, as returned by AWSCloudTrail.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSCloudTrail indicating either a problem with the data in the request, or a server side issue.
        return describeTrails(new DescribeTrailsRequest());
    }
    @Override
    public void setEndpoint(String endpoint) {
        super.setEndpoint(endpoint);
    }
    @Override
    public void setEndpoint(String endpointString serviceNameString regionIdthrows IllegalArgumentException {
        super.setEndpoint(endpointserviceNameregionId);
    }

    
Returns additional metadata for a previously executed successful, request, typically used for debugging issues where a service isn't acting as expected. This data isn't considered part of the result data returned by an operation, so it's available through this separate, diagnostic interface.

Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing the request.

Parameters:
request The originally executed request
Returns:
The response metadata for the specified request, or null if none is available.
        return .getResponseMetadataForRequest(request);
    }
    private <X, Y extends AmazonWebServiceRequestResponse<X> invoke(Request<Y> request,
            HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
            ExecutionContext executionContext) {
        request.setEndpoint();
        request.setTimeOffset();
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        AWSCredentials credentials;
        awsRequestMetrics.startEvent(.);
        try {
            credentials = .getCredentials();
        } finally {
            awsRequestMetrics.endEvent(.);
        }
        AmazonWebServiceRequest originalRequest = request.getOriginalRequest();
        if (originalRequest != null && originalRequest.getRequestCredentials() != null) {
            credentials = originalRequest.getRequestCredentials();
        }
        executionContext.setCredentials(credentials);
        JsonErrorResponseHandler errorResponseHandler = new JsonErrorResponseHandler();
        Response<X> result = .execute(requestresponseHandler,
                errorResponseHandlerexecutionContext);
        return result;
    }
}
        
New to GrepCode? Check out our FAQ X