com.amazonaws.services.securityhub.AWSSecurityHubAsyncClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk-securityhub Show documentation
Show all versions of aws-java-sdk-securityhub Show documentation
The AWS Java SDK for AWS SecurityHub module holds the client classes that are used for communicating with AWS SecurityHub Service
/*
* Copyright 2014-2019 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.securityhub;
import javax.annotation.Generated;
import com.amazonaws.services.securityhub.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import java.util.concurrent.ExecutorService;
/**
* Client for accessing AWS SecurityHub 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.
*
*
* AWS Security Hub provides you with a comprehensive view of your security state in AWS and your compliance with the
* security industry standards and best practices. Security Hub collects security data from across AWS accounts,
* services, and supported third-party partners and helps you analyze your security trends and identify the highest
* priority security issues. For more information, see AWS Security Hub User
* Guide.
*
*
*
* Important: AWS Security Hub is currently in Preview release.
*
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSSecurityHubAsyncClient extends AWSSecurityHubClient implements AWSSecurityHubAsync {
private static final int DEFAULT_THREAD_POOL_SIZE = 50;
private final java.util.concurrent.ExecutorService executorService;
public static AWSSecurityHubAsyncClientBuilder asyncBuilder() {
return AWSSecurityHubAsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on AWS SecurityHub using the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AWSSecurityHubAsyncClient(AwsAsyncClientParams asyncClientParams) {
super(asyncClientParams);
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 batchDisableStandardsAsync(BatchDisableStandardsRequest request) {
return batchDisableStandardsAsync(request, null);
}
@Override
public java.util.concurrent.Future batchDisableStandardsAsync(final BatchDisableStandardsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final BatchDisableStandardsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public BatchDisableStandardsResult call() throws Exception {
BatchDisableStandardsResult result = null;
try {
result = executeBatchDisableStandards(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 batchEnableStandardsAsync(BatchEnableStandardsRequest request) {
return batchEnableStandardsAsync(request, null);
}
@Override
public java.util.concurrent.Future batchEnableStandardsAsync(final BatchEnableStandardsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final BatchEnableStandardsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public BatchEnableStandardsResult call() throws Exception {
BatchEnableStandardsResult result = null;
try {
result = executeBatchEnableStandards(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 batchImportFindingsAsync(BatchImportFindingsRequest request) {
return batchImportFindingsAsync(request, null);
}
@Override
public java.util.concurrent.Future batchImportFindingsAsync(final BatchImportFindingsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final BatchImportFindingsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public BatchImportFindingsResult call() throws Exception {
BatchImportFindingsResult result = null;
try {
result = executeBatchImportFindings(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 createInsightAsync(CreateInsightRequest request) {
return createInsightAsync(request, null);
}
@Override
public java.util.concurrent.Future createInsightAsync(final CreateInsightRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateInsightRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateInsightResult call() throws Exception {
CreateInsightResult result = null;
try {
result = executeCreateInsight(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 declineInvitationsAsync(DeclineInvitationsRequest request) {
return declineInvitationsAsync(request, null);
}
@Override
public java.util.concurrent.Future declineInvitationsAsync(final DeclineInvitationsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeclineInvitationsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeclineInvitationsResult call() throws Exception {
DeclineInvitationsResult result = null;
try {
result = executeDeclineInvitations(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 deleteInsightAsync(DeleteInsightRequest request) {
return deleteInsightAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteInsightAsync(final DeleteInsightRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteInsightRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteInsightResult call() throws Exception {
DeleteInsightResult result = null;
try {
result = executeDeleteInsight(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 deleteInvitationsAsync(DeleteInvitationsRequest request) {
return deleteInvitationsAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteInvitationsAsync(final DeleteInvitationsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteInvitationsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteInvitationsResult call() throws Exception {
DeleteInvitationsResult result = null;
try {
result = executeDeleteInvitations(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 describeProductsAsync(DescribeProductsRequest request) {
return describeProductsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeProductsAsync(final DescribeProductsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeProductsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeProductsResult call() throws Exception {
DescribeProductsResult result = null;
try {
result = executeDescribeProducts(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 disableImportFindingsForProductAsync(
DisableImportFindingsForProductRequest request) {
return disableImportFindingsForProductAsync(request, null);
}
@Override
public java.util.concurrent.Future disableImportFindingsForProductAsync(
final DisableImportFindingsForProductRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DisableImportFindingsForProductRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DisableImportFindingsForProductResult call() throws Exception {
DisableImportFindingsForProductResult result = null;
try {
result = executeDisableImportFindingsForProduct(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 disableSecurityHubAsync(DisableSecurityHubRequest request) {
return disableSecurityHubAsync(request, null);
}
@Override
public java.util.concurrent.Future disableSecurityHubAsync(final DisableSecurityHubRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DisableSecurityHubRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DisableSecurityHubResult call() throws Exception {
DisableSecurityHubResult result = null;
try {
result = executeDisableSecurityHub(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 disassociateFromMasterAccountAsync(DisassociateFromMasterAccountRequest request) {
return disassociateFromMasterAccountAsync(request, null);
}
@Override
public java.util.concurrent.Future disassociateFromMasterAccountAsync(
final DisassociateFromMasterAccountRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DisassociateFromMasterAccountRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DisassociateFromMasterAccountResult call() throws Exception {
DisassociateFromMasterAccountResult result = null;
try {
result = executeDisassociateFromMasterAccount(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 disassociateMembersAsync(DisassociateMembersRequest request) {
return disassociateMembersAsync(request, null);
}
@Override
public java.util.concurrent.Future disassociateMembersAsync(final DisassociateMembersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DisassociateMembersRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DisassociateMembersResult call() throws Exception {
DisassociateMembersResult result = null;
try {
result = executeDisassociateMembers(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 enableImportFindingsForProductAsync(EnableImportFindingsForProductRequest request) {
return enableImportFindingsForProductAsync(request, null);
}
@Override
public java.util.concurrent.Future enableImportFindingsForProductAsync(
final EnableImportFindingsForProductRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final EnableImportFindingsForProductRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public EnableImportFindingsForProductResult call() throws Exception {
EnableImportFindingsForProductResult result = null;
try {
result = executeEnableImportFindingsForProduct(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 enableSecurityHubAsync(EnableSecurityHubRequest request) {
return enableSecurityHubAsync(request, null);
}
@Override
public java.util.concurrent.Future enableSecurityHubAsync(final EnableSecurityHubRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final EnableSecurityHubRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public EnableSecurityHubResult call() throws Exception {
EnableSecurityHubResult result = null;
try {
result = executeEnableSecurityHub(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 getEnabledStandardsAsync(GetEnabledStandardsRequest request) {
return getEnabledStandardsAsync(request, null);
}
@Override
public java.util.concurrent.Future getEnabledStandardsAsync(final GetEnabledStandardsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetEnabledStandardsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetEnabledStandardsResult call() throws Exception {
GetEnabledStandardsResult result = null;
try {
result = executeGetEnabledStandards(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 getFindingsAsync(GetFindingsRequest request) {
return getFindingsAsync(request, null);
}
@Override
public java.util.concurrent.Future getFindingsAsync(final GetFindingsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetFindingsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetFindingsResult call() throws Exception {
GetFindingsResult result = null;
try {
result = executeGetFindings(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 getInsightResultsAsync(GetInsightResultsRequest request) {
return getInsightResultsAsync(request, null);
}
@Override
public java.util.concurrent.Future getInsightResultsAsync(final GetInsightResultsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetInsightResultsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetInsightResultsResult call() throws Exception {
GetInsightResultsResult result = null;
try {
result = executeGetInsightResults(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 getInsightsAsync(GetInsightsRequest request) {
return getInsightsAsync(request, null);
}
@Override
public java.util.concurrent.Future getInsightsAsync(final GetInsightsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetInsightsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetInsightsResult call() throws Exception {
GetInsightsResult result = null;
try {
result = executeGetInsights(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 getInvitationsCountAsync(GetInvitationsCountRequest request) {
return getInvitationsCountAsync(request, null);
}
@Override
public java.util.concurrent.Future getInvitationsCountAsync(final GetInvitationsCountRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetInvitationsCountRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetInvitationsCountResult call() throws Exception {
GetInvitationsCountResult result = null;
try {
result = executeGetInvitationsCount(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 getMasterAccountAsync(GetMasterAccountRequest request) {
return getMasterAccountAsync(request, null);
}
@Override
public java.util.concurrent.Future getMasterAccountAsync(final GetMasterAccountRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetMasterAccountRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetMasterAccountResult call() throws Exception {
GetMasterAccountResult result = null;
try {
result = executeGetMasterAccount(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 inviteMembersAsync(InviteMembersRequest request) {
return inviteMembersAsync(request, null);
}
@Override
public java.util.concurrent.Future inviteMembersAsync(final InviteMembersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final InviteMembersRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public InviteMembersResult call() throws Exception {
InviteMembersResult result = null;
try {
result = executeInviteMembers(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 listEnabledProductsForImportAsync(ListEnabledProductsForImportRequest request) {
return listEnabledProductsForImportAsync(request, null);
}
@Override
public java.util.concurrent.Future listEnabledProductsForImportAsync(final ListEnabledProductsForImportRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListEnabledProductsForImportRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListEnabledProductsForImportResult call() throws Exception {
ListEnabledProductsForImportResult result = null;
try {
result = executeListEnabledProductsForImport(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 listProductSubscribersAsync(ListProductSubscribersRequest request) {
return listProductSubscribersAsync(request, null);
}
@Override
public java.util.concurrent.Future listProductSubscribersAsync(final ListProductSubscribersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListProductSubscribersRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListProductSubscribersResult call() throws Exception {
ListProductSubscribersResult result = null;
try {
result = executeListProductSubscribers(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 updateFindingsAsync(UpdateFindingsRequest request) {
return updateFindingsAsync(request, null);
}
@Override
public java.util.concurrent.Future updateFindingsAsync(final UpdateFindingsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateFindingsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateFindingsResult call() throws Exception {
UpdateFindingsResult result = null;
try {
result = executeUpdateFindings(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 updateInsightAsync(UpdateInsightRequest request) {
return updateInsightAsync(request, null);
}
@Override
public java.util.concurrent.Future updateInsightAsync(final UpdateInsightRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateInsightRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateInsightResult call() throws Exception {
UpdateInsightResult result = null;
try {
result = executeUpdateInsight(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();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy