com.ibm.commerce.foundation.common.exception

Class AbstractApplicationException

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • com.ibm.commerce.foundation.common.exception.AbstractApplicationException
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.util.logging.Level DEFAULT_SEVERITY
      The default severity to use when logging exceptions.
      static java.lang.String EMPTY_MSG
      Constant representing an empty message.
    • Constructor Summary

      Constructors 
      Constructor and Description
      AbstractApplicationException()
      Default Constructor
      AbstractApplicationException(java.lang.String astrMessage)
      Creates the ApplicationException.
      AbstractApplicationException(java.lang.String astrMessageKey, java.lang.Object[] aParams, java.lang.String astrClassName, java.lang.String astrMethodName)
      Creates the ApplicationException.
      AbstractApplicationException(java.lang.String astrMessageKey, java.lang.Object[] aParams, java.lang.String aResourceBundle, java.lang.String astrClassName, java.lang.String astrMethodName, java.lang.Throwable aCause)
      Creates the ApplicationException.
      AbstractApplicationException(java.lang.String astrMessageKey, java.lang.Object[] aParams, java.lang.String astrClassName, java.lang.String astrMethodName, java.lang.Throwable aCause)
      Creates the ApplicationException.
      AbstractApplicationException(java.lang.String astrMessage, java.lang.String astrClassName, java.lang.String astrMethodName)
      Creates the ApplicationException.
      AbstractApplicationException(java.lang.String astrMessageKey, java.lang.String aLocalizedMsg, java.lang.String aErrorCode, java.lang.Object[] aParams, java.lang.String aResourceBundle, java.lang.String astrClassName, java.lang.String astrMethodName, java.lang.Throwable aCause)
      Creates the ApplicationException.
      AbstractApplicationException(java.lang.String astrMessage, java.lang.String astrClassName, java.lang.String astrMethodName, java.lang.Throwable aCause)
      Creates the ApplicationException.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addApplicationError(ApplicationError applicationError)
      This method adds an application error to the application exception.
      void addApplicationError(java.util.List applicationErrors)
      This method adds a list of application errors to the application exception.
      java.util.List getApplicationErrors()
      Returns the application errors
      java.lang.String getCorrelationId()
      Get the correlation Id for this exception The correlation Id for this exception.
      java.lang.String getErrorCode()
      Get a error code of this Throwable.
      java.lang.String getLocalizedMessage()
      Get a localized description of this Throwable.
      java.lang.String getLocalizedMessage(java.util.Locale aLocale)
      Get the exception message localized to a different locale.
      java.lang.String getMessage()
      Returns the error message string of this throwable object.
      java.lang.String getMessageKey()
      Return the message key.
      java.lang.Object[] getMessageParams()
      Return the message parameters.
      • Methods inherited from class java.lang.Throwable

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

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DEFAULT_SEVERITY

        public static final java.util.logging.Level DEFAULT_SEVERITY
        The default severity to use when logging exceptions.
      • EMPTY_MSG

        public static final java.lang.String EMPTY_MSG
        Constant representing an empty message.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractApplicationException

        public AbstractApplicationException()
        Default Constructor
      • AbstractApplicationException

        public AbstractApplicationException(java.lang.String astrMessage)
        Creates the ApplicationException.
        Parameters:
        astrMessage - The message or message key of the exception.
      • AbstractApplicationException

        public AbstractApplicationException(java.lang.String astrMessage,
                                            java.lang.String astrClassName,
                                            java.lang.String astrMethodName)
        Creates the ApplicationException.
        Parameters:
        astrMessage - The message or message key of the exception.
        astrClassName - The name of the class throwing the exception.
        astrMethodName - The name of the method throwing the exception.
      • AbstractApplicationException

        public AbstractApplicationException(java.lang.String astrMessageKey,
                                            java.lang.Object[] aParams,
                                            java.lang.String astrClassName,
                                            java.lang.String astrMethodName)
        Creates the ApplicationException.
        Parameters:
        astrMessageKey - The message key of the exception.
        aParams - The parameters used for the message key of the exception.
        astrClassName - The name of the class throwing the exception.
        astrMethodName - The name of the method throwing the exception.
      • AbstractApplicationException

        public AbstractApplicationException(java.lang.String astrMessage,
                                            java.lang.String astrClassName,
                                            java.lang.String astrMethodName,
                                            java.lang.Throwable aCause)
        Creates the ApplicationException.
        Parameters:
        astrMessage - The cause of the exception.
        astrClassName - The name of the class throwing the exception.
        astrMethodName - The name of the method throwing the exception.
        aCause - The cause of the exception.
      • AbstractApplicationException

        public AbstractApplicationException(java.lang.String astrMessageKey,
                                            java.lang.Object[] aParams,
                                            java.lang.String astrClassName,
                                            java.lang.String astrMethodName,
                                            java.lang.Throwable aCause)
        Creates the ApplicationException.
        Parameters:
        astrMessageKey - The message key of the exception.
        aParams - The parameters used for the message key of the exception.
        astrClassName - The name of the class throwing the exception.
        astrMethodName - The name of the method throwing the exception.
        aCause - The cause of the exception.
      • AbstractApplicationException

        public AbstractApplicationException(java.lang.String astrMessageKey,
                                            java.lang.Object[] aParams,
                                            java.lang.String aResourceBundle,
                                            java.lang.String astrClassName,
                                            java.lang.String astrMethodName,
                                            java.lang.Throwable aCause)
        Creates the ApplicationException.
        Parameters:
        astrMessageKey - The message key of the exception.
        aParams - The parameters used for the message key of the exception.
        aResourceBundle - The resource bundle associated with the message key
        astrClassName - The name of the class throwing the exception.
        astrMethodName - The name of the method throwing the exception.
        aCause - The cause of the exception.
      • AbstractApplicationException

        public AbstractApplicationException(java.lang.String astrMessageKey,
                                            java.lang.String aLocalizedMsg,
                                            java.lang.String aErrorCode,
                                            java.lang.Object[] aParams,
                                            java.lang.String aResourceBundle,
                                            java.lang.String astrClassName,
                                            java.lang.String astrMethodName,
                                            java.lang.Throwable aCause)
        Creates the ApplicationException.
        Parameters:
        astrMessageKey - The message key of the exception.
        aLocalizedMsg - The localised message of the exception.
        aErrorCode - The error code of the exception.
        aParams - The parameters used for the message key of the exception.
        aResourceBundle - The resource bundle associated with the message key
        astrClassName - The name of the class throwing the exception.
        astrMethodName - The name of the method throwing the exception.
        aCause - The cause of the exception.
    • Method Detail

      • getLocalizedMessage

        public java.lang.String getLocalizedMessage()
        Get a localized description of this Throwable. Return the preset value of localized message when initialize this object If it is not pre-set, returns the same result as getMessage().
        Overrides:
        getLocalizedMessage in class java.lang.Throwable
        Returns:
        java.lang.String
      • getErrorCode

        public java.lang.String getErrorCode()
        Get a error code of this Throwable.
        Returns:
        java.lang.String error code of this Throwable.
      • getLocalizedMessage

        public java.lang.String getLocalizedMessage(java.util.Locale aLocale)
        Get the exception message localized to a different locale.
        Parameters:
        aLocale - The locale for which the message should be returned
        Returns:
        The localized message; returns the message key if the resource bundle for the specified locale cannot be located
      • getMessage

        public java.lang.String getMessage()
        Returns the error message string of this throwable object.
        Overrides:
        getMessage in class java.lang.Throwable
        Returns:
        the error message string of this Throwable object if it was created with an error message string; or the message key if the resource bundle for the default locale cannot be found. Null is returned if the exception was created with no error message key.
      • getMessageKey

        public java.lang.String getMessageKey()
        Return the message key.
        Returns:
        the exception message key.
      • getMessageParams

        public java.lang.Object[] getMessageParams()
        Return the message parameters.
        Returns:
        the exception message parameters.
      • getCorrelationId

        public java.lang.String getCorrelationId()
        Get the correlation Id for this exception The correlation Id for this exception. When a system exception is thrown, the message will be transformed to a more generic message for response to the client. A uniquely generated correlation Id will be used to associate the exception on the client side with an error message in the server log.
        Returns:
        the correlation Id for this exception.
      • addApplicationError

        public void addApplicationError(ApplicationError applicationError)
        This method adds an application error to the application exception.
        Parameters:
        applicationError - The application error.
      • addApplicationError

        public void addApplicationError(java.util.List applicationErrors)
        This method adds a list of application errors to the application exception.
        Parameters:
        applicationErrors - The application errors.
      • getApplicationErrors

        public java.util.List getApplicationErrors()
        Returns the application errors
        Returns:
        the application errors