com.amazonaws.services.signer.AWSsignerAsyncClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-signer 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.signer;
import javax.annotation.Generated;
import com.amazonaws.services.signer.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import java.util.concurrent.ExecutorService;
/**
* Client for accessing signer 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 Signer is a fully managed code-signing service to help you ensure the trust and integrity of your code.
*
*
* Signer supports the following applications:
*
*
* With code signing for AWS Lambda, you can sign AWS Lambda
* deployment packages. Integrated support is provided for Amazon S3, Amazon CloudWatch, and AWS CloudTrail. In order to sign code, you
* create a signing profile and then use Signer to sign Lambda zip files in S3.
*
*
* With code signing for IoT, you can sign code for any IoT device that is supported by AWS. IoT code signing is
* available for Amazon FreeRTOS and AWS IoT Device Management, and is integrated with AWS Certificate Manager (ACM). In order to sign code, you
* Project, you can sign container images stored in a container registry such as Amazon Elastic Container Registry
* (ECR). The signatures are stored in the registry alongside the images, where they are available for verifying image
* authenticity and integrity.
*
*
* For more information about Signer, see the AWS Signer Developer Guide.
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSsignerAsyncClient extends AWSsignerClient implements AWSsignerAsync {
private static final int DEFAULT_THREAD_POOL_SIZE = 50;
private final java.util.concurrent.ExecutorService executorService;
public static AWSsignerAsyncClientBuilder asyncBuilder() {
return AWSsignerAsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on signer using the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AWSsignerAsyncClient(AwsAsyncClientParams asyncClientParams) {
this(asyncClientParams, false);
}
/**
* Constructs a new asynchronous client to invoke service methods on signer using the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
* @param endpointDiscoveryEnabled
* true will enable endpoint discovery if the service supports it.
*/
AWSsignerAsyncClient(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 addProfilePermissionAsync(AddProfilePermissionRequest request) {
return addProfilePermissionAsync(request, null);
}
@Override
public java.util.concurrent.Future addProfilePermissionAsync(final AddProfilePermissionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AddProfilePermissionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AddProfilePermissionResult call() throws Exception {
AddProfilePermissionResult result = null;
try {
result = executeAddProfilePermission(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 cancelSigningProfileAsync(CancelSigningProfileRequest request) {
return cancelSigningProfileAsync(request, null);
}
@Override
public java.util.concurrent.Future cancelSigningProfileAsync(final CancelSigningProfileRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CancelSigningProfileRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CancelSigningProfileResult call() throws Exception {
CancelSigningProfileResult result = null;
try {
result = executeCancelSigningProfile(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 describeSigningJobAsync(DescribeSigningJobRequest request) {
return describeSigningJobAsync(request, null);
}
@Override
public java.util.concurrent.Future describeSigningJobAsync(final DescribeSigningJobRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeSigningJobRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeSigningJobResult call() throws Exception {
DescribeSigningJobResult result = null;
try {
result = executeDescribeSigningJob(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 getRevocationStatusAsync(GetRevocationStatusRequest request) {
return getRevocationStatusAsync(request, null);
}
@Override
public java.util.concurrent.Future getRevocationStatusAsync(final GetRevocationStatusRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetRevocationStatusRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetRevocationStatusResult call() throws Exception {
GetRevocationStatusResult result = null;
try {
result = executeGetRevocationStatus(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 getSigningPlatformAsync(GetSigningPlatformRequest request) {
return getSigningPlatformAsync(request, null);
}
@Override
public java.util.concurrent.Future getSigningPlatformAsync(final GetSigningPlatformRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetSigningPlatformRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetSigningPlatformResult call() throws Exception {
GetSigningPlatformResult result = null;
try {
result = executeGetSigningPlatform(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 getSigningProfileAsync(GetSigningProfileRequest request) {
return getSigningProfileAsync(request, null);
}
@Override
public java.util.concurrent.Future getSigningProfileAsync(final GetSigningProfileRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetSigningProfileRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetSigningProfileResult call() throws Exception {
GetSigningProfileResult result = null;
try {
result = executeGetSigningProfile(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 listProfilePermissionsAsync(ListProfilePermissionsRequest request) {
return listProfilePermissionsAsync(request, null);
}
@Override
public java.util.concurrent.Future listProfilePermissionsAsync(final ListProfilePermissionsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListProfilePermissionsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListProfilePermissionsResult call() throws Exception {
ListProfilePermissionsResult result = null;
try {
result = executeListProfilePermissions(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 listSigningJobsAsync(ListSigningJobsRequest request) {
return listSigningJobsAsync(request, null);
}
@Override
public java.util.concurrent.Future listSigningJobsAsync(final ListSigningJobsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListSigningJobsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListSigningJobsResult call() throws Exception {
ListSigningJobsResult result = null;
try {
result = executeListSigningJobs(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 listSigningPlatformsAsync(ListSigningPlatformsRequest request) {
return listSigningPlatformsAsync(request, null);
}
@Override
public java.util.concurrent.Future listSigningPlatformsAsync(final ListSigningPlatformsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListSigningPlatformsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListSigningPlatformsResult call() throws Exception {
ListSigningPlatformsResult result = null;
try {
result = executeListSigningPlatforms(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 listSigningProfilesAsync(ListSigningProfilesRequest request) {
return listSigningProfilesAsync(request, null);
}
@Override
public java.util.concurrent.Future listSigningProfilesAsync(final ListSigningProfilesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListSigningProfilesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListSigningProfilesResult call() throws Exception {
ListSigningProfilesResult result = null;
try {
result = executeListSigningProfiles(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 putSigningProfileAsync(PutSigningProfileRequest request) {
return putSigningProfileAsync(request, null);
}
@Override
public java.util.concurrent.Future putSigningProfileAsync(final PutSigningProfileRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final PutSigningProfileRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public PutSigningProfileResult call() throws Exception {
PutSigningProfileResult result = null;
try {
result = executePutSigningProfile(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 removeProfilePermissionAsync(RemoveProfilePermissionRequest request) {
return removeProfilePermissionAsync(request, null);
}
@Override
public java.util.concurrent.Future removeProfilePermissionAsync(final RemoveProfilePermissionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final RemoveProfilePermissionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public RemoveProfilePermissionResult call() throws Exception {
RemoveProfilePermissionResult result = null;
try {
result = executeRemoveProfilePermission(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 revokeSignatureAsync(RevokeSignatureRequest request) {
return revokeSignatureAsync(request, null);
}
@Override
public java.util.concurrent.Future revokeSignatureAsync(final RevokeSignatureRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final RevokeSignatureRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public RevokeSignatureResult call() throws Exception {
RevokeSignatureResult result = null;
try {
result = executeRevokeSignature(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 revokeSigningProfileAsync(RevokeSigningProfileRequest request) {
return revokeSigningProfileAsync(request, null);
}
@Override
public java.util.concurrent.Future revokeSigningProfileAsync(final RevokeSigningProfileRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final RevokeSigningProfileRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public RevokeSigningProfileResult call() throws Exception {
RevokeSigningProfileResult result = null;
try {
result = executeRevokeSigningProfile(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 signPayloadAsync(SignPayloadRequest request) {
return signPayloadAsync(request, null);
}
@Override
public java.util.concurrent.Future signPayloadAsync(final SignPayloadRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final SignPayloadRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public SignPayloadResult call() throws Exception {
SignPayloadResult result = null;
try {
result = executeSignPayload(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 startSigningJobAsync(StartSigningJobRequest request) {
return startSigningJobAsync(request, null);
}
@Override
public java.util.concurrent.Future startSigningJobAsync(final StartSigningJobRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartSigningJobRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartSigningJobResult call() throws Exception {
StartSigningJobResult result = null;
try {
result = executeStartSigningJob(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();
}
}