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

software.amazon.awssdk.services.transfer.DefaultTransferAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Transfer module holds the client classes that are used for communicating with Transfer.

There is a newer version: 2.29.39
Show newest version
/*
 * Copyright 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 software.amazon.awssdk.services.transfer;

import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ScheduledExecutorService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.transfer.internal.TransferServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.transfer.model.AccessDeniedException;
import software.amazon.awssdk.services.transfer.model.ConflictException;
import software.amazon.awssdk.services.transfer.model.CreateAccessRequest;
import software.amazon.awssdk.services.transfer.model.CreateAccessResponse;
import software.amazon.awssdk.services.transfer.model.CreateAgreementRequest;
import software.amazon.awssdk.services.transfer.model.CreateAgreementResponse;
import software.amazon.awssdk.services.transfer.model.CreateConnectorRequest;
import software.amazon.awssdk.services.transfer.model.CreateConnectorResponse;
import software.amazon.awssdk.services.transfer.model.CreateProfileRequest;
import software.amazon.awssdk.services.transfer.model.CreateProfileResponse;
import software.amazon.awssdk.services.transfer.model.CreateServerRequest;
import software.amazon.awssdk.services.transfer.model.CreateServerResponse;
import software.amazon.awssdk.services.transfer.model.CreateUserRequest;
import software.amazon.awssdk.services.transfer.model.CreateUserResponse;
import software.amazon.awssdk.services.transfer.model.CreateWorkflowRequest;
import software.amazon.awssdk.services.transfer.model.CreateWorkflowResponse;
import software.amazon.awssdk.services.transfer.model.DeleteAccessRequest;
import software.amazon.awssdk.services.transfer.model.DeleteAccessResponse;
import software.amazon.awssdk.services.transfer.model.DeleteAgreementRequest;
import software.amazon.awssdk.services.transfer.model.DeleteAgreementResponse;
import software.amazon.awssdk.services.transfer.model.DeleteCertificateRequest;
import software.amazon.awssdk.services.transfer.model.DeleteCertificateResponse;
import software.amazon.awssdk.services.transfer.model.DeleteConnectorRequest;
import software.amazon.awssdk.services.transfer.model.DeleteConnectorResponse;
import software.amazon.awssdk.services.transfer.model.DeleteHostKeyRequest;
import software.amazon.awssdk.services.transfer.model.DeleteHostKeyResponse;
import software.amazon.awssdk.services.transfer.model.DeleteProfileRequest;
import software.amazon.awssdk.services.transfer.model.DeleteProfileResponse;
import software.amazon.awssdk.services.transfer.model.DeleteServerRequest;
import software.amazon.awssdk.services.transfer.model.DeleteServerResponse;
import software.amazon.awssdk.services.transfer.model.DeleteSshPublicKeyRequest;
import software.amazon.awssdk.services.transfer.model.DeleteSshPublicKeyResponse;
import software.amazon.awssdk.services.transfer.model.DeleteUserRequest;
import software.amazon.awssdk.services.transfer.model.DeleteUserResponse;
import software.amazon.awssdk.services.transfer.model.DeleteWorkflowRequest;
import software.amazon.awssdk.services.transfer.model.DeleteWorkflowResponse;
import software.amazon.awssdk.services.transfer.model.DescribeAccessRequest;
import software.amazon.awssdk.services.transfer.model.DescribeAccessResponse;
import software.amazon.awssdk.services.transfer.model.DescribeAgreementRequest;
import software.amazon.awssdk.services.transfer.model.DescribeAgreementResponse;
import software.amazon.awssdk.services.transfer.model.DescribeCertificateRequest;
import software.amazon.awssdk.services.transfer.model.DescribeCertificateResponse;
import software.amazon.awssdk.services.transfer.model.DescribeConnectorRequest;
import software.amazon.awssdk.services.transfer.model.DescribeConnectorResponse;
import software.amazon.awssdk.services.transfer.model.DescribeExecutionRequest;
import software.amazon.awssdk.services.transfer.model.DescribeExecutionResponse;
import software.amazon.awssdk.services.transfer.model.DescribeHostKeyRequest;
import software.amazon.awssdk.services.transfer.model.DescribeHostKeyResponse;
import software.amazon.awssdk.services.transfer.model.DescribeProfileRequest;
import software.amazon.awssdk.services.transfer.model.DescribeProfileResponse;
import software.amazon.awssdk.services.transfer.model.DescribeSecurityPolicyRequest;
import software.amazon.awssdk.services.transfer.model.DescribeSecurityPolicyResponse;
import software.amazon.awssdk.services.transfer.model.DescribeServerRequest;
import software.amazon.awssdk.services.transfer.model.DescribeServerResponse;
import software.amazon.awssdk.services.transfer.model.DescribeUserRequest;
import software.amazon.awssdk.services.transfer.model.DescribeUserResponse;
import software.amazon.awssdk.services.transfer.model.DescribeWorkflowRequest;
import software.amazon.awssdk.services.transfer.model.DescribeWorkflowResponse;
import software.amazon.awssdk.services.transfer.model.ImportCertificateRequest;
import software.amazon.awssdk.services.transfer.model.ImportCertificateResponse;
import software.amazon.awssdk.services.transfer.model.ImportHostKeyRequest;
import software.amazon.awssdk.services.transfer.model.ImportHostKeyResponse;
import software.amazon.awssdk.services.transfer.model.ImportSshPublicKeyRequest;
import software.amazon.awssdk.services.transfer.model.ImportSshPublicKeyResponse;
import software.amazon.awssdk.services.transfer.model.InternalServiceErrorException;
import software.amazon.awssdk.services.transfer.model.InvalidNextTokenException;
import software.amazon.awssdk.services.transfer.model.InvalidRequestException;
import software.amazon.awssdk.services.transfer.model.ListAccessesRequest;
import software.amazon.awssdk.services.transfer.model.ListAccessesResponse;
import software.amazon.awssdk.services.transfer.model.ListAgreementsRequest;
import software.amazon.awssdk.services.transfer.model.ListAgreementsResponse;
import software.amazon.awssdk.services.transfer.model.ListCertificatesRequest;
import software.amazon.awssdk.services.transfer.model.ListCertificatesResponse;
import software.amazon.awssdk.services.transfer.model.ListConnectorsRequest;
import software.amazon.awssdk.services.transfer.model.ListConnectorsResponse;
import software.amazon.awssdk.services.transfer.model.ListExecutionsRequest;
import software.amazon.awssdk.services.transfer.model.ListExecutionsResponse;
import software.amazon.awssdk.services.transfer.model.ListHostKeysRequest;
import software.amazon.awssdk.services.transfer.model.ListHostKeysResponse;
import software.amazon.awssdk.services.transfer.model.ListProfilesRequest;
import software.amazon.awssdk.services.transfer.model.ListProfilesResponse;
import software.amazon.awssdk.services.transfer.model.ListSecurityPoliciesRequest;
import software.amazon.awssdk.services.transfer.model.ListSecurityPoliciesResponse;
import software.amazon.awssdk.services.transfer.model.ListServersRequest;
import software.amazon.awssdk.services.transfer.model.ListServersResponse;
import software.amazon.awssdk.services.transfer.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.transfer.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.transfer.model.ListUsersRequest;
import software.amazon.awssdk.services.transfer.model.ListUsersResponse;
import software.amazon.awssdk.services.transfer.model.ListWorkflowsRequest;
import software.amazon.awssdk.services.transfer.model.ListWorkflowsResponse;
import software.amazon.awssdk.services.transfer.model.ResourceExistsException;
import software.amazon.awssdk.services.transfer.model.ResourceNotFoundException;
import software.amazon.awssdk.services.transfer.model.SendWorkflowStepStateRequest;
import software.amazon.awssdk.services.transfer.model.SendWorkflowStepStateResponse;
import software.amazon.awssdk.services.transfer.model.ServiceUnavailableException;
import software.amazon.awssdk.services.transfer.model.StartDirectoryListingRequest;
import software.amazon.awssdk.services.transfer.model.StartDirectoryListingResponse;
import software.amazon.awssdk.services.transfer.model.StartFileTransferRequest;
import software.amazon.awssdk.services.transfer.model.StartFileTransferResponse;
import software.amazon.awssdk.services.transfer.model.StartServerRequest;
import software.amazon.awssdk.services.transfer.model.StartServerResponse;
import software.amazon.awssdk.services.transfer.model.StopServerRequest;
import software.amazon.awssdk.services.transfer.model.StopServerResponse;
import software.amazon.awssdk.services.transfer.model.TagResourceRequest;
import software.amazon.awssdk.services.transfer.model.TagResourceResponse;
import software.amazon.awssdk.services.transfer.model.TestConnectionRequest;
import software.amazon.awssdk.services.transfer.model.TestConnectionResponse;
import software.amazon.awssdk.services.transfer.model.TestIdentityProviderRequest;
import software.amazon.awssdk.services.transfer.model.TestIdentityProviderResponse;
import software.amazon.awssdk.services.transfer.model.ThrottlingException;
import software.amazon.awssdk.services.transfer.model.TransferException;
import software.amazon.awssdk.services.transfer.model.UntagResourceRequest;
import software.amazon.awssdk.services.transfer.model.UntagResourceResponse;
import software.amazon.awssdk.services.transfer.model.UpdateAccessRequest;
import software.amazon.awssdk.services.transfer.model.UpdateAccessResponse;
import software.amazon.awssdk.services.transfer.model.UpdateAgreementRequest;
import software.amazon.awssdk.services.transfer.model.UpdateAgreementResponse;
import software.amazon.awssdk.services.transfer.model.UpdateCertificateRequest;
import software.amazon.awssdk.services.transfer.model.UpdateCertificateResponse;
import software.amazon.awssdk.services.transfer.model.UpdateConnectorRequest;
import software.amazon.awssdk.services.transfer.model.UpdateConnectorResponse;
import software.amazon.awssdk.services.transfer.model.UpdateHostKeyRequest;
import software.amazon.awssdk.services.transfer.model.UpdateHostKeyResponse;
import software.amazon.awssdk.services.transfer.model.UpdateProfileRequest;
import software.amazon.awssdk.services.transfer.model.UpdateProfileResponse;
import software.amazon.awssdk.services.transfer.model.UpdateServerRequest;
import software.amazon.awssdk.services.transfer.model.UpdateServerResponse;
import software.amazon.awssdk.services.transfer.model.UpdateUserRequest;
import software.amazon.awssdk.services.transfer.model.UpdateUserResponse;
import software.amazon.awssdk.services.transfer.transform.CreateAccessRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.CreateAgreementRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.CreateConnectorRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.CreateProfileRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.CreateServerRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.CreateUserRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.CreateWorkflowRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DeleteAccessRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DeleteAgreementRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DeleteCertificateRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DeleteConnectorRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DeleteHostKeyRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DeleteProfileRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DeleteServerRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DeleteSshPublicKeyRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DeleteUserRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DeleteWorkflowRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DescribeAccessRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DescribeAgreementRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DescribeCertificateRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DescribeConnectorRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DescribeExecutionRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DescribeHostKeyRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DescribeProfileRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DescribeSecurityPolicyRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DescribeServerRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DescribeUserRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.DescribeWorkflowRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.ImportCertificateRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.ImportHostKeyRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.ImportSshPublicKeyRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.ListAccessesRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.ListAgreementsRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.ListCertificatesRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.ListConnectorsRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.ListExecutionsRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.ListHostKeysRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.ListProfilesRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.ListSecurityPoliciesRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.ListServersRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.ListUsersRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.ListWorkflowsRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.SendWorkflowStepStateRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.StartDirectoryListingRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.StartFileTransferRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.StartServerRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.StopServerRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.TestConnectionRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.TestIdentityProviderRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.UpdateAccessRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.UpdateAgreementRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.UpdateCertificateRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.UpdateConnectorRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.UpdateHostKeyRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.UpdateProfileRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.UpdateServerRequestMarshaller;
import software.amazon.awssdk.services.transfer.transform.UpdateUserRequestMarshaller;
import software.amazon.awssdk.services.transfer.waiters.TransferAsyncWaiter;
import software.amazon.awssdk.utils.CompletableFutureUtils;

/**
 * Internal implementation of {@link TransferAsyncClient}.
 *
 * @see TransferAsyncClient#builder()
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultTransferAsyncClient implements TransferAsyncClient {
    private static final Logger log = LoggerFactory.getLogger(DefaultTransferAsyncClient.class);

    private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
            .serviceProtocol(AwsServiceProtocol.AWS_JSON).build();

    private final AsyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

    private final ScheduledExecutorService executorService;

    protected DefaultTransferAsyncClient(SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
        this.executorService = clientConfiguration.option(SdkClientOption.SCHEDULED_EXECUTOR_SERVICE);
    }

    /**
     * 

* Used by administrators to choose which groups in the directory should have access to upload and download files * over the enabled protocols using Transfer Family. For example, a Microsoft Active Directory might contain 50,000 * users, but only a small fraction might need the ability to transfer files to the server. An administrator can use * CreateAccess to limit the access to the correct set of users who need this ability. *

* * @param createAccessRequest * @return A Java Future containing the result of the CreateAccess operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • ResourceExistsException The requested resource does not exist, or exists in a region other than the * one specified for the command.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.CreateAccess * @see AWS API * Documentation */ @Override public CompletableFuture createAccess(CreateAccessRequest createAccessRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createAccessRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createAccessRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAccess"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateAccessResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateAccess").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateAccessRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createAccessRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an agreement. An agreement is a bilateral trading partner agreement, or partnership, between an Transfer * Family server and an AS2 process. The agreement defines the file and message transfer relationship between the * server and the AS2 process. To define an agreement, Transfer Family combines a server, local profile, partner * profile, certificate, and other attributes. *

*

* The partner is identified with the PartnerProfileId, and the AS2 process is identified with the * LocalProfileId. *

* * @param createAgreementRequest * @return A Java Future containing the result of the CreateAgreement operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • ResourceExistsException The requested resource does not exist, or exists in a region other than the * one specified for the command.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.CreateAgreement * @see AWS API * Documentation */ @Override public CompletableFuture createAgreement(CreateAgreementRequest createAgreementRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createAgreementRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createAgreementRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAgreement"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateAgreementResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateAgreement").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateAgreementRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createAgreementRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates the connector, which captures the parameters for a connection for the AS2 or SFTP protocol. For AS2, the * connector is required for sending files to an externally hosted AS2 server. For SFTP, the connector is required * when sending files to an SFTP server or receiving files from an SFTP server. For more details about connectors, * see Configure AS2 * connectors and Create SFTP * connectors. *

* *

* You must specify exactly one configuration object: either for AS2 (As2Config) or SFTP ( * SftpConfig). *

*
* * @param createConnectorRequest * @return A Java Future containing the result of the CreateConnector operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • ResourceExistsException The requested resource does not exist, or exists in a region other than the * one specified for the command.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.CreateConnector * @see AWS API * Documentation */ @Override public CompletableFuture createConnector(CreateConnectorRequest createConnectorRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createConnectorRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createConnectorRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateConnector"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateConnectorResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateConnector").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateConnectorRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createConnectorRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates the local or partner profile to use for AS2 transfers. *

* * @param createProfileRequest * @return A Java Future containing the result of the CreateProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.CreateProfile * @see AWS API * Documentation */ @Override public CompletableFuture createProfile(CreateProfileRequest createProfileRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createProfileRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createProfileRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateProfile"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateProfileResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateProfile").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateProfileRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createProfileRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Instantiates an auto-scaling virtual server based on the selected file transfer protocol in Amazon Web Services. * When you make updates to your file transfer protocol-enabled server or when you work with users, use the * service-generated ServerId property that is assigned to the newly created server. *

* * @param createServerRequest * @return A Java Future containing the result of the CreateServer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • ResourceExistsException The requested resource does not exist, or exists in a region other than the * one specified for the command.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.CreateServer * @see AWS API * Documentation */ @Override public CompletableFuture createServer(CreateServerRequest createServerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createServerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createServerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateServer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateServerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateServer").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateServerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createServerRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a user and associates them with an existing file transfer protocol-enabled server. You can only create * and associate users with servers that have the IdentityProviderType set to * SERVICE_MANAGED. Using parameters for CreateUser, you can specify the user name, set * the home directory, store the user's public key, and assign the user's Identity and Access Management (IAM) role. * You can also optionally add a session policy, and assign metadata with tags that can be used to group and search * for users. *

* * @param createUserRequest * @return A Java Future containing the result of the CreateUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • ResourceExistsException The requested resource does not exist, or exists in a region other than the * one specified for the command.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.CreateUser * @see AWS API * Documentation */ @Override public CompletableFuture createUser(CreateUserRequest createUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("CreateUser") .withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createUserRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Allows you to create a workflow with specified steps and step details the workflow invokes after file transfer * completes. After creating a workflow, you can associate the workflow created with any transfer servers by * specifying the workflow-details field in CreateServer and UpdateServer * operations. *

* * @param createWorkflowRequest * @return A Java Future containing the result of the CreateWorkflow operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • ResourceExistsException The requested resource does not exist, or exists in a region other than the * one specified for the command.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.CreateWorkflow * @see AWS API * Documentation */ @Override public CompletableFuture createWorkflow(CreateWorkflowRequest createWorkflowRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createWorkflowRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createWorkflowRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateWorkflow"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateWorkflowResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateWorkflow").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateWorkflowRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createWorkflowRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Allows you to delete the access specified in the ServerID and ExternalID parameters. *

* * @param deleteAccessRequest * @return A Java Future containing the result of the DeleteAccess operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DeleteAccess * @see AWS API * Documentation */ @Override public CompletableFuture deleteAccess(DeleteAccessRequest deleteAccessRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAccessRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAccessRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAccess"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteAccessResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteAccess").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteAccessRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteAccessRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Delete the agreement that's specified in the provided AgreementId. *

* * @param deleteAgreementRequest * @return A Java Future containing the result of the DeleteAgreement operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DeleteAgreement * @see AWS API * Documentation */ @Override public CompletableFuture deleteAgreement(DeleteAgreementRequest deleteAgreementRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAgreementRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAgreementRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAgreement"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteAgreementResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteAgreement").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteAgreementRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteAgreementRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the certificate that's specified in the CertificateId parameter. *

* * @param deleteCertificateRequest * @return A Java Future containing the result of the DeleteCertificate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DeleteCertificate * @see AWS * API Documentation */ @Override public CompletableFuture deleteCertificate(DeleteCertificateRequest deleteCertificateRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCertificateRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCertificateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCertificate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCertificateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCertificate").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteCertificateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteCertificateRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the connector that's specified in the provided ConnectorId. *

* * @param deleteConnectorRequest * @return A Java Future containing the result of the DeleteConnector operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DeleteConnector * @see AWS API * Documentation */ @Override public CompletableFuture deleteConnector(DeleteConnectorRequest deleteConnectorRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteConnectorRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteConnectorRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteConnector"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteConnectorResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteConnector").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteConnectorRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteConnectorRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the host key that's specified in the HostKeyId parameter. *

* * @param deleteHostKeyRequest * @return A Java Future containing the result of the DeleteHostKey operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DeleteHostKey * @see AWS API * Documentation */ @Override public CompletableFuture deleteHostKey(DeleteHostKeyRequest deleteHostKeyRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteHostKeyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteHostKeyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteHostKey"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteHostKeyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteHostKey").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteHostKeyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteHostKeyRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the profile that's specified in the ProfileId parameter. *

* * @param deleteProfileRequest * @return A Java Future containing the result of the DeleteProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DeleteProfile * @see AWS API * Documentation */ @Override public CompletableFuture deleteProfile(DeleteProfileRequest deleteProfileRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteProfileRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteProfileRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteProfile"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteProfileResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteProfile").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteProfileRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteProfileRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the file transfer protocol-enabled server that you specify. *

*

* No response returns from this operation. *

* * @param deleteServerRequest * @return A Java Future containing the result of the DeleteServer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DeleteServer * @see AWS API * Documentation */ @Override public CompletableFuture deleteServer(DeleteServerRequest deleteServerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteServerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteServerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteServer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteServerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteServer").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteServerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteServerRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a user's Secure Shell (SSH) public key. *

* * @param deleteSshPublicKeyRequest * @return A Java Future containing the result of the DeleteSshPublicKey operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DeleteSshPublicKey * @see AWS * API Documentation */ @Override public CompletableFuture deleteSshPublicKey(DeleteSshPublicKeyRequest deleteSshPublicKeyRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteSshPublicKeyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSshPublicKeyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSshPublicKey"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteSshPublicKeyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteSshPublicKey").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteSshPublicKeyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteSshPublicKeyRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the user belonging to a file transfer protocol-enabled server you specify. *

*

* No response returns from this operation. *

* *

* When you delete a user from a server, the user's information is lost. *

*
* * @param deleteUserRequest * @return A Java Future containing the result of the DeleteUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DeleteUser * @see AWS API * Documentation */ @Override public CompletableFuture deleteUser(DeleteUserRequest deleteUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("DeleteUser") .withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteUserRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the specified workflow. *

* * @param deleteWorkflowRequest * @return A Java Future containing the result of the DeleteWorkflow operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DeleteWorkflow * @see AWS API * Documentation */ @Override public CompletableFuture deleteWorkflow(DeleteWorkflowRequest deleteWorkflowRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteWorkflowRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteWorkflowRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteWorkflow"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteWorkflowResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteWorkflow").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteWorkflowRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteWorkflowRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the access that is assigned to the specific file transfer protocol-enabled server, as identified by its * ServerId property and its ExternalId. *

*

* The response from this call returns the properties of the access that is associated with the * ServerId value that was specified. *

* * @param describeAccessRequest * @return A Java Future containing the result of the DescribeAccess operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DescribeAccess * @see AWS API * Documentation */ @Override public CompletableFuture describeAccess(DescribeAccessRequest describeAccessRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAccessRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAccessRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAccess"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeAccessResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAccess").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeAccessRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeAccessRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the agreement that's identified by the AgreementId. *

* * @param describeAgreementRequest * @return A Java Future containing the result of the DescribeAgreement operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DescribeAgreement * @see AWS * API Documentation */ @Override public CompletableFuture describeAgreement(DescribeAgreementRequest describeAgreementRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAgreementRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAgreementRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAgreement"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeAgreementResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAgreement").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeAgreementRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeAgreementRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the certificate that's identified by the CertificateId. *

* * @param describeCertificateRequest * @return A Java Future containing the result of the DescribeCertificate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DescribeCertificate * @see AWS * API Documentation */ @Override public CompletableFuture describeCertificate( DescribeCertificateRequest describeCertificateRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeCertificateRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCertificateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCertificate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeCertificateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeCertificate").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeCertificateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeCertificateRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the connector that's identified by the ConnectorId. *

* * @param describeConnectorRequest * @return A Java Future containing the result of the DescribeConnector operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DescribeConnector * @see AWS * API Documentation */ @Override public CompletableFuture describeConnector(DescribeConnectorRequest describeConnectorRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeConnectorRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeConnectorRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeConnector"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeConnectorResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeConnector").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeConnectorRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeConnectorRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* You can use DescribeExecution to check the details of the execution of the specified workflow. *

* *

* This API call only returns details for in-progress workflows. *

*

* If you provide an ID for an execution that is not in progress, or if the execution doesn't match the specified * workflow ID, you receive a ResourceNotFound exception. *

*
* * @param describeExecutionRequest * @return A Java Future containing the result of the DescribeExecution operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DescribeExecution * @see AWS * API Documentation */ @Override public CompletableFuture describeExecution(DescribeExecutionRequest describeExecutionRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeExecutionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeExecutionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeExecution"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeExecutionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeExecution").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeExecutionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeExecutionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the details of the host key that's specified by the HostKeyId and ServerId. *

* * @param describeHostKeyRequest * @return A Java Future containing the result of the DescribeHostKey operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DescribeHostKey * @see AWS API * Documentation */ @Override public CompletableFuture describeHostKey(DescribeHostKeyRequest describeHostKeyRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeHostKeyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeHostKeyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeHostKey"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeHostKeyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeHostKey").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeHostKeyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeHostKeyRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the details of the profile that's specified by the ProfileId. *

* * @param describeProfileRequest * @return A Java Future containing the result of the DescribeProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DescribeProfile * @see AWS API * Documentation */ @Override public CompletableFuture describeProfile(DescribeProfileRequest describeProfileRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeProfileRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeProfileRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeProfile"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeProfileResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeProfile").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeProfileRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeProfileRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the security policy that is attached to your server or SFTP connector. The response contains a * description of the security policy's properties. For more information about security policies, see Working with security * policies for servers or Working with * security policies for SFTP connectors. *

* * @param describeSecurityPolicyRequest * @return A Java Future containing the result of the DescribeSecurityPolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DescribeSecurityPolicy * @see AWS API Documentation */ @Override public CompletableFuture describeSecurityPolicy( DescribeSecurityPolicyRequest describeSecurityPolicyRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeSecurityPolicyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeSecurityPolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeSecurityPolicy"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeSecurityPolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeSecurityPolicy").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeSecurityPolicyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeSecurityPolicyRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes a file transfer protocol-enabled server that you specify by passing the ServerId * parameter. *

*

* The response contains a description of a server's properties. When you set EndpointType to VPC, the * response will contain the EndpointDetails. *

* * @param describeServerRequest * @return A Java Future containing the result of the DescribeServer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DescribeServer * @see AWS API * Documentation */ @Override public CompletableFuture describeServer(DescribeServerRequest describeServerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeServerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeServerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeServer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeServerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeServer").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeServerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeServerRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the user assigned to the specific file transfer protocol-enabled server, as identified by its * ServerId property. *

*

* The response from this call returns the properties of the user associated with the ServerId value * that was specified. *

* * @param describeUserRequest * @return A Java Future containing the result of the DescribeUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DescribeUser * @see AWS API * Documentation */ @Override public CompletableFuture describeUser(DescribeUserRequest describeUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DescribeUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeUser").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeUserRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the specified workflow. *

* * @param describeWorkflowRequest * @return A Java Future containing the result of the DescribeWorkflow operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.DescribeWorkflow * @see AWS API * Documentation */ @Override public CompletableFuture describeWorkflow(DescribeWorkflowRequest describeWorkflowRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeWorkflowRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeWorkflowRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeWorkflow"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeWorkflowResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeWorkflow").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeWorkflowRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeWorkflowRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Imports the signing and encryption certificates that you need to create local (AS2) profiles and partner * profiles. *

* * @param importCertificateRequest * @return A Java Future containing the result of the ImportCertificate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.ImportCertificate * @see AWS * API Documentation */ @Override public CompletableFuture importCertificate(ImportCertificateRequest importCertificateRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(importCertificateRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, importCertificateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ImportCertificate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ImportCertificateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ImportCertificate").withProtocolMetadata(protocolMetadata) .withMarshaller(new ImportCertificateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(importCertificateRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Adds a host key to the server that's specified by the ServerId parameter. *

* * @param importHostKeyRequest * @return A Java Future containing the result of the ImportHostKey operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • ResourceExistsException The requested resource does not exist, or exists in a region other than the * one specified for the command.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.ImportHostKey * @see AWS API * Documentation */ @Override public CompletableFuture importHostKey(ImportHostKeyRequest importHostKeyRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(importHostKeyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, importHostKeyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ImportHostKey"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ImportHostKeyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ImportHostKey").withProtocolMetadata(protocolMetadata) .withMarshaller(new ImportHostKeyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(importHostKeyRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Adds a Secure Shell (SSH) public key to a Transfer Family user identified by a UserName value * assigned to the specific file transfer protocol-enabled server, identified by ServerId. *

*

* The response returns the UserName value, the ServerId value, and the name of the * SshPublicKeyId. *

* * @param importSshPublicKeyRequest * @return A Java Future containing the result of the ImportSshPublicKey operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • ResourceExistsException The requested resource does not exist, or exists in a region other than the * one specified for the command.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.ImportSshPublicKey * @see AWS * API Documentation */ @Override public CompletableFuture importSshPublicKey(ImportSshPublicKeyRequest importSshPublicKeyRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(importSshPublicKeyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, importSshPublicKeyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ImportSshPublicKey"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ImportSshPublicKeyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ImportSshPublicKey").withProtocolMetadata(protocolMetadata) .withMarshaller(new ImportSshPublicKeyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(importSshPublicKeyRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the details for all the accesses you have on your server. *

* * @param listAccessesRequest * @return A Java Future containing the result of the ListAccesses operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • InvalidNextTokenException The NextToken parameter that was passed is invalid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.ListAccesses * @see AWS API * Documentation */ @Override public CompletableFuture listAccesses(ListAccessesRequest listAccessesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAccessesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listAccessesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAccesses"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListAccessesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListAccesses").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListAccessesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listAccessesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a list of the agreements for the server that's identified by the ServerId that you supply. * If you want to limit the results to a certain number, supply a value for the MaxResults parameter. * If you ran the command previously and received a value for NextToken, you can supply that value to * continue listing agreements from where you left off. *

* * @param listAgreementsRequest * @return A Java Future containing the result of the ListAgreements operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • InvalidNextTokenException The NextToken parameter that was passed is invalid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.ListAgreements * @see AWS API * Documentation */ @Override public CompletableFuture listAgreements(ListAgreementsRequest listAgreementsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAgreementsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listAgreementsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAgreements"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListAgreementsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListAgreements").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListAgreementsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listAgreementsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a list of the current certificates that have been imported into Transfer Family. If you want to limit the * results to a certain number, supply a value for the MaxResults parameter. If you ran the command * previously and received a value for the NextToken parameter, you can supply that value to continue * listing certificates from where you left off. *

* * @param listCertificatesRequest * @return A Java Future containing the result of the ListCertificates operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • InvalidNextTokenException The NextToken parameter that was passed is invalid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.ListCertificates * @see AWS API * Documentation */ @Override public CompletableFuture listCertificates(ListCertificatesRequest listCertificatesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCertificatesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listCertificatesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCertificates"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListCertificatesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCertificates").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListCertificatesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listCertificatesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the connectors for the specified Region. *

* * @param listConnectorsRequest * @return A Java Future containing the result of the ListConnectors operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • InvalidNextTokenException The NextToken parameter that was passed is invalid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.ListConnectors * @see AWS API * Documentation */ @Override public CompletableFuture listConnectors(ListConnectorsRequest listConnectorsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listConnectorsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listConnectorsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListConnectors"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListConnectorsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListConnectors").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListConnectorsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listConnectorsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists all in-progress executions for the specified workflow. *

* *

* If the specified workflow ID cannot be found, ListExecutions returns a ResourceNotFound * exception. *

*
* * @param listExecutionsRequest * @return A Java Future containing the result of the ListExecutions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • InvalidNextTokenException The NextToken parameter that was passed is invalid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.ListExecutions * @see AWS API * Documentation */ @Override public CompletableFuture listExecutions(ListExecutionsRequest listExecutionsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listExecutionsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listExecutionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListExecutions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListExecutionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListExecutions").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListExecutionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listExecutionsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a list of host keys for the server that's specified by the ServerId parameter. *

* * @param listHostKeysRequest * @return A Java Future containing the result of the ListHostKeys operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • InvalidNextTokenException The NextToken parameter that was passed is invalid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.ListHostKeys * @see AWS API * Documentation */ @Override public CompletableFuture listHostKeys(ListHostKeysRequest listHostKeysRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listHostKeysRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listHostKeysRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListHostKeys"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListHostKeysResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListHostKeys").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListHostKeysRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listHostKeysRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a list of the profiles for your system. If you want to limit the results to a certain number, supply a * value for the MaxResults parameter. If you ran the command previously and received a value for * NextToken, you can supply that value to continue listing profiles from where you left off. *

* * @param listProfilesRequest * @return A Java Future containing the result of the ListProfiles operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • InvalidNextTokenException The NextToken parameter that was passed is invalid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.ListProfiles * @see AWS API * Documentation */ @Override public CompletableFuture listProfiles(ListProfilesRequest listProfilesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listProfilesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listProfilesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListProfiles"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListProfilesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListProfiles").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListProfilesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listProfilesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the security policies that are attached to your servers and SFTP connectors. For more information about * security policies, see Working with security * policies for servers or Working with * security policies for SFTP connectors. *

* * @param listSecurityPoliciesRequest * @return A Java Future containing the result of the ListSecurityPolicies operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • InvalidNextTokenException The NextToken parameter that was passed is invalid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.ListSecurityPolicies * @see AWS * API Documentation */ @Override public CompletableFuture listSecurityPolicies( ListSecurityPoliciesRequest listSecurityPoliciesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSecurityPoliciesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listSecurityPoliciesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSecurityPolicies"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListSecurityPoliciesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListSecurityPolicies").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListSecurityPoliciesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listSecurityPoliciesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the file transfer protocol-enabled servers that are associated with your Amazon Web Services account. *

* * @param listServersRequest * @return A Java Future containing the result of the ListServers operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • InvalidNextTokenException The NextToken parameter that was passed is invalid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.ListServers * @see AWS API * Documentation */ @Override public CompletableFuture listServers(ListServersRequest listServersRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listServersRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listServersRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListServers"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListServersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListServers").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListServersRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listServersRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists all of the tags associated with the Amazon Resource Name (ARN) that you specify. The resource can be a * user, server, or role. *

* * @param listTagsForResourceRequest * @return A Java Future containing the result of the ListTagsForResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • InvalidNextTokenException The NextToken parameter that was passed is invalid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.ListTagsForResource * @see AWS * API Documentation */ @Override public CompletableFuture listTagsForResource( ListTagsForResourceRequest listTagsForResourceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTagsForResourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTagsForResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListTagsForResource").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listTagsForResourceRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the users for a file transfer protocol-enabled server that you specify by passing the ServerId * parameter. *

* * @param listUsersRequest * @return A Java Future containing the result of the ListUsers operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • InvalidNextTokenException The NextToken parameter that was passed is invalid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.ListUsers * @see AWS API * Documentation */ @Override public CompletableFuture listUsers(ListUsersRequest listUsersRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listUsersRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listUsersRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListUsers"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListUsersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("ListUsers") .withProtocolMetadata(protocolMetadata) .withMarshaller(new ListUsersRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withMetricCollector(apiCallMetricCollector).withInput(listUsersRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists all workflows associated with your Amazon Web Services account for your current region. *

* * @param listWorkflowsRequest * @return A Java Future containing the result of the ListWorkflows operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • InvalidNextTokenException The NextToken parameter that was passed is invalid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.ListWorkflows * @see AWS API * Documentation */ @Override public CompletableFuture listWorkflows(ListWorkflowsRequest listWorkflowsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listWorkflowsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listWorkflowsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListWorkflows"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListWorkflowsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListWorkflows").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListWorkflowsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listWorkflowsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Sends a callback for asynchronous custom steps. *

*

* The ExecutionId, WorkflowId, and Token are passed to the target resource * during execution of a custom step of a workflow. You must include those with their callback as well as providing * a status. *

* * @param sendWorkflowStepStateRequest * @return A Java Future containing the result of the SendWorkflowStepState operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.SendWorkflowStepState * @see AWS API Documentation */ @Override public CompletableFuture sendWorkflowStepState( SendWorkflowStepStateRequest sendWorkflowStepStateRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(sendWorkflowStepStateRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, sendWorkflowStepStateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SendWorkflowStepState"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, SendWorkflowStepStateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("SendWorkflowStepState").withProtocolMetadata(protocolMetadata) .withMarshaller(new SendWorkflowStepStateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(sendWorkflowStepStateRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list of the contents of a directory from a remote SFTP server. You specify the connector ID, the * output path, and the remote directory path. You can also specify the optional MaxItems value to * control the maximum number of items that are listed from the remote directory. This API returns a list of all * files and directories in the remote directory (up to the maximum value), but does not return files or folders in * sub-directories. That is, it only returns a list of files and directories one-level deep. *

*

* After you receive the listing file, you can provide the files that you want to transfer to the * RetrieveFilePaths parameter of the StartFileTransfer API call. *

*

* The naming convention for the output file is connector-ID-listing-ID.json. The output * file contains the following information: *

*
    *
  • *

    * filePath: the complete path of a remote file, relative to the directory of the listing request for * your SFTP connector on the remote server. *

    *
  • *
  • *

    * modifiedTimestamp: the last time the file was modified, in UTC time format. This field is optional. * If the remote file attributes don't contain a timestamp, it is omitted from the file listing. *

    *
  • *
  • *

    * size: the size of the file, in bytes. This field is optional. If the remote file attributes don't * contain a file size, it is omitted from the file listing. *

    *
  • *
  • *

    * path: the complete path of a remote directory, relative to the directory of the listing request for * your SFTP connector on the remote server. *

    *
  • *
  • *

    * truncated: a flag indicating whether the list output contains all of the items contained in the * remote directory or not. If your Truncated output value is true, you can increase the value provided * in the optional max-items input attribute to be able to list more items (up to the maximum allowed * list size of 10,000 items). *

    *
  • *
* * @param startDirectoryListingRequest * @return A Java Future containing the result of the StartDirectoryListing operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.StartDirectoryListing * @see AWS API Documentation */ @Override public CompletableFuture startDirectoryListing( StartDirectoryListingRequest startDirectoryListingRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startDirectoryListingRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startDirectoryListingRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartDirectoryListing"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartDirectoryListingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StartDirectoryListing").withProtocolMetadata(protocolMetadata) .withMarshaller(new StartDirectoryListingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(startDirectoryListingRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Begins a file transfer between local Amazon Web Services storage and a remote AS2 or SFTP server. *

*
    *
  • *

    * For an AS2 connector, you specify the ConnectorId and one or more SendFilePaths to * identify the files you want to transfer. *

    *
  • *
  • *

    * For an SFTP connector, the file transfer can be either outbound or inbound. In both cases, you specify the * ConnectorId. Depending on the direction of the transfer, you also specify the following items: *

    *
      *
    • *

      * If you are transferring file from a partner's SFTP server to Amazon Web Services storage, you specify one or more * RetrieveFilePaths to identify the files you want to transfer, and a LocalDirectoryPath * to specify the destination folder. *

      *
    • *
    • *

      * If you are transferring file to a partner's SFTP server from Amazon Web Services storage, you specify one or more * SendFilePaths to identify the files you want to transfer, and a RemoteDirectoryPath to * specify the destination folder. *

      *
    • *
    *
  • *
* * @param startFileTransferRequest * @return A Java Future containing the result of the StartFileTransfer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.StartFileTransfer * @see AWS * API Documentation */ @Override public CompletableFuture startFileTransfer(StartFileTransferRequest startFileTransferRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startFileTransferRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startFileTransferRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartFileTransfer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartFileTransferResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StartFileTransfer").withProtocolMetadata(protocolMetadata) .withMarshaller(new StartFileTransferRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(startFileTransferRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Changes the state of a file transfer protocol-enabled server from OFFLINE to ONLINE. It * has no impact on a server that is already ONLINE. An ONLINE server can accept and * process file transfer jobs. *

*

* The state of STARTING indicates that the server is in an intermediate state, either not fully able * to respond, or not fully online. The values of START_FAILED can indicate an error condition. *

*

* No response is returned from this call. *

* * @param startServerRequest * @return A Java Future containing the result of the StartServer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.StartServer * @see AWS API * Documentation */ @Override public CompletableFuture startServer(StartServerRequest startServerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startServerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startServerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartServer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StartServerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StartServer").withProtocolMetadata(protocolMetadata) .withMarshaller(new StartServerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(startServerRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Changes the state of a file transfer protocol-enabled server from ONLINE to OFFLINE. An * OFFLINE server cannot accept and process file transfer jobs. Information tied to your server, such * as server and user properties, are not affected by stopping your server. *

* *

* Stopping the server does not reduce or impact your file transfer protocol endpoint billing; you must delete the * server to stop being billed. *

*
*

* The state of STOPPING indicates that the server is in an intermediate state, either not fully able * to respond, or not fully offline. The values of STOP_FAILED can indicate an error condition. *

*

* No response is returned from this call. *

* * @param stopServerRequest * @return A Java Future containing the result of the StopServer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.StopServer * @see AWS API * Documentation */ @Override public CompletableFuture stopServer(StopServerRequest stopServerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(stopServerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, stopServerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopServer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StopServerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("StopServer") .withProtocolMetadata(protocolMetadata) .withMarshaller(new StopServerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(stopServerRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Attaches a key-value pair to a resource, as identified by its Amazon Resource Name (ARN). Resources are users, * servers, roles, and other entities. *

*

* There is no response returned from this call. *

* * @param tagResourceRequest * @return A Java Future containing the result of the TagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.TagResource * @see AWS API * Documentation */ @Override public CompletableFuture tagResource(TagResourceRequest tagResourceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(tagResourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, TagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("TagResource").withProtocolMetadata(protocolMetadata) .withMarshaller(new TagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(tagResourceRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Tests whether your SFTP connector is set up successfully. We highly recommend that you call this operation to * test your ability to transfer files between local Amazon Web Services storage and a trading partner's SFTP * server. *

* * @param testConnectionRequest * @return A Java Future containing the result of the TestConnection operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.TestConnection * @see AWS API * Documentation */ @Override public CompletableFuture testConnection(TestConnectionRequest testConnectionRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(testConnectionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, testConnectionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TestConnection"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, TestConnectionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("TestConnection").withProtocolMetadata(protocolMetadata) .withMarshaller(new TestConnectionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(testConnectionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* If the IdentityProviderType of a file transfer protocol-enabled server is * AWS_DIRECTORY_SERVICE or API_Gateway, tests whether your identity provider is set up * successfully. We highly recommend that you call this operation to test your authentication method as soon as you * create your server. By doing so, you can troubleshoot issues with the identity provider integration to ensure * that your users can successfully use the service. *

*

* The ServerId and UserName parameters are required. The ServerProtocol, * SourceIp, and UserPassword are all optional. *

*

* Note the following: *

*
    *
  • *

    * You cannot use TestIdentityProvider if the IdentityProviderType of your server is * SERVICE_MANAGED. *

    *
  • *
  • *

    * TestIdentityProvider does not work with keys: it only accepts passwords. *

    *
  • *
  • *

    * TestIdentityProvider can test the password operation for a custom Identity Provider that handles * keys and passwords. *

    *
  • *
  • *

    * If you provide any incorrect values for any parameters, the Response field is empty. *

    *
  • *
  • *

    * If you provide a server ID for a server that uses service-managed users, you get an error: *

    *

    * An error occurred (InvalidRequestException) when calling the TestIdentityProvider operation: s-server-ID not configured for external auth *

    *
  • *
  • *

    * If you enter a Server ID for the --server-id parameter that does not identify an actual Transfer * server, you receive the following error: *

    *

    * An error occurred (ResourceNotFoundException) when calling the TestIdentityProvider operation: Unknown server * . *

    *

    * It is possible your sever is in a different region. You can specify a region by adding the following: * --region region-code, such as --region us-east-2 to specify a server in US East * (Ohio). *

    *
  • *
* * @param testIdentityProviderRequest * @return A Java Future containing the result of the TestIdentityProvider operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.TestIdentityProvider * @see AWS * API Documentation */ @Override public CompletableFuture testIdentityProvider( TestIdentityProviderRequest testIdentityProviderRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(testIdentityProviderRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, testIdentityProviderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TestIdentityProvider"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, TestIdentityProviderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("TestIdentityProvider").withProtocolMetadata(protocolMetadata) .withMarshaller(new TestIdentityProviderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(testIdentityProviderRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Detaches a key-value pair from a resource, as identified by its Amazon Resource Name (ARN). Resources are users, * servers, roles, and other entities. *

*

* No response is returned from this call. *

* * @param untagResourceRequest * @return A Java Future containing the result of the UntagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.UntagResource * @see AWS API * Documentation */ @Override public CompletableFuture untagResource(UntagResourceRequest untagResourceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(untagResourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UntagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UntagResource").withProtocolMetadata(protocolMetadata) .withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(untagResourceRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Allows you to update parameters for the access specified in the ServerID and ExternalID * parameters. *

* * @param updateAccessRequest * @return A Java Future containing the result of the UpdateAccess operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • ResourceExistsException The requested resource does not exist, or exists in a region other than the * one specified for the command.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.UpdateAccess * @see AWS API * Documentation */ @Override public CompletableFuture updateAccess(UpdateAccessRequest updateAccessRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateAccessRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAccessRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAccess"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateAccessResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateAccess").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateAccessRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateAccessRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates some of the parameters for an existing agreement. Provide the AgreementId and the * ServerId for the agreement that you want to update, along with the new values for the parameters to * update. *

* * @param updateAgreementRequest * @return A Java Future containing the result of the UpdateAgreement operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • ResourceExistsException The requested resource does not exist, or exists in a region other than the * one specified for the command.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.UpdateAgreement * @see AWS API * Documentation */ @Override public CompletableFuture updateAgreement(UpdateAgreementRequest updateAgreementRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateAgreementRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAgreementRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAgreement"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateAgreementResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateAgreement").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateAgreementRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateAgreementRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the active and inactive dates for a certificate. *

* * @param updateCertificateRequest * @return A Java Future containing the result of the UpdateCertificate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.UpdateCertificate * @see AWS * API Documentation */ @Override public CompletableFuture updateCertificate(UpdateCertificateRequest updateCertificateRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateCertificateRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCertificateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCertificate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCertificateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateCertificate").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateCertificateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateCertificateRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates some of the parameters for an existing connector. Provide the ConnectorId for the connector * that you want to update, along with the new values for the parameters to update. *

* * @param updateConnectorRequest * @return A Java Future containing the result of the UpdateConnector operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • ResourceExistsException The requested resource does not exist, or exists in a region other than the * one specified for the command.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.UpdateConnector * @see AWS API * Documentation */ @Override public CompletableFuture updateConnector(UpdateConnectorRequest updateConnectorRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateConnectorRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateConnectorRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateConnector"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateConnectorResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateConnector").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateConnectorRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateConnectorRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the description for the host key that's specified by the ServerId and HostKeyId * parameters. *

* * @param updateHostKeyRequest * @return A Java Future containing the result of the UpdateHostKey operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.UpdateHostKey * @see AWS API * Documentation */ @Override public CompletableFuture updateHostKey(UpdateHostKeyRequest updateHostKeyRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateHostKeyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateHostKeyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateHostKey"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateHostKeyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateHostKey").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateHostKeyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateHostKeyRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates some of the parameters for an existing profile. Provide the ProfileId for the profile that * you want to update, along with the new values for the parameters to update. *

* * @param updateProfileRequest * @return A Java Future containing the result of the UpdateProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.UpdateProfile * @see AWS API * Documentation */ @Override public CompletableFuture updateProfile(UpdateProfileRequest updateProfileRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateProfileRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateProfileRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateProfile"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateProfileResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateProfile").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateProfileRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateProfileRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the file transfer protocol-enabled server's properties after that server has been created. *

*

* The UpdateServer call returns the ServerId of the server you updated. *

* * @param updateServerRequest * @return A Java Future containing the result of the UpdateServer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ConflictException This exception is thrown when the UpdateServer is called for a file * transfer protocol-enabled server that has VPC as the endpoint type and the server's * VpcEndpointID is not in the available state.
  • *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • ResourceExistsException The requested resource does not exist, or exists in a region other than the * one specified for the command.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.UpdateServer * @see AWS API * Documentation */ @Override public CompletableFuture updateServer(UpdateServerRequest updateServerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateServerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateServerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateServer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateServerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateServer").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateServerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateServerRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Assigns new properties to a user. Parameters you pass modify any or all of the following: the home directory, * role, and policy for the UserName and ServerId you specify. *

*

* The response returns the ServerId and the UserName for the updated user. *

*

* In the console, you can select Restricted when you create or update a user. This ensures that the user * can't access anything outside of their home directory. The programmatic way to configure this behavior is to * update the user. Set their HomeDirectoryType to LOGICAL, and specify * HomeDirectoryMappings with Entry as root (/) and Target as * their home directory. *

*

* For example, if the user's home directory is /test/admin-user, the following command updates the * user so that their configuration in the console shows the Restricted flag as selected. *

*

* aws transfer update-user --server-id <server-id> --user-name admin-user --home-directory-type LOGICAL --home-directory-mappings "[{\"Entry\":\"/\", \"Target\":\"/test/admin-user\"}]" *

* * @param updateUserRequest * @return A Java Future containing the result of the UpdateUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException This exception is thrown when a resource is not found by the Amazon Web * ServicesTransfer Family service.
  • *
  • InvalidRequestException This exception is thrown when the client submits a malformed request.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServiceErrorException This exception is thrown when an error occurs in the Transfer Family * service.
  • *
  • ServiceUnavailableException The request has failed because the Amazon Web ServicesTransfer Family * service is not available.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • TransferException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample TransferAsyncClient.UpdateUser * @see AWS API * Documentation */ @Override public CompletableFuture updateUser(UpdateUserRequest updateUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Transfer"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("UpdateUser") .withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateUserRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } @Override public TransferAsyncWaiter waiter() { return TransferAsyncWaiter.builder().client(this).scheduledExecutorService(executorService).build(); } @Override public final TransferServiceClientConfiguration serviceClientConfiguration() { return new TransferServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build(); } @Override public final String serviceName() { return SERVICE_NAME; } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(TransferException::builder) .protocol(AwsJsonProtocol.AWS_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidRequestException") .exceptionBuilderSupplier(InvalidRequestException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidNextTokenException") .exceptionBuilderSupplier(InvalidNextTokenException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFoundException") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalServiceError") .exceptionBuilderSupplier(InternalServiceErrorException::builder).httpStatusCode(500).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceExistsException") .exceptionBuilderSupplier(ResourceExistsException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ThrottlingException") .exceptionBuilderSupplier(ThrottlingException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AccessDeniedException") .exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ConflictException") .exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceUnavailableException") .exceptionBuilderSupplier(ServiceUnavailableException::builder).httpStatusCode(500).build()); } private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration, RequestOverrideConfiguration requestOverrideConfiguration) { List publishers = null; if (requestOverrideConfiguration != null) { publishers = requestOverrideConfiguration.metricPublishers(); } if (publishers == null || publishers.isEmpty()) { publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS); } if (publishers == null) { publishers = Collections.emptyList(); } return publishers; } private SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request, SdkClientConfiguration clientConfiguration) { List plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList()); SdkClientConfiguration.Builder configuration = clientConfiguration.toBuilder(); if (plugins.isEmpty()) { return configuration.build(); } TransferServiceClientConfigurationBuilder serviceConfigBuilder = new TransferServiceClientConfigurationBuilder( configuration); for (SdkPlugin plugin : plugins) { plugin.configureClient(serviceConfigBuilder); } return configuration.build(); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy