public static ReservedNodeStaxUnmarshaller getInstance() { if (instance == null) instance = new ReservedNodeStaxUnmarshaller(); return instance; } }
public DescribeReservedNodesResult unmarshall(StaxUnmarshallerContext context) throws Exception { DescribeReservedNodesResult describeReservedNodesResult = new DescribeReservedNodesResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return describeReservedNodesResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Marker", targetDepth)) { describeReservedNodesResult.setMarker(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("ReservedNodes", targetDepth)) { describeReservedNodesResult.withReservedNodes(new ArrayList<ReservedNode>()); continue; } if (context.testExpression("ReservedNodes/ReservedNode", targetDepth)) { describeReservedNodesResult.withReservedNodes(ReservedNodeStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return describeReservedNodesResult; } } } }
public DescribeReservedNodesResult unmarshall(StaxUnmarshallerContext context) throws Exception { DescribeReservedNodesResult describeReservedNodesResult = new DescribeReservedNodesResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return describeReservedNodesResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Marker", targetDepth)) { describeReservedNodesResult.setMarker(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("ReservedNodes", targetDepth)) { describeReservedNodesResult.withReservedNodes(new ArrayList<ReservedNode>()); continue; } if (context.testExpression("ReservedNodes/ReservedNode", targetDepth)) { describeReservedNodesResult.withReservedNodes(ReservedNodeStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return describeReservedNodesResult; } } } }
@SdkInternalApi final ReservedNode executeAcceptReservedNodeExchange(AcceptReservedNodeExchangeRequest acceptReservedNodeExchangeRequest) { ExecutionContext executionContext = createExecutionContext(acceptReservedNodeExchangeRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<AcceptReservedNodeExchangeRequest> request = null; Response<ReservedNode> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AcceptReservedNodeExchangeRequestMarshaller().marshall(super.beforeMarshalling(acceptReservedNodeExchangeRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Redshift"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AcceptReservedNodeExchange"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler<ReservedNode> responseHandler = new StaxResponseHandler<ReservedNode>(new ReservedNodeStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } }
@SdkInternalApi final ReservedNode executePurchaseReservedNodeOffering(PurchaseReservedNodeOfferingRequest purchaseReservedNodeOfferingRequest) { ExecutionContext executionContext = createExecutionContext(purchaseReservedNodeOfferingRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<PurchaseReservedNodeOfferingRequest> request = null; Response<ReservedNode> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new PurchaseReservedNodeOfferingRequestMarshaller().marshall(super.beforeMarshalling(purchaseReservedNodeOfferingRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Redshift"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PurchaseReservedNodeOffering"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler<ReservedNode> responseHandler = new StaxResponseHandler<ReservedNode>(new ReservedNodeStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } }
public static ReservedNodeStaxUnmarshaller getInstance() { if (instance == null) instance = new ReservedNodeStaxUnmarshaller(); return instance; } }
@SdkInternalApi final ReservedNode executeAcceptReservedNodeExchange(AcceptReservedNodeExchangeRequest acceptReservedNodeExchangeRequest) { ExecutionContext executionContext = createExecutionContext(acceptReservedNodeExchangeRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<AcceptReservedNodeExchangeRequest> request = null; Response<ReservedNode> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AcceptReservedNodeExchangeRequestMarshaller().marshall(super.beforeMarshalling(acceptReservedNodeExchangeRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Redshift"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AcceptReservedNodeExchange"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler<ReservedNode> responseHandler = new StaxResponseHandler<ReservedNode>(new ReservedNodeStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } }
@SdkInternalApi final ReservedNode executePurchaseReservedNodeOffering(PurchaseReservedNodeOfferingRequest purchaseReservedNodeOfferingRequest) { ExecutionContext executionContext = createExecutionContext(purchaseReservedNodeOfferingRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<PurchaseReservedNodeOfferingRequest> request = null; Response<ReservedNode> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new PurchaseReservedNodeOfferingRequestMarshaller().marshall(super.beforeMarshalling(purchaseReservedNodeOfferingRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Redshift"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PurchaseReservedNodeOffering"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } StaxResponseHandler<ReservedNode> responseHandler = new StaxResponseHandler<ReservedNode>(new ReservedNodeStaxUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } }