com.softwareag.tamino.db.api.invocation.http
Class THTTPCommunicationException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.softwareag.tamino.db.api.common.TException
              extended by com.softwareag.tamino.db.api.invocation.TInvocationException
                  extended by com.softwareag.tamino.db.api.invocation.TCommunicationException
                      extended by com.softwareag.tamino.db.api.invocation.http.THTTPCommunicationException
All Implemented Interfaces:
java.io.Serializable

public class THTTPCommunicationException
extends TCommunicationException

THTTPCommunicationException represents a exception that contains the information provided by the HTTP communication protocoll.

Version:
$Revision: 1.3 $
Author:
Stefan Liebig
See Also:
Serialized Form

Constructor Summary
THTTPCommunicationException(int responseCode, java.lang.String messageText, java.lang.Exception cause, java.util.Locale locale)
          Initializes the invocation failure message with the given response code and message text.
THTTPCommunicationException(int responseCode, java.lang.String messageText, java.util.Locale locale)
          Initializes the invocation failure message with the given response code and message text.
THTTPCommunicationException(TResourceId resourceId, java.lang.Exception nestedException, java.util.Locale locale)
          Initializes a THTTPInvocationFailureException instance with a resource message and an internal nested exception.
THTTPCommunicationException(TResourceId resourceId, java.util.Locale locale)
          Initializes a THTTPInvocationFailureException instance with a resource message.
 
Method Summary
protected  org.w3c.dom.Element getAdditionalXMLMessageContent(org.w3c.dom.Document document)
          Gets an additional message content part.
 java.lang.String getMessageText()
          Gets the message text.
 int getReponseCode()
          Gets the response code.
 boolean matchesResponseCode(int matchValue)
          Indicates if the failure message matches the given response code.
 boolean matchesResponseCode(int startValue, int endValue)
          Indicates if the failure message matches a response code that lies in between the specified response code value range including the startValue and the endValue.
 
Methods inherited from class com.softwareag.tamino.db.api.invocation.TInvocationException
isRetryPossible, setNoRetryPossible, setRetryPossible
 
Methods inherited from class com.softwareag.tamino.db.api.common.TException
getAccessFailureException, getCause, getDeepestException, getDeepestTException, getExceptionMessage, getLocale, getMessageCode, getMessageContent, getNestedException, getResourceMessage, getRootCause, getRootTCause, getXMLMessage, getXMLMessage, hasAccessFailureException, hasCause, hasNestedException, printStackTrace, printStackTrace, printStackTrace, setLocale, toString, toXMLString
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

THTTPCommunicationException

public THTTPCommunicationException(int responseCode,
                                   java.lang.String messageText,
                                   java.util.Locale locale)
Initializes the invocation failure message with the given response code and message text.

Parameters:
responseCode - the HTTP response code.
messageText - the message text.

THTTPCommunicationException

public THTTPCommunicationException(int responseCode,
                                   java.lang.String messageText,
                                   java.lang.Exception cause,
                                   java.util.Locale locale)
Initializes the invocation failure message with the given response code and message text.

Parameters:
responseCode - the HTTP response code.
messageText - the message text.

THTTPCommunicationException

public THTTPCommunicationException(TResourceId resourceId,
                                   java.util.Locale locale)
Initializes a THTTPInvocationFailureException instance with a resource message.

Parameters:
resourceId - containing the message of this exception
See Also:
TResourceId

THTTPCommunicationException

public THTTPCommunicationException(TResourceId resourceId,
                                   java.lang.Exception nestedException,
                                   java.util.Locale locale)
Initializes a THTTPInvocationFailureException instance with a resource message and an internal nested exception.

Parameters:
resourceId - containing the message of this exception
nestedException - can be nested into a TException if it is given
See Also:
TResourceId
Method Detail

getReponseCode

public int getReponseCode()
Gets the response code.

Returns:
the response code.

getMessageText

public java.lang.String getMessageText()
Gets the message text.

Returns:
the message text.

matchesResponseCode

public boolean matchesResponseCode(int matchValue)
Indicates if the failure message matches the given response code.

Parameters:
the - matchValue the value to match
Returns:
true if this.getResponseCode() == matchValue )

matchesResponseCode

public boolean matchesResponseCode(int startValue,
                                   int endValue)
Indicates if the failure message matches a response code that lies in between the specified response code value range including the startValue and the endValue.

Parameters:
startValue - the start for the return value range.
endValue - the end of the return value range.
Returns:
true if responseCode >= startValue and responseCode <= endValue else false.

getAdditionalXMLMessageContent

protected org.w3c.dom.Element getAdditionalXMLMessageContent(org.w3c.dom.Document document)
Gets an additional message content part. Derived classes may put in some additional information. The output should contain a element named "additional" containing the additional elements.

Overrides:
getAdditionalXMLMessageContent in class TException
Returns:
the additional element.


Copyright (c) 2013 Software AG. All Rights Reserved.