software.amazon.awssdk.services.iotfleetwise.DefaultIoTFleetWiseAsyncClient Maven / Gradle / Ivy
Show all versions of iotfleetwise Show documentation
/*
* 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.iotfleetwise;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.util.VersionInfo;
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.iotfleetwise.model.AccessDeniedException;
import software.amazon.awssdk.services.iotfleetwise.model.AssociateVehicleFleetRequest;
import software.amazon.awssdk.services.iotfleetwise.model.AssociateVehicleFleetResponse;
import software.amazon.awssdk.services.iotfleetwise.model.BatchCreateVehicleRequest;
import software.amazon.awssdk.services.iotfleetwise.model.BatchCreateVehicleResponse;
import software.amazon.awssdk.services.iotfleetwise.model.BatchUpdateVehicleRequest;
import software.amazon.awssdk.services.iotfleetwise.model.BatchUpdateVehicleResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ConflictException;
import software.amazon.awssdk.services.iotfleetwise.model.CreateCampaignRequest;
import software.amazon.awssdk.services.iotfleetwise.model.CreateCampaignResponse;
import software.amazon.awssdk.services.iotfleetwise.model.CreateDecoderManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.CreateDecoderManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.CreateFleetRequest;
import software.amazon.awssdk.services.iotfleetwise.model.CreateFleetResponse;
import software.amazon.awssdk.services.iotfleetwise.model.CreateModelManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.CreateModelManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.CreateSignalCatalogRequest;
import software.amazon.awssdk.services.iotfleetwise.model.CreateSignalCatalogResponse;
import software.amazon.awssdk.services.iotfleetwise.model.CreateVehicleRequest;
import software.amazon.awssdk.services.iotfleetwise.model.CreateVehicleResponse;
import software.amazon.awssdk.services.iotfleetwise.model.DecoderManifestValidationException;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteCampaignRequest;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteCampaignResponse;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteDecoderManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteDecoderManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteFleetRequest;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteFleetResponse;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteModelManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteModelManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteSignalCatalogRequest;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteSignalCatalogResponse;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteVehicleRequest;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteVehicleResponse;
import software.amazon.awssdk.services.iotfleetwise.model.DisassociateVehicleFleetRequest;
import software.amazon.awssdk.services.iotfleetwise.model.DisassociateVehicleFleetResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetCampaignRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetCampaignResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetDecoderManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetDecoderManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetFleetRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetFleetResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetLoggingOptionsRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetLoggingOptionsResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetModelManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetModelManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetRegisterAccountStatusRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetRegisterAccountStatusResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetSignalCatalogRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetSignalCatalogResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetVehicleRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetVehicleResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetVehicleStatusRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetVehicleStatusResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ImportDecoderManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ImportDecoderManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ImportSignalCatalogRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ImportSignalCatalogResponse;
import software.amazon.awssdk.services.iotfleetwise.model.InternalServerException;
import software.amazon.awssdk.services.iotfleetwise.model.InvalidNodeException;
import software.amazon.awssdk.services.iotfleetwise.model.InvalidSignalsException;
import software.amazon.awssdk.services.iotfleetwise.model.IoTFleetWiseException;
import software.amazon.awssdk.services.iotfleetwise.model.IoTFleetWiseRequest;
import software.amazon.awssdk.services.iotfleetwise.model.LimitExceededException;
import software.amazon.awssdk.services.iotfleetwise.model.ListCampaignsRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListCampaignsResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestNetworkInterfacesRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestNetworkInterfacesResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestSignalsRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestSignalsResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestsRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestsResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListFleetsForVehicleRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListFleetsForVehicleResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListFleetsRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListFleetsResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListModelManifestNodesRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListModelManifestNodesResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListModelManifestsRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListModelManifestsResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListSignalCatalogNodesRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListSignalCatalogNodesResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListSignalCatalogsRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListSignalCatalogsResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListVehiclesInFleetRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListVehiclesInFleetResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListVehiclesRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListVehiclesResponse;
import software.amazon.awssdk.services.iotfleetwise.model.PutLoggingOptionsRequest;
import software.amazon.awssdk.services.iotfleetwise.model.PutLoggingOptionsResponse;
import software.amazon.awssdk.services.iotfleetwise.model.RegisterAccountRequest;
import software.amazon.awssdk.services.iotfleetwise.model.RegisterAccountResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ResourceNotFoundException;
import software.amazon.awssdk.services.iotfleetwise.model.TagResourceRequest;
import software.amazon.awssdk.services.iotfleetwise.model.TagResourceResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ThrottlingException;
import software.amazon.awssdk.services.iotfleetwise.model.UntagResourceRequest;
import software.amazon.awssdk.services.iotfleetwise.model.UntagResourceResponse;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateCampaignRequest;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateCampaignResponse;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateDecoderManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateDecoderManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateFleetRequest;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateFleetResponse;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateModelManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateModelManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateSignalCatalogRequest;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateSignalCatalogResponse;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateVehicleRequest;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateVehicleResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ValidationException;
import software.amazon.awssdk.services.iotfleetwise.paginators.GetVehicleStatusPublisher;
import software.amazon.awssdk.services.iotfleetwise.paginators.ListCampaignsPublisher;
import software.amazon.awssdk.services.iotfleetwise.paginators.ListDecoderManifestNetworkInterfacesPublisher;
import software.amazon.awssdk.services.iotfleetwise.paginators.ListDecoderManifestSignalsPublisher;
import software.amazon.awssdk.services.iotfleetwise.paginators.ListDecoderManifestsPublisher;
import software.amazon.awssdk.services.iotfleetwise.paginators.ListFleetsForVehiclePublisher;
import software.amazon.awssdk.services.iotfleetwise.paginators.ListFleetsPublisher;
import software.amazon.awssdk.services.iotfleetwise.paginators.ListModelManifestNodesPublisher;
import software.amazon.awssdk.services.iotfleetwise.paginators.ListModelManifestsPublisher;
import software.amazon.awssdk.services.iotfleetwise.paginators.ListSignalCatalogNodesPublisher;
import software.amazon.awssdk.services.iotfleetwise.paginators.ListSignalCatalogsPublisher;
import software.amazon.awssdk.services.iotfleetwise.paginators.ListVehiclesInFleetPublisher;
import software.amazon.awssdk.services.iotfleetwise.paginators.ListVehiclesPublisher;
import software.amazon.awssdk.services.iotfleetwise.transform.AssociateVehicleFleetRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.BatchCreateVehicleRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.BatchUpdateVehicleRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.CreateCampaignRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.CreateDecoderManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.CreateFleetRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.CreateModelManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.CreateSignalCatalogRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.CreateVehicleRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.DeleteCampaignRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.DeleteDecoderManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.DeleteFleetRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.DeleteModelManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.DeleteSignalCatalogRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.DeleteVehicleRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.DisassociateVehicleFleetRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetCampaignRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetDecoderManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetFleetRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetLoggingOptionsRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetModelManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetRegisterAccountStatusRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetSignalCatalogRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetVehicleRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetVehicleStatusRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ImportDecoderManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ImportSignalCatalogRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListCampaignsRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListDecoderManifestNetworkInterfacesRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListDecoderManifestSignalsRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListDecoderManifestsRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListFleetsForVehicleRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListFleetsRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListModelManifestNodesRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListModelManifestsRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListSignalCatalogNodesRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListSignalCatalogsRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListVehiclesInFleetRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListVehiclesRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.PutLoggingOptionsRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.RegisterAccountRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.UpdateCampaignRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.UpdateDecoderManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.UpdateFleetRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.UpdateModelManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.UpdateSignalCatalogRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.UpdateVehicleRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;
/**
* Internal implementation of {@link IoTFleetWiseAsyncClient}.
*
* @see IoTFleetWiseAsyncClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultIoTFleetWiseAsyncClient implements IoTFleetWiseAsyncClient {
private static final Logger log = LoggerFactory.getLogger(DefaultIoTFleetWiseAsyncClient.class);
private final AsyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultIoTFleetWiseAsyncClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration;
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
/**
*
* Adds, or associates, a vehicle with a fleet.
*
*
* @param associateVehicleFleetRequest
* @return A Java Future containing the result of the AssociateVehicleFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.AssociateVehicleFleet
* @see AWS API Documentation
*/
@Override
public CompletableFuture associateVehicleFleet(
AssociateVehicleFleetRequest associateVehicleFleetRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, associateVehicleFleetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateVehicleFleet");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AssociateVehicleFleetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AssociateVehicleFleet")
.withMarshaller(new AssociateVehicleFleetRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(associateVehicleFleetRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a group, or batch, of vehicles.
*
*
*
* You must specify a decoder manifest and a vehicle model (model manifest) for each vehicle.
*
*
*
* For more information, see Create multiple
* vehicles (AWS CLI) in the Amazon Web Services IoT FleetWise Developer Guide.
*
*
* @param batchCreateVehicleRequest
* @return A Java Future containing the result of the BatchCreateVehicle operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - LimitExceededException A service quota was exceeded.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.BatchCreateVehicle
* @see AWS API Documentation
*/
@Override
public CompletableFuture batchCreateVehicle(BatchCreateVehicleRequest batchCreateVehicleRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, batchCreateVehicleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchCreateVehicle");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, BatchCreateVehicleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("BatchCreateVehicle")
.withMarshaller(new BatchCreateVehicleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(batchCreateVehicleRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Updates a group, or batch, of vehicles.
*
*
*
* You must specify a decoder manifest and a vehicle model (model manifest) for each vehicle.
*
*
*
* For more information, see Update multiple
* vehicles (AWS CLI) in the Amazon Web Services IoT FleetWise Developer Guide.
*
*
* @param batchUpdateVehicleRequest
* @return A Java Future containing the result of the BatchUpdateVehicle operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.BatchUpdateVehicle
* @see AWS API Documentation
*/
@Override
public CompletableFuture batchUpdateVehicle(BatchUpdateVehicleRequest batchUpdateVehicleRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, batchUpdateVehicleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchUpdateVehicle");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, BatchUpdateVehicleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("BatchUpdateVehicle")
.withMarshaller(new BatchUpdateVehicleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(batchUpdateVehicleRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates an orchestration of data collection rules. The Amazon Web Services IoT FleetWise Edge Agent software
* running in vehicles uses campaigns to decide how to collect and transfer data to the cloud. You create campaigns
* in the cloud. After you or your team approve campaigns, Amazon Web Services IoT FleetWise automatically deploys
* them to vehicles.
*
*
* For more information, see Collect and transfer data
* with campaigns in the Amazon Web Services IoT FleetWise Developer Guide.
*
*
* @param createCampaignRequest
* @return A Java Future containing the result of the CreateCampaign operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - LimitExceededException A service quota was exceeded.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.CreateCampaign
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createCampaign(CreateCampaignRequest createCampaignRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createCampaignRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCampaign");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateCampaignResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateCampaign")
.withMarshaller(new CreateCampaignRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createCampaignRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates the decoder manifest associated with a model manifest. To create a decoder manifest, the following must
* be true:
*
*
* -
*
* Every signal decoder has a unique name.
*
*
* -
*
* Each signal decoder is associated with a network interface.
*
*
* -
*
* Each network interface has a unique ID.
*
*
* -
*
* The signal decoders are specified in the model manifest.
*
*
*
*
* @param createDecoderManifestRequest
* @return A Java Future containing the result of the CreateDecoderManifest operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - LimitExceededException A service quota was exceeded.
* - DecoderManifestValidationException The request couldn't be completed because it contains signal
* decoders with one or more validation errors.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.CreateDecoderManifest
* @see AWS API Documentation
*/
@Override
public CompletableFuture createDecoderManifest(
CreateDecoderManifestRequest createDecoderManifestRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createDecoderManifestRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDecoderManifest");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateDecoderManifestResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateDecoderManifest")
.withMarshaller(new CreateDecoderManifestRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createDecoderManifestRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a fleet that represents a group of vehicles.
*
*
*
* You must create both a signal catalog and vehicles before you can create a fleet.
*
*
*
* For more information, see Fleets in the Amazon
* Web Services IoT FleetWise Developer Guide.
*
*
* @param createFleetRequest
* @return A Java Future containing the result of the CreateFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - LimitExceededException A service quota was exceeded.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.CreateFleet
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture createFleet(CreateFleetRequest createFleetRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createFleetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateFleet");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateFleetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateFleet").withMarshaller(new CreateFleetRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createFleetRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a vehicle model (model manifest) that specifies signals (attributes, branches, sensors, and actuators).
*
*
* For more information, see Vehicle models in
* the Amazon Web Services IoT FleetWise Developer Guide.
*
*
* @param createModelManifestRequest
* @return A Java Future containing the result of the CreateModelManifest operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - LimitExceededException A service quota was exceeded.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - InvalidSignalsException The request couldn't be completed because it contains signals that aren't
* valid.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.CreateModelManifest
* @see AWS API Documentation
*/
@Override
public CompletableFuture createModelManifest(
CreateModelManifestRequest createModelManifestRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createModelManifestRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateModelManifest");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateModelManifestResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateModelManifest")
.withMarshaller(new CreateModelManifestRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createModelManifestRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a collection of standardized signals that can be reused to create vehicle models.
*
*
* @param createSignalCatalogRequest
* @return A Java Future containing the result of the CreateSignalCatalog operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - LimitExceededException A service quota was exceeded.
* - InvalidNodeException The specified node type doesn't match the expected node type for a node. You can
* specify the node type as branch, sensor, actuator, or attribute.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - InvalidSignalsException The request couldn't be completed because it contains signals that aren't
* valid.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.CreateSignalCatalog
* @see AWS API Documentation
*/
@Override
public CompletableFuture createSignalCatalog(
CreateSignalCatalogRequest createSignalCatalogRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createSignalCatalogRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSignalCatalog");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateSignalCatalogResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateSignalCatalog")
.withMarshaller(new CreateSignalCatalogRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createSignalCatalogRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a vehicle, which is an instance of a vehicle model (model manifest). Vehicles created from the same
* vehicle model consist of the same signals inherited from the vehicle model.
*
*
*
* If you have an existing Amazon Web Services IoT Thing, you can use Amazon Web Services IoT FleetWise to create a
* vehicle and collect data from your thing.
*
*
*
* For more information, see Create a vehicle
* (AWS CLI) in the Amazon Web Services IoT FleetWise Developer Guide.
*
*
* @param createVehicleRequest
* @return A Java Future containing the result of the CreateVehicle operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - LimitExceededException A service quota was exceeded.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.CreateVehicle
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createVehicle(CreateVehicleRequest createVehicleRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createVehicleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateVehicle");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateVehicleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateVehicle")
.withMarshaller(new CreateVehicleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createVehicleRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a data collection campaign. Deleting a campaign suspends all data collection and removes it from any
* vehicles.
*
*
* @param deleteCampaignRequest
* @return A Java Future containing the result of the DeleteCampaign operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.DeleteCampaign
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteCampaign(DeleteCampaignRequest deleteCampaignRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCampaignRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCampaign");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteCampaignResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteCampaign")
.withMarshaller(new DeleteCampaignRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteCampaignRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a decoder manifest. You can't delete a decoder manifest if it has vehicles associated with it.
*
*
*
* If the decoder manifest is successfully deleted, Amazon Web Services IoT FleetWise sends back an HTTP 200
* response with an empty body.
*
*
*
* @param deleteDecoderManifestRequest
* @return A Java Future containing the result of the DeleteDecoderManifest operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.DeleteDecoderManifest
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteDecoderManifest(
DeleteDecoderManifestRequest deleteDecoderManifestRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDecoderManifestRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDecoderManifest");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteDecoderManifestResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteDecoderManifest")
.withMarshaller(new DeleteDecoderManifestRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteDecoderManifestRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a fleet. Before you delete a fleet, all vehicles must be dissociated from the fleet. For more
* information, see Delete a fleet (AWS
* CLI) in the Amazon Web Services IoT FleetWise Developer Guide.
*
*
*
* If the fleet is successfully deleted, Amazon Web Services IoT FleetWise sends back an HTTP 200 response with an
* empty body.
*
*
*
* @param deleteFleetRequest
* @return A Java Future containing the result of the DeleteFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.DeleteFleet
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteFleet(DeleteFleetRequest deleteFleetRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteFleetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteFleet");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteFleetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteFleet").withMarshaller(new DeleteFleetRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteFleetRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a vehicle model (model manifest).
*
*
*
* If the vehicle model is successfully deleted, Amazon Web Services IoT FleetWise sends back an HTTP 200 response
* with an empty body.
*
*
*
* @param deleteModelManifestRequest
* @return A Java Future containing the result of the DeleteModelManifest operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.DeleteModelManifest
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteModelManifest(
DeleteModelManifestRequest deleteModelManifestRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteModelManifestRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteModelManifest");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteModelManifestResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteModelManifest")
.withMarshaller(new DeleteModelManifestRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteModelManifestRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a signal catalog.
*
*
*
* If the signal catalog is successfully deleted, Amazon Web Services IoT FleetWise sends back an HTTP 200 response
* with an empty body.
*
*
*
* @param deleteSignalCatalogRequest
* @return A Java Future containing the result of the DeleteSignalCatalog operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.DeleteSignalCatalog
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteSignalCatalog(
DeleteSignalCatalogRequest deleteSignalCatalogRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSignalCatalogRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSignalCatalog");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteSignalCatalogResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteSignalCatalog")
.withMarshaller(new DeleteSignalCatalogRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteSignalCatalogRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a vehicle and removes it from any campaigns.
*
*
*
* If the vehicle is successfully deleted, Amazon Web Services IoT FleetWise sends back an HTTP 200 response with an
* empty body.
*
*
*
* @param deleteVehicleRequest
* @return A Java Future containing the result of the DeleteVehicle operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.DeleteVehicle
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteVehicle(DeleteVehicleRequest deleteVehicleRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteVehicleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteVehicle");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteVehicleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteVehicle")
.withMarshaller(new DeleteVehicleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteVehicleRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Removes, or disassociates, a vehicle from a fleet. Disassociating a vehicle from a fleet doesn't delete the
* vehicle.
*
*
*
* If the vehicle is successfully dissociated from a fleet, Amazon Web Services IoT FleetWise sends back an HTTP 200
* response with an empty body.
*
*
*
* @param disassociateVehicleFleetRequest
* @return A Java Future containing the result of the DisassociateVehicleFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.DisassociateVehicleFleet
* @see AWS API Documentation
*/
@Override
public CompletableFuture disassociateVehicleFleet(
DisassociateVehicleFleetRequest disassociateVehicleFleetRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateVehicleFleetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateVehicleFleet");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DisassociateVehicleFleetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DisassociateVehicleFleet")
.withMarshaller(new DisassociateVehicleFleetRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(disassociateVehicleFleetRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about a campaign.
*
*
* @param getCampaignRequest
* @return A Java Future containing the result of the GetCampaign operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetCampaign
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getCampaign(GetCampaignRequest getCampaignRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getCampaignRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCampaign");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetCampaignResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetCampaign").withMarshaller(new GetCampaignRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getCampaignRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about a created decoder manifest.
*
*
* @param getDecoderManifestRequest
* @return A Java Future containing the result of the GetDecoderManifest operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetDecoderManifest
* @see AWS API Documentation
*/
@Override
public CompletableFuture getDecoderManifest(GetDecoderManifestRequest getDecoderManifestRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getDecoderManifestRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDecoderManifest");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetDecoderManifestResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetDecoderManifest")
.withMarshaller(new GetDecoderManifestRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getDecoderManifestRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about a fleet.
*
*
* @param getFleetRequest
* @return A Java Future containing the result of the GetFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetFleet
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getFleet(GetFleetRequest getFleetRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getFleetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetFleet");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetFleetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("GetFleet")
.withMarshaller(new GetFleetRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector)
.withInput(getFleetRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves the logging options.
*
*
* @param getLoggingOptionsRequest
* @return A Java Future containing the result of the GetLoggingOptions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetLoggingOptions
* @see AWS API Documentation
*/
@Override
public CompletableFuture getLoggingOptions(GetLoggingOptionsRequest getLoggingOptionsRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getLoggingOptionsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetLoggingOptions");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetLoggingOptionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetLoggingOptions")
.withMarshaller(new GetLoggingOptionsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getLoggingOptionsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about a vehicle model (model manifest).
*
*
* @param getModelManifestRequest
* @return A Java Future containing the result of the GetModelManifest operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetModelManifest
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture getModelManifest(GetModelManifestRequest getModelManifestRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getModelManifestRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetModelManifest");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetModelManifestResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetModelManifest")
.withMarshaller(new GetModelManifestRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getModelManifestRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about the status of registering your Amazon Web Services account, IAM, and Amazon
* Timestream resources so that Amazon Web Services IoT FleetWise can transfer your vehicle data to the Amazon Web
* Services Cloud.
*
*
* For more information, including step-by-step procedures, see Setting up Amazon Web
* Services IoT FleetWise.
*
*
*
* This API operation doesn't require input parameters.
*
*
*
* @param getRegisterAccountStatusRequest
* @return A Java Future containing the result of the GetRegisterAccountStatus operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetRegisterAccountStatus
* @see AWS API Documentation
*/
@Override
public CompletableFuture getRegisterAccountStatus(
GetRegisterAccountStatusRequest getRegisterAccountStatusRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getRegisterAccountStatusRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetRegisterAccountStatus");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetRegisterAccountStatusResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetRegisterAccountStatus")
.withMarshaller(new GetRegisterAccountStatusRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getRegisterAccountStatusRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about a signal catalog.
*
*
* @param getSignalCatalogRequest
* @return A Java Future containing the result of the GetSignalCatalog operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetSignalCatalog
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture getSignalCatalog(GetSignalCatalogRequest getSignalCatalogRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getSignalCatalogRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSignalCatalog");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetSignalCatalogResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetSignalCatalog")
.withMarshaller(new GetSignalCatalogRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getSignalCatalogRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about a vehicle.
*
*
* @param getVehicleRequest
* @return A Java Future containing the result of the GetVehicle operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetVehicle
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getVehicle(GetVehicleRequest getVehicleRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getVehicleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetVehicle");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetVehicleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("GetVehicle")
.withMarshaller(new GetVehicleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getVehicleRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about the status of a vehicle with any associated campaigns.
*
*
* @param getVehicleStatusRequest
* @return A Java Future containing the result of the GetVehicleStatus operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetVehicleStatus
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture getVehicleStatus(GetVehicleStatusRequest getVehicleStatusRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getVehicleStatusRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetVehicleStatus");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetVehicleStatusResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetVehicleStatus")
.withMarshaller(new GetVehicleStatusRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getVehicleStatusRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about the status of a vehicle with any associated campaigns.
*
*
*
* This is a variant of
* {@link #getVehicleStatus(software.amazon.awssdk.services.iotfleetwise.model.GetVehicleStatusRequest)} operation.
* The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will
* internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.GetVehicleStatusPublisher publisher = client.getVehicleStatusPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.GetVehicleStatusPublisher publisher = client.getVehicleStatusPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.iotfleetwise.model.GetVehicleStatusResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Please notice that the configuration of maxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #getVehicleStatus(software.amazon.awssdk.services.iotfleetwise.model.GetVehicleStatusRequest)}
* operation.
*
*
* @param getVehicleStatusRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetVehicleStatus
* @see AWS
* API Documentation
*/
public GetVehicleStatusPublisher getVehicleStatusPaginator(GetVehicleStatusRequest getVehicleStatusRequest) {
return new GetVehicleStatusPublisher(this, applyPaginatorUserAgent(getVehicleStatusRequest));
}
/**
*
* Creates a decoder manifest using your existing CAN DBC file from your local device.
*
*
* @param importDecoderManifestRequest
* @return A Java Future containing the result of the ImportDecoderManifest operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - DecoderManifestValidationException The request couldn't be completed because it contains signal
* decoders with one or more validation errors.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - InvalidSignalsException The request couldn't be completed because it contains signals that aren't
* valid.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ImportDecoderManifest
* @see AWS API Documentation
*/
@Override
public CompletableFuture importDecoderManifest(
ImportDecoderManifestRequest importDecoderManifestRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, importDecoderManifestRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ImportDecoderManifest");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ImportDecoderManifestResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ImportDecoderManifest")
.withMarshaller(new ImportDecoderManifestRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(importDecoderManifestRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a signal catalog using your existing VSS formatted content from your local device.
*
*
* @param importSignalCatalogRequest
* @return A Java Future containing the result of the ImportSignalCatalog operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - LimitExceededException A service quota was exceeded.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - InvalidSignalsException The request couldn't be completed because it contains signals that aren't
* valid.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ImportSignalCatalog
* @see AWS API Documentation
*/
@Override
public CompletableFuture importSignalCatalog(
ImportSignalCatalogRequest importSignalCatalogRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, importSignalCatalogRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ImportSignalCatalog");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ImportSignalCatalogResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ImportSignalCatalog")
.withMarshaller(new ImportSignalCatalogRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(importSignalCatalogRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists information about created campaigns.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* @param listCampaignsRequest
* @return A Java Future containing the result of the ListCampaigns operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListCampaigns
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture listCampaigns(ListCampaignsRequest listCampaignsRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listCampaignsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCampaigns");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListCampaignsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListCampaigns")
.withMarshaller(new ListCampaignsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listCampaignsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists information about created campaigns.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* This is a variant of
* {@link #listCampaigns(software.amazon.awssdk.services.iotfleetwise.model.ListCampaignsRequest)} operation. The
* return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will
* internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.ListCampaignsPublisher publisher = client.listCampaignsPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.ListCampaignsPublisher publisher = client.listCampaignsPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.iotfleetwise.model.ListCampaignsResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Please notice that the configuration of maxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listCampaigns(software.amazon.awssdk.services.iotfleetwise.model.ListCampaignsRequest)} operation.
*
*
* @param listCampaignsRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListCampaigns
* @see AWS
* API Documentation
*/
public ListCampaignsPublisher listCampaignsPaginator(ListCampaignsRequest listCampaignsRequest) {
return new ListCampaignsPublisher(this, applyPaginatorUserAgent(listCampaignsRequest));
}
/**
*
* Lists the network interfaces specified in a decoder manifest.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* @param listDecoderManifestNetworkInterfacesRequest
* @return A Java Future containing the result of the ListDecoderManifestNetworkInterfaces operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListDecoderManifestNetworkInterfaces
* @see AWS API Documentation
*/
@Override
public CompletableFuture listDecoderManifestNetworkInterfaces(
ListDecoderManifestNetworkInterfacesRequest listDecoderManifestNetworkInterfacesRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listDecoderManifestNetworkInterfacesRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDecoderManifestNetworkInterfaces");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, ListDecoderManifestNetworkInterfacesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListDecoderManifestNetworkInterfaces")
.withMarshaller(new ListDecoderManifestNetworkInterfacesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listDecoderManifestNetworkInterfacesRequest));
CompletableFuture whenCompleted = executeFuture
.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists the network interfaces specified in a decoder manifest.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* This is a variant of
* {@link #listDecoderManifestNetworkInterfaces(software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestNetworkInterfacesRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.ListDecoderManifestNetworkInterfacesPublisher publisher = client.listDecoderManifestNetworkInterfacesPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.ListDecoderManifestNetworkInterfacesPublisher publisher = client.listDecoderManifestNetworkInterfacesPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestNetworkInterfacesResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Please notice that the configuration of maxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listDecoderManifestNetworkInterfaces(software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestNetworkInterfacesRequest)}
* operation.
*
*
* @param listDecoderManifestNetworkInterfacesRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListDecoderManifestNetworkInterfaces
* @see AWS API Documentation
*/
public ListDecoderManifestNetworkInterfacesPublisher listDecoderManifestNetworkInterfacesPaginator(
ListDecoderManifestNetworkInterfacesRequest listDecoderManifestNetworkInterfacesRequest) {
return new ListDecoderManifestNetworkInterfacesPublisher(this,
applyPaginatorUserAgent(listDecoderManifestNetworkInterfacesRequest));
}
/**
*
* A list of information about signal decoders specified in a decoder manifest.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* @param listDecoderManifestSignalsRequest
* @return A Java Future containing the result of the ListDecoderManifestSignals operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListDecoderManifestSignals
* @see AWS API Documentation
*/
@Override
public CompletableFuture listDecoderManifestSignals(
ListDecoderManifestSignalsRequest listDecoderManifestSignalsRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listDecoderManifestSignalsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDecoderManifestSignals");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListDecoderManifestSignalsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListDecoderManifestSignals")
.withMarshaller(new ListDecoderManifestSignalsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listDecoderManifestSignalsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* A list of information about signal decoders specified in a decoder manifest.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* This is a variant of
* {@link #listDecoderManifestSignals(software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestSignalsRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.ListDecoderManifestSignalsPublisher publisher = client.listDecoderManifestSignalsPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.ListDecoderManifestSignalsPublisher publisher = client.listDecoderManifestSignalsPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestSignalsResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Please notice that the configuration of maxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listDecoderManifestSignals(software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestSignalsRequest)}
* operation.
*
*
* @param listDecoderManifestSignalsRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListDecoderManifestSignals
* @see AWS API Documentation
*/
public ListDecoderManifestSignalsPublisher listDecoderManifestSignalsPaginator(
ListDecoderManifestSignalsRequest listDecoderManifestSignalsRequest) {
return new ListDecoderManifestSignalsPublisher(this, applyPaginatorUserAgent(listDecoderManifestSignalsRequest));
}
/**
*
* Lists decoder manifests.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* @param listDecoderManifestsRequest
* @return A Java Future containing the result of the ListDecoderManifests operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListDecoderManifests
* @see AWS API Documentation
*/
@Override
public CompletableFuture listDecoderManifests(
ListDecoderManifestsRequest listDecoderManifestsRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listDecoderManifestsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDecoderManifests");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListDecoderManifestsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListDecoderManifests")
.withMarshaller(new ListDecoderManifestsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listDecoderManifestsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists decoder manifests.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* This is a variant of
* {@link #listDecoderManifests(software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestsRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.ListDecoderManifestsPublisher publisher = client.listDecoderManifestsPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.ListDecoderManifestsPublisher publisher = client.listDecoderManifestsPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestsResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Please notice that the configuration of maxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listDecoderManifests(software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestsRequest)}
* operation.
*
*
* @param listDecoderManifestsRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListDecoderManifests
* @see AWS API Documentation
*/
public ListDecoderManifestsPublisher listDecoderManifestsPaginator(ListDecoderManifestsRequest listDecoderManifestsRequest) {
return new ListDecoderManifestsPublisher(this, applyPaginatorUserAgent(listDecoderManifestsRequest));
}
/**
*
* Retrieves information for each created fleet in an Amazon Web Services account.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* @param listFleetsRequest
* @return A Java Future containing the result of the ListFleets operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListFleets
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture listFleets(ListFleetsRequest listFleetsRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listFleetsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListFleets");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListFleetsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("ListFleets")
.withMarshaller(new ListFleetsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listFleetsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves a list of IDs for all fleets that the vehicle is associated with.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* @param listFleetsForVehicleRequest
* @return A Java Future containing the result of the ListFleetsForVehicle operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListFleetsForVehicle
* @see AWS API Documentation
*/
@Override
public CompletableFuture listFleetsForVehicle(
ListFleetsForVehicleRequest listFleetsForVehicleRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listFleetsForVehicleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListFleetsForVehicle");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListFleetsForVehicleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListFleetsForVehicle")
.withMarshaller(new ListFleetsForVehicleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listFleetsForVehicleRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves a list of IDs for all fleets that the vehicle is associated with.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* This is a variant of
* {@link #listFleetsForVehicle(software.amazon.awssdk.services.iotfleetwise.model.ListFleetsForVehicleRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.ListFleetsForVehiclePublisher publisher = client.listFleetsForVehiclePaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.ListFleetsForVehiclePublisher publisher = client.listFleetsForVehiclePaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.iotfleetwise.model.ListFleetsForVehicleResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Please notice that the configuration of maxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listFleetsForVehicle(software.amazon.awssdk.services.iotfleetwise.model.ListFleetsForVehicleRequest)}
* operation.
*
*
* @param listFleetsForVehicleRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListFleetsForVehicle
* @see AWS API Documentation
*/
public ListFleetsForVehiclePublisher listFleetsForVehiclePaginator(ListFleetsForVehicleRequest listFleetsForVehicleRequest) {
return new ListFleetsForVehiclePublisher(this, applyPaginatorUserAgent(listFleetsForVehicleRequest));
}
/**
*
* Retrieves information for each created fleet in an Amazon Web Services account.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* This is a variant of {@link #listFleets(software.amazon.awssdk.services.iotfleetwise.model.ListFleetsRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.ListFleetsPublisher publisher = client.listFleetsPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.ListFleetsPublisher publisher = client.listFleetsPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.iotfleetwise.model.ListFleetsResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Please notice that the configuration of maxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listFleets(software.amazon.awssdk.services.iotfleetwise.model.ListFleetsRequest)} operation.
*
*
* @param listFleetsRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListFleets
* @see AWS API
* Documentation
*/
public ListFleetsPublisher listFleetsPaginator(ListFleetsRequest listFleetsRequest) {
return new ListFleetsPublisher(this, applyPaginatorUserAgent(listFleetsRequest));
}
/**
*
* Lists information about nodes specified in a vehicle model (model manifest).
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* @param listModelManifestNodesRequest
* @return A Java Future containing the result of the ListModelManifestNodes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - LimitExceededException A service quota was exceeded.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListModelManifestNodes
* @see AWS API Documentation
*/
@Override
public CompletableFuture listModelManifestNodes(
ListModelManifestNodesRequest listModelManifestNodesRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listModelManifestNodesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListModelManifestNodes");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListModelManifestNodesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListModelManifestNodes")
.withMarshaller(new ListModelManifestNodesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listModelManifestNodesRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists information about nodes specified in a vehicle model (model manifest).
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* This is a variant of
* {@link #listModelManifestNodes(software.amazon.awssdk.services.iotfleetwise.model.ListModelManifestNodesRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.ListModelManifestNodesPublisher publisher = client.listModelManifestNodesPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.ListModelManifestNodesPublisher publisher = client.listModelManifestNodesPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.iotfleetwise.model.ListModelManifestNodesResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Please notice that the configuration of maxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listModelManifestNodes(software.amazon.awssdk.services.iotfleetwise.model.ListModelManifestNodesRequest)}
* operation.
*
*
* @param listModelManifestNodesRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - LimitExceededException A service quota was exceeded.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListModelManifestNodes
* @see AWS API Documentation
*/
public ListModelManifestNodesPublisher listModelManifestNodesPaginator(
ListModelManifestNodesRequest listModelManifestNodesRequest) {
return new ListModelManifestNodesPublisher(this, applyPaginatorUserAgent(listModelManifestNodesRequest));
}
/**
*
* Retrieves a list of vehicle models (model manifests).
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* @param listModelManifestsRequest
* @return A Java Future containing the result of the ListModelManifests operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListModelManifests
* @see AWS API Documentation
*/
@Override
public CompletableFuture listModelManifests(ListModelManifestsRequest listModelManifestsRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listModelManifestsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListModelManifests");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListModelManifestsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListModelManifests")
.withMarshaller(new ListModelManifestsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listModelManifestsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves a list of vehicle models (model manifests).
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* This is a variant of
* {@link #listModelManifests(software.amazon.awssdk.services.iotfleetwise.model.ListModelManifestsRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.ListModelManifestsPublisher publisher = client.listModelManifestsPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.iotfleetwise.paginators.ListModelManifestsPublisher publisher = client.listModelManifestsPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.iotfleetwise.model.ListModelManifestsResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Please notice that the configuration of maxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listModelManifests(software.amazon.awssdk.services.iotfleetwise.model.ListModelManifestsRequest)}
* operation.
*
*
* @param listModelManifestsRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListModelManifests
* @see AWS API Documentation
*/
public ListModelManifestsPublisher listModelManifestsPaginator(ListModelManifestsRequest listModelManifestsRequest) {
return new ListModelManifestsPublisher(this, applyPaginatorUserAgent(listModelManifestsRequest));
}
/**
*
* Lists of information about the signals (nodes) specified in a signal catalog.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* @param listSignalCatalogNodesRequest
* @return A Java Future containing the result of the ListSignalCatalogNodes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - LimitExceededException A service quota was exceeded.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListSignalCatalogNodes
* @see AWS API Documentation
*/
@Override
public CompletableFuture listSignalCatalogNodes(
ListSignalCatalogNodesRequest listSignalCatalogNodesRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listSignalCatalogNodesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSignalCatalogNodes");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListSignalCatalogNodesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams