com.ibm.xdms.exception.sip
Class SipException

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
                  extended by com.ibm.xdms.exception.sip.SipException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BadEventException, BadRequestException, DocumentNotFoundException, IntervalTooBriefException, UnauthorizedException

public class SipException
extends XdmsException

Top level SIP Exception class

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
           
protected static java.util.logging.Logger LOGGER
          Logger
protected  int statusCode
          SIP Status Code
protected  java.lang.String subcriptionState
          The SIP Subscription State *
 
Fields inherited from class com.ibm.xdms.exception.XdmsException
hasSetResponse
 
Constructor Summary
SipException(int statusCode, java.lang.String subcriptionState)
          Constructor for setting the status code only
SipException(int statusCode, java.lang.String subcriptionState, java.lang.String message)
          Constructs a new SIP exception with the specified message
SipException(int statusCode, java.lang.String subcriptionState, java.lang.String message, java.lang.Throwable rootCause)
          Constructs a new SIP 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
SipException(int statusCode, java.lang.String subcriptionState, java.lang.Throwable rootCause)
          Constructs a new SIP 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
 int getStatusCode()
          Returns the HTTP status code
 java.lang.String getSubcriptionState()
          Returns the subscription state used for a SIP NOTIFY request
 void setupResponse(ApplicationUsage appUsage, javax.servlet.sip.SipServletRequest req, javax.servlet.sip.SipServletResponse resp)
          Sets up the response based on the XdmsException
 
Methods inherited from class com.ibm.xdms.exception.XdmsException
createLocalizedMessage, createLocalizedXdmsException, createServerMessage, createServerXdmsException, setupResponse
 
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

COPYRIGHT

public static final java.lang.String COPYRIGHT

statusCode

protected int statusCode
SIP Status Code


subcriptionState

protected java.lang.String subcriptionState
The SIP Subscription State *


LOGGER

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

Constructor Detail

SipException

public SipException(int statusCode,
                    java.lang.String subcriptionState)
Constructor for setting the status code only

Parameters:
statusCode - The SIP status code which should be return in the response
subcriptionState - The subscription state for a SIP NOTIFY

SipException

public SipException(int statusCode,
                    java.lang.String subcriptionState,
                    java.lang.String message)
Constructs a new SIP exception with the specified message

Parameters:
statusCode - The SIP status code which should be return in the response
subcriptionState - The subscription state for a SIP NOTIFY
message - a String specifying the text of the exception message

SipException

public SipException(int statusCode,
                    java.lang.String subcriptionState,
                    java.lang.String message,
                    java.lang.Throwable rootCause)
Constructs a new SIP 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:
statusCode - The SIP status code which should be return in the response
subcriptionState - The subscription state for a SIP NOTIFY
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

SipException

public SipException(int statusCode,
                    java.lang.String subcriptionState,
                    java.lang.Throwable rootCause)
Constructs a new SIP 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:
statusCode - The SIP status code which should be return in the response
subcriptionState - The subscription state for a SIP NOTIFY
rootCause - the Throwable exception that interfered with the XDMS's normal operation, making this XDMS exception necessary
Method Detail

getStatusCode

public int getStatusCode()
Returns the HTTP status code

Returns:
HTTP status code

getSubcriptionState

public java.lang.String getSubcriptionState()
Returns the subscription state used for a SIP NOTIFY request

Returns:
Returns the subscription state used for a SIP NOTIFY request

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

Overrides:
setupResponse in class XdmsException
Parameters:
appUsage - ApplicationUsage
req - SipServletRequest
resp - SipServletResponse
Throws:
java.io.IOException