com.softwareag.tamino.db.api.common
Class TAccessFailureException

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.common.TAccessFailureException
All Implemented Interfaces:
TAccessFailureMessage, java.io.Serializable

public class TAccessFailureException
extends TException
implements TAccessFailureMessage

TAccessFailureException represents a message that contains all the information provided by Tamino in case a specific access operation fails. This includes the return value, error code, message text and the message line. Each of these properties can be obtained by the appropiate access method.

Version:
$Revision: 1.20 $
Author:
Marcus Schreyer
See Also:
Serialized Form

Constructor Summary
TAccessFailureException(java.io.InputStream errorStream, java.util.Locale locale)
          Initializes the access failure message with the given error stream expecting a Tamino error response.
TAccessFailureException(java.util.Locale locale)
          Initialize the access failure exception with the given locale.
TAccessFailureException(java.lang.String returnValue, java.lang.String code, java.lang.String messageText, java.lang.String messageLine, java.util.Locale locale)
          Initializes the access failure message with the given return value, error code, message text and message line.
 
Method Summary
protected  org.w3c.dom.Element getAdditionalXMLMessageContent(org.w3c.dom.Document document)
          Gets an additional message content part.
 java.lang.String getCode()
          Gets the error code.
 java.lang.String getMessage()
          Returns the detail message of this TAccessFailureException.
 java.lang.String getMessageLine()
          Gets the message line.
 java.lang.String getMessageText()
          Gets the message text.
 java.lang.String getReturnValue()
          Gets the return value.
 boolean matchesReturnValue(java.lang.String returnValue)
          Indicates if the access failure message matches the given return value.
 boolean matchesReturnValue(java.lang.String startValue, java.lang.String endValue)
          Indicates if the access failure message matches a return value that lies in between the specified return value range including the startValue and the endValue.
 
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, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TAccessFailureException

public TAccessFailureException(java.lang.String returnValue,
                               java.lang.String code,
                               java.lang.String messageText,
                               java.lang.String messageLine,
                               java.util.Locale locale)
Initializes the access failure message with the given return value, error code, message text and message line.

Parameters:
returnValue - the return value.
code - the return code.
messageText - the message text.
messageLine - the message line.
locale - the locale.

TAccessFailureException

public TAccessFailureException(java.util.Locale locale)
Initialize the access failure exception with the given locale.

Parameters:
locale - the locale.

TAccessFailureException

public TAccessFailureException(java.io.InputStream errorStream,
                               java.util.Locale locale)
Initializes the access failure message with the given error stream expecting a Tamino error response.

Parameters:
errorStream - the error stream
locale - the locale.
Method Detail

getMessage

public java.lang.String getMessage()
Returns the detail message of this TAccessFailureException.

Overrides:
getMessage in class java.lang.Throwable
Returns:
the detail message string.

getReturnValue

public java.lang.String getReturnValue()
Gets the return value.

Specified by:
getReturnValue in interface TAccessFailureMessage
Returns:
the return value

getCode

public java.lang.String getCode()
Gets the error code.

Specified by:
getCode in interface TAccessFailureMessage
Returns:
the error code.

getMessageText

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

Specified by:
getMessageText in interface TAccessFailureMessage
Returns:
the message text.

getMessageLine

public java.lang.String getMessageLine()
Gets the message line.

Specified by:
getMessageLine in interface TAccessFailureMessage
Returns:
the message line.

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.

matchesReturnValue

public boolean matchesReturnValue(java.lang.String returnValue)
Indicates if the access failure message matches the given return value.

Specified by:
matchesReturnValue in interface TAccessFailureMessage
Parameters:
the - returnValue to match
Returns:
true if this.getReturnValue().equals( returnValue )

matchesReturnValue

public boolean matchesReturnValue(java.lang.String startValue,
                                  java.lang.String endValue)
Indicates if the access failure message matches a return value that lies in between the specified return value range including the startValue and the endValue.

Specified by:
matchesReturnValue in interface TAccessFailureMessage
Parameters:
startValue - the start for the return value range.
endValue - the end of the return value range.
Returns:
true if returnValue >= startValue and returnValue <= endValue else false.


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