com.amazonaws.services.detective.AmazonDetectiveAsyncClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-detective Show documentation
/*
* Copyright 2019-2024 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.detective;
import javax.annotation.Generated;
import com.amazonaws.services.detective.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import java.util.concurrent.ExecutorService;
/**
* Client for accessing Amazon Detective asynchronously. Each asynchronous method will return a Java Future object
* representing the asynchronous operation; overloads which accept an {@code AsyncHandler} can be used to receive
* notification when an asynchronous operation completes.
*
*
* Detective uses machine learning and purpose-built visualizations to help you to analyze and investigate security
* issues across your Amazon Web Services (Amazon Web Services) workloads. Detective automatically extracts time-based
* events such as login attempts, API calls, and network traffic from CloudTrail and Amazon Virtual Private Cloud
* (Amazon VPC) flow logs. It also extracts findings detected by Amazon GuardDuty.
*
*
* The Detective API primarily supports the creation and management of behavior graphs. A behavior graph contains the
* extracted data from a set of member accounts, and is created and managed by an administrator account.
*
*
* To add a member account to the behavior graph, the administrator account sends an invitation to the account. When the
* account accepts the invitation, it becomes a member account in the behavior graph.
*
*
* Detective is also integrated with Organizations. The organization management account designates the Detective
* administrator account for the organization. That account becomes the administrator account for the organization
* behavior graph. The Detective administrator account is also the delegated administrator account for Detective in
* Organizations.
*
*
* The Detective administrator account can enable any organization account as a member account in the organization
* behavior graph. The organization accounts do not receive invitations. The Detective administrator account can also
* invite other accounts to the organization behavior graph.
*
*
* Every behavior graph is specific to a Region. You can only use the API to manage behavior graphs that belong to the
* Region that is associated with the currently selected endpoint.
*
*
* The administrator account for a behavior graph can use the Detective API to do the following:
*
*
* -
*
* Enable and disable Detective. Enabling Detective creates a new behavior graph.
*
*
* -
*
* View the list of member accounts in a behavior graph.
*
*
* -
*
* Add member accounts to a behavior graph.
*
*
* -
*
* Remove member accounts from a behavior graph.
*
*
* -
*
* Apply tags to a behavior graph.
*
*
*
*
* The organization management account can use the Detective API to select the delegated administrator for Detective.
*
*
* The Detective administrator account for an organization can use the Detective API to do the following:
*
*
* -
*
* Perform all of the functions of an administrator account.
*
*
* -
*
* Determine whether to automatically enable new organization accounts as member accounts in the organization behavior
* graph.
*
*
*
*
* An invited member account can use the Detective API to do the following:
*
*
* -
*
* View the list of behavior graphs that they are invited to.
*
*
* -
*
* Accept an invitation to contribute to a behavior graph.
*
*
* -
*
* Decline an invitation to contribute to a behavior graph.
*
*
* -
*
* Remove their account from a behavior graph.
*
*
*
*
* All API actions are logged as CloudTrail events. See Logging Detective API
* Calls with CloudTrail.
*
*
*
* We replaced the term "master account" with the term "administrator account". An administrator account is used to
* centrally manage multiple accounts. In the case of Detective, the administrator account manages the accounts in their
* behavior graph.
*
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AmazonDetectiveAsyncClient extends AmazonDetectiveClient implements AmazonDetectiveAsync {
private static final int DEFAULT_THREAD_POOL_SIZE = 50;
private final java.util.concurrent.ExecutorService executorService;
public static AmazonDetectiveAsyncClientBuilder asyncBuilder() {
return AmazonDetectiveAsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon Detective using the specified
* parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AmazonDetectiveAsyncClient(AwsAsyncClientParams asyncClientParams) {
this(asyncClientParams, false);
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon Detective using the specified
* parameters.
*
* @param asyncClientParams
* Object providing client parameters.
* @param endpointDiscoveryEnabled
* true will enable endpoint discovery if the service supports it.
*/
AmazonDetectiveAsyncClient(AwsAsyncClientParams asyncClientParams, boolean endpointDiscoveryEnabled) {
super(asyncClientParams, endpointDiscoveryEnabled);
this.executorService = asyncClientParams.getExecutor();
}
/**
* Returns the executor service used by this client to execute async requests.
*
* @return The executor service used by this client to execute async requests.
*/
public ExecutorService getExecutorService() {
return executorService;
}
@Override
public java.util.concurrent.Future acceptInvitationAsync(AcceptInvitationRequest request) {
return acceptInvitationAsync(request, null);
}
@Override
public java.util.concurrent.Future acceptInvitationAsync(final AcceptInvitationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AcceptInvitationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AcceptInvitationResult call() throws Exception {
AcceptInvitationResult result = null;
try {
result = executeAcceptInvitation(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future batchGetGraphMemberDatasourcesAsync(BatchGetGraphMemberDatasourcesRequest request) {
return batchGetGraphMemberDatasourcesAsync(request, null);
}
@Override
public java.util.concurrent.Future batchGetGraphMemberDatasourcesAsync(
final BatchGetGraphMemberDatasourcesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final BatchGetGraphMemberDatasourcesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public BatchGetGraphMemberDatasourcesResult call() throws Exception {
BatchGetGraphMemberDatasourcesResult result = null;
try {
result = executeBatchGetGraphMemberDatasources(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future batchGetMembershipDatasourcesAsync(BatchGetMembershipDatasourcesRequest request) {
return batchGetMembershipDatasourcesAsync(request, null);
}
@Override
public java.util.concurrent.Future batchGetMembershipDatasourcesAsync(
final BatchGetMembershipDatasourcesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final BatchGetMembershipDatasourcesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public BatchGetMembershipDatasourcesResult call() throws Exception {
BatchGetMembershipDatasourcesResult result = null;
try {
result = executeBatchGetMembershipDatasources(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future createGraphAsync(CreateGraphRequest request) {
return createGraphAsync(request, null);
}
@Override
public java.util.concurrent.Future createGraphAsync(final CreateGraphRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateGraphRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateGraphResult call() throws Exception {
CreateGraphResult result = null;
try {
result = executeCreateGraph(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future createMembersAsync(CreateMembersRequest request) {
return createMembersAsync(request, null);
}
@Override
public java.util.concurrent.Future createMembersAsync(final CreateMembersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateMembersRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateMembersResult call() throws Exception {
CreateMembersResult result = null;
try {
result = executeCreateMembers(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future deleteGraphAsync(DeleteGraphRequest request) {
return deleteGraphAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteGraphAsync(final DeleteGraphRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteGraphRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteGraphResult call() throws Exception {
DeleteGraphResult result = null;
try {
result = executeDeleteGraph(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future deleteMembersAsync(DeleteMembersRequest request) {
return deleteMembersAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteMembersAsync(final DeleteMembersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteMembersRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteMembersResult call() throws Exception {
DeleteMembersResult result = null;
try {
result = executeDeleteMembers(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeOrganizationConfigurationAsync(
DescribeOrganizationConfigurationRequest request) {
return describeOrganizationConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future describeOrganizationConfigurationAsync(
final DescribeOrganizationConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeOrganizationConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeOrganizationConfigurationResult call() throws Exception {
DescribeOrganizationConfigurationResult result = null;
try {
result = executeDescribeOrganizationConfiguration(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future disableOrganizationAdminAccountAsync(
DisableOrganizationAdminAccountRequest request) {
return disableOrganizationAdminAccountAsync(request, null);
}
@Override
public java.util.concurrent.Future disableOrganizationAdminAccountAsync(
final DisableOrganizationAdminAccountRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DisableOrganizationAdminAccountRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DisableOrganizationAdminAccountResult call() throws Exception {
DisableOrganizationAdminAccountResult result = null;
try {
result = executeDisableOrganizationAdminAccount(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future disassociateMembershipAsync(DisassociateMembershipRequest request) {
return disassociateMembershipAsync(request, null);
}
@Override
public java.util.concurrent.Future disassociateMembershipAsync(final DisassociateMembershipRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DisassociateMembershipRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DisassociateMembershipResult call() throws Exception {
DisassociateMembershipResult result = null;
try {
result = executeDisassociateMembership(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future enableOrganizationAdminAccountAsync(EnableOrganizationAdminAccountRequest request) {
return enableOrganizationAdminAccountAsync(request, null);
}
@Override
public java.util.concurrent.Future enableOrganizationAdminAccountAsync(
final EnableOrganizationAdminAccountRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final EnableOrganizationAdminAccountRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public EnableOrganizationAdminAccountResult call() throws Exception {
EnableOrganizationAdminAccountResult result = null;
try {
result = executeEnableOrganizationAdminAccount(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future getInvestigationAsync(GetInvestigationRequest request) {
return getInvestigationAsync(request, null);
}
@Override
public java.util.concurrent.Future getInvestigationAsync(final GetInvestigationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetInvestigationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetInvestigationResult call() throws Exception {
GetInvestigationResult result = null;
try {
result = executeGetInvestigation(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future getMembersAsync(GetMembersRequest request) {
return getMembersAsync(request, null);
}
@Override
public java.util.concurrent.Future getMembersAsync(final GetMembersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetMembersRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetMembersResult call() throws Exception {
GetMembersResult result = null;
try {
result = executeGetMembers(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future listDatasourcePackagesAsync(ListDatasourcePackagesRequest request) {
return listDatasourcePackagesAsync(request, null);
}
@Override
public java.util.concurrent.Future listDatasourcePackagesAsync(final ListDatasourcePackagesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListDatasourcePackagesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListDatasourcePackagesResult call() throws Exception {
ListDatasourcePackagesResult result = null;
try {
result = executeListDatasourcePackages(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future listGraphsAsync(ListGraphsRequest request) {
return listGraphsAsync(request, null);
}
@Override
public java.util.concurrent.Future listGraphsAsync(final ListGraphsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListGraphsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListGraphsResult call() throws Exception {
ListGraphsResult result = null;
try {
result = executeListGraphs(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future listIndicatorsAsync(ListIndicatorsRequest request) {
return listIndicatorsAsync(request, null);
}
@Override
public java.util.concurrent.Future listIndicatorsAsync(final ListIndicatorsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListIndicatorsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListIndicatorsResult call() throws Exception {
ListIndicatorsResult result = null;
try {
result = executeListIndicators(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future listInvestigationsAsync(ListInvestigationsRequest request) {
return listInvestigationsAsync(request, null);
}
@Override
public java.util.concurrent.Future listInvestigationsAsync(final ListInvestigationsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListInvestigationsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListInvestigationsResult call() throws Exception {
ListInvestigationsResult result = null;
try {
result = executeListInvestigations(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future listInvitationsAsync(ListInvitationsRequest request) {
return listInvitationsAsync(request, null);
}
@Override
public java.util.concurrent.Future listInvitationsAsync(final ListInvitationsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListInvitationsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListInvitationsResult call() throws Exception {
ListInvitationsResult result = null;
try {
result = executeListInvitations(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future listMembersAsync(ListMembersRequest request) {
return listMembersAsync(request, null);
}
@Override
public java.util.concurrent.Future listMembersAsync(final ListMembersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListMembersRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListMembersResult call() throws Exception {
ListMembersResult result = null;
try {
result = executeListMembers(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future listOrganizationAdminAccountsAsync(ListOrganizationAdminAccountsRequest request) {
return listOrganizationAdminAccountsAsync(request, null);
}
@Override
public java.util.concurrent.Future listOrganizationAdminAccountsAsync(
final ListOrganizationAdminAccountsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListOrganizationAdminAccountsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListOrganizationAdminAccountsResult call() throws Exception {
ListOrganizationAdminAccountsResult result = null;
try {
result = executeListOrganizationAdminAccounts(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future listTagsForResourceAsync(ListTagsForResourceRequest request) {
return listTagsForResourceAsync(request, null);
}
@Override
public java.util.concurrent.Future listTagsForResourceAsync(final ListTagsForResourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListTagsForResourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListTagsForResourceResult call() throws Exception {
ListTagsForResourceResult result = null;
try {
result = executeListTagsForResource(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future rejectInvitationAsync(RejectInvitationRequest request) {
return rejectInvitationAsync(request, null);
}
@Override
public java.util.concurrent.Future rejectInvitationAsync(final RejectInvitationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final RejectInvitationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public RejectInvitationResult call() throws Exception {
RejectInvitationResult result = null;
try {
result = executeRejectInvitation(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future startInvestigationAsync(StartInvestigationRequest request) {
return startInvestigationAsync(request, null);
}
@Override
public java.util.concurrent.Future startInvestigationAsync(final StartInvestigationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartInvestigationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartInvestigationResult call() throws Exception {
StartInvestigationResult result = null;
try {
result = executeStartInvestigation(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future startMonitoringMemberAsync(StartMonitoringMemberRequest request) {
return startMonitoringMemberAsync(request, null);
}
@Override
public java.util.concurrent.Future startMonitoringMemberAsync(final StartMonitoringMemberRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartMonitoringMemberRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartMonitoringMemberResult call() throws Exception {
StartMonitoringMemberResult result = null;
try {
result = executeStartMonitoringMember(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future tagResourceAsync(TagResourceRequest request) {
return tagResourceAsync(request, null);
}
@Override
public java.util.concurrent.Future tagResourceAsync(final TagResourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final TagResourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public TagResourceResult call() throws Exception {
TagResourceResult result = null;
try {
result = executeTagResource(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future untagResourceAsync(UntagResourceRequest request) {
return untagResourceAsync(request, null);
}
@Override
public java.util.concurrent.Future untagResourceAsync(final UntagResourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UntagResourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UntagResourceResult call() throws Exception {
UntagResourceResult result = null;
try {
result = executeUntagResource(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future updateDatasourcePackagesAsync(UpdateDatasourcePackagesRequest request) {
return updateDatasourcePackagesAsync(request, null);
}
@Override
public java.util.concurrent.Future updateDatasourcePackagesAsync(final UpdateDatasourcePackagesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateDatasourcePackagesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateDatasourcePackagesResult call() throws Exception {
UpdateDatasourcePackagesResult result = null;
try {
result = executeUpdateDatasourcePackages(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future updateInvestigationStateAsync(UpdateInvestigationStateRequest request) {
return updateInvestigationStateAsync(request, null);
}
@Override
public java.util.concurrent.Future updateInvestigationStateAsync(final UpdateInvestigationStateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateInvestigationStateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateInvestigationStateResult call() throws Exception {
UpdateInvestigationStateResult result = null;
try {
result = executeUpdateInvestigationState(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future updateOrganizationConfigurationAsync(
UpdateOrganizationConfigurationRequest request) {
return updateOrganizationConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future updateOrganizationConfigurationAsync(
final UpdateOrganizationConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateOrganizationConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateOrganizationConfigurationResult call() throws Exception {
UpdateOrganizationConfigurationResult result = null;
try {
result = executeUpdateOrganizationConfiguration(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Shuts down the client, releasing all managed resources. This includes forcibly terminating all pending
* asynchronous service calls. Clients who wish to give pending asynchronous service calls time to complete should
* call {@code getExecutorService().shutdown()} followed by {@code getExecutorService().awaitTermination()} prior to
* calling this method.
*/
@Override
public void shutdown() {
super.shutdown();
executorService.shutdownNow();
}
}