com.amazonaws.services.billingconductor.AWSBillingConductorAsyncClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-billingconductor 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.billingconductor;
import javax.annotation.Generated;
import com.amazonaws.services.billingconductor.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import java.util.concurrent.ExecutorService;
/**
* Client for accessing AWSBillingConductor 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.
*
*
* Amazon Web Services Billing Conductor is a fully managed service that you can use to customize a proforma version of your billing data each month, to accurately show or chargeback your end customers. Amazon
* Web Services Billing Conductor doesn't change the way you're billed by Amazon Web Services each month by design.
* Instead, it provides you with a mechanism to configure, generate, and display rates to certain customers over a given
* billing period. You can also analyze the difference between the rates you apply to your accounting groupings relative
* to your actual rates from Amazon Web Services. As a result of your Amazon Web Services Billing Conductor
* configuration, the payer account can also see the custom rate applied on the billing details page of the Amazon Web Services Billing console, or configure a cost and usage
* report per billing group.
*
*
* This documentation shows how you can configure Amazon Web Services Billing Conductor using its API. For more
* information about using the Amazon Web Services Billing
* Conductor user interface, see the Amazon Web
* Services Billing Conductor User Guide.
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSBillingConductorAsyncClient extends AWSBillingConductorClient implements AWSBillingConductorAsync {
private static final int DEFAULT_THREAD_POOL_SIZE = 50;
private final java.util.concurrent.ExecutorService executorService;
public static AWSBillingConductorAsyncClientBuilder asyncBuilder() {
return AWSBillingConductorAsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on AWSBillingConductor using the specified
* parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AWSBillingConductorAsyncClient(AwsAsyncClientParams asyncClientParams) {
this(asyncClientParams, false);
}
/**
* Constructs a new asynchronous client to invoke service methods on AWSBillingConductor using the specified
* parameters.
*
* @param asyncClientParams
* Object providing client parameters.
* @param endpointDiscoveryEnabled
* true will enable endpoint discovery if the service supports it.
*/
AWSBillingConductorAsyncClient(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 associateAccountsAsync(AssociateAccountsRequest request) {
return associateAccountsAsync(request, null);
}
@Override
public java.util.concurrent.Future associateAccountsAsync(final AssociateAccountsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AssociateAccountsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AssociateAccountsResult call() throws Exception {
AssociateAccountsResult result = null;
try {
result = executeAssociateAccounts(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 associatePricingRulesAsync(AssociatePricingRulesRequest request) {
return associatePricingRulesAsync(request, null);
}
@Override
public java.util.concurrent.Future associatePricingRulesAsync(final AssociatePricingRulesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AssociatePricingRulesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AssociatePricingRulesResult call() throws Exception {
AssociatePricingRulesResult result = null;
try {
result = executeAssociatePricingRules(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 batchAssociateResourcesToCustomLineItemAsync(
BatchAssociateResourcesToCustomLineItemRequest request) {
return batchAssociateResourcesToCustomLineItemAsync(request, null);
}
@Override
public java.util.concurrent.Future batchAssociateResourcesToCustomLineItemAsync(
final BatchAssociateResourcesToCustomLineItemRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final BatchAssociateResourcesToCustomLineItemRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public BatchAssociateResourcesToCustomLineItemResult call() throws Exception {
BatchAssociateResourcesToCustomLineItemResult result = null;
try {
result = executeBatchAssociateResourcesToCustomLineItem(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 batchDisassociateResourcesFromCustomLineItemAsync(
BatchDisassociateResourcesFromCustomLineItemRequest request) {
return batchDisassociateResourcesFromCustomLineItemAsync(request, null);
}
@Override
public java.util.concurrent.Future batchDisassociateResourcesFromCustomLineItemAsync(
final BatchDisassociateResourcesFromCustomLineItemRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final BatchDisassociateResourcesFromCustomLineItemRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public BatchDisassociateResourcesFromCustomLineItemResult call() throws Exception {
BatchDisassociateResourcesFromCustomLineItemResult result = null;
try {
result = executeBatchDisassociateResourcesFromCustomLineItem(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 createBillingGroupAsync(CreateBillingGroupRequest request) {
return createBillingGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future createBillingGroupAsync(final CreateBillingGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateBillingGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateBillingGroupResult call() throws Exception {
CreateBillingGroupResult result = null;
try {
result = executeCreateBillingGroup(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 createCustomLineItemAsync(CreateCustomLineItemRequest request) {
return createCustomLineItemAsync(request, null);
}
@Override
public java.util.concurrent.Future createCustomLineItemAsync(final CreateCustomLineItemRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateCustomLineItemRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateCustomLineItemResult call() throws Exception {
CreateCustomLineItemResult result = null;
try {
result = executeCreateCustomLineItem(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 createPricingPlanAsync(CreatePricingPlanRequest request) {
return createPricingPlanAsync(request, null);
}
@Override
public java.util.concurrent.Future createPricingPlanAsync(final CreatePricingPlanRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreatePricingPlanRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreatePricingPlanResult call() throws Exception {
CreatePricingPlanResult result = null;
try {
result = executeCreatePricingPlan(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 createPricingRuleAsync(CreatePricingRuleRequest request) {
return createPricingRuleAsync(request, null);
}
@Override
public java.util.concurrent.Future createPricingRuleAsync(final CreatePricingRuleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreatePricingRuleRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreatePricingRuleResult call() throws Exception {
CreatePricingRuleResult result = null;
try {
result = executeCreatePricingRule(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 deleteBillingGroupAsync(DeleteBillingGroupRequest request) {
return deleteBillingGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteBillingGroupAsync(final DeleteBillingGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteBillingGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteBillingGroupResult call() throws Exception {
DeleteBillingGroupResult result = null;
try {
result = executeDeleteBillingGroup(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 deleteCustomLineItemAsync(DeleteCustomLineItemRequest request) {
return deleteCustomLineItemAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteCustomLineItemAsync(final DeleteCustomLineItemRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteCustomLineItemRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteCustomLineItemResult call() throws Exception {
DeleteCustomLineItemResult result = null;
try {
result = executeDeleteCustomLineItem(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 deletePricingPlanAsync(DeletePricingPlanRequest request) {
return deletePricingPlanAsync(request, null);
}
@Override
public java.util.concurrent.Future deletePricingPlanAsync(final DeletePricingPlanRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeletePricingPlanRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeletePricingPlanResult call() throws Exception {
DeletePricingPlanResult result = null;
try {
result = executeDeletePricingPlan(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 deletePricingRuleAsync(DeletePricingRuleRequest request) {
return deletePricingRuleAsync(request, null);
}
@Override
public java.util.concurrent.Future deletePricingRuleAsync(final DeletePricingRuleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeletePricingRuleRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeletePricingRuleResult call() throws Exception {
DeletePricingRuleResult result = null;
try {
result = executeDeletePricingRule(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 disassociateAccountsAsync(DisassociateAccountsRequest request) {
return disassociateAccountsAsync(request, null);
}
@Override
public java.util.concurrent.Future disassociateAccountsAsync(final DisassociateAccountsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DisassociateAccountsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DisassociateAccountsResult call() throws Exception {
DisassociateAccountsResult result = null;
try {
result = executeDisassociateAccounts(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 disassociatePricingRulesAsync(DisassociatePricingRulesRequest request) {
return disassociatePricingRulesAsync(request, null);
}
@Override
public java.util.concurrent.Future disassociatePricingRulesAsync(final DisassociatePricingRulesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DisassociatePricingRulesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DisassociatePricingRulesResult call() throws Exception {
DisassociatePricingRulesResult result = null;
try {
result = executeDisassociatePricingRules(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 getBillingGroupCostReportAsync(GetBillingGroupCostReportRequest request) {
return getBillingGroupCostReportAsync(request, null);
}
@Override
public java.util.concurrent.Future getBillingGroupCostReportAsync(final GetBillingGroupCostReportRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetBillingGroupCostReportRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetBillingGroupCostReportResult call() throws Exception {
GetBillingGroupCostReportResult result = null;
try {
result = executeGetBillingGroupCostReport(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 listAccountAssociationsAsync(ListAccountAssociationsRequest request) {
return listAccountAssociationsAsync(request, null);
}
@Override
public java.util.concurrent.Future listAccountAssociationsAsync(final ListAccountAssociationsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListAccountAssociationsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListAccountAssociationsResult call() throws Exception {
ListAccountAssociationsResult result = null;
try {
result = executeListAccountAssociations(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 listBillingGroupCostReportsAsync(ListBillingGroupCostReportsRequest request) {
return listBillingGroupCostReportsAsync(request, null);
}
@Override
public java.util.concurrent.Future listBillingGroupCostReportsAsync(final ListBillingGroupCostReportsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListBillingGroupCostReportsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListBillingGroupCostReportsResult call() throws Exception {
ListBillingGroupCostReportsResult result = null;
try {
result = executeListBillingGroupCostReports(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 listBillingGroupsAsync(ListBillingGroupsRequest request) {
return listBillingGroupsAsync(request, null);
}
@Override
public java.util.concurrent.Future listBillingGroupsAsync(final ListBillingGroupsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListBillingGroupsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListBillingGroupsResult call() throws Exception {
ListBillingGroupsResult result = null;
try {
result = executeListBillingGroups(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 listCustomLineItemVersionsAsync(ListCustomLineItemVersionsRequest request) {
return listCustomLineItemVersionsAsync(request, null);
}
@Override
public java.util.concurrent.Future listCustomLineItemVersionsAsync(final ListCustomLineItemVersionsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListCustomLineItemVersionsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListCustomLineItemVersionsResult call() throws Exception {
ListCustomLineItemVersionsResult result = null;
try {
result = executeListCustomLineItemVersions(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 listCustomLineItemsAsync(ListCustomLineItemsRequest request) {
return listCustomLineItemsAsync(request, null);
}
@Override
public java.util.concurrent.Future listCustomLineItemsAsync(final ListCustomLineItemsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListCustomLineItemsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListCustomLineItemsResult call() throws Exception {
ListCustomLineItemsResult result = null;
try {
result = executeListCustomLineItems(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 listPricingPlansAsync(ListPricingPlansRequest request) {
return listPricingPlansAsync(request, null);
}
@Override
public java.util.concurrent.Future listPricingPlansAsync(final ListPricingPlansRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListPricingPlansRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListPricingPlansResult call() throws Exception {
ListPricingPlansResult result = null;
try {
result = executeListPricingPlans(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 listPricingPlansAssociatedWithPricingRuleAsync(
ListPricingPlansAssociatedWithPricingRuleRequest request) {
return listPricingPlansAssociatedWithPricingRuleAsync(request, null);
}
@Override
public java.util.concurrent.Future listPricingPlansAssociatedWithPricingRuleAsync(
final ListPricingPlansAssociatedWithPricingRuleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListPricingPlansAssociatedWithPricingRuleRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListPricingPlansAssociatedWithPricingRuleResult call() throws Exception {
ListPricingPlansAssociatedWithPricingRuleResult result = null;
try {
result = executeListPricingPlansAssociatedWithPricingRule(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 listPricingRulesAsync(ListPricingRulesRequest request) {
return listPricingRulesAsync(request, null);
}
@Override
public java.util.concurrent.Future listPricingRulesAsync(final ListPricingRulesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListPricingRulesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListPricingRulesResult call() throws Exception {
ListPricingRulesResult result = null;
try {
result = executeListPricingRules(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 listPricingRulesAssociatedToPricingPlanAsync(
ListPricingRulesAssociatedToPricingPlanRequest request) {
return listPricingRulesAssociatedToPricingPlanAsync(request, null);
}
@Override
public java.util.concurrent.Future listPricingRulesAssociatedToPricingPlanAsync(
final ListPricingRulesAssociatedToPricingPlanRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListPricingRulesAssociatedToPricingPlanRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListPricingRulesAssociatedToPricingPlanResult call() throws Exception {
ListPricingRulesAssociatedToPricingPlanResult result = null;
try {
result = executeListPricingRulesAssociatedToPricingPlan(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 listResourcesAssociatedToCustomLineItemAsync(
ListResourcesAssociatedToCustomLineItemRequest request) {
return listResourcesAssociatedToCustomLineItemAsync(request, null);
}
@Override
public java.util.concurrent.Future listResourcesAssociatedToCustomLineItemAsync(
final ListResourcesAssociatedToCustomLineItemRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListResourcesAssociatedToCustomLineItemRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListResourcesAssociatedToCustomLineItemResult call() throws Exception {
ListResourcesAssociatedToCustomLineItemResult result = null;
try {
result = executeListResourcesAssociatedToCustomLineItem(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 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 updateBillingGroupAsync(UpdateBillingGroupRequest request) {
return updateBillingGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future updateBillingGroupAsync(final UpdateBillingGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateBillingGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateBillingGroupResult call() throws Exception {
UpdateBillingGroupResult result = null;
try {
result = executeUpdateBillingGroup(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 updateCustomLineItemAsync(UpdateCustomLineItemRequest request) {
return updateCustomLineItemAsync(request, null);
}
@Override
public java.util.concurrent.Future updateCustomLineItemAsync(final UpdateCustomLineItemRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateCustomLineItemRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateCustomLineItemResult call() throws Exception {
UpdateCustomLineItemResult result = null;
try {
result = executeUpdateCustomLineItem(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 updatePricingPlanAsync(UpdatePricingPlanRequest request) {
return updatePricingPlanAsync(request, null);
}
@Override
public java.util.concurrent.Future updatePricingPlanAsync(final UpdatePricingPlanRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdatePricingPlanRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdatePricingPlanResult call() throws Exception {
UpdatePricingPlanResult result = null;
try {
result = executeUpdatePricingPlan(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 updatePricingRuleAsync(UpdatePricingRuleRequest request) {
return updatePricingRuleAsync(request, null);
}
@Override
public java.util.concurrent.Future updatePricingRuleAsync(final UpdatePricingRuleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdatePricingRuleRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdatePricingRuleResult call() throws Exception {
UpdatePricingRuleResult result = null;
try {
result = executeUpdatePricingRule(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();
}
}