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

software.amazon.awssdk.services.m2.DefaultM2Client Maven / Gradle / Ivy

Go to download

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

The 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.m2;

import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
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.awscore.retry.AwsRetryStrategy;
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.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.retry.RetryMode;
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.retries.api.RetryStrategy;
import software.amazon.awssdk.services.m2.internal.M2ServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.m2.model.AccessDeniedException;
import software.amazon.awssdk.services.m2.model.CancelBatchJobExecutionRequest;
import software.amazon.awssdk.services.m2.model.CancelBatchJobExecutionResponse;
import software.amazon.awssdk.services.m2.model.ConflictException;
import software.amazon.awssdk.services.m2.model.CreateApplicationRequest;
import software.amazon.awssdk.services.m2.model.CreateApplicationResponse;
import software.amazon.awssdk.services.m2.model.CreateDataSetImportTaskRequest;
import software.amazon.awssdk.services.m2.model.CreateDataSetImportTaskResponse;
import software.amazon.awssdk.services.m2.model.CreateDeploymentRequest;
import software.amazon.awssdk.services.m2.model.CreateDeploymentResponse;
import software.amazon.awssdk.services.m2.model.CreateEnvironmentRequest;
import software.amazon.awssdk.services.m2.model.CreateEnvironmentResponse;
import software.amazon.awssdk.services.m2.model.DeleteApplicationFromEnvironmentRequest;
import software.amazon.awssdk.services.m2.model.DeleteApplicationFromEnvironmentResponse;
import software.amazon.awssdk.services.m2.model.DeleteApplicationRequest;
import software.amazon.awssdk.services.m2.model.DeleteApplicationResponse;
import software.amazon.awssdk.services.m2.model.DeleteEnvironmentRequest;
import software.amazon.awssdk.services.m2.model.DeleteEnvironmentResponse;
import software.amazon.awssdk.services.m2.model.ExecutionTimeoutException;
import software.amazon.awssdk.services.m2.model.GetApplicationRequest;
import software.amazon.awssdk.services.m2.model.GetApplicationResponse;
import software.amazon.awssdk.services.m2.model.GetApplicationVersionRequest;
import software.amazon.awssdk.services.m2.model.GetApplicationVersionResponse;
import software.amazon.awssdk.services.m2.model.GetBatchJobExecutionRequest;
import software.amazon.awssdk.services.m2.model.GetBatchJobExecutionResponse;
import software.amazon.awssdk.services.m2.model.GetDataSetDetailsRequest;
import software.amazon.awssdk.services.m2.model.GetDataSetDetailsResponse;
import software.amazon.awssdk.services.m2.model.GetDataSetImportTaskRequest;
import software.amazon.awssdk.services.m2.model.GetDataSetImportTaskResponse;
import software.amazon.awssdk.services.m2.model.GetDeploymentRequest;
import software.amazon.awssdk.services.m2.model.GetDeploymentResponse;
import software.amazon.awssdk.services.m2.model.GetEnvironmentRequest;
import software.amazon.awssdk.services.m2.model.GetEnvironmentResponse;
import software.amazon.awssdk.services.m2.model.GetSignedBluinsightsUrlRequest;
import software.amazon.awssdk.services.m2.model.GetSignedBluinsightsUrlResponse;
import software.amazon.awssdk.services.m2.model.InternalServerException;
import software.amazon.awssdk.services.m2.model.ListApplicationVersionsRequest;
import software.amazon.awssdk.services.m2.model.ListApplicationVersionsResponse;
import software.amazon.awssdk.services.m2.model.ListApplicationsRequest;
import software.amazon.awssdk.services.m2.model.ListApplicationsResponse;
import software.amazon.awssdk.services.m2.model.ListBatchJobDefinitionsRequest;
import software.amazon.awssdk.services.m2.model.ListBatchJobDefinitionsResponse;
import software.amazon.awssdk.services.m2.model.ListBatchJobExecutionsRequest;
import software.amazon.awssdk.services.m2.model.ListBatchJobExecutionsResponse;
import software.amazon.awssdk.services.m2.model.ListBatchJobRestartPointsRequest;
import software.amazon.awssdk.services.m2.model.ListBatchJobRestartPointsResponse;
import software.amazon.awssdk.services.m2.model.ListDataSetImportHistoryRequest;
import software.amazon.awssdk.services.m2.model.ListDataSetImportHistoryResponse;
import software.amazon.awssdk.services.m2.model.ListDataSetsRequest;
import software.amazon.awssdk.services.m2.model.ListDataSetsResponse;
import software.amazon.awssdk.services.m2.model.ListDeploymentsRequest;
import software.amazon.awssdk.services.m2.model.ListDeploymentsResponse;
import software.amazon.awssdk.services.m2.model.ListEngineVersionsRequest;
import software.amazon.awssdk.services.m2.model.ListEngineVersionsResponse;
import software.amazon.awssdk.services.m2.model.ListEnvironmentsRequest;
import software.amazon.awssdk.services.m2.model.ListEnvironmentsResponse;
import software.amazon.awssdk.services.m2.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.m2.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.m2.model.M2Exception;
import software.amazon.awssdk.services.m2.model.ResourceNotFoundException;
import software.amazon.awssdk.services.m2.model.ServiceQuotaExceededException;
import software.amazon.awssdk.services.m2.model.ServiceUnavailableException;
import software.amazon.awssdk.services.m2.model.StartApplicationRequest;
import software.amazon.awssdk.services.m2.model.StartApplicationResponse;
import software.amazon.awssdk.services.m2.model.StartBatchJobRequest;
import software.amazon.awssdk.services.m2.model.StartBatchJobResponse;
import software.amazon.awssdk.services.m2.model.StopApplicationRequest;
import software.amazon.awssdk.services.m2.model.StopApplicationResponse;
import software.amazon.awssdk.services.m2.model.TagResourceRequest;
import software.amazon.awssdk.services.m2.model.TagResourceResponse;
import software.amazon.awssdk.services.m2.model.ThrottlingException;
import software.amazon.awssdk.services.m2.model.UntagResourceRequest;
import software.amazon.awssdk.services.m2.model.UntagResourceResponse;
import software.amazon.awssdk.services.m2.model.UpdateApplicationRequest;
import software.amazon.awssdk.services.m2.model.UpdateApplicationResponse;
import software.amazon.awssdk.services.m2.model.UpdateEnvironmentRequest;
import software.amazon.awssdk.services.m2.model.UpdateEnvironmentResponse;
import software.amazon.awssdk.services.m2.model.ValidationException;
import software.amazon.awssdk.services.m2.transform.CancelBatchJobExecutionRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.CreateApplicationRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.CreateDataSetImportTaskRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.CreateDeploymentRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.CreateEnvironmentRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.DeleteApplicationFromEnvironmentRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.DeleteApplicationRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.DeleteEnvironmentRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.GetApplicationRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.GetApplicationVersionRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.GetBatchJobExecutionRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.GetDataSetDetailsRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.GetDataSetImportTaskRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.GetDeploymentRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.GetEnvironmentRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.GetSignedBluinsightsUrlRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.ListApplicationVersionsRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.ListApplicationsRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.ListBatchJobDefinitionsRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.ListBatchJobExecutionsRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.ListBatchJobRestartPointsRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.ListDataSetImportHistoryRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.ListDataSetsRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.ListDeploymentsRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.ListEngineVersionsRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.ListEnvironmentsRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.StartApplicationRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.StartBatchJobRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.StopApplicationRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.UpdateApplicationRequestMarshaller;
import software.amazon.awssdk.services.m2.transform.UpdateEnvironmentRequestMarshaller;
import software.amazon.awssdk.utils.Logger;

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

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

    private final SyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

    protected DefaultM2Client(SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
    }

    /**
     * 

* Cancels the running of a specific batch job execution. *

* * @param cancelBatchJobExecutionRequest * @return Result of the CancelBatchJobExecution operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ConflictException * The parameters provided in the request conflict with existing resources. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.CancelBatchJobExecution * @see AWS * API Documentation */ @Override public CancelBatchJobExecutionResponse cancelBatchJobExecution(CancelBatchJobExecutionRequest cancelBatchJobExecutionRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ConflictException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CancelBatchJobExecutionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(cancelBatchJobExecutionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, cancelBatchJobExecutionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CancelBatchJobExecution"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("CancelBatchJobExecution").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(cancelBatchJobExecutionRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CancelBatchJobExecutionRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a new application with given parameters. Requires an existing runtime environment and application * definition file. *

* * @param createApplicationRequest * @return Result of the CreateApplication operation returned by the service. * @throws ServiceQuotaExceededException * One or more quotas for Amazon Web Services Mainframe Modernization exceeds the limit. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ConflictException * The parameters provided in the request conflict with existing resources. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.CreateApplication * @see AWS API * Documentation */ @Override public CreateApplicationResponse createApplication(CreateApplicationRequest createApplicationRequest) throws ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, ConflictException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateApplicationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createApplicationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createApplicationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateApplication"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateApplication").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createApplicationRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateApplicationRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Starts a data set import task for a specific application. *

* * @param createDataSetImportTaskRequest * @return Result of the CreateDataSetImportTask operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ServiceQuotaExceededException * One or more quotas for Amazon Web Services Mainframe Modernization exceeds the limit. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ConflictException * The parameters provided in the request conflict with existing resources. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.CreateDataSetImportTask * @see AWS * API Documentation */ @Override public CreateDataSetImportTaskResponse createDataSetImportTask(CreateDataSetImportTaskRequest createDataSetImportTaskRequest) throws ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, ConflictException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateDataSetImportTaskResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDataSetImportTaskRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createDataSetImportTaskRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDataSetImportTask"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateDataSetImportTask").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createDataSetImportTaskRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateDataSetImportTaskRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates and starts a deployment to deploy an application into a runtime environment. *

* * @param createDeploymentRequest * @return Result of the CreateDeployment operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ServiceQuotaExceededException * One or more quotas for Amazon Web Services Mainframe Modernization exceeds the limit. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ConflictException * The parameters provided in the request conflict with existing resources. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.CreateDeployment * @see AWS API * Documentation */ @Override public CreateDeploymentResponse createDeployment(CreateDeploymentRequest createDeploymentRequest) throws ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, ConflictException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateDeploymentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDeploymentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createDeploymentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDeployment"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateDeployment").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createDeploymentRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateDeploymentRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a runtime environment for a given runtime engine. *

* * @param createEnvironmentRequest * @return Result of the CreateEnvironment operation returned by the service. * @throws ServiceQuotaExceededException * One or more quotas for Amazon Web Services Mainframe Modernization exceeds the limit. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ConflictException * The parameters provided in the request conflict with existing resources. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.CreateEnvironment * @see AWS API * Documentation */ @Override public CreateEnvironmentResponse createEnvironment(CreateEnvironmentRequest createEnvironmentRequest) throws ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, ConflictException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateEnvironmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createEnvironmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createEnvironmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateEnvironment"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateEnvironment").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createEnvironmentRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateEnvironmentRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a specific application. You cannot delete a running application. *

* * @param deleteApplicationRequest * @return Result of the DeleteApplication operation returned by the service. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ConflictException * The parameters provided in the request conflict with existing resources. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.DeleteApplication * @see AWS API * Documentation */ @Override public DeleteApplicationResponse deleteApplication(DeleteApplicationRequest deleteApplicationRequest) throws ThrottlingException, AccessDeniedException, ConflictException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteApplicationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteApplicationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteApplicationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteApplication"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteApplication").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteApplicationRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteApplicationRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a specific application from the specific runtime environment where it was previously deployed. You cannot * delete a runtime environment using DeleteEnvironment if any application has ever been deployed to it. This API * removes the association of the application with the runtime environment so you can delete the environment * smoothly. *

* * @param deleteApplicationFromEnvironmentRequest * @return Result of the DeleteApplicationFromEnvironment operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ConflictException * The parameters provided in the request conflict with existing resources. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.DeleteApplicationFromEnvironment * @see AWS API Documentation */ @Override public DeleteApplicationFromEnvironmentResponse deleteApplicationFromEnvironment( DeleteApplicationFromEnvironmentRequest deleteApplicationFromEnvironmentRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ConflictException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteApplicationFromEnvironmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteApplicationFromEnvironmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteApplicationFromEnvironmentRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteApplicationFromEnvironment"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteApplicationFromEnvironment").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteApplicationFromEnvironmentRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteApplicationFromEnvironmentRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a specific runtime environment. The environment cannot contain deployed applications. If it does, you * must delete those applications before you delete the environment. *

* * @param deleteEnvironmentRequest * @return Result of the DeleteEnvironment operation returned by the service. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ConflictException * The parameters provided in the request conflict with existing resources. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.DeleteEnvironment * @see AWS API * Documentation */ @Override public DeleteEnvironmentResponse deleteEnvironment(DeleteEnvironmentRequest deleteEnvironmentRequest) throws ThrottlingException, AccessDeniedException, ConflictException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteEnvironmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteEnvironmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteEnvironmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteEnvironment"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteEnvironment").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteEnvironmentRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteEnvironmentRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Describes the details of a specific application. *

* * @param getApplicationRequest * @return Result of the GetApplication operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.GetApplication * @see AWS API * Documentation */ @Override public GetApplicationResponse getApplication(GetApplicationRequest getApplicationRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetApplicationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getApplicationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getApplicationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetApplication"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetApplication").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getApplicationRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetApplicationRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns details about a specific version of a specific application. *

* * @param getApplicationVersionRequest * @return Result of the GetApplicationVersion operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.GetApplicationVersion * @see AWS API * Documentation */ @Override public GetApplicationVersionResponse getApplicationVersion(GetApplicationVersionRequest getApplicationVersionRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetApplicationVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getApplicationVersionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getApplicationVersionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetApplicationVersion"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetApplicationVersion").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getApplicationVersionRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetApplicationVersionRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Gets the details of a specific batch job execution for a specific application. *

* * @param getBatchJobExecutionRequest * @return Result of the GetBatchJobExecution operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.GetBatchJobExecution * @see AWS API * Documentation */ @Override public GetBatchJobExecutionResponse getBatchJobExecution(GetBatchJobExecutionRequest getBatchJobExecutionRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetBatchJobExecutionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getBatchJobExecutionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getBatchJobExecutionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetBatchJobExecution"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetBatchJobExecution").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getBatchJobExecutionRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetBatchJobExecutionRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Gets the details of a specific data set. *

* * @param getDataSetDetailsRequest * @return Result of the GetDataSetDetails operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ExecutionTimeoutException * Failed to connect to server, or didn’t receive response within expected time period. * @throws ServiceUnavailableException * Server cannot process the request at the moment. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ConflictException * The parameters provided in the request conflict with existing resources. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.GetDataSetDetails * @see AWS API * Documentation */ @Override public GetDataSetDetailsResponse getDataSetDetails(GetDataSetDetailsRequest getDataSetDetailsRequest) throws ResourceNotFoundException, ExecutionTimeoutException, ServiceUnavailableException, ThrottlingException, AccessDeniedException, ConflictException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetDataSetDetailsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDataSetDetailsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getDataSetDetailsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDataSetDetails"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetDataSetDetails").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getDataSetDetailsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetDataSetDetailsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Gets the status of a data set import task initiated with the CreateDataSetImportTask operation. *

* * @param getDataSetImportTaskRequest * @return Result of the GetDataSetImportTask operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.GetDataSetImportTask * @see AWS API * Documentation */ @Override public GetDataSetImportTaskResponse getDataSetImportTask(GetDataSetImportTaskRequest getDataSetImportTaskRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetDataSetImportTaskResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDataSetImportTaskRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getDataSetImportTaskRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDataSetImportTask"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetDataSetImportTask").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getDataSetImportTaskRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetDataSetImportTaskRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Gets details of a specific deployment with a given deployment identifier. *

* * @param getDeploymentRequest * @return Result of the GetDeployment operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.GetDeployment * @see AWS API * Documentation */ @Override public GetDeploymentResponse getDeployment(GetDeploymentRequest getDeploymentRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetDeploymentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDeploymentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getDeploymentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDeployment"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetDeployment").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getDeploymentRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetDeploymentRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Describes a specific runtime environment. *

* * @param getEnvironmentRequest * @return Result of the GetEnvironment operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.GetEnvironment * @see AWS API * Documentation */ @Override public GetEnvironmentResponse getEnvironment(GetEnvironmentRequest getEnvironmentRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetEnvironmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getEnvironmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getEnvironmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetEnvironment"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetEnvironment").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getEnvironmentRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetEnvironmentRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Gets a single sign-on URL that can be used to connect to AWS Blu Insights. *

* * @param getSignedBluinsightsUrlRequest * @return Result of the GetSignedBluinsightsUrl operation returned by the service. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.GetSignedBluinsightsUrl * @see AWS * API Documentation */ @Override public GetSignedBluinsightsUrlResponse getSignedBluinsightsUrl(GetSignedBluinsightsUrlRequest getSignedBluinsightsUrlRequest) throws ThrottlingException, AccessDeniedException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetSignedBluinsightsUrlResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSignedBluinsightsUrlRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getSignedBluinsightsUrlRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSignedBluinsightsUrl"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSignedBluinsightsUrl").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getSignedBluinsightsUrlRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetSignedBluinsightsUrlRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns a list of the application versions for a specific application. *

* * @param listApplicationVersionsRequest * @return Result of the ListApplicationVersions operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.ListApplicationVersions * @see AWS * API Documentation */ @Override public ListApplicationVersionsResponse listApplicationVersions(ListApplicationVersionsRequest listApplicationVersionsRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListApplicationVersionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listApplicationVersionsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listApplicationVersionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListApplicationVersions"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ListApplicationVersions").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listApplicationVersionsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListApplicationVersionsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists the applications associated with a specific Amazon Web Services account. You can provide the unique * identifier of a specific runtime environment in a query parameter to see all applications associated with that * environment. *

* * @param listApplicationsRequest * @return Result of the ListApplications operation returned by the service. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.ListApplications * @see AWS API * Documentation */ @Override public ListApplicationsResponse listApplications(ListApplicationsRequest listApplicationsRequest) throws ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListApplicationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listApplicationsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listApplicationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListApplications"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListApplications").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listApplicationsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListApplicationsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists all the available batch job definitions based on the batch job resources uploaded during the application * creation. You can use the batch job definitions in the list to start a batch job. *

* * @param listBatchJobDefinitionsRequest * @return Result of the ListBatchJobDefinitions operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.ListBatchJobDefinitions * @see AWS * API Documentation */ @Override public ListBatchJobDefinitionsResponse listBatchJobDefinitions(ListBatchJobDefinitionsRequest listBatchJobDefinitionsRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListBatchJobDefinitionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listBatchJobDefinitionsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listBatchJobDefinitionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListBatchJobDefinitions"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ListBatchJobDefinitions").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listBatchJobDefinitionsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListBatchJobDefinitionsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists historical, current, and scheduled batch job executions for a specific application. *

* * @param listBatchJobExecutionsRequest * @return Result of the ListBatchJobExecutions operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.ListBatchJobExecutions * @see AWS API * Documentation */ @Override public ListBatchJobExecutionsResponse listBatchJobExecutions(ListBatchJobExecutionsRequest listBatchJobExecutionsRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListBatchJobExecutionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listBatchJobExecutionsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listBatchJobExecutionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListBatchJobExecutions"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ListBatchJobExecutions").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listBatchJobExecutionsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListBatchJobExecutionsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists all the job steps for a JCL file to restart a batch job. This is only applicable for Micro Focus engine * with versions 8.0.6 and above. *

* * @param listBatchJobRestartPointsRequest * @return Result of the ListBatchJobRestartPoints operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ConflictException * The parameters provided in the request conflict with existing resources. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.ListBatchJobRestartPoints * @see AWS * API Documentation */ @Override public ListBatchJobRestartPointsResponse listBatchJobRestartPoints( ListBatchJobRestartPointsRequest listBatchJobRestartPointsRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ConflictException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListBatchJobRestartPointsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listBatchJobRestartPointsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listBatchJobRestartPointsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListBatchJobRestartPoints"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ListBatchJobRestartPoints").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listBatchJobRestartPointsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListBatchJobRestartPointsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists the data set imports for the specified application. *

* * @param listDataSetImportHistoryRequest * @return Result of the ListDataSetImportHistory operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.ListDataSetImportHistory * @see AWS * API Documentation */ @Override public ListDataSetImportHistoryResponse listDataSetImportHistory( ListDataSetImportHistoryRequest listDataSetImportHistoryRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListDataSetImportHistoryResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDataSetImportHistoryRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listDataSetImportHistoryRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDataSetImportHistory"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ListDataSetImportHistory").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listDataSetImportHistoryRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListDataSetImportHistoryRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists the data sets imported for a specific application. In Amazon Web Services Mainframe Modernization, data * sets are associated with applications deployed on runtime environments. This is known as importing data sets. * Currently, Amazon Web Services Mainframe Modernization can import data sets into catalogs using CreateDataSetImportTask. *

* * @param listDataSetsRequest * @return Result of the ListDataSets operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ExecutionTimeoutException * Failed to connect to server, or didn’t receive response within expected time period. * @throws ServiceUnavailableException * Server cannot process the request at the moment. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ConflictException * The parameters provided in the request conflict with existing resources. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.ListDataSets * @see AWS API * Documentation */ @Override public ListDataSetsResponse listDataSets(ListDataSetsRequest listDataSetsRequest) throws ResourceNotFoundException, ExecutionTimeoutException, ServiceUnavailableException, ThrottlingException, AccessDeniedException, ConflictException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListDataSetsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDataSetsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listDataSetsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDataSets"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListDataSets").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listDataSetsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListDataSetsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns a list of all deployments of a specific application. A deployment is a combination of a specific * application and a specific version of that application. Each deployment is mapped to a particular application * version. *

* * @param listDeploymentsRequest * @return Result of the ListDeployments operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.ListDeployments * @see AWS API * Documentation */ @Override public ListDeploymentsResponse listDeployments(ListDeploymentsRequest listDeploymentsRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListDeploymentsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDeploymentsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listDeploymentsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDeployments"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListDeployments").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listDeploymentsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListDeploymentsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists the available engine versions. *

* * @param listEngineVersionsRequest * @return Result of the ListEngineVersions operation returned by the service. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.ListEngineVersions * @see AWS API * Documentation */ @Override public ListEngineVersionsResponse listEngineVersions(ListEngineVersionsRequest listEngineVersionsRequest) throws ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListEngineVersionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listEngineVersionsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listEngineVersionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListEngineVersions"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListEngineVersions").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listEngineVersionsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListEngineVersionsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists the runtime environments. *

* * @param listEnvironmentsRequest * @return Result of the ListEnvironments operation returned by the service. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.ListEnvironments * @see AWS API * Documentation */ @Override public ListEnvironmentsResponse listEnvironments(ListEnvironmentsRequest listEnvironmentsRequest) throws ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListEnvironmentsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listEnvironmentsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listEnvironmentsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListEnvironments"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListEnvironments").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listEnvironmentsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListEnvironmentsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists the tags for the specified resource. *

* * @param listTagsForResourceRequest * @return Result of the ListTagsForResource operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.ListTagsForResource * @see AWS API * Documentation */ @Override public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTagsForResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); 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, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListTagsForResource").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listTagsForResourceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Starts an application that is currently stopped. *

* * @param startApplicationRequest * @return Result of the StartApplication operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ConflictException * The parameters provided in the request conflict with existing resources. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.StartApplication * @see AWS API * Documentation */ @Override public StartApplicationResponse startApplication(StartApplicationRequest startApplicationRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ConflictException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StartApplicationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startApplicationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startApplicationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartApplication"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StartApplication").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(startApplicationRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new StartApplicationRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Starts a batch job and returns the unique identifier of this execution of the batch job. The associated * application must be running in order to start the batch job. *

* * @param startBatchJobRequest * @return Result of the StartBatchJob operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ConflictException * The parameters provided in the request conflict with existing resources. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.StartBatchJob * @see AWS API * Documentation */ @Override public StartBatchJobResponse startBatchJob(StartBatchJobRequest startBatchJobRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ConflictException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StartBatchJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startBatchJobRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startBatchJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartBatchJob"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StartBatchJob").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(startBatchJobRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new StartBatchJobRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Stops a running application. *

* * @param stopApplicationRequest * @return Result of the StopApplication operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ConflictException * The parameters provided in the request conflict with existing resources. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.StopApplication * @see AWS API * Documentation */ @Override public StopApplicationResponse stopApplication(StopApplicationRequest stopApplicationRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ConflictException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StopApplicationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(stopApplicationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, stopApplicationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopApplication"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StopApplication").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(stopApplicationRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new StopApplicationRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Adds one or more tags to the specified resource. *

* * @param tagResourceRequest * @return Result of the TagResource operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ServiceQuotaExceededException * One or more quotas for Amazon Web Services Mainframe Modernization exceeds the limit. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.TagResource * @see AWS API * Documentation */ @Override public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, TagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); 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, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("TagResource").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(tagResourceRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new TagResourceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Removes one or more tags from the specified resource. *

* * @param untagResourceRequest * @return Result of the UntagResource operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.UntagResource * @see AWS API * Documentation */ @Override public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UntagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); 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, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UntagResource").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(untagResourceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UntagResourceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates an application and creates a new version. *

* * @param updateApplicationRequest * @return Result of the UpdateApplication operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ConflictException * The parameters provided in the request conflict with existing resources. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.UpdateApplication * @see AWS API * Documentation */ @Override public UpdateApplicationResponse updateApplication(UpdateApplicationRequest updateApplicationRequest) throws ResourceNotFoundException, ThrottlingException, AccessDeniedException, ConflictException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateApplicationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateApplicationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateApplicationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateApplication"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateApplication").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateApplicationRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateApplicationRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates the configuration details for a specific runtime environment. *

* * @param updateEnvironmentRequest * @return Result of the UpdateEnvironment operation returned by the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ServiceQuotaExceededException * One or more quotas for Amazon Web Services Mainframe Modernization exceeds the limit. * @throws ThrottlingException * The number of requests made exceeds the limit. * @throws AccessDeniedException * The account or role doesn't have the right permissions to make the request. * @throws ConflictException * The parameters provided in the request conflict with existing resources. * @throws ValidationException * One or more parameters provided in the request is not valid. * @throws InternalServerException * An unexpected error occurred during the processing of the request. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws M2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample M2Client.UpdateEnvironment * @see AWS API * Documentation */ @Override public UpdateEnvironmentResponse updateEnvironment(UpdateEnvironmentRequest updateEnvironmentRequest) throws ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, ConflictException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, M2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateEnvironmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateEnvironmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateEnvironmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "m2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateEnvironment"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateEnvironment").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateEnvironmentRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateEnvironmentRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } @Override public final String serviceName() { return SERVICE_NAME; } 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 HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } private void updateRetryStrategyClientConfiguration(SdkClientConfiguration.Builder configuration) { ClientOverrideConfiguration.Builder builder = configuration.asOverrideConfigurationBuilder(); RetryMode retryMode = builder.retryMode(); if (retryMode != null) { configuration.option(SdkClientOption.RETRY_STRATEGY, AwsRetryStrategy.forRetryMode(retryMode)); } else { Consumer> configurator = builder.retryStrategyConfigurator(); if (configurator != null) { RetryStrategy.Builder defaultBuilder = AwsRetryStrategy.defaultRetryStrategy().toBuilder(); configurator.accept(defaultBuilder); configuration.option(SdkClientOption.RETRY_STRATEGY, defaultBuilder.build()); } else { RetryStrategy retryStrategy = builder.retryStrategy(); if (retryStrategy != null) { configuration.option(SdkClientOption.RETRY_STRATEGY, retryStrategy); } } } configuration.option(SdkClientOption.CONFIGURED_RETRY_MODE, null); configuration.option(SdkClientOption.CONFIGURED_RETRY_STRATEGY, null); configuration.option(SdkClientOption.CONFIGURED_RETRY_CONFIGURATOR, null); } 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(); } M2ServiceClientConfigurationBuilder serviceConfigBuilder = new M2ServiceClientConfigurationBuilder(configuration); for (SdkPlugin plugin : plugins) { plugin.configureClient(serviceConfigBuilder); } updateRetryStrategyClientConfiguration(configuration); return configuration.build(); } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(M2Exception::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("ThrottlingException") .exceptionBuilderSupplier(ThrottlingException::builder).httpStatusCode(429).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceQuotaExceededException") .exceptionBuilderSupplier(ServiceQuotaExceededException::builder).httpStatusCode(402).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalServerException") .exceptionBuilderSupplier(InternalServerException::builder).httpStatusCode(500).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AccessDeniedException") .exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(403).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ConflictException") .exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFoundException") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ValidationException") .exceptionBuilderSupplier(ValidationException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceUnavailableException") .exceptionBuilderSupplier(ServiceUnavailableException::builder).httpStatusCode(503).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ExecutionTimeoutException") .exceptionBuilderSupplier(ExecutionTimeoutException::builder).httpStatusCode(504).build()); } @Override public final M2ServiceClientConfiguration serviceClientConfiguration() { return new M2ServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build(); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy