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

com.ksc.network.vpc.KSCVPCClient Maven / Gradle / Ivy

There is a newer version: 2.1.8
Show newest version
package com.ksc.network.vpc;

import java.util.ArrayList;
import java.util.List;

import org.w3c.dom.Node;

import com.ksc.ClientConfiguration;
import com.ksc.ClientConfigurationFactory;
import com.ksc.KscServiceException;
import com.ksc.KscWebServiceClient;
import com.ksc.KscWebServiceRequest;
import com.ksc.KscWebServiceResponse;
import com.ksc.Request;
import com.ksc.Response;
import com.ksc.auth.AWSCredentialsProvider;
import com.ksc.auth.DefaultAWSCredentialsProviderChain;
import com.ksc.auth.credentials.AWSCredentials;
import com.ksc.http.DefaultErrorResponseHandler;
import com.ksc.http.ExecutionContext;
import com.ksc.http.HttpResponseHandler;
import com.ksc.http.StaxResponseHandler;
import com.ksc.internal.StaticCredentialsProvider;
import com.ksc.metrics.RequestMetricCollector;
import com.ksc.network.vpc.model.AvailabilityZone.DescribeAvailabilityZonesRequest;
import com.ksc.network.vpc.model.AvailabilityZone.DescribeAvailabilityZonesResult;
import com.ksc.network.vpc.model.InternetGateways.DescribeInternetGatewaysRequest;
import com.ksc.network.vpc.model.InternetGateways.DescribeInternetGatewaysResult;
import com.ksc.network.vpc.model.Nat.AssociateNatRequest;
import com.ksc.network.vpc.model.Nat.AssociateNatResult;
import com.ksc.network.vpc.model.Nat.CreateNatRequest;
import com.ksc.network.vpc.model.Nat.CreateNatResult;
import com.ksc.network.vpc.model.Nat.DeleteNatRequest;
import com.ksc.network.vpc.model.Nat.DeleteNatResult;
import com.ksc.network.vpc.model.Nat.DescribeNatsRequest;
import com.ksc.network.vpc.model.Nat.DescribeNatsResult;
import com.ksc.network.vpc.model.Nat.DisassociateNatRequest;
import com.ksc.network.vpc.model.Nat.DisassociateNatResult;
import com.ksc.network.vpc.model.Nat.ModifyNatRequest;
import com.ksc.network.vpc.model.Nat.ModifyNatResult;
import com.ksc.network.vpc.model.NetworkAcl.CreateNetworkAclEntryRequest;
import com.ksc.network.vpc.model.NetworkAcl.CreateNetworkAclEntryResult;
import com.ksc.network.vpc.model.NetworkAcl.CreateNetworkAclRequest;
import com.ksc.network.vpc.model.NetworkAcl.CreateNetworkAclResult;
import com.ksc.network.vpc.model.NetworkAcl.DeleteNetworkAclEntryRequest;
import com.ksc.network.vpc.model.NetworkAcl.DeleteNetworkAclEntryResult;
import com.ksc.network.vpc.model.NetworkAcl.DeleteNetworkAclRequest;
import com.ksc.network.vpc.model.NetworkAcl.DeleteNetworkAclResult;
import com.ksc.network.vpc.model.NetworkAcl.DescribeNetworkAclsRequest;
import com.ksc.network.vpc.model.NetworkAcl.DescribeNetworkAclsResult;
import com.ksc.network.vpc.model.NetworkAcl.ModifyNetworkAclRequest;
import com.ksc.network.vpc.model.NetworkAcl.ModifyNetworkAclResult;
import com.ksc.network.vpc.model.NetworkInterface.DescribeNetworkInterfacesRequest;
import com.ksc.network.vpc.model.NetworkInterface.DescribeNetworkInterfacesResult;
import com.ksc.network.vpc.model.Route.CreateRouteRequest;
import com.ksc.network.vpc.model.Route.CreateRouteResult;
import com.ksc.network.vpc.model.Route.DeleteRouteRequest;
import com.ksc.network.vpc.model.Route.DeleteRouteResult;
import com.ksc.network.vpc.model.Route.DescribeRoutesRequest;
import com.ksc.network.vpc.model.Route.DescribeRoutesResult;
import com.ksc.network.vpc.model.SecurityGroups.AuthorizeSecurityGroupEntryRequest;
import com.ksc.network.vpc.model.SecurityGroups.AuthorizeSecurityGroupEntryResult;
import com.ksc.network.vpc.model.SecurityGroups.CreateSecurityGroupRequest;
import com.ksc.network.vpc.model.SecurityGroups.CreateSecurityGroupResult;
import com.ksc.network.vpc.model.SecurityGroups.DeleteSecurityGroupRequest;
import com.ksc.network.vpc.model.SecurityGroups.DeleteSecurityGroupResult;
import com.ksc.network.vpc.model.SecurityGroups.DescribeSecurityGroupsRequest;
import com.ksc.network.vpc.model.SecurityGroups.DescribeSecurityGroupsResult;
import com.ksc.network.vpc.model.SecurityGroups.ModifySecurityGroupRequest;
import com.ksc.network.vpc.model.SecurityGroups.ModifySecurityGroupResult;
import com.ksc.network.vpc.model.SecurityGroups.RevokeSecurityGroupEntryRequest;
import com.ksc.network.vpc.model.SecurityGroups.RevokeSecurityGroupEntryResult;
import com.ksc.network.vpc.model.subnet.AssociateNetworkAclRequest;
import com.ksc.network.vpc.model.subnet.AssociateNetworkAclResult;
import com.ksc.network.vpc.model.subnet.CreateSubnetRequest;
import com.ksc.network.vpc.model.subnet.CreateSubnetResult;
import com.ksc.network.vpc.model.subnet.DeleteSubnetRequest;
import com.ksc.network.vpc.model.subnet.DeleteSubnetResult;
import com.ksc.network.vpc.model.subnet.DescribeSubnetAvailableAddressesRequest;
import com.ksc.network.vpc.model.subnet.DescribeSubnetAvailableAddressesResult;
import com.ksc.network.vpc.model.subnet.DescribeSubnetsRequest;
import com.ksc.network.vpc.model.subnet.DescribeSubnetsResult;
import com.ksc.network.vpc.model.subnet.DisassociateNetworkAclRequest;
import com.ksc.network.vpc.model.subnet.DisassociateNetworkAclResult;
import com.ksc.network.vpc.model.subnet.ModifySubnetRequest;
import com.ksc.network.vpc.model.subnet.ModifySubnetResult;
import com.ksc.network.vpc.model.vpc.CreateVpcRequest;
import com.ksc.network.vpc.model.vpc.CreateVpcResult;
import com.ksc.network.vpc.model.vpc.DeleteVpcRequest;
import com.ksc.network.vpc.model.vpc.DeleteVpcResult;
import com.ksc.network.vpc.model.vpc.DescribeVpcsRequest;
import com.ksc.network.vpc.model.vpc.DescribeVpcsResult;
import com.ksc.network.vpc.transform.AvailabilityZone.DescribeAvailabilityZonesRequestMarshaller;
import com.ksc.network.vpc.transform.AvailabilityZone.DescribeAvailabilityZonesResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.InternetGateways.DescribeInternetGatewaysRequestMarshaller;
import com.ksc.network.vpc.transform.InternetGateways.DescribeInternetGatewaysResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.Nat.AssociateNatRequestMarshaller;
import com.ksc.network.vpc.transform.Nat.AssociateNatResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.Nat.CreateNatRequestMarshaller;
import com.ksc.network.vpc.transform.Nat.CreateNatResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.Nat.DeleteNatRequestMarshaller;
import com.ksc.network.vpc.transform.Nat.DeleteNatResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.Nat.DescribeNatsRequestMarshaller;
import com.ksc.network.vpc.transform.Nat.DescribeNatsResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.Nat.DisassociateNatRequestMarshaller;
import com.ksc.network.vpc.transform.Nat.DisassociateNatResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.Nat.ModifyNatRequestMarshaller;
import com.ksc.network.vpc.transform.Nat.ModifyNatResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.NetworkAcl.CreateNetworkAclEntryRequestMarshaller;
import com.ksc.network.vpc.transform.NetworkAcl.CreateNetworkAclEntryResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.NetworkAcl.CreateNetworkAclRequestMarshaller;
import com.ksc.network.vpc.transform.NetworkAcl.CreateNetworkAclResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.NetworkAcl.DeleteNetworkAclEntryRequestMarshaller;
import com.ksc.network.vpc.transform.NetworkAcl.DeleteNetworkAclEntryResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.NetworkAcl.DeleteNetworkAclRequestMarshaller;
import com.ksc.network.vpc.transform.NetworkAcl.DeleteNetworkAclResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.NetworkAcl.DescribeNetworkAclsRequestMarshaller;
import com.ksc.network.vpc.transform.NetworkAcl.DescribeNetworkAclsResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.NetworkAcl.ModifyNetworkAclRequestMarshaller;
import com.ksc.network.vpc.transform.NetworkAcl.ModifyNetworkAclResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.NetworkInterface.DescribeNetworkInterfacesRequestMarshaller;
import com.ksc.network.vpc.transform.NetworkInterface.DescribeNetworkInterfacesResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.Routes.CreateRouteRequestMarshaller;
import com.ksc.network.vpc.transform.Routes.CreateRouteResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.Routes.DeleteRouteRequestMarshaller;
import com.ksc.network.vpc.transform.Routes.DeleteRouteResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.Routes.DescribeRoutesRequestMarshaller;
import com.ksc.network.vpc.transform.Routes.DescribeRoutesResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.SecurityGroups.AuthorizeSecurityGroupEntryRequestMarshaller;
import com.ksc.network.vpc.transform.SecurityGroups.AuthorizeSecurityGroupEntryResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.SecurityGroups.CreateSecurityGroupRequestMarshaller;
import com.ksc.network.vpc.transform.SecurityGroups.CreateSecurityGroupResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.SecurityGroups.DeleteSecurityGroupRequestMarshaller;
import com.ksc.network.vpc.transform.SecurityGroups.DeleteSecurityGroupResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.SecurityGroups.DescribeSecurityGroupsRequestMarshaller;
import com.ksc.network.vpc.transform.SecurityGroups.DescribeSecurityGroupsResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.SecurityGroups.ModifySecurityGroupRequestMarshaller;
import com.ksc.network.vpc.transform.SecurityGroups.ModifySecurityGroupResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.SecurityGroups.RevokeSecurityGroupEntryRequestMarshaller;
import com.ksc.network.vpc.transform.SecurityGroups.RevokeSecurityGroupEntryResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.subnet.AssociateNetworkAclRequestMarshaller;
import com.ksc.network.vpc.transform.subnet.AssociateNetworkAclResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.subnet.CreateSubnetRequestMarshaller;
import com.ksc.network.vpc.transform.subnet.CreateSubnetResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.subnet.DeleteSubnetRequestMarshaller;
import com.ksc.network.vpc.transform.subnet.DeleteSubnetResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.subnet.DescribeSubnetAvailableAddressesRequestMarshaller;
import com.ksc.network.vpc.transform.subnet.DescribeSubnetAvailableAddressesResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.subnet.DescribeSubnetsRequestMarshaller;
import com.ksc.network.vpc.transform.subnet.DescribeSubnetsResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.subnet.DisassociateNetworkAclRequestMarshaller;
import com.ksc.network.vpc.transform.subnet.DisassociateNetworkAclResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.subnet.ModifySubnetRequestMarshaller;
import com.ksc.network.vpc.transform.subnet.ModifySubnetResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.vpc.CreateVpcRequestMarshaller;
import com.ksc.network.vpc.transform.vpc.CreateVpcResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.vpc.DeleteVpcRequestMarshaller;
import com.ksc.network.vpc.transform.vpc.DeleteVpcResultStaxUnmarshaller;
import com.ksc.network.vpc.transform.vpc.DescribeVpcsRequestMarshaller;
import com.ksc.network.vpc.transform.vpc.DescribeVpcsResultStaxUnmarshaller;
import com.ksc.transform.LegacyErrorUnmarshaller;
import com.ksc.transform.StandardErrorUnmarshaller;
import com.ksc.transform.Unmarshaller;
import com.ksc.util.CredentialUtils;
import com.ksc.util.KscRequestMetrics;
import com.ksc.util.KscRequestMetrics.Field;

public class KSCVPCClient extends KscWebServiceClient implements KSCVPC {
	/**
	 * Provider for AWS credentials.
	 */
	private AWSCredentialsProvider kscCredentialsProvider;

	/**
	 * Default signing name for the service.
	 */
	private static final String DEFAULT_SIGNING_NAME = "vpc";

	/**
	 * The region metadata service name for computing region endpoints.
	 */
	private static final String DEFAULT_ENDPOINT_PREFIX = "vpc";

	/**
	 * Client configuration factory providing ClientConfigurations tailored to
	 * this client
	 */
	protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory();

	/**
	 * List of exception unmarshallers for all modeled exceptions
	 */
	protected final List> exceptionUnmarshallers = new ArrayList>();

	/**
	 * Constructs a new client to invoke service methods on VPC. A credentials
	 * provider chain will be used that searches for credentials in this order:
	 * 
    *
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • *
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • *
  • Instance profile credentials delivered through the VPC metadata * service
  • *
*

*

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @see DefaultAWSCredentialsProviderChain */ public KSCVPCClient() { this(new DefaultAWSCredentialsProviderChain(), configFactory .getConfig()); } /** * Constructs a new client to invoke service methods on VPC. A credentials * provider chain will be used that searches for credentials in this order: *

    *
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • *
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • *
  • Instance profile credentials delivered through the VPC metadata * service
  • *
*

*

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param clientConfiguration * The client configuration options controlling how this client * connects to KSC (ex: proxy settings, retry counts, etc.). * @see DefaultAWSCredentialsProviderChain */ public KSCVPCClient(ClientConfiguration clientConfiguration) { this(new DefaultAWSCredentialsProviderChain(), clientConfiguration); } /** * Constructs a new client to invoke service methods on VPC using the * specified AWS account credentials. *

*

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when * authenticating with AWS services. */ public KSCVPCClient(AWSCredentials awsCredentials) { this(awsCredentials, configFactory.getConfig()); } /** * Constructs a new client to invoke service methods on VPC using the * specified AWS account credentials and client configuration options. *

*

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when * authenticating with AWS services. * @param clientConfiguration * The client configuration options controlling how this client * connects to vpc (ex: proxy settings, retry counts, etc.). */ public KSCVPCClient( AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) { super(clientConfiguration); this.kscCredentialsProvider = new StaticCredentialsProvider( awsCredentials); init(); } /** * Constructs a new client to invoke service methods on VPC using the * specified AWS account credentials provider. *

*

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to * authenticate requests with KSC services. */ public KSCVPCClient(AWSCredentialsProvider awsCredentialsProvider) { this(awsCredentialsProvider, configFactory.getConfig()); } /** * Constructs a new client to invoke service methods on VPC using the * specified AWS account credentials provider and client configuration * options. *

*

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to * authenticate requests with KSC services. * @param clientConfiguration * The client configuration options controlling how this client * connects to VPC (ex: proxy settings, retry counts, etc.). */ public KSCVPCClient( AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) { this(awsCredentialsProvider, clientConfiguration, null); } /** * Constructs a new client to invoke service methods on VPC using the * specified KSC account credentials provider, client configuration options, * and request metric collector. *

*

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to * authenticate requests with KSC services. * @param clientConfiguration * The client configuration options controlling how this client * connects to VPC (ex: proxy settings, retry counts, etc.). * @param requestMetricCollector * optional request metric collector */ public KSCVPCClient( AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector) { super(clientConfiguration, requestMetricCollector); this.kscCredentialsProvider = awsCredentialsProvider; init(); } @Override public DescribeVpcsResult describeVpcs() { return this.describeVpcs(new DescribeVpcsRequest()); } @Override public DescribeVpcsResult describeVpcs( DescribeVpcsRequest describeVpcsRequest) { ExecutionContext executionContext = createExecutionContext( describeVpcsRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeVpcsRequestMarshaller() .marshall(super.beforeMarshalling(describeVpcsRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DescribeVpcsResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } private void init() { exceptionUnmarshallers.add(new StandardErrorUnmarshaller()); exceptionUnmarshallers.add(new LegacyErrorUnmarshaller()); setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(DEFAULT_ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly setEndpoint("http://vpc.cn-beijing-6.api.ksyun.com"); } /** * Normal invoke with authentication. Credentials are required and may be * overriden at the request level. **/ private Response invoke( Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext) { executionContext.setCredentialsProvider(CredentialUtils .getCredentialsProvider(request.getOriginalRequest(), kscCredentialsProvider)); return doInvoke(request, responseHandler, executionContext); } /** * 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) { request.setEndpoint(endpoint); request.setTimeOffset(timeOffset); DefaultErrorResponseHandler errorResponseHandler = new DefaultErrorResponseHandler( exceptionUnmarshallers); return client.execute(request, responseHandler, errorResponseHandler, executionContext); } @Override public DescribeAvailabilityZonesResult describeAvailabilityZones( DescribeAvailabilityZonesRequest describeAvailabilityZonesRequest) { ExecutionContext executionContext = createExecutionContext( describeAvailabilityZonesRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeAvailabilityZonesRequestMarshaller() .marshall(super.beforeMarshalling( describeAvailabilityZonesRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DescribeAvailabilityZonesResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public DescribeNetworkInterfacesResult describeNetworkInterfaces( DescribeNetworkInterfacesRequest describeNetworkInterfacesRequest) { ExecutionContext executionContext = createExecutionContext( describeNetworkInterfacesRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeNetworkInterfacesRequestMarshaller() .marshall(super.beforeMarshalling( describeNetworkInterfacesRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DescribeNetworkInterfacesResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public DescribeSubnetsResult describeSubnets( DescribeSubnetsRequest describeSubnetsRequest) { ExecutionContext executionContext = createExecutionContext( describeSubnetsRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeSubnetsRequestMarshaller().marshall( super.beforeMarshalling(describeSubnetsRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DescribeSubnetsResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public DescribeSecurityGroupsResult describeSecurityGroups( DescribeSecurityGroupsRequest describeSecurityGroupsRequest) { ExecutionContext executionContext = createExecutionContext( describeSecurityGroupsRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeSecurityGroupsRequestMarshaller() .marshall(super.beforeMarshalling( describeSecurityGroupsRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DescribeSecurityGroupsResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public DescribeInternetGatewaysResult describeInternetGateways( DescribeInternetGatewaysRequest describeInternetGatewaysRequest) { ExecutionContext executionContext = createExecutionContext( describeInternetGatewaysRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeInternetGatewaysRequestMarshaller() .marshall(super.beforeMarshalling( describeInternetGatewaysRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DescribeInternetGatewaysResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public CreateVpcResult createVpc(CreateVpcRequest createVpcRequest) { ExecutionContext executionContext = createExecutionContext( createVpcRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateVpcRequestMarshaller() .marshall(super.beforeMarshalling(createVpcRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new CreateVpcResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public DeleteVpcResult deleteVpc(DeleteVpcRequest deleteVpcRequest) { ExecutionContext executionContext = createExecutionContext( deleteVpcRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteVpcRequestMarshaller() .marshall(super.beforeMarshalling(deleteVpcRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DeleteVpcResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public CreateSubnetResult createSubnet( CreateSubnetRequest createSubnetRequest) { ExecutionContext executionContext = createExecutionContext( createSubnetRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateSubnetRequestMarshaller() .marshall(super.beforeMarshalling(createSubnetRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new CreateSubnetResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public DeleteSubnetResult deleteSubnet( DeleteSubnetRequest deleteSubnetRequest) { ExecutionContext executionContext = createExecutionContext( deleteSubnetRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteSubnetRequestMarshaller() .marshall(super.beforeMarshalling(deleteSubnetRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DeleteSubnetResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public CreateSecurityGroupResult createSecurityGroup( CreateSecurityGroupRequest createSecurityGroupRequest) { ExecutionContext executionContext = createExecutionContext( createSecurityGroupRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateSecurityGroupRequestMarshaller().marshall( super.beforeMarshalling(createSecurityGroupRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new CreateSecurityGroupResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public DeleteSecurityGroupResult deleteSecurityGroup( DeleteSecurityGroupRequest deleteSecurityGroupRequest) { ExecutionContext executionContext = createExecutionContext( deleteSecurityGroupRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteSecurityGroupRequestMarshaller().marshall( super.beforeMarshalling(deleteSecurityGroupRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DeleteSecurityGroupResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public ModifySecurityGroupResult modifySecurityGroup( ModifySecurityGroupRequest modifySecurityGroupRequest) { ExecutionContext executionContext = createExecutionContext( modifySecurityGroupRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ModifySecurityGroupRequestMarshaller().marshall( super.beforeMarshalling(modifySecurityGroupRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new ModifySecurityGroupResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public AuthorizeSecurityGroupEntryResult authorizeSecurityGroupEntry( AuthorizeSecurityGroupEntryRequest authorizeSecurityGroupEntryRequest) { ExecutionContext executionContext = createExecutionContext( authorizeSecurityGroupEntryRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AuthorizeSecurityGroupEntryRequestMarshaller() .marshall(super.beforeMarshalling( authorizeSecurityGroupEntryRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new AuthorizeSecurityGroupEntryResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public RevokeSecurityGroupEntryResult revokeSecurityGroupEntry( RevokeSecurityGroupEntryRequest revokeSecurityGroupEntryRequest) { ExecutionContext executionContext = createExecutionContext( revokeSecurityGroupEntryRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new RevokeSecurityGroupEntryRequestMarshaller() .marshall(super.beforeMarshalling( revokeSecurityGroupEntryRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new RevokeSecurityGroupEntryResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public CreateRouteResult createRoute( CreateRouteRequest createRouteRequest) { ExecutionContext executionContext = createExecutionContext( createRouteRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateRouteRequestMarshaller() .marshall(super.beforeMarshalling(createRouteRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new CreateRouteResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public DeleteRouteResult deleteRoute( DeleteRouteRequest deleteRouteRequest) { ExecutionContext executionContext = createExecutionContext( deleteRouteRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteRouteRequestMarshaller() .marshall(super.beforeMarshalling(deleteRouteRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DeleteRouteResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public DescribeRoutesResult describeRoutes( DescribeRoutesRequest describeRoutesRequest) { ExecutionContext executionContext = createExecutionContext( describeRoutesRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeRoutesRequestMarshaller().marshall( super.beforeMarshalling(describeRoutesRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DescribeRoutesResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public ModifySubnetResult modifySubnet( ModifySubnetRequest modifySubnetRequest) { ExecutionContext executionContext = createExecutionContext( modifySubnetRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ModifySubnetRequestMarshaller().marshall( super.beforeMarshalling(modifySubnetRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new ModifySubnetResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public CreateNetworkAclResult createNetworkAcl( CreateNetworkAclRequest createNetworkAclRequest) { ExecutionContext executionContext = createExecutionContext( createNetworkAclRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateNetworkAclRequestMarshaller() .marshall(super.beforeMarshalling(createNetworkAclRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new CreateNetworkAclResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public DeleteNetworkAclResult deleteNetworkAcl( DeleteNetworkAclRequest deleteNetworkAclRequest) { ExecutionContext executionContext = createExecutionContext( deleteNetworkAclRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteNetworkAclRequestMarshaller() .marshall(super.beforeMarshalling(deleteNetworkAclRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DeleteNetworkAclResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public ModifyNetworkAclResult modifyNetworkAcl( ModifyNetworkAclRequest modifyNetworkAclRequest) { ExecutionContext executionContext = createExecutionContext( modifyNetworkAclRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ModifyNetworkAclRequestMarshaller().marshall( super.beforeMarshalling(modifyNetworkAclRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new ModifyNetworkAclResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public CreateNetworkAclEntryResult createNetworkAclEntry( CreateNetworkAclEntryRequest createNetworkAclEntryRequest) { ExecutionContext executionContext = createExecutionContext( createNetworkAclEntryRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateNetworkAclEntryRequestMarshaller() .marshall(super.beforeMarshalling(createNetworkAclEntryRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new CreateNetworkAclEntryResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public DeleteNetworkAclEntryResult deleteNetworkAclEntry( DeleteNetworkAclEntryRequest deleteNetworkAclEntryRequest) { ExecutionContext executionContext = createExecutionContext( deleteNetworkAclEntryRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteNetworkAclEntryRequestMarshaller() .marshall(super.beforeMarshalling(deleteNetworkAclEntryRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DeleteNetworkAclEntryResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public DescribeNetworkAclsResult describeNetworkAcls( DescribeNetworkAclsRequest describeNetworkAclsRequest) { ExecutionContext executionContext = createExecutionContext( describeNetworkAclsRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeNetworkAclsRequestMarshaller() .marshall(super.beforeMarshalling( describeNetworkAclsRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DescribeNetworkAclsResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public AssociateNetworkAclResult associateNetworkAcl( AssociateNetworkAclRequest associateNetworkAclRequest) { ExecutionContext executionContext = createExecutionContext( associateNetworkAclRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AssociateNetworkAclRequestMarshaller().marshall( super.beforeMarshalling(associateNetworkAclRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new AssociateNetworkAclResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public DisassociateNetworkAclResult disassociateNetworkAcl( DisassociateNetworkAclRequest disassociateNetworkAclRequest) { ExecutionContext executionContext = createExecutionContext( disassociateNetworkAclRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DisassociateNetworkAclRequestMarshaller().marshall( super.beforeMarshalling(disassociateNetworkAclRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DisassociateNetworkAclResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public DescribeSubnetAvailableAddressesResult describeSubnetAvailableAddresses( DescribeSubnetAvailableAddressesRequest describeSubnetAvailableAddressesRequest) { ExecutionContext executionContext = createExecutionContext( describeSubnetAvailableAddressesRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeSubnetAvailableAddressesRequestMarshaller().marshall( super.beforeMarshalling(describeSubnetAvailableAddressesRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler(new DescribeSubnetAvailableAddressesResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public CreateNatResult createNat( CreateNatRequest createNatRequest) { ExecutionContext executionContext = createExecutionContext( createNatRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateNatRequestMarshaller() .marshall(super.beforeMarshalling(createNatRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new CreateNatResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public DeleteNatResult deleteNat( DeleteNatRequest deleteNatRequest) { ExecutionContext executionContext = createExecutionContext( deleteNatRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteNatRequestMarshaller() .marshall(super.beforeMarshalling(deleteNatRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DeleteNatResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public ModifyNatResult modifyNat( ModifyNatRequest modifyNatRequest) { ExecutionContext executionContext = createExecutionContext( modifyNatRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ModifyNatRequestMarshaller().marshall( super.beforeMarshalling(modifyNatRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new ModifyNatResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public AssociateNatResult associateNat( AssociateNatRequest associateNatRequest) { ExecutionContext executionContext = createExecutionContext( associateNatRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AssociateNatRequestMarshaller().marshall( super.beforeMarshalling(associateNatRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new AssociateNatResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public DisassociateNatResult disassociateNat( DisassociateNatRequest disassociateNatRequest) { ExecutionContext executionContext = createExecutionContext( disassociateNatRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DisassociateNatRequestMarshaller().marshall( super.beforeMarshalling(disassociateNatRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DisassociateNatResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } @Override public DescribeNatsResult describeNats( DescribeNatsRequest describeNatsRequest) { ExecutionContext executionContext = createExecutionContext( describeNatsRequest); KscRequestMetrics kscRequestMetrics = executionContext .getKscRequestMetrics(); kscRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { kscRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeNatsRequestMarshaller() .marshall(super.beforeMarshalling( describeNatsRequest)); // Binds the request metrics to the current request. request.setKscRequestMetrics(kscRequestMetrics); } finally { kscRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler responseHandler = new StaxResponseHandler( new DescribeNatsResultStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getKscResponse(); } finally { endClientExecution(kscRequestMetrics, request, response); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy