com.ibm.commerce.foundation.common.exception

Class AbstractSystemException

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

      Fields 
      Modifier and Type Field and Description
      static java.lang.String EMPTY_MSG
      Constant representing an empty message.
    • Constructor Summary

      Constructors 
      Constructor and Description
      AbstractSystemException()
      Creates the SystemException with the generic error.
      AbstractSystemException(java.lang.String astrMessage)
      Creates the SystemException.
      AbstractSystemException(java.lang.String astrMessageKey, java.lang.Object[] aParams, java.lang.String astrClassName, java.lang.String astrMethodName)
      Creates the SystemException.
      AbstractSystemException(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 SystemException.
      AbstractSystemException(java.lang.String astrMessageKey, java.lang.Object[] aParams, java.lang.String astrClassName, java.lang.String astrMethodName, java.lang.Throwable aCause)
      Creates the SystemException.
      AbstractSystemException(java.lang.String astrMessageKey, java.lang.String astrLocalizedMessage, java.lang.Object[] aParams, java.lang.String astrErrorCode, java.lang.String aResourceBundle, java.lang.String astrClassName, java.lang.String astrMethodName, java.lang.Throwable aCause)
      Creates the SystemException.
      AbstractSystemException(java.lang.String astrMessageKey, java.lang.String astrLocalizedMessage, java.lang.Object[] aParams, java.lang.String aResourceBundle, java.lang.String astrClassName, java.lang.String astrMethodName, java.lang.Throwable aCause)
      Creates the SystemException.
      AbstractSystemException(java.lang.String astrMessage, java.lang.String astrClassName, java.lang.String astrMethodName)
      Creates the SystemException.
      AbstractSystemException(java.lang.String astrMessage, java.lang.String astrClassName, java.lang.String astrMethodName, java.lang.Throwable aCause)
      Creates the SystemException.
      AbstractSystemException(java.lang.Throwable aCause)
      Creates the SystemException with the generic error.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getCorrelationId()
      Gets the correlation Id for this exception When a system exception is thrown, the message will be transformed to a more generic message for the response to the client.
      java.lang.String getErrorCode()
      Returns the error code of the exception
      java.lang.String getLocalizedMessage()
      Creates a localized description of this Throwable.
      java.lang.String getLocalizedMessage(java.util.Locale aLocale)
      Gets 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()
      Returns the message key.
      java.lang.Object[] getMessageParams()
      Returns the message parameters.
      boolean isClient()
      This method returns whether the system exception is a result of client input or is generated by some server exception.
      void setClient(boolean isClientException)
      This method sets whether the exception was caused as a result of input from the client request or it is because of a server issue.
      • 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

      • EMPTY_MSG

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

      • AbstractSystemException

        public AbstractSystemException()
        Creates the SystemException with the generic error.
      • AbstractSystemException

        public AbstractSystemException(java.lang.Throwable aCause)
        Creates the SystemException with the generic error.
        Parameters:
        aCause - The cause of the exception.
      • AbstractSystemException

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

        public AbstractSystemException(java.lang.String astrMessage,
                                       java.lang.String astrClassName,
                                       java.lang.String astrMethodName)
        Creates the SystemException.
        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.
      • AbstractSystemException

        public AbstractSystemException(java.lang.String astrMessageKey,
                                       java.lang.Object[] aParams,
                                       java.lang.String astrClassName,
                                       java.lang.String astrMethodName)
        Creates the SystemException.
        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.
      • AbstractSystemException

        public AbstractSystemException(java.lang.String astrMessage,
                                       java.lang.String astrClassName,
                                       java.lang.String astrMethodName,
                                       java.lang.Throwable aCause)
        Creates the SystemException.
        Parameters:
        astrMessage - 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.
      • AbstractSystemException

        public AbstractSystemException(java.lang.String astrMessageKey,
                                       java.lang.Object[] aParams,
                                       java.lang.String astrClassName,
                                       java.lang.String astrMethodName,
                                       java.lang.Throwable aCause)
        Creates the SystemException.
        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.
      • AbstractSystemException

        public AbstractSystemException(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 SystemException.
        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.
      • AbstractSystemException

        public AbstractSystemException(java.lang.String astrMessageKey,
                                       java.lang.String astrLocalizedMessage,
                                       java.lang.Object[] aParams,
                                       java.lang.String aResourceBundle,
                                       java.lang.String astrClassName,
                                       java.lang.String astrMethodName,
                                       java.lang.Throwable aCause)
        Creates the SystemException.
        Parameters:
        astrMessageKey - The message key of the exception.
        astrLocalizedMessage - The localized message 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.
      • AbstractSystemException

        public AbstractSystemException(java.lang.String astrMessageKey,
                                       java.lang.String astrLocalizedMessage,
                                       java.lang.Object[] aParams,
                                       java.lang.String astrErrorCode,
                                       java.lang.String aResourceBundle,
                                       java.lang.String astrClassName,
                                       java.lang.String astrMethodName,
                                       java.lang.Throwable aCause)
        Creates the SystemException.
        Parameters:
        astrMessageKey - The message key of the exception.
        astrLocalizedMessage - The localized message of the exception.
        aParams - The parameters used for the message key of the exception.
        astrErrorCode - The error code 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()
        Creates a localized description of this Throwable. Subclasses may override this method in order to produce a locale-specific message. For subclasses that do not override this method, the default implementation returns the same result as getMessage().
        Overrides:
        getLocalizedMessage in class java.lang.Throwable
        Returns:
        a localized message.
      • getLocalizedMessage

        public java.lang.String getLocalizedMessage(java.util.Locale aLocale)
        Gets 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.
      • getErrorCode

        public java.lang.String getErrorCode()
        Returns the error code of the exception
        Returns:
        The error code of the exception.
      • getMessageKey

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

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

        public java.lang.String getCorrelationId()
        Gets the correlation Id for this exception When a system exception is thrown, the message will be transformed to a more generic message for the 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.
      • isClient

        public boolean isClient()
        This method returns whether the system exception is a result of client input or is generated by some server exception. By default the system exception will be the result of a server error unless specified by the setClient().
        Returns:
        Whether the system exception is raised because of something the client specified or whether this is a server exception.
      • setClient

        public void setClient(boolean isClientException)
        This method sets whether the exception was caused as a result of input from the client request or it is because of a server issue. By default the system exception will be a result of a server exception unless client is set to true.
        Parameters:
        isClientException - Whether the system exception is a result of client input.