Class PubServerException

    • Constructor Summary

      Constructors 
      Constructor Description
      PubServerException()  
      PubServerException​(java.lang.Object caller, int errorCode, java.lang.String message, java.lang.Throwable cause, java.lang.String... parameters)
      Create a basic publishing server exception.
      PubServerException​(java.lang.String message, java.lang.Throwable cause, int errorCode, java.lang.Object caller)
      Instantiates a new Pub server exception with no parameters.
      PubServerException​(java.lang.String message, java.lang.Throwable cause, int errorCode, java.lang.Object caller, java.lang.String... parameters)
      Instantiates a new Pub server exception.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getCode()
      Get error code.
      ErrorCodeInfo getErrorCodeInfo()
      This methods returns ErrorCodeInfo object.
      java.util.List<ErrorStackInfo> getErrorsStack()
      This method returns list of ErrorStackInfo, the list is not filled automatically.
      java.util.List<java.lang.Throwable> getExceptionsStack​(java.lang.Throwable exception)
      Returns list of exceptions from exceptions stack
      java.lang.String getFormattedMessage()
      Returns a formatted exception message for the exception.
      java.lang.String getFormattedMessageTrace()
      Returns a formatted exception message for the exception and all causes.
      java.util.List<java.lang.String> getMessageStack()
      Returns a List of Exception Messages following the cause chain to the initial exception and message from current exception
      java.lang.String getModule()
      Get module name that created this exception.
      java.lang.String[] getParameters()
      Get parameters string [ ] array.
      void retrieveErrorCodeInfo()
      Sets errorCodeInfo object
      void retrieveErrorsStack()
      Sets errorsStack list
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PubServerException

        public PubServerException()
      • PubServerException

        public PubServerException​(java.lang.Object caller,
                                  int errorCode,
                                  java.lang.String message,
                                  java.lang.Throwable cause,
                                  java.lang.String... parameters)
        Create a basic publishing server exception.
        Parameters:
        message - short textual error message, possibly containing some identifying object data
        cause - (optional) original exception leading to this one or null
        errorCode - some error specific code for support or 0. Error codes should be defined as public constants in the exception class derived from PubServerException.
        caller - Object that creates this exception. Object class name will be used as name of the module that created this exception. If caller is of type String the string itself will be used as module name (long strings might be truncated).
        parameters - the parameters
      • PubServerException

        public PubServerException​(java.lang.String message,
                                  java.lang.Throwable cause,
                                  int errorCode,
                                  java.lang.Object caller)
        Instantiates a new Pub server exception with no parameters.
        Parameters:
        message - the message
        cause - the cause
        errorCode - the error code
        caller - the caller
      • PubServerException

        public PubServerException​(java.lang.String message,
                                  java.lang.Throwable cause,
                                  int errorCode,
                                  java.lang.Object caller,
                                  java.lang.String... parameters)
        Instantiates a new Pub server exception.
        Parameters:
        message - the message
        cause - the cause
        errorCode - the error code
        caller - the caller
        parameters - the parameters
    • Method Detail

      • getCode

        public final int getCode()
        Get error code. Error codes should be defined as public constants in the exception class derived from PubServerException.
        Returns:
        code as integer.
      • getModule

        public final java.lang.String getModule()
        Get module name that created this exception. Name will be derived from caller argument of the exception constructor.
        Returns:
        module name
      • getFormattedMessage

        public final java.lang.String getFormattedMessage()
        Returns a formatted exception message for the exception. Like:
         MyPlugin:00201  Third Exception [hashCode=452800031]
         
        Returns:
        formatted exception message
      • getFormattedMessageTrace

        public final java.lang.String getFormattedMessageTrace()
        Returns a formatted exception message for the exception and all causes. Like:
         [1] MyPlugin1:00201  Third Exception [hashCode=452800031]
         [2] Exception:00000  Second Exception
         [3] MyPlugin2:00200  First Exception [hashCode=452800031]
         
        Returns:
        formatted exception message
      • getMessageStack

        public final java.util.List<java.lang.String> getMessageStack()
        Returns a List of Exception Messages following the cause chain to the initial exception and message from current exception
        Returns:
        message list
      • getExceptionsStack

        public java.util.List<java.lang.Throwable> getExceptionsStack​(java.lang.Throwable exception)
        Returns list of exceptions from exceptions stack
        Parameters:
        exception - from which we want to get stack of exceptions
        Returns:
        list of Throwable objects
      • getErrorsStack

        public java.util.List<ErrorStackInfo> getErrorsStack()
        This method returns list of ErrorStackInfo, the list is not filled automatically. To fill this list you need to call setErrorsStack() method manually.
        Returns:
      • retrieveErrorsStack

        public void retrieveErrorsStack()
        Sets errorsStack list
      • getErrorCodeInfo

        public ErrorCodeInfo getErrorCodeInfo()
        This methods returns ErrorCodeInfo object. This object is not filled automatically. To set this object you must call setErrorCodeInfo();
        Returns:
      • retrieveErrorCodeInfo

        public void retrieveErrorCodeInfo()
        Sets errorCodeInfo object
      • getParameters

        public java.lang.String[] getParameters()
        Get parameters string [ ] array.
        Returns:
        the string [ ]