Refine search
private void init() { exceptionUnmarshallers.add(new NoSuchPublicAccessBlockConfigurationExceptionUnmarshaller()); exceptionUnmarshallers.add(new StandardErrorUnmarshaller(com.amazonaws.services.s3control.model.AWSS3ControlException.class)); setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("s3-control.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/s3control/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/s3control/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); }
@Override public AmazonServiceException unmarshall(Node node) throws Exception { // Bail out if this isn't the right error code that this // marshaller understands String errorCode = parseErrorCode(node); if (errorCode == null || !errorCode.equals("InvalidParameterInput")) return null; DashboardInvalidInputErrorException e = (DashboardInvalidInputErrorException) super.unmarshall(node); return e; } }
@Test public void testUnmarshall() throws TransformerFactoryConfigurationError, Exception { Document xmlDoc = new DocumentImpl(); Element root = xmlDoc.createElement("ErrorResponse"); Element requestId = xmlDoc.createElement("RequestId"); requestId.appendChild(xmlDoc.createTextNode("TestId")); Element error = xmlDoc.createElement("Error"); Element message = xmlDoc.createElement("Message"); message.appendChild(xmlDoc.createTextNode("TestMessage")); Element type = xmlDoc.createElement("Type"); type.appendChild(xmlDoc.createTextNode("Receiver")); error.appendChild(message); error.appendChild(type); root.appendChild(error); root.appendChild(requestId); xmlDoc.appendChild(root); StandardErrorUnmarshaller seu = new StandardErrorUnmarshaller(); AmazonServiceException ase = seu.unmarshall(xmlDoc); assertEquals(ase.getErrorMessage(), "TestMessage"); assertEquals(ase.getErrorType(), ErrorType.Service); assertEquals(ase.getRequestId(), "TestId"); Element code = xmlDoc.createElement("Code"); code.appendChild(xmlDoc.createTextNode("TestCode")); }
@Test public void testParseErrorCode() throws Exception { Document xmlDoc = new DocumentImpl(); Element root = xmlDoc.createElement("ErrorResponse"); Element error = xmlDoc.createElement("Error"); Element code = xmlDoc.createElement("Code"); code.appendChild(xmlDoc.createTextNode("TestCode")); error.appendChild(code); root.appendChild(error); xmlDoc.appendChild(root); StandardErrorUnmarshaller seu = new StandardErrorUnmarshaller(); assertEquals("TestCode", seu.parseErrorCode(xmlDoc)); }
@Test public void testGetPropertyPath() { StandardErrorUnmarshaller seu = new StandardErrorUnmarshaller(); assertEquals(seu.getErrorPropertyPath("Property"), "ErrorResponse/Error/Property"); }
/** * @see com.amazonaws.transform.Unmarshaller#unmarshall(java.lang.Object) */ public AmazonServiceException unmarshall(Node in) throws Exception { XPath xpath = xpath(); String errorCode = parseErrorCode(in, xpath); String errorType = asString("ErrorResponse/Error/Type", in, xpath); String requestId = asString("ErrorResponse/RequestId", in, xpath); String message = asString("ErrorResponse/Error/Message", in, xpath); AmazonServiceException ase = newException(message); ase.setErrorCode(errorCode); ase.setRequestId(requestId); if (errorType == null) { ase.setErrorType(ErrorType.Unknown); } else if (errorType.equalsIgnoreCase("Receiver")) { ase.setErrorType(ErrorType.Service); } else if (errorType.equalsIgnoreCase("Sender")) { ase.setErrorType(ErrorType.Client); } return ase; }
/** * @see com.amazonaws.transform.Unmarshaller#unmarshall(java.lang.Object) */ @Override public AmazonServiceException unmarshall(Node in) throws Exception { String errorCode = parseErrorCode(in); String errorType = XpathUtils.asString("ErrorResponse/Error/Type", in); String requestId = XpathUtils.asString("ErrorResponse/RequestId", in); String message = XpathUtils.asString("ErrorResponse/Error/Message", in); AmazonServiceException ase = newException(message); ase.setErrorCode(errorCode); ase.setRequestId(requestId); if (errorType == null) { ase.setErrorType(ErrorType.Unknown); } else if ("Receiver".equalsIgnoreCase(errorType)) { ase.setErrorType(ErrorType.Service); } else if ("Sender".equalsIgnoreCase(errorType)) { ase.setErrorType(ErrorType.Client); } return ase; }
private void init() { exceptionUnmarshallers.add(new DisabledOperationExceptionUnmarshaller()); exceptionUnmarshallers.add(new ResourceNotFoundExceptionUnmarshaller()); exceptionUnmarshallers.add(new BaseExceptionUnmarshaller()); exceptionUnmarshallers.add(new InternalExceptionUnmarshaller()); exceptionUnmarshallers.add(new LimitExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidTypeExceptionUnmarshaller()); exceptionUnmarshallers.add(new StandardErrorUnmarshaller(com.amazonaws.services.cloudsearchv2.model.AmazonCloudSearchException.class)); setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("https://cloudsearch.us-east-1.amazonaws.com/"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/cloudsearchv2/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/cloudsearchv2/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); }
@Override public AmazonServiceException unmarshall(Node node) throws Exception { // Bail out if this isn't the right error code that this // marshaller understands String errorCode = parseErrorCode(node); if (errorCode == null || !errorCode.equals("CodeBuildNotInServiceRegionException")) return null; CodeBuildNotInServiceRegionException e = (CodeBuildNotInServiceRegionException) super.unmarshall(node); return e; } }
/** * @see com.amazonaws.transform.Unmarshaller#unmarshall(java.lang.Object) */ public AmazonServiceException unmarshall(Node in) throws Exception { XPath xpath = xpath(); String errorCode = parseErrorCode(in, xpath); String errorType = asString("ErrorResponse/Error/Type", in, xpath); String requestId = asString("ErrorResponse/RequestId", in, xpath); String message = asString("ErrorResponse/Error/Message", in, xpath); AmazonServiceException ase = newException(message); ase.setErrorCode(errorCode); ase.setRequestId(requestId); if (errorType == null) { ase.setErrorType(ErrorType.Unknown); } else if (errorType.equalsIgnoreCase("Receiver")) { ase.setErrorType(ErrorType.Service); } else if (errorType.equalsIgnoreCase("Sender")) { ase.setErrorType(ErrorType.Client); } return ase; }
private void init() { exceptionUnmarshallers.add(new ResourceInUseExceptionUnmarshaller()); exceptionUnmarshallers.add(new ScalingActivityInProgressExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidNextTokenExceptionUnmarshaller()); exceptionUnmarshallers.add(new LimitExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new AlreadyExistsExceptionUnmarshaller()); exceptionUnmarshallers.add(new ResourceContentionExceptionUnmarshaller()); exceptionUnmarshallers.add(new ServiceLinkedRoleFailureExceptionUnmarshaller()); exceptionUnmarshallers.add(new StandardErrorUnmarshaller(com.amazonaws.services.autoscaling.model.AmazonAutoScalingException.class)); setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("https://autoscaling.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/autoscaling/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/autoscaling/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); }
@Override public AmazonServiceException unmarshall(Node node) throws Exception { // Bail out if this isn't the right error code that this // marshaller understands String errorCode = parseErrorCode(node); if (errorCode == null || !errorCode.equals("TooManyBucketsException")) return null; TooManyBucketsException e = (TooManyBucketsException) super.unmarshall(node); return e; } }
/** * @see com.amazonaws.transform.Unmarshaller#unmarshall(java.lang.Object) */ @Override public AmazonServiceException unmarshall(Node in) throws Exception { String errorCode = parseErrorCode(in); String errorType = XpathUtils.asString("ErrorResponse/Error/Type", in); String requestId = XpathUtils.asString("ErrorResponse/RequestId", in); String message = XpathUtils.asString("ErrorResponse/Error/Message", in); AmazonServiceException ase = newException(message); ase.setErrorCode(errorCode); ase.setRequestId(requestId); if (errorType == null) { ase.setErrorType(ErrorType.Unknown); } else if ("Receiver".equalsIgnoreCase(errorType)) { ase.setErrorType(ErrorType.Service); } else if ("Sender".equalsIgnoreCase(errorType)) { ase.setErrorType(ErrorType.Client); } return ase; }
private void init() { exceptionUnmarshallers.add(new InvalidAuthorizationMessageExceptionUnmarshaller()); exceptionUnmarshallers.add(new ExpiredTokenExceptionUnmarshaller()); exceptionUnmarshallers.add(new PackedPolicyTooLargeExceptionUnmarshaller()); exceptionUnmarshallers.add(new RegionDisabledExceptionUnmarshaller()); exceptionUnmarshallers.add(new MalformedPolicyDocumentExceptionUnmarshaller()); exceptionUnmarshallers.add(new IDPCommunicationErrorExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidIdentityTokenExceptionUnmarshaller()); exceptionUnmarshallers.add(new IDPRejectedClaimExceptionUnmarshaller()); exceptionUnmarshallers.add(new StandardErrorUnmarshaller(com.amazonaws.services.securitytoken.model.AWSSecurityTokenServiceException.class)); setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("sts.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/securitytoken/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/securitytoken/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); }
@Override public AmazonServiceException unmarshall(Node node) throws Exception { // Bail out if this isn't the right error code that this // marshaller understands String errorCode = parseErrorCode(node); if (errorCode == null || !errorCode.equals("InsufficientDBInstanceCapacity")) return null; InsufficientDBInstanceCapacityException e = (InsufficientDBInstanceCapacityException) super.unmarshall(node); return e; } }
/** * @see com.amazonaws.transform.Unmarshaller#unmarshall(java.lang.Object) */ @Override public AmazonServiceException unmarshall(Node in) throws Exception { String errorCode = parseErrorCode(in); String errorType = XpathUtils.asString("ErrorResponse/Error/Type", in); String requestId = XpathUtils.asString("ErrorResponse/RequestId", in); String message = XpathUtils.asString("ErrorResponse/Error/Message", in); AmazonServiceException ase = newException(message); ase.setErrorCode(errorCode); ase.setRequestId(requestId); if (errorType == null) { ase.setErrorType(ErrorType.Unknown); } else if ("Receiver".equalsIgnoreCase(errorType)) { ase.setErrorType(ErrorType.Service); } else if ("Sender".equalsIgnoreCase(errorType)) { ase.setErrorType(ErrorType.Client); } return ase; }
private void init() { exceptionUnmarshallers.add(new InvalidParameterValueExceptionUnmarshaller()); exceptionUnmarshallers.add(new ResourceNotFoundExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidParameterCombinationExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidFormatExceptionUnmarshaller()); exceptionUnmarshallers.add(new MissingRequiredParameterExceptionUnmarshaller()); exceptionUnmarshallers.add(new DashboardNotFoundErrorExceptionUnmarshaller()); exceptionUnmarshallers.add(new DashboardInvalidInputErrorExceptionUnmarshaller()); exceptionUnmarshallers.add(new InternalServiceExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidNextTokenExceptionUnmarshaller()); exceptionUnmarshallers.add(new LimitExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new StandardErrorUnmarshaller(com.amazonaws.services.cloudwatch.model.AmazonCloudWatchException.class)); setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("https://monitoring.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/cloudwatch/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/cloudwatch/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); }
@Override public AmazonServiceException unmarshall(Node node) throws Exception { // Bail out if this isn't the right error code that this // marshaller understands String errorCode = parseErrorCode(node); if (errorCode == null || !errorCode.equals("PasswordPolicyViolation")) return null; PasswordPolicyViolationException e = (PasswordPolicyViolationException) super.unmarshall(node); return e; } }
/** * @see com.amazonaws.transform.Unmarshaller#unmarshall(java.lang.Object) */ public AmazonServiceException unmarshall(Node in) throws Exception { XPath xpath = xpath(); String errorCode = parseErrorCode(in, xpath); String errorType = asString("ErrorResponse/Error/Type", in, xpath); String requestId = asString("ErrorResponse/RequestId", in, xpath); String message = asString("ErrorResponse/Error/Message", in, xpath); AmazonServiceException ase = newException(message); ase.setErrorCode(errorCode); ase.setRequestId(requestId); if (errorType == null) { ase.setErrorType(ErrorType.Unknown); } else if (errorType.equalsIgnoreCase("Receiver")) { ase.setErrorType(ErrorType.Service); } else if (errorType.equalsIgnoreCase("Sender")) { ase.setErrorType(ErrorType.Client); } return ase; }
private void init() { exceptionUnmarshallers.add(new InvalidChangeSetStatusExceptionUnmarshaller()); exceptionUnmarshallers.add(new StackSetNotEmptyExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidOperationExceptionUnmarshaller()); exceptionUnmarshallers.add(new TokenAlreadyExistsExceptionUnmarshaller()); exceptionUnmarshallers.add(new ChangeSetNotFoundExceptionUnmarshaller()); exceptionUnmarshallers.add(new NameAlreadyExistsExceptionUnmarshaller()); exceptionUnmarshallers.add(new LimitExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new OperationNotFoundExceptionUnmarshaller()); exceptionUnmarshallers.add(new StackSetNotFoundExceptionUnmarshaller()); exceptionUnmarshallers.add(new InsufficientCapabilitiesExceptionUnmarshaller()); exceptionUnmarshallers.add(new StackInstanceNotFoundExceptionUnmarshaller()); exceptionUnmarshallers.add(new AlreadyExistsExceptionUnmarshaller()); exceptionUnmarshallers.add(new OperationInProgressExceptionUnmarshaller()); exceptionUnmarshallers.add(new StaleRequestExceptionUnmarshaller()); exceptionUnmarshallers.add(new OperationIdAlreadyExistsExceptionUnmarshaller()); exceptionUnmarshallers.add(new CreatedButModifiedExceptionUnmarshaller()); exceptionUnmarshallers.add(new StandardErrorUnmarshaller(com.amazonaws.services.cloudformation.model.AmazonCloudFormationException.class)); setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("https://cloudformation.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/cloudformation/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/cloudformation/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); }