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

software.amazon.awssdk.services.medicalimaging.DefaultMedicalImagingClient Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.29.39
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.medicalimaging;

import java.util.Collections;
import java.util.List;
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.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.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.sync.ResponseTransformer;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.medicalimaging.internal.MedicalImagingServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.medicalimaging.model.AccessDeniedException;
import software.amazon.awssdk.services.medicalimaging.model.ConflictException;
import software.amazon.awssdk.services.medicalimaging.model.CopyImageSetRequest;
import software.amazon.awssdk.services.medicalimaging.model.CopyImageSetResponse;
import software.amazon.awssdk.services.medicalimaging.model.CreateDatastoreRequest;
import software.amazon.awssdk.services.medicalimaging.model.CreateDatastoreResponse;
import software.amazon.awssdk.services.medicalimaging.model.DeleteDatastoreRequest;
import software.amazon.awssdk.services.medicalimaging.model.DeleteDatastoreResponse;
import software.amazon.awssdk.services.medicalimaging.model.DeleteImageSetRequest;
import software.amazon.awssdk.services.medicalimaging.model.DeleteImageSetResponse;
import software.amazon.awssdk.services.medicalimaging.model.GetDatastoreRequest;
import software.amazon.awssdk.services.medicalimaging.model.GetDatastoreResponse;
import software.amazon.awssdk.services.medicalimaging.model.GetDicomImportJobRequest;
import software.amazon.awssdk.services.medicalimaging.model.GetDicomImportJobResponse;
import software.amazon.awssdk.services.medicalimaging.model.GetImageFrameRequest;
import software.amazon.awssdk.services.medicalimaging.model.GetImageFrameResponse;
import software.amazon.awssdk.services.medicalimaging.model.GetImageSetMetadataRequest;
import software.amazon.awssdk.services.medicalimaging.model.GetImageSetMetadataResponse;
import software.amazon.awssdk.services.medicalimaging.model.GetImageSetRequest;
import software.amazon.awssdk.services.medicalimaging.model.GetImageSetResponse;
import software.amazon.awssdk.services.medicalimaging.model.InternalServerException;
import software.amazon.awssdk.services.medicalimaging.model.ListDatastoresRequest;
import software.amazon.awssdk.services.medicalimaging.model.ListDatastoresResponse;
import software.amazon.awssdk.services.medicalimaging.model.ListDicomImportJobsRequest;
import software.amazon.awssdk.services.medicalimaging.model.ListDicomImportJobsResponse;
import software.amazon.awssdk.services.medicalimaging.model.ListImageSetVersionsRequest;
import software.amazon.awssdk.services.medicalimaging.model.ListImageSetVersionsResponse;
import software.amazon.awssdk.services.medicalimaging.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.medicalimaging.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.medicalimaging.model.MedicalImagingException;
import software.amazon.awssdk.services.medicalimaging.model.ResourceNotFoundException;
import software.amazon.awssdk.services.medicalimaging.model.SearchImageSetsRequest;
import software.amazon.awssdk.services.medicalimaging.model.SearchImageSetsResponse;
import software.amazon.awssdk.services.medicalimaging.model.ServiceQuotaExceededException;
import software.amazon.awssdk.services.medicalimaging.model.StartDicomImportJobRequest;
import software.amazon.awssdk.services.medicalimaging.model.StartDicomImportJobResponse;
import software.amazon.awssdk.services.medicalimaging.model.TagResourceRequest;
import software.amazon.awssdk.services.medicalimaging.model.TagResourceResponse;
import software.amazon.awssdk.services.medicalimaging.model.ThrottlingException;
import software.amazon.awssdk.services.medicalimaging.model.UntagResourceRequest;
import software.amazon.awssdk.services.medicalimaging.model.UntagResourceResponse;
import software.amazon.awssdk.services.medicalimaging.model.UpdateImageSetMetadataRequest;
import software.amazon.awssdk.services.medicalimaging.model.UpdateImageSetMetadataResponse;
import software.amazon.awssdk.services.medicalimaging.model.ValidationException;
import software.amazon.awssdk.services.medicalimaging.transform.CopyImageSetRequestMarshaller;
import software.amazon.awssdk.services.medicalimaging.transform.CreateDatastoreRequestMarshaller;
import software.amazon.awssdk.services.medicalimaging.transform.DeleteDatastoreRequestMarshaller;
import software.amazon.awssdk.services.medicalimaging.transform.DeleteImageSetRequestMarshaller;
import software.amazon.awssdk.services.medicalimaging.transform.GetDatastoreRequestMarshaller;
import software.amazon.awssdk.services.medicalimaging.transform.GetDicomImportJobRequestMarshaller;
import software.amazon.awssdk.services.medicalimaging.transform.GetImageFrameRequestMarshaller;
import software.amazon.awssdk.services.medicalimaging.transform.GetImageSetMetadataRequestMarshaller;
import software.amazon.awssdk.services.medicalimaging.transform.GetImageSetRequestMarshaller;
import software.amazon.awssdk.services.medicalimaging.transform.ListDatastoresRequestMarshaller;
import software.amazon.awssdk.services.medicalimaging.transform.ListDicomImportJobsRequestMarshaller;
import software.amazon.awssdk.services.medicalimaging.transform.ListImageSetVersionsRequestMarshaller;
import software.amazon.awssdk.services.medicalimaging.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.medicalimaging.transform.SearchImageSetsRequestMarshaller;
import software.amazon.awssdk.services.medicalimaging.transform.StartDicomImportJobRequestMarshaller;
import software.amazon.awssdk.services.medicalimaging.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.medicalimaging.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.medicalimaging.transform.UpdateImageSetMetadataRequestMarshaller;
import software.amazon.awssdk.utils.Logger;

/**
 * Internal implementation of {@link MedicalImagingClient}.
 *
 * @see MedicalImagingClient#builder()
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultMedicalImagingClient implements MedicalImagingClient {
    private static final Logger log = Logger.loggerFor(DefaultMedicalImagingClient.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 DefaultMedicalImagingClient(SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration;
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
    }

    /**
     * 

* Copy an image set. *

* * @param copyImageSetRequest * @return Result of the CopyImageSet operation returned by the service. * @throws ThrottlingException * The request was denied due to throttling. * @throws ConflictException * Updating or deleting a resource can cause an inconsistent state. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during processing of the request. * @throws ResourceNotFoundException * The request references a resource which does not exist. * @throws ServiceQuotaExceededException * The request caused a service quota to be exceeded. * @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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.CopyImageSet * @see AWS * API Documentation */ @Override public CopyImageSetResponse copyImageSet(CopyImageSetRequest copyImageSetRequest) throws ThrottlingException, ConflictException, AccessDeniedException, ValidationException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, MedicalImagingException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CopyImageSetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(copyImageSetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, copyImageSetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Medical Imaging"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CopyImageSet"); String hostPrefix = "runtime-"; String resolvedHostExpression = "runtime-"; return clientHandler.execute(new ClientExecutionParams() .withOperationName("CopyImageSet").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .hostPrefixExpression(resolvedHostExpression).withRequestConfiguration(clientConfiguration) .withInput(copyImageSetRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new CopyImageSetRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Create a data store. *

* * @param createDatastoreRequest * @return Result of the CreateDatastore operation returned by the service. * @throws ThrottlingException * The request was denied due to throttling. * @throws ConflictException * Updating or deleting a resource can cause an inconsistent state. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during processing of the request. * @throws ServiceQuotaExceededException * The request caused a service quota to be exceeded. * @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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.CreateDatastore * @see AWS API Documentation */ @Override public CreateDatastoreResponse createDatastore(CreateDatastoreRequest createDatastoreRequest) throws ThrottlingException, ConflictException, AccessDeniedException, ValidationException, InternalServerException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, MedicalImagingException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateDatastoreResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDatastoreRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createDatastoreRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Medical Imaging"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDatastore"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateDatastore").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createDatastoreRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateDatastoreRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Delete a data store. *

* *

* Before a data store can be deleted, you must first delete all image sets within it. *

*
* * @param deleteDatastoreRequest * @return Result of the DeleteDatastore operation returned by the service. * @throws ThrottlingException * The request was denied due to throttling. * @throws ConflictException * Updating or deleting a resource can cause an inconsistent state. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during processing of the request. * @throws ResourceNotFoundException * The request references a resource which does not exist. * @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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.DeleteDatastore * @see AWS API Documentation */ @Override public DeleteDatastoreResponse deleteDatastore(DeleteDatastoreRequest deleteDatastoreRequest) throws ThrottlingException, ConflictException, AccessDeniedException, ValidationException, InternalServerException, ResourceNotFoundException, AwsServiceException, SdkClientException, MedicalImagingException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteDatastoreResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteDatastoreRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDatastoreRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Medical Imaging"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDatastore"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteDatastore").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteDatastoreRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteDatastoreRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Delete an image set. *

* * @param deleteImageSetRequest * @return Result of the DeleteImageSet operation returned by the service. * @throws ThrottlingException * The request was denied due to throttling. * @throws ConflictException * Updating or deleting a resource can cause an inconsistent state. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during processing of the request. * @throws ResourceNotFoundException * The request references a resource which does not exist. * @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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.DeleteImageSet * @see AWS API Documentation */ @Override public DeleteImageSetResponse deleteImageSet(DeleteImageSetRequest deleteImageSetRequest) throws ThrottlingException, ConflictException, AccessDeniedException, ValidationException, InternalServerException, ResourceNotFoundException, AwsServiceException, SdkClientException, MedicalImagingException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteImageSetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteImageSetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteImageSetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Medical Imaging"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteImageSet"); String hostPrefix = "runtime-"; String resolvedHostExpression = "runtime-"; return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteImageSet").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .hostPrefixExpression(resolvedHostExpression).withRequestConfiguration(clientConfiguration) .withInput(deleteImageSetRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteImageSetRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Get the import job properties to learn more about the job or job progress. *

* * @param getDicomImportJobRequest * @return Result of the GetDICOMImportJob operation returned by the service. * @throws ThrottlingException * The request was denied due to throttling. * @throws ConflictException * Updating or deleting a resource can cause an inconsistent state. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during processing of the request. * @throws ResourceNotFoundException * The request references a resource which does not exist. * @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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.GetDICOMImportJob * @see AWS API Documentation */ @Override public GetDicomImportJobResponse getDICOMImportJob(GetDicomImportJobRequest getDicomImportJobRequest) throws ThrottlingException, ConflictException, AccessDeniedException, ValidationException, InternalServerException, ResourceNotFoundException, AwsServiceException, SdkClientException, MedicalImagingException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetDicomImportJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDicomImportJobRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getDicomImportJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Medical Imaging"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDICOMImportJob"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetDICOMImportJob").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getDicomImportJobRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetDicomImportJobRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Get data store properties. *

* * @param getDatastoreRequest * @return Result of the GetDatastore operation returned by the service. * @throws ThrottlingException * The request was denied due to throttling. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during processing of the request. * @throws ResourceNotFoundException * The request references a resource which does not exist. * @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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.GetDatastore * @see AWS * API Documentation */ @Override public GetDatastoreResponse getDatastore(GetDatastoreRequest getDatastoreRequest) throws ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, ResourceNotFoundException, AwsServiceException, SdkClientException, MedicalImagingException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetDatastoreResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDatastoreRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getDatastoreRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Medical Imaging"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDatastore"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetDatastore").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getDatastoreRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetDatastoreRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Get an image frame (pixel data) for an image set. *

* * @param getImageFrameRequest * @param responseTransformer * Functional interface for processing the streamed response content. The unmarshalled GetImageFrameResponse * and an InputStream to the response content are provided as parameters to the callback. The callback may * return a transformed type which will be the return value of this method. See * {@link software.amazon.awssdk.core.sync.ResponseTransformer} for details on implementing this interface * and for links to pre-canned implementations for common scenarios like downloading to a file. The service * documentation for the response content is as follows ' *

* The blob containing the aggregated image frame information. *

* '. * @return The transformed result of the ResponseTransformer. * @throws ThrottlingException * The request was denied due to throttling. * @throws ConflictException * Updating or deleting a resource can cause an inconsistent state. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during processing of the request. * @throws ResourceNotFoundException * The request references a resource which does not exist. * @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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.GetImageFrame * @see AWS * API Documentation */ @Override public ReturnT getImageFrame(GetImageFrameRequest getImageFrameRequest, ResponseTransformer responseTransformer) throws ThrottlingException, ConflictException, AccessDeniedException, ValidationException, InternalServerException, ResourceNotFoundException, AwsServiceException, SdkClientException, MedicalImagingException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(true) .isPayloadJson(false).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetImageFrameResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getImageFrameRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getImageFrameRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Medical Imaging"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetImageFrame"); String hostPrefix = "runtime-"; String resolvedHostExpression = "runtime-"; return clientHandler.execute( new ClientExecutionParams().withOperationName("GetImageFrame") .withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).hostPrefixExpression(resolvedHostExpression) .withRequestConfiguration(clientConfiguration).withInput(getImageFrameRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetImageFrameRequestMarshaller(protocolFactory)), responseTransformer); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Get image set properties. *

* * @param getImageSetRequest * @return Result of the GetImageSet operation returned by the service. * @throws ThrottlingException * The request was denied due to throttling. * @throws ConflictException * Updating or deleting a resource can cause an inconsistent state. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during processing of the request. * @throws ResourceNotFoundException * The request references a resource which does not exist. * @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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.GetImageSet * @see AWS * API Documentation */ @Override public GetImageSetResponse getImageSet(GetImageSetRequest getImageSetRequest) throws ThrottlingException, ConflictException, AccessDeniedException, ValidationException, InternalServerException, ResourceNotFoundException, AwsServiceException, SdkClientException, MedicalImagingException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetImageSetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getImageSetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getImageSetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Medical Imaging"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetImageSet"); String hostPrefix = "runtime-"; String resolvedHostExpression = "runtime-"; return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetImageSet").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).hostPrefixExpression(resolvedHostExpression) .withRequestConfiguration(clientConfiguration).withInput(getImageSetRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetImageSetRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Get metadata attributes for an image set. *

* * @param getImageSetMetadataRequest * @param responseTransformer * Functional interface for processing the streamed response content. The unmarshalled * GetImageSetMetadataResponse and an InputStream to the response content are provided as parameters to the * callback. The callback may return a transformed type which will be the return value of this method. See * {@link software.amazon.awssdk.core.sync.ResponseTransformer} for details on implementing this interface * and for links to pre-canned implementations for common scenarios like downloading to a file. The service * documentation for the response content is as follows ' *

* The blob containing the aggregated metadata information for the image set. *

* '. * @return The transformed result of the ResponseTransformer. * @throws ThrottlingException * The request was denied due to throttling. * @throws ConflictException * Updating or deleting a resource can cause an inconsistent state. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during processing of the request. * @throws ResourceNotFoundException * The request references a resource which does not exist. * @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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.GetImageSetMetadata * @see AWS API Documentation */ @Override public ReturnT getImageSetMetadata(GetImageSetMetadataRequest getImageSetMetadataRequest, ResponseTransformer responseTransformer) throws ThrottlingException, ConflictException, AccessDeniedException, ValidationException, InternalServerException, ResourceNotFoundException, AwsServiceException, SdkClientException, MedicalImagingException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(true) .isPayloadJson(false).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetImageSetMetadataResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getImageSetMetadataRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getImageSetMetadataRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Medical Imaging"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetImageSetMetadata"); String hostPrefix = "runtime-"; String resolvedHostExpression = "runtime-"; return clientHandler.execute( new ClientExecutionParams() .withOperationName("GetImageSetMetadata").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .hostPrefixExpression(resolvedHostExpression).withRequestConfiguration(clientConfiguration) .withInput(getImageSetMetadataRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetImageSetMetadataRequestMarshaller(protocolFactory)), responseTransformer); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* List import jobs created for a specific data store. *

* * @param listDicomImportJobsRequest * @return Result of the ListDICOMImportJobs operation returned by the service. * @throws ThrottlingException * The request was denied due to throttling. * @throws ConflictException * Updating or deleting a resource can cause an inconsistent state. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during processing of the request. * @throws ResourceNotFoundException * The request references a resource which does not exist. * @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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.ListDICOMImportJobs * @see AWS API Documentation */ @Override public ListDicomImportJobsResponse listDICOMImportJobs(ListDicomImportJobsRequest listDicomImportJobsRequest) throws ThrottlingException, ConflictException, AccessDeniedException, ValidationException, InternalServerException, ResourceNotFoundException, AwsServiceException, SdkClientException, MedicalImagingException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListDicomImportJobsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDicomImportJobsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listDicomImportJobsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Medical Imaging"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDICOMImportJobs"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListDICOMImportJobs").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listDicomImportJobsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListDicomImportJobsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* List data stores. *

* * @param listDatastoresRequest * @return Result of the ListDatastores operation returned by the service. * @throws ThrottlingException * The request was denied due to throttling. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during 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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.ListDatastores * @see AWS API Documentation */ @Override public ListDatastoresResponse listDatastores(ListDatastoresRequest listDatastoresRequest) throws ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, MedicalImagingException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListDatastoresResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDatastoresRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listDatastoresRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Medical Imaging"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDatastores"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListDatastores").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listDatastoresRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListDatastoresRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* List image set versions. *

* * @param listImageSetVersionsRequest * @return Result of the ListImageSetVersions operation returned by the service. * @throws ThrottlingException * The request was denied due to throttling. * @throws ConflictException * Updating or deleting a resource can cause an inconsistent state. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during processing of the request. * @throws ResourceNotFoundException * The request references a resource which does not exist. * @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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.ListImageSetVersions * @see AWS API Documentation */ @Override public ListImageSetVersionsResponse listImageSetVersions(ListImageSetVersionsRequest listImageSetVersionsRequest) throws ThrottlingException, ConflictException, AccessDeniedException, ValidationException, InternalServerException, ResourceNotFoundException, AwsServiceException, SdkClientException, MedicalImagingException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListImageSetVersionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listImageSetVersionsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listImageSetVersionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Medical Imaging"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListImageSetVersions"); String hostPrefix = "runtime-"; String resolvedHostExpression = "runtime-"; return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListImageSetVersions").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .hostPrefixExpression(resolvedHostExpression).withRequestConfiguration(clientConfiguration) .withInput(listImageSetVersionsRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListImageSetVersionsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists all tags associated with a medical imaging resource. *

* * @param listTagsForResourceRequest * @return Result of the ListTagsForResource operation returned by the service. * @throws ThrottlingException * The request was denied due to throttling. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during processing of the request. * @throws ResourceNotFoundException * The request references a resource which does not exist. * @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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.ListTagsForResource * @see AWS API Documentation */ @Override public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) throws ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, ResourceNotFoundException, AwsServiceException, SdkClientException, MedicalImagingException { 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, "Medical Imaging"); 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())); } } /** *

* Search image sets based on defined input attributes. *

* *

* SearchImageSets accepts a single search query parameter and returns a paginated response of all * image sets that have the matching criteria. All range queries must be input as * (lowerBound, upperBound). *

*

* SearchImageSets uses the updatedAt field for sorting in decreasing order from latest to * oldest. *

*
* * @param searchImageSetsRequest * @return Result of the SearchImageSets operation returned by the service. * @throws ThrottlingException * The request was denied due to throttling. * @throws ConflictException * Updating or deleting a resource can cause an inconsistent state. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during processing of the request. * @throws ResourceNotFoundException * The request references a resource which does not exist. * @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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.SearchImageSets * @see AWS API Documentation */ @Override public SearchImageSetsResponse searchImageSets(SearchImageSetsRequest searchImageSetsRequest) throws ThrottlingException, ConflictException, AccessDeniedException, ValidationException, InternalServerException, ResourceNotFoundException, AwsServiceException, SdkClientException, MedicalImagingException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, SearchImageSetsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(searchImageSetsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, searchImageSetsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Medical Imaging"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SearchImageSets"); String hostPrefix = "runtime-"; String resolvedHostExpression = "runtime-"; return clientHandler.execute(new ClientExecutionParams() .withOperationName("SearchImageSets").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .hostPrefixExpression(resolvedHostExpression).withRequestConfiguration(clientConfiguration) .withInput(searchImageSetsRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new SearchImageSetsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Start importing bulk data into an ACTIVE data store. The import job imports DICOM P10 files found in * the S3 prefix specified by the inputS3Uri parameter. The import job stores processing results in the * file specified by the outputS3Uri parameter. *

* * @param startDicomImportJobRequest * @return Result of the StartDICOMImportJob operation returned by the service. * @throws ThrottlingException * The request was denied due to throttling. * @throws ConflictException * Updating or deleting a resource can cause an inconsistent state. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during processing of the request. * @throws ResourceNotFoundException * The request references a resource which does not exist. * @throws ServiceQuotaExceededException * The request caused a service quota to be exceeded. * @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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.StartDICOMImportJob * @see AWS API Documentation */ @Override public StartDicomImportJobResponse startDICOMImportJob(StartDicomImportJobRequest startDicomImportJobRequest) throws ThrottlingException, ConflictException, AccessDeniedException, ValidationException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, MedicalImagingException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartDicomImportJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startDicomImportJobRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startDicomImportJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Medical Imaging"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartDICOMImportJob"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StartDICOMImportJob").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(startDicomImportJobRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new StartDicomImportJobRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Adds a user-specifed key and value tag to a medical imaging resource. *

* * @param tagResourceRequest * @return Result of the TagResource operation returned by the service. * @throws ThrottlingException * The request was denied due to throttling. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during processing of the request. * @throws ResourceNotFoundException * The request references a resource which does not exist. * @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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.TagResource * @see AWS * API Documentation */ @Override public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, ResourceNotFoundException, AwsServiceException, SdkClientException, MedicalImagingException { 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, "Medical Imaging"); 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 tags from a medical imaging resource. *

* * @param untagResourceRequest * @return Result of the UntagResource operation returned by the service. * @throws ThrottlingException * The request was denied due to throttling. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during processing of the request. * @throws ResourceNotFoundException * The request references a resource which does not exist. * @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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.UntagResource * @see AWS * API Documentation */ @Override public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws ThrottlingException, AccessDeniedException, ValidationException, InternalServerException, ResourceNotFoundException, AwsServiceException, SdkClientException, MedicalImagingException { 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, "Medical Imaging"); 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())); } } /** *

* Update image set metadata attributes. *

* * @param updateImageSetMetadataRequest * @return Result of the UpdateImageSetMetadata operation returned by the service. * @throws ThrottlingException * The request was denied due to throttling. * @throws ConflictException * Updating or deleting a resource can cause an inconsistent state. * @throws AccessDeniedException * The user does not have sufficient access to perform this action. * @throws ValidationException * The input fails to satisfy the constraints set by the service. * @throws InternalServerException * An unexpected error occurred during processing of the request. * @throws ResourceNotFoundException * The request references a resource which does not exist. * @throws ServiceQuotaExceededException * The request caused a service quota to be exceeded. * @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 MedicalImagingException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MedicalImagingClient.UpdateImageSetMetadata * @see AWS API Documentation */ @Override public UpdateImageSetMetadataResponse updateImageSetMetadata(UpdateImageSetMetadataRequest updateImageSetMetadataRequest) throws ThrottlingException, ConflictException, AccessDeniedException, ValidationException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, MedicalImagingException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateImageSetMetadataResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateImageSetMetadataRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateImageSetMetadataRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Medical Imaging"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateImageSetMetadata"); String hostPrefix = "runtime-"; String resolvedHostExpression = "runtime-"; return clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateImageSetMetadata").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .hostPrefixExpression(resolvedHostExpression).withRequestConfiguration(clientConfiguration) .withInput(updateImageSetMetadataRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateImageSetMetadataRequestMarshaller(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 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(); } MedicalImagingServiceClientConfigurationBuilder serviceConfigBuilder = new MedicalImagingServiceClientConfigurationBuilder( configuration); for (SdkPlugin plugin : plugins) { plugin.configureClient(serviceConfigBuilder); } return configuration.build(); } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(MedicalImagingException::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .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("ThrottlingException") .exceptionBuilderSupplier(ThrottlingException::builder).httpStatusCode(429).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ValidationException") .exceptionBuilderSupplier(ValidationException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceQuotaExceededException") .exceptionBuilderSupplier(ServiceQuotaExceededException::builder).httpStatusCode(402).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalServerException") .exceptionBuilderSupplier(InternalServerException::builder).httpStatusCode(500).build()); } @Override public final MedicalImagingServiceClientConfiguration serviceClientConfiguration() { return new MedicalImagingServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build(); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy