atg.rest
Class RestException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by atg.rest.RestException
All Implemented Interfaces:
java.io.Serializable

public class RestException
extends java.lang.Exception

The base RestException class. Note that all RestExceptions require that a servlet response status code be supplied in order to appropriately set the status on the response object. The error code must be an http status code from the HttpServletResponse object.

See Also:
Exception, Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
RestException(java.util.List<java.lang.Throwable> pCauses, javax.servlet.http.HttpServletResponse pResponse, int pErrorCode)
          A constructor which takes a List of source exceptions, response object and error code.
RestException(java.lang.String pMessage, javax.servlet.http.HttpServletResponse pResponse, int pErrorCode)
          A constructor which takes a message, response object and error code.
RestException(java.lang.String pMessage, java.util.List<java.lang.Throwable> pCauses, javax.servlet.http.HttpServletResponse pResponse, int pErrorCode)
          A constructor which takes a message, a List of source exceptions, response object and error code.
RestException(java.lang.String pMessage, java.lang.Throwable pCause, javax.servlet.http.HttpServletResponse pResponse, int pErrorCode)
          A constructor which takes a source exception, response object and error code.
RestException(java.lang.Throwable pCause, javax.servlet.http.HttpServletResponse pResponse, int pErrorCode)
          A constructor which takes a source exception, response object and error code.
 
Method Summary
 java.util.List<java.lang.Throwable> getCauses()
          Returns a List of exceptions which caused the RestException
 int getErrorCode()
          Returns the error code that was set into the response object for this exception.
 void setCauses(java.util.List<java.lang.Throwable> pCauses)
          Sets the causes property.
 void setErrorCode(int pErrorCode)
          Sets the error code that was set into the response object for this exception
 
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

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

RestException

public RestException(java.lang.String pMessage,
                     javax.servlet.http.HttpServletResponse pResponse,
                     int pErrorCode)
A constructor which takes a message, response object and error code.

Parameters:
pMessage - an error message describing the REST exception.
pResponse - the servlet response object
pErrorCode - an error code to set into the response object. This should be one of the error codes defined in javax.servlet.http.HttpServletResponse.
See Also:
HttpServletResponse

RestException

public RestException(java.lang.Throwable pCause,
                     javax.servlet.http.HttpServletResponse pResponse,
                     int pErrorCode)
A constructor which takes a source exception, response object and error code.

Parameters:
pCause - the source exception
pResponse - the servlet response object
pErrorCode - an error code to set into the response object. This should be one of the error codes defined in javax.servlet.http.HttpServletResponse.
See Also:
HttpServletResponse

RestException

public RestException(java.lang.String pMessage,
                     java.lang.Throwable pCause,
                     javax.servlet.http.HttpServletResponse pResponse,
                     int pErrorCode)
A constructor which takes a source exception, response object and error code.

Parameters:
pMessage - an error message describing the REST exception.
pCause - the source exception
pResponse - the servlet response object
pErrorCode - an error code to set into the response object. This should be one of the error codes defined in javax.servlet.http.HttpServletResponse.
See Also:
HttpServletResponse

RestException

public RestException(java.util.List<java.lang.Throwable> pCauses,
                     javax.servlet.http.HttpServletResponse pResponse,
                     int pErrorCode)
A constructor which takes a List of source exceptions, response object and error code.

Parameters:
pCauses - a List of source exceptions
pResponse - the servlet response object
pErrorCode - an error code to set into the response object. This should be one of the error codes defined in javax.servlet.http.HttpServletResponse.
See Also:
HttpServletResponse

RestException

public RestException(java.lang.String pMessage,
                     java.util.List<java.lang.Throwable> pCauses,
                     javax.servlet.http.HttpServletResponse pResponse,
                     int pErrorCode)
A constructor which takes a message, a List of source exceptions, response object and error code.

Parameters:
pMessage - an error message describing the REST exception.
pCauses - a List of source exceptions
pResponse - the servlet response object
pErrorCode - an error code to set into the response object. This should be one of the error codes defined in javax.servlet.http.HttpServletResponse.
See Also:
HttpServletResponse
Method Detail

getErrorCode

public int getErrorCode()
Returns the error code that was set into the response object for this exception.

Returns:
the error code that was set into the response object for this exception

setErrorCode

public void setErrorCode(int pErrorCode)
Sets the error code that was set into the response object for this exception

Parameters:
pErrorCode - the error code that was set into the response object for this exception

getCauses

public java.util.List<java.lang.Throwable> getCauses()
Returns a List of exceptions which caused the RestException

Returns:
the value of causes. This is only used when a form handler contains more than one error.

setCauses

public void setCauses(java.util.List<java.lang.Throwable> pCauses)
Sets the causes property.

Parameters:
pCauses - the causes to set