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

com.amazonaws.services.simspaceweaver.AWSSimSpaceWeaverClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS SimSpace Weaver module holds the client classes that are used for communicating with AWS SimSpace Weaver Service

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

import org.w3c.dom.*;

import java.net.*;
import java.util.*;

import javax.annotation.Generated;

import org.apache.commons.logging.*;

import com.amazonaws.*;
import com.amazonaws.annotation.SdkInternalApi;
import com.amazonaws.auth.*;

import com.amazonaws.handlers.*;
import com.amazonaws.http.*;
import com.amazonaws.internal.*;
import com.amazonaws.internal.auth.*;
import com.amazonaws.metrics.*;
import com.amazonaws.regions.*;
import com.amazonaws.transform.*;
import com.amazonaws.util.*;
import com.amazonaws.protocol.json.*;
import com.amazonaws.util.AWSRequestMetrics.Field;
import com.amazonaws.annotation.ThreadSafe;
import com.amazonaws.client.AwsSyncClientParams;
import com.amazonaws.client.builder.AdvancedConfig;

import com.amazonaws.services.simspaceweaver.AWSSimSpaceWeaverClientBuilder;

import com.amazonaws.AmazonServiceException;

import com.amazonaws.services.simspaceweaver.model.*;

import com.amazonaws.services.simspaceweaver.model.transform.*;

/**
 * Client for accessing AWS SimSpace Weaver. All service calls made using this client are blocking, and will not return
 * until the service call completes.
 * 

*

* SimSpace Weaver (SimSpace Weaver) is a service that you can use to build and run large-scale spatial simulations in * the Amazon Web Services Cloud. For example, you can create crowd simulations, large real-world environments, and * immersive and interactive experiences. For more information about SimSpace Weaver, see the SimSpace Weaver User Guide . *

*

* This API reference describes the API operations and data types that you can use to communicate directly with SimSpace * Weaver. *

*

* SimSpace Weaver also provides the SimSpace Weaver app SDK, which you use for app development. The SimSpace Weaver app * SDK API reference is included in the SimSpace Weaver app SDK documentation. This documentation is part of the * SimSpace Weaver app SDK distributable package. *

*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AWSSimSpaceWeaverClient extends AmazonWebServiceClient implements AWSSimSpaceWeaver { /** Provider for AWS credentials. */ private final AWSCredentialsProvider awsCredentialsProvider; private static final Log log = LogFactory.getLog(AWSSimSpaceWeaver.class); /** Default signing name for the service. */ private static final String DEFAULT_SIGNING_NAME = "simspaceweaver"; /** Client configuration factory providing ClientConfigurations tailored to this client */ protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory(); private final AdvancedConfig advancedConfig; private static final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory( new JsonClientMetadata() .withProtocolVersion("1.1") .withSupportsCbor(false) .withSupportsIon(false) .withContentTypeOverride("application/json") .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("AccessDeniedException").withExceptionUnmarshaller( com.amazonaws.services.simspaceweaver.model.transform.AccessDeniedExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ConflictException").withExceptionUnmarshaller( com.amazonaws.services.simspaceweaver.model.transform.ConflictExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("TooManyTagsException").withExceptionUnmarshaller( com.amazonaws.services.simspaceweaver.model.transform.TooManyTagsExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ResourceNotFoundException").withExceptionUnmarshaller( com.amazonaws.services.simspaceweaver.model.transform.ResourceNotFoundExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ValidationException").withExceptionUnmarshaller( com.amazonaws.services.simspaceweaver.model.transform.ValidationExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ServiceQuotaExceededException").withExceptionUnmarshaller( com.amazonaws.services.simspaceweaver.model.transform.ServiceQuotaExceededExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InternalServerException").withExceptionUnmarshaller( com.amazonaws.services.simspaceweaver.model.transform.InternalServerExceptionUnmarshaller.getInstance())) .withBaseServiceExceptionClass(com.amazonaws.services.simspaceweaver.model.AWSSimSpaceWeaverException.class)); public static AWSSimSpaceWeaverClientBuilder builder() { return AWSSimSpaceWeaverClientBuilder.standard(); } /** * Constructs a new client to invoke service methods on AWS SimSpace Weaver using the specified parameters. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientParams * Object providing client parameters. */ AWSSimSpaceWeaverClient(AwsSyncClientParams clientParams) { this(clientParams, false); } /** * Constructs a new client to invoke service methods on AWS SimSpace Weaver using the specified parameters. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientParams * Object providing client parameters. */ AWSSimSpaceWeaverClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) { super(clientParams); this.awsCredentialsProvider = clientParams.getCredentialsProvider(); this.advancedConfig = clientParams.getAdvancedConfig(); init(); } private void init() { setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly setEndpoint("simspaceweaver.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/simspaceweaver/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/simspaceweaver/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); } /** *

* Creates a snapshot of the specified simulation. A snapshot is a file that contains simulation state data at a * specific time. The state data saved in a snapshot includes entity data from the State Fabric, the simulation * configuration specified in the schema, and the clock tick number. You can use the snapshot to initialize a new * simulation. For more information about snapshots, see Snapshots in * the SimSpace Weaver User Guide. *

*

* You specify a Destination when you create a snapshot. The Destination is the name of an * Amazon S3 bucket and an optional ObjectKeyPrefix. The ObjectKeyPrefix is usually the * name of a folder in the bucket. SimSpace Weaver creates a snapshot folder inside the * Destination and places the snapshot file there. *

*

* The snapshot file is an Amazon S3 object. It has an object key with the form: * object-key-prefix/snapshot/simulation-name-YYMMdd-HHmm-ss.zip, * where: *

*
    *
  • *

    * YY is the 2-digit year *

    *
  • *
  • *

    * MM is the 2-digit month *

    *
  • *
  • *

    * dd is the 2-digit day of the month *

    *
  • *
  • *

    * HH is the 2-digit hour (24-hour clock) *

    *
  • *
  • *

    * mm is the 2-digit minutes *

    *
  • *
  • *

    * ss is the 2-digit seconds *

    *
  • *
* * @param createSnapshotRequest * @return Result of the CreateSnapshot operation returned by the service. * @throws ResourceNotFoundException * @throws InternalServerException * @throws AccessDeniedException * @throws ValidationException * @throws ConflictException * @sample AWSSimSpaceWeaver.CreateSnapshot * @see AWS * API Documentation */ @Override public CreateSnapshotResult createSnapshot(CreateSnapshotRequest request) { request = beforeClientExecution(request); return executeCreateSnapshot(request); } @SdkInternalApi final CreateSnapshotResult executeCreateSnapshot(CreateSnapshotRequest createSnapshotRequest) { ExecutionContext executionContext = createExecutionContext(createSnapshotRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateSnapshotRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createSnapshotRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SimSpaceWeaver"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSnapshot"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateSnapshotResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Deletes the instance of the given custom app. *

* * @param deleteAppRequest * @return Result of the DeleteApp operation returned by the service. * @throws ResourceNotFoundException * @throws InternalServerException * @throws AccessDeniedException * @throws ValidationException * @throws ConflictException * @sample AWSSimSpaceWeaver.DeleteApp * @see AWS API * Documentation */ @Override public DeleteAppResult deleteApp(DeleteAppRequest request) { request = beforeClientExecution(request); return executeDeleteApp(request); } @SdkInternalApi final DeleteAppResult executeDeleteApp(DeleteAppRequest deleteAppRequest) { ExecutionContext executionContext = createExecutionContext(deleteAppRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteAppRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteAppRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SimSpaceWeaver"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteApp"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteAppResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Deletes all SimSpace Weaver resources assigned to the given simulation. *

* *

* Your simulation uses resources in other Amazon Web Services. This API operation doesn't delete resources in other * Amazon Web Services. *

*
* * @param deleteSimulationRequest * @return Result of the DeleteSimulation operation returned by the service. * @throws ResourceNotFoundException * @throws InternalServerException * @throws AccessDeniedException * @throws ValidationException * @throws ConflictException * @sample AWSSimSpaceWeaver.DeleteSimulation * @see AWS API Documentation */ @Override public DeleteSimulationResult deleteSimulation(DeleteSimulationRequest request) { request = beforeClientExecution(request); return executeDeleteSimulation(request); } @SdkInternalApi final DeleteSimulationResult executeDeleteSimulation(DeleteSimulationRequest deleteSimulationRequest) { ExecutionContext executionContext = createExecutionContext(deleteSimulationRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteSimulationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteSimulationRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SimSpaceWeaver"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteSimulation"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteSimulationResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Returns the state of the given custom app. *

* * @param describeAppRequest * @return Result of the DescribeApp operation returned by the service. * @throws ResourceNotFoundException * @throws InternalServerException * @throws AccessDeniedException * @throws ValidationException * @sample AWSSimSpaceWeaver.DescribeApp * @see AWS API * Documentation */ @Override public DescribeAppResult describeApp(DescribeAppRequest request) { request = beforeClientExecution(request); return executeDescribeApp(request); } @SdkInternalApi final DescribeAppResult executeDescribeApp(DescribeAppRequest describeAppRequest) { ExecutionContext executionContext = createExecutionContext(describeAppRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeAppRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeAppRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SimSpaceWeaver"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeApp"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeAppResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Returns the current state of the given simulation. *

* * @param describeSimulationRequest * @return Result of the DescribeSimulation operation returned by the service. * @throws ResourceNotFoundException * @throws InternalServerException * @throws AccessDeniedException * @throws ValidationException * @sample AWSSimSpaceWeaver.DescribeSimulation * @see AWS API Documentation */ @Override public DescribeSimulationResult describeSimulation(DescribeSimulationRequest request) { request = beforeClientExecution(request); return executeDescribeSimulation(request); } @SdkInternalApi final DescribeSimulationResult executeDescribeSimulation(DescribeSimulationRequest describeSimulationRequest) { ExecutionContext executionContext = createExecutionContext(describeSimulationRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeSimulationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeSimulationRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SimSpaceWeaver"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeSimulation"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeSimulationResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Lists all custom apps or service apps for the given simulation and domain. *

* * @param listAppsRequest * @return Result of the ListApps operation returned by the service. * @throws ResourceNotFoundException * @throws InternalServerException * @throws AccessDeniedException * @throws ValidationException * @sample AWSSimSpaceWeaver.ListApps * @see AWS API * Documentation */ @Override public ListAppsResult listApps(ListAppsRequest request) { request = beforeClientExecution(request); return executeListApps(request); } @SdkInternalApi final ListAppsResult executeListApps(ListAppsRequest listAppsRequest) { ExecutionContext executionContext = createExecutionContext(listAppsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListAppsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAppsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SimSpaceWeaver"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListApps"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAppsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Lists the SimSpace Weaver simulations in the Amazon Web Services account used to make the API call. *

* * @param listSimulationsRequest * @return Result of the ListSimulations operation returned by the service. * @throws InternalServerException * @throws AccessDeniedException * @throws ValidationException * @sample AWSSimSpaceWeaver.ListSimulations * @see AWS * API Documentation */ @Override public ListSimulationsResult listSimulations(ListSimulationsRequest request) { request = beforeClientExecution(request); return executeListSimulations(request); } @SdkInternalApi final ListSimulationsResult executeListSimulations(ListSimulationsRequest listSimulationsRequest) { ExecutionContext executionContext = createExecutionContext(listSimulationsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListSimulationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listSimulationsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SimSpaceWeaver"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListSimulations"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListSimulationsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Lists all tags on a SimSpace Weaver resource. *

* * @param listTagsForResourceRequest * @return Result of the ListTagsForResource operation returned by the service. * @throws ResourceNotFoundException * @throws ValidationException * @sample AWSSimSpaceWeaver.ListTagsForResource * @see AWS API Documentation */ @Override public ListTagsForResourceResult listTagsForResource(ListTagsForResourceRequest request) { request = beforeClientExecution(request); return executeListTagsForResource(request); } @SdkInternalApi final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) { ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SimSpaceWeaver"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Starts a custom app with the configuration specified in the simulation schema. *

* * @param startAppRequest * @return Result of the StartApp operation returned by the service. * @throws InternalServerException * @throws AccessDeniedException * @throws ValidationException * @throws ServiceQuotaExceededException * @throws ConflictException * @sample AWSSimSpaceWeaver.StartApp * @see AWS API * Documentation */ @Override public StartAppResult startApp(StartAppRequest request) { request = beforeClientExecution(request); return executeStartApp(request); } @SdkInternalApi final StartAppResult executeStartApp(StartAppRequest startAppRequest) { ExecutionContext executionContext = createExecutionContext(startAppRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new StartAppRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startAppRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SimSpaceWeaver"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartApp"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartAppResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Starts the simulation clock. *

* * @param startClockRequest * @return Result of the StartClock operation returned by the service. * @throws ResourceNotFoundException * @throws InternalServerException * @throws AccessDeniedException * @throws ValidationException * @throws ConflictException * @sample AWSSimSpaceWeaver.StartClock * @see AWS API * Documentation */ @Override public StartClockResult startClock(StartClockRequest request) { request = beforeClientExecution(request); return executeStartClock(request); } @SdkInternalApi final StartClockResult executeStartClock(StartClockRequest startClockRequest) { ExecutionContext executionContext = createExecutionContext(startClockRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new StartClockRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startClockRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SimSpaceWeaver"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartClock"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartClockResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Starts a simulation with the given name. You must choose to start your simulation from a schema or from a * snapshot. For more information about the schema, see the schema reference in * the SimSpace Weaver User Guide. For more information about snapshots, see Snapshots in * the SimSpace Weaver User Guide. *

* * @param startSimulationRequest * @return Result of the StartSimulation operation returned by the service. * @throws InternalServerException * @throws AccessDeniedException * @throws ValidationException * @throws ServiceQuotaExceededException * @throws ConflictException * @sample AWSSimSpaceWeaver.StartSimulation * @see AWS * API Documentation */ @Override public StartSimulationResult startSimulation(StartSimulationRequest request) { request = beforeClientExecution(request); return executeStartSimulation(request); } @SdkInternalApi final StartSimulationResult executeStartSimulation(StartSimulationRequest startSimulationRequest) { ExecutionContext executionContext = createExecutionContext(startSimulationRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new StartSimulationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startSimulationRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SimSpaceWeaver"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartSimulation"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartSimulationResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Stops the given custom app and shuts down all of its allocated compute resources. *

* * @param stopAppRequest * @return Result of the StopApp operation returned by the service. * @throws ResourceNotFoundException * @throws InternalServerException * @throws AccessDeniedException * @throws ValidationException * @throws ConflictException * @sample AWSSimSpaceWeaver.StopApp * @see AWS API * Documentation */ @Override public StopAppResult stopApp(StopAppRequest request) { request = beforeClientExecution(request); return executeStopApp(request); } @SdkInternalApi final StopAppResult executeStopApp(StopAppRequest stopAppRequest) { ExecutionContext executionContext = createExecutionContext(stopAppRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new StopAppRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopAppRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SimSpaceWeaver"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopApp"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true).withHasStreamingSuccessResponse(false), new StopAppResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Stops the simulation clock. *

* * @param stopClockRequest * @return Result of the StopClock operation returned by the service. * @throws ResourceNotFoundException * @throws InternalServerException * @throws AccessDeniedException * @throws ValidationException * @throws ConflictException * @sample AWSSimSpaceWeaver.StopClock * @see AWS API * Documentation */ @Override public StopClockResult stopClock(StopClockRequest request) { request = beforeClientExecution(request); return executeStopClock(request); } @SdkInternalApi final StopClockResult executeStopClock(StopClockRequest stopClockRequest) { ExecutionContext executionContext = createExecutionContext(stopClockRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new StopClockRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopClockRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SimSpaceWeaver"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopClock"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true).withHasStreamingSuccessResponse(false), new StopClockResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Stops the given simulation. *

* *

* You can't restart a simulation after you stop it. If you want to restart a simulation, then you must stop it, * delete it, and start a new instance of it. *

*
* * @param stopSimulationRequest * @return Result of the StopSimulation operation returned by the service. * @throws ResourceNotFoundException * @throws InternalServerException * @throws AccessDeniedException * @throws ValidationException * @throws ConflictException * @sample AWSSimSpaceWeaver.StopSimulation * @see AWS * API Documentation */ @Override public StopSimulationResult stopSimulation(StopSimulationRequest request) { request = beforeClientExecution(request); return executeStopSimulation(request); } @SdkInternalApi final StopSimulationResult executeStopSimulation(StopSimulationRequest stopSimulationRequest) { ExecutionContext executionContext = createExecutionContext(stopSimulationRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new StopSimulationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopSimulationRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SimSpaceWeaver"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopSimulation"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StopSimulationResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Adds tags to a SimSpace Weaver resource. For more information about tags, see Tagging Amazon Web Services resources * in the Amazon Web Services General Reference. *

* * @param tagResourceRequest * @return Result of the TagResource operation returned by the service. * @throws TooManyTagsException * @throws ResourceNotFoundException * @throws ValidationException * @sample AWSSimSpaceWeaver.TagResource * @see AWS API * Documentation */ @Override public TagResourceResult tagResource(TagResourceRequest request) { request = beforeClientExecution(request); return executeTagResource(request); } @SdkInternalApi final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) { ExecutionContext executionContext = createExecutionContext(tagResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SimSpaceWeaver"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Removes tags from a SimSpace Weaver resource. For more information about tags, see Tagging Amazon Web Services resources * in the Amazon Web Services General Reference. *

* * @param untagResourceRequest * @return Result of the UntagResource operation returned by the service. * @throws ResourceNotFoundException * @throws ValidationException * @sample AWSSimSpaceWeaver.UntagResource * @see AWS * API Documentation */ @Override public UntagResourceResult untagResource(UntagResourceRequest request) { request = beforeClientExecution(request); return executeUntagResource(request); } @SdkInternalApi final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) { ExecutionContext executionContext = createExecutionContext(untagResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SimSpaceWeaver"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * Returns additional metadata for a previously executed successful, request, typically used for debugging issues * where a service isn't acting as expected. This data isn't considered part of the result data returned by an * operation, so it's available through this separate, diagnostic interface. *

* Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic * information for an executed request, you should use this method to retrieve it as soon as possible after * executing the request. * * @param request * The originally executed request * * @return The response metadata for the specified request, or null if none is available. */ public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) { return client.getResponseMetadataForRequest(request); } /** * Normal invoke with authentication. Credentials are required and may be overriden at the request level. **/ private Response invoke(Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext) { return invoke(request, responseHandler, executionContext, null, null); } /** * Normal invoke with authentication. Credentials are required and may be overriden at the request level. **/ private Response invoke(Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext, URI cachedEndpoint, URI uriFromEndpointTrait) { executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider)); return doInvoke(request, responseHandler, executionContext, cachedEndpoint, uriFromEndpointTrait); } /** * Invoke with no authentication. Credentials are not required and any credentials set on the client or request will * be ignored for this operation. **/ private Response anonymousInvoke(Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext) { return doInvoke(request, responseHandler, executionContext, null, null); } /** * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the * ExecutionContext beforehand. **/ private Response doInvoke(Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) { if (discoveredEndpoint != null) { request.setEndpoint(discoveredEndpoint); request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery"); } else if (uriFromEndpointTrait != null) { request.setEndpoint(uriFromEndpointTrait); } else { request.setEndpoint(endpoint); } request.setTimeOffset(timeOffset); HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata()); return client.execute(request, responseHandler, errorResponseHandler, executionContext); } @com.amazonaws.annotation.SdkInternalApi static com.amazonaws.protocol.json.SdkJsonProtocolFactory getProtocolFactory() { return protocolFactory; } @Override public void shutdown() { super.shutdown(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy