Class TException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.cdlib.mrt.utility.TException
All Implemented Interfaces:
Serializable, StateInf
Direct Known Subclasses:
TException.CONCURRENT_UPDATE, TException.EXTERNAL_SERVICE_UNAVAILABLE, TException.FIXITY_CHECK_FAILS, TException.GATEWAY_TIMEOUT, TException.GENERAL_EXCEPTION, TException.INVALID_ARCHITECTURE, TException.INVALID_CONFIGURATION, TException.INVALID_DATA_FORMAT, TException.INVALID_OR_MISSING_PARM, TException.LOCKING_ERROR, TException.NEARLINE_RESTORE_IN_PROCESS, TException.REMOTE_IO_SERVICE_EXCEPTION, TException.REQUEST_ELEMENT_UNSUPPORTED, TException.REQUEST_INVALID, TException.REQUEST_ITEM_EXISTS, TException.REQUESTED_ITEM_NOT_FOUND, TException.SQL_EXCEPTION, TException.UNIMPLEMENTED_CODE, TException.USER_NOT_AUTHENTICATED, TException.USER_NOT_AUTHORIZED

public class TException extends Exception implements StateInf
mrt Exception
Author:
dloy
See Also:
  • Field Details

  • Constructor Details

    • TException

      public TException(Exception ex)
      Degenerate case - where only an exceptin is provided. This defaults to a GENERAL_EXCEPTION status
      Parameters:
      ex - remote exception to be saved
    • TException

      public TException(TExceptionEnum status, Exception ex)
      The constructor set the status code and no message
      Parameters:
      status - - the int status code associated with this exception
      ex - remote exception to be saved
    • TException

      public TException(TExceptionEnum status, String msg)
      This constuctor sets the message and status code associated with this exception.
      Parameters:
      status - - the int status code
      msg - - the String message
    • TException

      public TException(TExceptionEnum status, String msg, Exception ex)
      The constructor set the status code and no message
      Parameters:
      status - - the int status code associated with this exception
      msg - - the String message
      ex - remote exception to be saved
  • Method Details

    • setTException

      protected void setTException(TExceptionEnum status, String msg, Exception ex)
      Set exception content based on whether a message or remote exception was provided. If a remote exception is also a TException then the value of the original TException is saved.
      Parameters:
      status - the int status code associated with this exception
      msg - the String message
      ex - remote exception to be saved
    • getStatus

      public TExceptionEnum getStatus()
      return the status code
    • getRemoteException

      public Exception getRemoteException()
      Return any remote exception stored as part of creating TException
      Returns:
      remote exception
    • getClassName

      public String getClassName()
      Return name of class where this exception occurred
      Returns:
      exception originating exception
    • getMethodName

      public String getMethodName()
      Return name of method where exception occurred
      Returns:
      originating name of method for this exception
    • getLineNumber

      public int getLineNumber()
      program code line number for this exception
      Returns:
      program line number
    • getStatusName

      public String getStatusName()
      value of status
    • getStatusDescription

      public String getStatusDescription()
      return the status description
    • getHTTPResponse

      public int getHTTPResponse()
      return the status description
    • getError

      public String getError()
      return the description
    • getTrace

      public String getTrace()
      return the stack trace
    • getLocation

      public String getLocation()
      location of exception
      Returns:
      exception location
    • toString

      public String toString()
      toString returns this exception as a string
      Overrides:
      toString in class Throwable
      Returns:
      the status and message
    • getDescription

      public static String getDescription(TExceptionEnum mnemonic)
      get a String message associated with an integer mnemonic code
      Parameters:
      int - mnemonic integer associated with exception
      Returns:
      String message from messages Hashtable
    • getDescription

      public String getDescription()
      get a String message associated with the MExceptionEnum.-- non-static version
      Returns:
      String message from messages Hashtable
    • setDetail

      public void setDetail(String detail)
      set the String detail message to give more information on an error
      Parameters:
      String - detail message
    • getDetail

      public String getDetail()
      get the String detail message, more information on an error
      Returns:
      String detail message
    • dump

      public String dump(String header)
    • getAccessExcp

      public String getAccessExcp()