private void init() { exceptionUnmarshallers.add(new LegacyErrorUnmarshaller(com.amazonaws.services.ec2.model.AmazonEC2Exception.class)); setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("https://ec2.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/ec2/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/ec2/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); }
private void init() { exceptionUnmarshallers.add(new NumberItemAttributesExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new NumberSubmittedItemsExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidNumberPredicatesExceptionUnmarshaller()); exceptionUnmarshallers.add(new NumberDomainBytesExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new AttributeDoesNotExistExceptionUnmarshaller()); exceptionUnmarshallers.add(new NumberDomainsExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new NoSuchDomainExceptionUnmarshaller()); exceptionUnmarshallers.add(new RequestTimeoutExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidParameterValueExceptionUnmarshaller()); exceptionUnmarshallers.add(new DuplicateItemNameExceptionUnmarshaller()); exceptionUnmarshallers.add(new TooManyRequestedAttributesExceptionUnmarshaller()); exceptionUnmarshallers.add(new NumberSubmittedAttributesExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidQueryExpressionExceptionUnmarshaller()); exceptionUnmarshallers.add(new NumberDomainAttributesExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidNumberValueTestsExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidNextTokenExceptionUnmarshaller()); exceptionUnmarshallers.add(new MissingParameterExceptionUnmarshaller()); exceptionUnmarshallers.add(new LegacyErrorUnmarshaller(com.amazonaws.services.simpledb.model.AmazonSimpleDBException.class)); setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("sdb.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/simpledb/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/simpledb/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); }
private void init() { exceptionUnmarshallers.add(new LegacyErrorUnmarshaller()); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("ec2.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( "/com/amazonaws/services/ec2/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain( "/com/amazonaws/services/ec2/request.handler2s")); }
private void init() { exceptionUnmarshallers.add(new InvalidNextTokenExceptionUnmarshaller()); exceptionUnmarshallers.add(new NumberItemAttributesExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new NumberDomainAttributesExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new DuplicateItemNameExceptionUnmarshaller()); exceptionUnmarshallers.add(new TooManyRequestedAttributesExceptionUnmarshaller()); exceptionUnmarshallers.add(new AttributeDoesNotExistExceptionUnmarshaller()); exceptionUnmarshallers.add(new MissingParameterExceptionUnmarshaller()); exceptionUnmarshallers.add(new NumberSubmittedItemsExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidQueryExpressionExceptionUnmarshaller()); exceptionUnmarshallers.add(new NoSuchDomainExceptionUnmarshaller()); exceptionUnmarshallers.add(new NumberDomainsExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidParameterValueExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidNumberValueTestsExceptionUnmarshaller()); exceptionUnmarshallers.add(new NumberSubmittedAttributesExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new RequestTimeoutExceptionUnmarshaller()); exceptionUnmarshallers.add(new NumberDomainBytesExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidNumberPredicatesExceptionUnmarshaller()); exceptionUnmarshallers.add(new LegacyErrorUnmarshaller()); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("sdb.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( "/com/amazonaws/services/simpledb/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain( "/com/amazonaws/services/simpledb/request.handler2s")); }
@Test public void testGetErrorPropertyPath() { LegacyErrorUnmarshaller leu = new LegacyErrorUnmarshaller(); assertEquals(leu.getErrorPropertyPath("Property"), "Response/Errors/Error/Property"); } }
@Test public void testUnmarshall() throws TransformerFactoryConfigurationError, Exception { Document xmlDoc = new DocumentImpl(); Element root = xmlDoc.createElement("Response"); Element requestId = xmlDoc.createElement("RequestID"); requestId.appendChild(xmlDoc.createTextNode("TestId")); Element errors = xmlDoc.createElement("Errors"); Element error = xmlDoc.createElement("Error"); Element message = xmlDoc.createElement("Message"); message.appendChild(xmlDoc.createTextNode("TestMessage")); Element type = xmlDoc.createElement("Type"); type.appendChild(xmlDoc.createTextNode("server")); Element code = xmlDoc.createElement("Code"); code.appendChild(xmlDoc.createTextNode("TestCode")); error.appendChild(message); error.appendChild(type); error.appendChild(code); errors.appendChild(error); root.appendChild(errors); root.appendChild(requestId); xmlDoc.appendChild(root); LegacyErrorUnmarshaller leu = new LegacyErrorUnmarshaller(); AmazonServiceException ase = leu.unmarshall(xmlDoc); assertEquals(ase.getErrorCode(), "TestCode"); assertEquals(ase.getErrorMessage(), "TestMessage"); assertEquals(ase.getErrorType(), ErrorType.Service); assertEquals(ase.getRequestId(), "TestId"); }
private void init() { exceptionUnmarshallers.add(new LegacyErrorUnmarshaller(com.amazonaws.services.ec2.model.AmazonEC2Exception.class)); setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("https://ec2.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/ec2/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/ec2/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); }
private void init() { exceptionUnmarshallers.add(new NumberItemAttributesExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new NumberSubmittedItemsExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidNumberPredicatesExceptionUnmarshaller()); exceptionUnmarshallers.add(new NumberDomainBytesExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new AttributeDoesNotExistExceptionUnmarshaller()); exceptionUnmarshallers.add(new NumberDomainsExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new NoSuchDomainExceptionUnmarshaller()); exceptionUnmarshallers.add(new RequestTimeoutExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidParameterValueExceptionUnmarshaller()); exceptionUnmarshallers.add(new DuplicateItemNameExceptionUnmarshaller()); exceptionUnmarshallers.add(new TooManyRequestedAttributesExceptionUnmarshaller()); exceptionUnmarshallers.add(new NumberSubmittedAttributesExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidQueryExpressionExceptionUnmarshaller()); exceptionUnmarshallers.add(new NumberDomainAttributesExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidNumberValueTestsExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidNextTokenExceptionUnmarshaller()); exceptionUnmarshallers.add(new MissingParameterExceptionUnmarshaller()); exceptionUnmarshallers.add(new LegacyErrorUnmarshaller(com.amazonaws.services.simpledb.model.AmazonSimpleDBException.class)); setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("sdb.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/simpledb/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/simpledb/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); }