com.ibm.xdms.exception
Class XdmsException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by javax.servlet.ServletException
              extended by com.ibm.xdms.exception.XdmsException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
SipException, XcapException

public class XdmsException
extends javax.servlet.ServletException

XDMS Exception Class

See Also:
Serialized Form

Field Summary
protected  boolean hasSetResponse
          Determines whether the response has been set with this exception *
protected static java.util.logging.Logger LOGGER
          Logger
 
Constructor Summary
XdmsException()
          Constructs a new XDMS exception
XdmsException(java.lang.String message)
          Constructs a new XDMS exception with the specified message
XdmsException(java.lang.String message, java.lang.Throwable rootCause)
          Constructs a new XDMS exception when the XDMS needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation, including a description message
XdmsException(java.lang.Throwable rootCause)
          Constructs a new XDMS exception when the XDMS needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation.
 
Method Summary
static java.lang.String createLocalizedMessage(java.lang.String messageKey, java.lang.Object[] params, java.lang.String resourceBundle)
          Creates a localized message.
static XdmsException createLocalizedXdmsException(java.lang.String messageKey, java.lang.Object[] params, java.lang.String resourceBundle, java.lang.Throwable rootCause)
          Creates an XdmsException with a localized message.
static java.lang.String createServerMessage(java.lang.String messageKey, java.lang.Object[] params, java.lang.String resourceBundle)
          Creates a localized message.
static XdmsException createServerXdmsException(java.lang.String messageKey, java.lang.Object[] params, java.lang.String resourceBundle, java.lang.Throwable rootCause)
          Creates an XdmsException with a localized message.
 void setupResponse(ApplicationUsage appUsage, javax.servlet.sip.SipServletRequest req, javax.servlet.sip.SipServletResponse resp)
          Sets up the response based on the XdmsException
 void setupResponse(XcapServerResponse xcapResponse)
          Sets up the response based on the XdmsException
 
Methods inherited from class javax.servlet.ServletException
getRootCause
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOGGER

protected static final java.util.logging.Logger LOGGER
Logger


hasSetResponse

protected boolean hasSetResponse
Determines whether the response has been set with this exception *

Constructor Detail

XdmsException

public XdmsException()
Constructs a new XDMS exception


XdmsException

public XdmsException(java.lang.String message)
Constructs a new XDMS exception with the specified message

Parameters:
message - a String specifying the text of the exception message

XdmsException

public XdmsException(java.lang.String message,
                     java.lang.Throwable rootCause)
Constructs a new XDMS exception when the XDMS needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation, including a description message

Parameters:
message - a String specifying the text of the exception message
rootCause - the Throwable exception that interfered with the XDMS's normal operation, making this XDMS exception necessary

XdmsException

public XdmsException(java.lang.Throwable rootCause)
Constructs a new XDMS exception when the XDMS needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation. The exception's message is based on the localized message of the underlying exception.
This method calls the getLocalizedMessage method on the Throwable exception to get a localized exception message.

Parameters:
rootCause - the Throwable exception that interfered with the XDMS's normal operation, making this XDMS exception necessary
Method Detail

createLocalizedXdmsException

public static XdmsException createLocalizedXdmsException(java.lang.String messageKey,
                                                         java.lang.Object[] params,
                                                         java.lang.String resourceBundle,
                                                         java.lang.Throwable rootCause)
Creates an XdmsException with a localized message. This method will construct the XdmsException using the following method if a root cause is available:

XdmsException(String message, Throwable rootCause)

This method will use the following method if the rootCause is null:

XdmsException(String message)

Parameters:
messageKey - Message Key for the message in the resource bundle
params - Optional array of parameters, pass null if there are none
resourceBundle - Resource Bundle to retreive the message from
rootCause - the Throwable exception that interfered with the XDMS's normal operation, making this XDMS exception necessary
Returns:
XdmsExeption with the localized message
See Also:
XdmsException(String, Throwable), XdmsException(String)

createLocalizedMessage

public static java.lang.String createLocalizedMessage(java.lang.String messageKey,
                                                      java.lang.Object[] params,
                                                      java.lang.String resourceBundle)
Creates a localized message. This method will construct the localized message based on the parameters below

Parameters:
messageKey - Message Key for the message in the resource bundle
params - Optional array of parameters, pass null if there are none
resourceBundle - Resource Bundle to retreive the message from
Returns:
String with the localized message

createServerXdmsException

public static XdmsException createServerXdmsException(java.lang.String messageKey,
                                                      java.lang.Object[] params,
                                                      java.lang.String resourceBundle,
                                                      java.lang.Throwable rootCause)
Creates an XdmsException with a localized message. This method will construct the XdmsException using the following method if a root cause is available:

XdmsException(String message, Throwable rootCause)

This method will use the following method if the rootCause is null:

XdmsException(String message)

Parameters:
messageKey - Message Key for the message in the resource bundle
params - Optional array of parameters, pass null if there are none
resourceBundle - Resource Bundle to retreive the message from
rootCause - the Throwable exception that interfered with the XDMS's normal operation, making this XDMS exception necessary
Returns:
XdmsExeption with the localized message
See Also:
XdmsException(String, Throwable), XdmsException(String)

createServerMessage

public static java.lang.String createServerMessage(java.lang.String messageKey,
                                                   java.lang.Object[] params,
                                                   java.lang.String resourceBundle)
Creates a localized message. This method will construct the localized message based on the parameters below

Parameters:
messageKey - Message Key for the message in the resource bundle
params - Optional array of parameters, pass null if there are none
resourceBundle - Resource Bundle to retreive the message from
Returns:
String with the localized message

setupResponse

public void setupResponse(XcapServerResponse xcapResponse)
                   throws java.io.IOException
Sets up the response based on the XdmsException

Parameters:
xcapResponse - XcapServerResponse
Throws:
java.io.IOException

setupResponse

public void setupResponse(ApplicationUsage appUsage,
                          javax.servlet.sip.SipServletRequest req,
                          javax.servlet.sip.SipServletResponse resp)
                   throws java.io.IOException
Sets up the response based on the XdmsException

Parameters:
appUsage - The ApplicationUsage
req - The SipServletRequest
resp - The SipServletResponse
Throws:
java.io.IOException