diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/AuthenticationException.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/AuthenticationException.java index a0709b15..6a77550f 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/AuthenticationException.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/AuthenticationException.java @@ -65,5 +65,16 @@ public AuthenticationException(Throwable throwable) { public AuthenticationException(String errorMessage, Throwable throwable) { super(errorMessage, throwable); } + + /** + * Constructor AuthenticationException + * + * @param errorMessage the error message + * @param throwable the throwable + * @param intuit_tid the transaction id + */ + public AuthenticationException(String errorMessage, Throwable throwable, String intuit_tid) { + super(errorMessage, throwable, intuit_tid); + } } diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/AuthorizationException.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/AuthorizationException.java index 9095be63..2ef457ba 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/AuthorizationException.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/AuthorizationException.java @@ -65,5 +65,16 @@ public AuthorizationException(Throwable throwable) { public AuthorizationException(String errorMessage, Throwable throwable) { super(errorMessage, throwable); } + + /** + * Constructor AuthorizationException + * + * @param errorMessage the error message + * @param throwable the throwable + * @param intuit_tid the transaction id + */ + public AuthorizationException(String errorMessage, Throwable throwable, String intuit_tid) { + super(errorMessage, throwable, intuit_tid); + } } diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/BadRequestException.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/BadRequestException.java index 7a03187e..e5d58778 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/BadRequestException.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/BadRequestException.java @@ -65,4 +65,15 @@ public BadRequestException(Throwable throwable) { public BadRequestException(String errorMessage, Throwable throwable) { super(errorMessage, throwable); } + + /** + * Constructor BasRequestException + * + * @param errorMessage the error message + * @param throwable the throwable + * @param intuit_tid the transaction id + */ + public BadRequestException(String errorMessage, Throwable throwable, String intuit_tid) { + super(errorMessage, throwable, intuit_tid); + } } diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/CompressionException.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/CompressionException.java index 9dbd58d4..835e4342 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/CompressionException.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/CompressionException.java @@ -55,4 +55,17 @@ public CompressionException(Throwable throwable) { public CompressionException(String errorMessage, Throwable e) { super(errorMessage, e); } + + /** + * Constructor CompressionException + * + * @param errorMessage + * the error message + * @param e + * the throwable object + * @param intuit_tid the transaction id + */ + public CompressionException(String errorMessage, Throwable e, String intuit_tid) { + super(errorMessage, e, intuit_tid); + } } diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/ConfigurationException.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/ConfigurationException.java index 590aa455..bc9bfccf 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/ConfigurationException.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/ConfigurationException.java @@ -53,4 +53,15 @@ public ConfigurationException(Throwable throwable) { public ConfigurationException(String errorMessage, Throwable throwable) { super(errorMessage, throwable); } + + /** + * Constructor ConfigurationException + * + * @param errorMessage the error message + * @param throwable the throwable + * @param intuit_tid the transaction id + */ + public ConfigurationException(String errorMessage, Throwable throwable, String intuit_tid) { + super(errorMessage, throwable, intuit_tid); + } } diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/FMSException.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/FMSException.java index eae8546d..be4c8515 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/FMSException.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/FMSException.java @@ -73,6 +73,41 @@ public FMSException(Throwable throwable) { super(throwable); this.throwable = throwable; } + + /** + * Constructor FMSException + * + * @param errorList the list of errors + * @param intuit_tid the transaction id + */ + public FMSException(List errorList, String intuit_tid) { + super(getString(errorList)); + this.errorList = errorList; + this.intuit_tid = intuit_tid; + } + + /** + * Constructor FMSException + * + * @param errorMessage the error message + * @param intuit_tid the transaction id + */ + public FMSException(String errorMessage, String intuit_tid) { + super(errorMessage); + this.intuit_tid = intuit_tid; + } + + /** + * Constructor FMSException + * + * @param throwable the throwable + * @param intuit_tid the transaction id + */ + public FMSException(Throwable throwable, String intuit_tid) { + super(throwable); + this.throwable = throwable; + this.intuit_tid = intuit_tid; + } /** * Constructor FMSException diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/InternalServiceException.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/InternalServiceException.java index a88d01e3..1c68d013 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/InternalServiceException.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/InternalServiceException.java @@ -66,4 +66,15 @@ public InternalServiceException(Throwable throwable) { public InternalServiceException(String errorMessage, Throwable throwable) { super(errorMessage, throwable); } + + /** + * Constructor for InternalServiceException + * + * @param errorMessage the error message + * @param throwable the throwable + * @param intuit_tid the transaction id + */ + public InternalServiceException(String errorMessage, Throwable throwable, String intuit_tid) { + super(errorMessage, throwable, intuit_tid); + } } diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/InvalidRequestException.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/InvalidRequestException.java index 74174e20..ff81608c 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/InvalidRequestException.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/InvalidRequestException.java @@ -66,4 +66,15 @@ public InvalidRequestException(Throwable throwable) { public InvalidRequestException(String errorMessage, Throwable throwable) { super(errorMessage, throwable); } + + /** + * Constructor InvalidRequestException + * + * @param errorMessage the error message + * @param throwable the throwable + * @param intuit_tid the transaction id + */ + public InvalidRequestException(String errorMessage, Throwable throwable, String intuit_tid) { + super(errorMessage, throwable, intuit_tid); + } } diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/InvalidTokenException.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/InvalidTokenException.java index a41ca3d5..4af6320b 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/InvalidTokenException.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/InvalidTokenException.java @@ -66,4 +66,15 @@ public InvalidTokenException(Throwable throwable) { public InvalidTokenException(String errorMessage, Throwable throwable) { super(errorMessage, throwable); } + + /** + * Constructor InvalidTokenException + * + * @param errorMessage the error message + * @param throwable the throwable + * @param intuit_tid the transaction id + */ + public InvalidTokenException(String errorMessage, Throwable throwable, String intuit_tid) { + super(errorMessage, throwable, intuit_tid); + } } diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/SerializationException.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/SerializationException.java index ec528348..e328a804 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/SerializationException.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/SerializationException.java @@ -53,4 +53,15 @@ public SerializationException(Throwable throwable) { public SerializationException(String errorMessage, Throwable throwable) { super(errorMessage, throwable); } + + /** + * Constructor SerializationException + * + * @param errorMessage the error message + * @param throwable the throwable + * @param intuit_tid the transaction id + */ + public SerializationException(String errorMessage, Throwable throwable, String intuit_tid) { + super(errorMessage, throwable, intuit_tid); + } } diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/ServiceException.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/ServiceException.java index 705e66aa..e014b3dd 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/ServiceException.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/ServiceException.java @@ -66,5 +66,16 @@ public ServiceException(Throwable throwable) { public ServiceException(String errorMessage, Throwable throwable) { super(errorMessage, throwable); } + + /** + * Constructor ServiceException + * + * @param errorMessage the error message + * @param throwable the throwable + * @param intuit_tid the transaction id + */ + public ServiceException(String errorMessage, Throwable throwable, String intuit_tid) { + super(errorMessage, throwable, intuit_tid); + } } diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/ServiceUnavailableException.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/ServiceUnavailableException.java index c6503ae2..5a4d2069 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/ServiceUnavailableException.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/ServiceUnavailableException.java @@ -66,4 +66,15 @@ public ServiceUnavailableException(Throwable throwable) { public ServiceUnavailableException(String errorMessage, Throwable throwable) { super(errorMessage, throwable); } + + /** + * Constructor ServiceUnavailableException + * + * @param errorMessage the error message + * @param throwable the throwable + * @param intuit_tid the transaction id + */ + public ServiceUnavailableException(String errorMessage, Throwable throwable, String intuit_tid) { + super(errorMessage, throwable, intuit_tid); + } } diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/ValidationException.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/ValidationException.java index 37639e95..46169854 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/ValidationException.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/exception/ValidationException.java @@ -66,5 +66,16 @@ public ValidationException(Throwable throwable) { public ValidationException(String errorMessage, Throwable throwable) { super(errorMessage, throwable); } + + /** + * Constructor ValidationException + * + * @param errorMessage the error message + * @param throwable the throwable + * @param intuit_tid the transaction id + */ + public ValidationException(String errorMessage, Throwable throwable, String intuit_tid) { + super(errorMessage, throwable, intuit_tid); + } } diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/CallbackHandlerInterceptor.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/CallbackHandlerInterceptor.java index 97dc0207..bba82a8e 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/CallbackHandlerInterceptor.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/CallbackHandlerInterceptor.java @@ -143,7 +143,7 @@ public void execute(IntuitMessage intuitMessage) throws FMSException { } } else if (isDownload(intuitMessage.getRequestElements().getAction())) { LOG.debug("CallbackHandlerInterceptor setting downloadedFile..."); - callbackMessage.setDownloadedFile(getDownloadedFile(intuitMessage.getResponseElements().getDecompressedData())); + callbackMessage.setDownloadedFile(getDownloadedFile(intuitMessage.getResponseElements().getDecompressedData(), intuitMessage.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_INTUIT_TID))); } else if (isDownloadPDF(intuitMessage.getRequestElements().getRequestParameters())) { LOG.debug("CallbackHandlerInterceptor setting binary content for PDF..."); callbackMessage.setDownloadedFile(intuitMessage.getResponseElements().getResponseBytes()); @@ -303,16 +303,17 @@ private boolean isDownloadPDF(Map requestHeaders) { * Method to get the input stream from the download URL returned from service * * @param response the download URL string + * @param intuit_tid * @return InputStream the downloaded file * @throws FMSException */ - private InputStream getDownloadedFile(String response) throws FMSException { + private InputStream getDownloadedFile(String response, String intuit_tid) throws FMSException { if (response != null) { try { URL url = new URL(response); return url.openStream(); } catch (Exception e) { - throw new FMSException("Exception while downloading the file from URL.", e); + throw new FMSException("Exception while downloading the file from URL.", e, intuit_tid); } } diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/DecompressionInterceptor.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/DecompressionInterceptor.java index ab577fed..1db6bf34 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/DecompressionInterceptor.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/DecompressionInterceptor.java @@ -68,10 +68,10 @@ public void execute(IntuitMessage intuitMessage) throws FMSException { decompressedData = new String(bytes.toByteArray()); } catch (IllegalStateException e) { LOG.error("IllegalStateException while get the content from HttpResponse.", e); - throw new FMSException(e); + throw new FMSException(e, intuitMessage.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_INTUIT_TID)); } catch (Exception e) { LOG.error("IOException in DecompressInterceptor.", e); - throw new FMSException(e); + throw new FMSException(e, intuitMessage.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_INTUIT_TID)); } } } @@ -90,10 +90,10 @@ public void execute(IntuitMessage intuitMessage) throws FMSException { } } catch (IllegalStateException e) { LOG.error("IllegalStateException while get the content from HttpResponse.", e); - throw new FMSException(e); + throw new FMSException(e, intuitMessage.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_INTUIT_TID)); } catch (Exception e) { LOG.error("IOException in DecompressInterceptor.", e); - throw new FMSException(e); + throw new FMSException(e, intuitMessage.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_INTUIT_TID)); } finally { if (br != null) { try { diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/DeserializeInterceptor.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/DeserializeInterceptor.java index f14afd59..3b12f037 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/DeserializeInterceptor.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/DeserializeInterceptor.java @@ -86,7 +86,7 @@ public void execute(IntuitMessage intuitMessage) throws FMSException { LOG.info("Invalid Content Type" + serializeFormat); LOG.debug("Decompressed Data" + responseElements.getDecompressedData()); LOG.error("Decompressed Data" + responseElements.getDecompressedData()); - throw new FMSException(responseElements.getDecompressedData()); + throw new FMSException(responseElements.getDecompressedData(), intuitMessage.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_INTUIT_TID)); } } diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HTTPClientConnectionInterceptor.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HTTPClientConnectionInterceptor.java index 3cd5949a..0e8d0e77 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HTTPClientConnectionInterceptor.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HTTPClientConnectionInterceptor.java @@ -115,7 +115,7 @@ public void execute(IntuitMessage intuitMessage) throws FMSException { try { uri = new URI(intuitRequest.getRequestParameters().get(RequestElements.REQ_PARAM_RESOURCE_URL)); } catch (URISyntaxException e) { - throw new FMSException("URISyntaxException", e); + throw new FMSException("URISyntaxException", e, intuitMessage.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_INTUIT_TID)); } String methodtype = intuitRequest.getRequestParameters().get(RequestElements.REQ_PARAM_METHOD_TYPE); @@ -136,7 +136,7 @@ public void execute(IntuitMessage intuitMessage) throws FMSException { try { entity = new StringEntity(intuitRequest.getPostString()); } catch (UnsupportedEncodingException e) { - throw new FMSException("UnsupportedEncodingException", e); + throw new FMSException("UnsupportedEncodingException", e, intuitMessage.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_INTUIT_TID)); } ((HttpPost) httpRequest).setEntity(entity); } @@ -163,7 +163,7 @@ public void execute(IntuitMessage intuitMessage) throws FMSException { } catch (ClientProtocolException e) { throw new ConfigurationException("Error in Http Protocol definition", e); } catch (IOException e) { - throw new FMSException(e); + throw new FMSException(e, intuitMessage.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_INTUIT_TID)); } finally { if (httpResponse != null) { try { @@ -365,10 +365,10 @@ private void setResponseElements(IntuitMessage intuitMessage, HttpResponse httpR responseElements.setResponseContent(getCopyOfResponseContent(httpResponse.getEntity().getContent())); } catch (IllegalStateException e) { LOG.error("IllegalStateException while get the content from HttpRespose.", e); - throw new FMSException(e); + throw new FMSException(e, intuitMessage.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_INTUIT_TID)); } catch (Exception e) { LOG.error("IOException in HTTPClientConnectionInterceptor while reading the entity from HttpResponse.", e); - throw new FMSException(e); + throw new FMSException(e, intuitMessage.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_INTUIT_TID)); } } diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HTTPURLConnectionInterceptor.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HTTPURLConnectionInterceptor.java index 0f060989..005c16f6 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HTTPURLConnectionInterceptor.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HTTPURLConnectionInterceptor.java @@ -112,11 +112,11 @@ public void execute(IntuitMessage intuitMessage) throws FMSException { setResponseElements(intuitMessage, httpUrlConnection); } catch (URISyntaxException e) { - throw new FMSException("URISyntaxException", e); + throw new FMSException("URISyntaxException", e, intuitMessage.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_INTUIT_TID)); } catch (IOException e) { - throw new FMSException("IO Exception", e); + throw new FMSException("IO Exception", e, intuitMessage.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_INTUIT_TID)); } catch(Throwable e){ - throw new FMSException("Unexpected expection", e); + throw new FMSException("Unexpected expection", e, intuitMessage.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_INTUIT_TID)); } finally{ // Make sure to always disconnect. diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HandleResponseInterceptor.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HandleResponseInterceptor.java index 70c1591f..e1f825dd 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HandleResponseInterceptor.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HandleResponseInterceptor.java @@ -120,7 +120,7 @@ public void execute(IntuitMessage intuitMessage) throws FMSException { throw new AuthorizationException(fault.getError()); } else { //not able to recognize the type of exception - throw new FMSException(fault.getError()); + throw new FMSException(fault.getError(), intuitMessage.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_INTUIT_TID)); } } else if (intuitResponse == null) { //intuitResponse is null means that message received contains error as message