Class AbstractAWSCloudTrail

  • All Implemented Interfaces:
    AWSCloudTrail
    Direct Known Subclasses:
    AbstractAWSCloudTrailAsync

    public class AbstractAWSCloudTrail
    extends Object
    implements AWSCloudTrail
    Abstract implementation of AWSCloudTrail. Convenient method forms pass through to the corresponding overload that takes a request object, which throws an UnsupportedOperationException.
    • Constructor Detail

      • AbstractAWSCloudTrail

        protected AbstractAWSCloudTrail()
    • Method Detail

      • setEndpoint

        public void setEndpoint​(String endpoint)
        Description copied from interface: AWSCloudTrail
        Overrides the default endpoint for this client ("cloudtrail.us-east-1.amazonaws.com"). Callers can use this method to control which AWS region they want to work with.

        Callers can pass in just the endpoint (ex: "cloudtrail.us-east-1.amazonaws.com") or a full URL, including the protocol (ex: "cloudtrail.us-east-1.amazonaws.com"). If the protocol is not specified here, the default protocol from this client's ClientConfiguration will be used, which by default is HTTPS.

        For more information on using AWS regions with the AWS SDK for Java, and a complete list of all available endpoints for all AWS services, see: http://developer.amazonwebservices.com/connect/entry.jspa?externalID= 3912

        This method is not threadsafe. An endpoint should be configured when the client is created and before any service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit or retrying.

        Specified by:
        setEndpoint in interface AWSCloudTrail
        Parameters:
        endpoint - The endpoint (ex: "cloudtrail.us-east-1.amazonaws.com") or a full URL, including the protocol (ex: "cloudtrail.us-east-1.amazonaws.com") of the region specific AWS endpoint this client will communicate with.
      • addTags

        public AddTagsResult addTags​(AddTagsRequest request)
        Description copied from interface: AWSCloudTrail

        Adds one or more tags to a trail, up to a limit of 10. Tags must be unique per trail. Overwrites an existing tag's value when a new value is specified for an existing tag key. If you specify a key without a value, the tag will be created with the specified key and a value of null. You can tag a trail that applies to all regions only from the region in which the trail was created (that is, from its home region).

        Specified by:
        addTags in interface AWSCloudTrail
        Parameters:
        request - Specifies the tags to add to a trail.
        Returns:
        Result of the AddTags operation returned by the service.
      • createTrail

        public CreateTrailResult createTrail​(CreateTrailRequest request)
        Description copied from interface: AWSCloudTrail

        Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket. A maximum of five trails can exist in a region, irrespective of the region in which they were created.

        Specified by:
        createTrail in interface AWSCloudTrail
        Parameters:
        request - Specifies the settings for each trail.
        Returns:
        Result of the CreateTrail operation returned by the service.
      • deleteTrail

        public DeleteTrailResult deleteTrail​(DeleteTrailRequest request)
        Description copied from interface: AWSCloudTrail

        Deletes a trail. This operation must be called from the region in which the trail was created. DeleteTrail cannot be called on the shadow trails (replicated trails in other regions) of a trail that is enabled in all regions.

        Specified by:
        deleteTrail in interface AWSCloudTrail
        Parameters:
        request - The request that specifies the name of a trail to delete.
        Returns:
        Result of the DeleteTrail operation returned by the service.
      • describeTrails

        public DescribeTrailsResult describeTrails​(DescribeTrailsRequest request)
        Description copied from interface: AWSCloudTrail

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

        Specified by:
        describeTrails in interface AWSCloudTrail
        Parameters:
        request - Returns information about the trail.
        Returns:
        Result of the DescribeTrails operation returned by the service.
      • getTrailStatus

        public GetTrailStatusResult getTrailStatus​(GetTrailStatusRequest request)
        Description copied from interface: AWSCloudTrail

        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. This operation returns trail status from a single region. To return trail status from all regions, you must call the operation on each region.

        Specified by:
        getTrailStatus in interface AWSCloudTrail
        Parameters:
        request - The name of a trail about which you want the current status.
        Returns:
        Result of the GetTrailStatus operation returned by the service.
      • listPublicKeys

        public ListPublicKeysResult listPublicKeys​(ListPublicKeysRequest request)
        Description copied from interface: AWSCloudTrail

        Returns all public keys whose private keys were used to sign the digest files within the specified time range. The public key is needed to validate digest files that were signed with its corresponding private key.

        CloudTrail uses different private/public key pairs per region. Each digest file is signed with a private key unique to its region. Therefore, when you validate a digest file from a particular region, you must look in the same region for its corresponding public key.

        Specified by:
        listPublicKeys in interface AWSCloudTrail
        Parameters:
        request - Requests the public keys for a specified time range.
        Returns:
        Result of the ListPublicKeys operation returned by the service.
      • listTags

        public ListTagsResult listTags​(ListTagsRequest request)
        Description copied from interface: AWSCloudTrail

        Lists the tags for the trail in the current region.

        Specified by:
        listTags in interface AWSCloudTrail
        Parameters:
        request - Specifies a list of trail tags to return.
        Returns:
        Result of the ListTags operation returned by the service.
      • lookupEvents

        public LookupEventsResult lookupEvents​(LookupEventsRequest request)
        Description copied from interface: AWSCloudTrail

        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.

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

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

        Specified by:
        lookupEvents in interface AWSCloudTrail
        Parameters:
        request - Contains a request for LookupEvents.
        Returns:
        Result of the LookupEvents operation returned by the service.
      • removeTags

        public RemoveTagsResult removeTags​(RemoveTagsRequest request)
        Description copied from interface: AWSCloudTrail

        Removes the specified tags from a trail.

        Specified by:
        removeTags in interface AWSCloudTrail
        Parameters:
        request - Specifies the tags to remove from a trail.
        Returns:
        Result of the RemoveTags operation returned by the service.
      • startLogging

        public StartLoggingResult startLogging​(StartLoggingRequest request)
        Description copied from interface: AWSCloudTrail

        Starts the recording of AWS API calls and log file delivery for a trail. For a trail that is enabled in all regions, this operation must be called from the region in which the trail was created. This operation cannot be called on the shadow trails (replicated trails in other regions) of a trail that is enabled in all regions.

        Specified by:
        startLogging in interface AWSCloudTrail
        Parameters:
        request - The request to CloudTrail to start logging AWS API calls for an account.
        Returns:
        Result of the StartLogging operation returned by the service.
      • stopLogging

        public StopLoggingResult stopLogging​(StopLoggingRequest request)
        Description copied from interface: AWSCloudTrail

        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. For a trail enabled in all regions, this operation must be called from the region in which the trail was created, or an InvalidHomeRegionException will occur. This operation cannot be called on the shadow trails (replicated trails in other regions) of a trail enabled in all regions.

        Specified by:
        stopLogging in interface AWSCloudTrail
        Parameters:
        request - Passes the request to CloudTrail to stop logging AWS API calls for the specified account.
        Returns:
        Result of the StopLogging operation returned by the service.
      • updateTrail

        public UpdateTrailResult updateTrail​(UpdateTrailRequest request)
        Description copied from interface: AWSCloudTrail

        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. UpdateTrail must be called from the region in which the trail was created; otherwise, an InvalidHomeRegionException is thrown.

        Specified by:
        updateTrail in interface AWSCloudTrail
        Parameters:
        request - Specifies settings to update for the trail.
        Returns:
        Result of the UpdateTrail operation returned by the service.
      • shutdown

        public void shutdown()
        Description copied from interface: AWSCloudTrail
        Shuts down this client object, releasing any resources that might be held open. This is an optional method, and callers are not expected to call it, but can if they want to explicitly release any open resources. Once a client has been shutdown, it should not be used to make any more requests.
        Specified by:
        shutdown in interface AWSCloudTrail
      • getCachedResponseMetadata

        public ResponseMetadata getCachedResponseMetadata​(AmazonWebServiceRequest request)
        Description copied from interface: AWSCloudTrail
        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 a request.

        Specified by:
        getCachedResponseMetadata in interface AWSCloudTrail
        Parameters:
        request - The originally executed request.
        Returns:
        The response metadata for the specified request, or null if none is available.