All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.servicequotas.AWSServiceQuotasAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Service Quotas module holds the client classes that are used for communicating with Service Quotas Service

There is a newer version: 1.12.780
Show newest version
/*
 * 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.servicequotas;

import javax.annotation.Generated;

import com.amazonaws.services.servicequotas.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;

import java.util.concurrent.ExecutorService;

/**
 * Client for accessing Service Quotas 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.
 * 

*

* With Service Quotas, you can view and manage your quotas easily as your Amazon Web Services workloads grow. Quotas, * also referred to as limits, are the maximum number of resources that you can create in your Amazon Web Services * account. For more information, see the Service * Quotas User Guide. *

*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AWSServiceQuotasAsyncClient extends AWSServiceQuotasClient implements AWSServiceQuotasAsync { private static final int DEFAULT_THREAD_POOL_SIZE = 50; private final java.util.concurrent.ExecutorService executorService; public static AWSServiceQuotasAsyncClientBuilder asyncBuilder() { return AWSServiceQuotasAsyncClientBuilder.standard(); } /** * Constructs a new asynchronous client to invoke service methods on Service Quotas using the specified parameters. * * @param asyncClientParams * Object providing client parameters. */ AWSServiceQuotasAsyncClient(AwsAsyncClientParams asyncClientParams) { this(asyncClientParams, false); } /** * Constructs a new asynchronous client to invoke service methods on Service Quotas using the specified parameters. * * @param asyncClientParams * Object providing client parameters. * @param endpointDiscoveryEnabled * true will enable endpoint discovery if the service supports it. */ AWSServiceQuotasAsyncClient(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 associateServiceQuotaTemplateAsync(AssociateServiceQuotaTemplateRequest request) { return associateServiceQuotaTemplateAsync(request, null); } @Override public java.util.concurrent.Future associateServiceQuotaTemplateAsync( final AssociateServiceQuotaTemplateRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final AssociateServiceQuotaTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public AssociateServiceQuotaTemplateResult call() throws Exception { AssociateServiceQuotaTemplateResult result = null; try { result = executeAssociateServiceQuotaTemplate(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 deleteServiceQuotaIncreaseRequestFromTemplateAsync( DeleteServiceQuotaIncreaseRequestFromTemplateRequest request) { return deleteServiceQuotaIncreaseRequestFromTemplateAsync(request, null); } @Override public java.util.concurrent.Future deleteServiceQuotaIncreaseRequestFromTemplateAsync( final DeleteServiceQuotaIncreaseRequestFromTemplateRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteServiceQuotaIncreaseRequestFromTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteServiceQuotaIncreaseRequestFromTemplateResult call() throws Exception { DeleteServiceQuotaIncreaseRequestFromTemplateResult result = null; try { result = executeDeleteServiceQuotaIncreaseRequestFromTemplate(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 disassociateServiceQuotaTemplateAsync( DisassociateServiceQuotaTemplateRequest request) { return disassociateServiceQuotaTemplateAsync(request, null); } @Override public java.util.concurrent.Future disassociateServiceQuotaTemplateAsync( final DisassociateServiceQuotaTemplateRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DisassociateServiceQuotaTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DisassociateServiceQuotaTemplateResult call() throws Exception { DisassociateServiceQuotaTemplateResult result = null; try { result = executeDisassociateServiceQuotaTemplate(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 getAWSDefaultServiceQuotaAsync(GetAWSDefaultServiceQuotaRequest request) { return getAWSDefaultServiceQuotaAsync(request, null); } @Override public java.util.concurrent.Future getAWSDefaultServiceQuotaAsync(final GetAWSDefaultServiceQuotaRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetAWSDefaultServiceQuotaRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetAWSDefaultServiceQuotaResult call() throws Exception { GetAWSDefaultServiceQuotaResult result = null; try { result = executeGetAWSDefaultServiceQuota(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 getAssociationForServiceQuotaTemplateAsync( GetAssociationForServiceQuotaTemplateRequest request) { return getAssociationForServiceQuotaTemplateAsync(request, null); } @Override public java.util.concurrent.Future getAssociationForServiceQuotaTemplateAsync( final GetAssociationForServiceQuotaTemplateRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetAssociationForServiceQuotaTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetAssociationForServiceQuotaTemplateResult call() throws Exception { GetAssociationForServiceQuotaTemplateResult result = null; try { result = executeGetAssociationForServiceQuotaTemplate(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 getRequestedServiceQuotaChangeAsync(GetRequestedServiceQuotaChangeRequest request) { return getRequestedServiceQuotaChangeAsync(request, null); } @Override public java.util.concurrent.Future getRequestedServiceQuotaChangeAsync( final GetRequestedServiceQuotaChangeRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetRequestedServiceQuotaChangeRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetRequestedServiceQuotaChangeResult call() throws Exception { GetRequestedServiceQuotaChangeResult result = null; try { result = executeGetRequestedServiceQuotaChange(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 getServiceQuotaAsync(GetServiceQuotaRequest request) { return getServiceQuotaAsync(request, null); } @Override public java.util.concurrent.Future getServiceQuotaAsync(final GetServiceQuotaRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetServiceQuotaRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetServiceQuotaResult call() throws Exception { GetServiceQuotaResult result = null; try { result = executeGetServiceQuota(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 getServiceQuotaIncreaseRequestFromTemplateAsync( GetServiceQuotaIncreaseRequestFromTemplateRequest request) { return getServiceQuotaIncreaseRequestFromTemplateAsync(request, null); } @Override public java.util.concurrent.Future getServiceQuotaIncreaseRequestFromTemplateAsync( final GetServiceQuotaIncreaseRequestFromTemplateRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetServiceQuotaIncreaseRequestFromTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetServiceQuotaIncreaseRequestFromTemplateResult call() throws Exception { GetServiceQuotaIncreaseRequestFromTemplateResult result = null; try { result = executeGetServiceQuotaIncreaseRequestFromTemplate(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 listAWSDefaultServiceQuotasAsync(ListAWSDefaultServiceQuotasRequest request) { return listAWSDefaultServiceQuotasAsync(request, null); } @Override public java.util.concurrent.Future listAWSDefaultServiceQuotasAsync(final ListAWSDefaultServiceQuotasRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListAWSDefaultServiceQuotasRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListAWSDefaultServiceQuotasResult call() throws Exception { ListAWSDefaultServiceQuotasResult result = null; try { result = executeListAWSDefaultServiceQuotas(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 listRequestedServiceQuotaChangeHistoryAsync( ListRequestedServiceQuotaChangeHistoryRequest request) { return listRequestedServiceQuotaChangeHistoryAsync(request, null); } @Override public java.util.concurrent.Future listRequestedServiceQuotaChangeHistoryAsync( final ListRequestedServiceQuotaChangeHistoryRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListRequestedServiceQuotaChangeHistoryRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListRequestedServiceQuotaChangeHistoryResult call() throws Exception { ListRequestedServiceQuotaChangeHistoryResult result = null; try { result = executeListRequestedServiceQuotaChangeHistory(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 listRequestedServiceQuotaChangeHistoryByQuotaAsync( ListRequestedServiceQuotaChangeHistoryByQuotaRequest request) { return listRequestedServiceQuotaChangeHistoryByQuotaAsync(request, null); } @Override public java.util.concurrent.Future listRequestedServiceQuotaChangeHistoryByQuotaAsync( final ListRequestedServiceQuotaChangeHistoryByQuotaRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListRequestedServiceQuotaChangeHistoryByQuotaRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListRequestedServiceQuotaChangeHistoryByQuotaResult call() throws Exception { ListRequestedServiceQuotaChangeHistoryByQuotaResult result = null; try { result = executeListRequestedServiceQuotaChangeHistoryByQuota(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 listServiceQuotaIncreaseRequestsInTemplateAsync( ListServiceQuotaIncreaseRequestsInTemplateRequest request) { return listServiceQuotaIncreaseRequestsInTemplateAsync(request, null); } @Override public java.util.concurrent.Future listServiceQuotaIncreaseRequestsInTemplateAsync( final ListServiceQuotaIncreaseRequestsInTemplateRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListServiceQuotaIncreaseRequestsInTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListServiceQuotaIncreaseRequestsInTemplateResult call() throws Exception { ListServiceQuotaIncreaseRequestsInTemplateResult result = null; try { result = executeListServiceQuotaIncreaseRequestsInTemplate(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 listServiceQuotasAsync(ListServiceQuotasRequest request) { return listServiceQuotasAsync(request, null); } @Override public java.util.concurrent.Future listServiceQuotasAsync(final ListServiceQuotasRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListServiceQuotasRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListServiceQuotasResult call() throws Exception { ListServiceQuotasResult result = null; try { result = executeListServiceQuotas(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 listServicesAsync(ListServicesRequest request) { return listServicesAsync(request, null); } @Override public java.util.concurrent.Future listServicesAsync(final ListServicesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListServicesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListServicesResult call() throws Exception { ListServicesResult result = null; try { result = executeListServices(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 putServiceQuotaIncreaseRequestIntoTemplateAsync( PutServiceQuotaIncreaseRequestIntoTemplateRequest request) { return putServiceQuotaIncreaseRequestIntoTemplateAsync(request, null); } @Override public java.util.concurrent.Future putServiceQuotaIncreaseRequestIntoTemplateAsync( final PutServiceQuotaIncreaseRequestIntoTemplateRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final PutServiceQuotaIncreaseRequestIntoTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public PutServiceQuotaIncreaseRequestIntoTemplateResult call() throws Exception { PutServiceQuotaIncreaseRequestIntoTemplateResult result = null; try { result = executePutServiceQuotaIncreaseRequestIntoTemplate(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 requestServiceQuotaIncreaseAsync(RequestServiceQuotaIncreaseRequest request) { return requestServiceQuotaIncreaseAsync(request, null); } @Override public java.util.concurrent.Future requestServiceQuotaIncreaseAsync(final RequestServiceQuotaIncreaseRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final RequestServiceQuotaIncreaseRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public RequestServiceQuotaIncreaseResult call() throws Exception { RequestServiceQuotaIncreaseResult result = null; try { result = executeRequestServiceQuotaIncrease(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; } }); } /** * 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