Class ApplicationException

    • Constructor Detail

      • ApplicationException

        public ApplicationException​(String name,
                                    Throwable cause,
                                    String context,
                                    String userMessage,
                                    String solution)
        Create an application exception object.
        Parameters:
        name - a name identifying the exception
        cause - the Throwable causing the error
        context - a message describing the context in which the error occurred
        userMessage - a detail message about the error intended for the user
        solution - an optional message outlining a solution to the problem
      • ApplicationException

        public ApplicationException​(String name,
                                    String context,
                                    String userMessage,
                                    String solution)
        Create an application exception object.
        Parameters:
        name - a name identifying the exception
        context - a message describing the context in which the error occurred
        userMessage - a detail message about the error intended for the user
        solution - an optional message outlining a solution to the problem
      • ApplicationException

        public ApplicationException​(Class<?> aClass,
                                    String context,
                                    String userMessage,
                                    String solution)
        Create an application exception object.
        Parameters:
        aClass - the source object class associated with the exception
        context - a message describing the context in which the error occurred
        userMessage - a detail message about the error intended for the user
        solution - an optional message outlining a solution to the problem
      • ApplicationException

        public ApplicationException​(Class aClass,
                                    String context,
                                    String userMessage)
        Create an application exception object.
        Parameters:
        aClass - the source object class associated with the exception
        context - a message describing the context in which the error occurred
        userMessage - a detail message about the error intended for the user
      • ApplicationException

        public ApplicationException​(String name,
                                    String context,
                                    String userMessage)
        Create an application exception object.
        Parameters:
        name - a name identifying the exception
        context - a message describing the context in which the error occurred
        userMessage - a detail message about the error intended for the user
        Since:
        3.6.0
      • ApplicationException

        public ApplicationException​(String name,
                                    Throwable cause,
                                    String context,
                                    String userMessage,
                                    String solution,
                                    boolean doNotRecord,
                                    String messageKey)
        Create an application exception object.
        Parameters:
        name - a name identifying the exception
        cause - the Throwable causing the error
        context - a message describing the context in which the error occurred
        userMessage - a detail message about the error intended for the user
        solution - an optional message outlining a solution to the problem
        doNotRecord - can be used to avoid the exception being logged to the error log
        messageKey - used to look up the error message from a resource bundle
      • ApplicationException

        public ApplicationException​(Class<?> aClass,
                                    Throwable cause,
                                    String context,
                                    String userMessage,
                                    String solution)
        Create an application exception object.
        Parameters:
        aClass - the source object class associated with the exception
        cause - the Throwable causing the error
        context - a message describing the context in which the error occurred
        userMessage - a detail message about the error intended for the user
        solution - an optional message outlining a solution to the problem
      • ApplicationException

        public ApplicationException​(Class<?> aClass,
                                    Throwable cause,
                                    String context,
                                    String userMessage)
        Create an application exception object.
        Parameters:
        aClass - the source object class associated with the exception
        cause - the Throwable causing the error
        context - a message describing the context in which the error occurred
        userMessage - a detail message about the error intended for the user
      • ApplicationException

        public ApplicationException​(String name,
                                    String context,
                                    String userMessage,
                                    String solution,
                                    boolean doNotRecord,
                                    String messageKey)
        Create an application exception object.
        Parameters:
        name - a name identifying the exception
        context - a message describing the context in which the error occurred
        userMessage - a detail message about the error intended for the user
        solution - an optional message outlining a solution to the problem
        doNotRecord - can be used to avoid the exception being logged to the error log
        messageKey - used to look up the error message from a resource bundle
      • ApplicationException

        protected ApplicationException​(String name)
    • Method Detail

      • getErrorLog

        public ErrorLog getErrorLog()
        Returns:
        the associated error log, if the exception has been logged.
        Since:
        4.3.4
      • setErrorLog

        public void setErrorLog​(ErrorLog errorLog)
        Set the associated error log, if the exception has been logged.
        Parameters:
        errorLog - the associated error log, if the exception has been logged.
        Since:
        4.3.4
      • getContext

        public String getContext()
        Return the user context to record any parameters that may be relevant to the exception.
        Returns:
        the user context of the exception
      • setContext

        public void setContext​(String context)
        Set the user context to record any parameters that may be relevant to the exception.
        Parameters:
        context - the user context of the exception
      • getName

        public String getName()
        Return the name of the exception.
        Returns:
        the name of the exception
      • getUserMessage

        public String getUserMessage()
        Return the user message. This will display various messages to the end user.
        Returns:
        the user message
      • setUserMessage

        public void setUserMessage​(String userMessage)
        Set the user message. This will display various messages to the end user.
        Parameters:
        userMessage - the user message
      • getSolution

        public String getSolution()
        Return the suggested solution for this problem.
        Returns:
        the suggested solution for this problem
      • setSolution

        public void setSolution​(String solution)
        Set the suggested solution for this problem.
        Parameters:
        solution - the suggested solution for this problem
      • isLogToErrorLog

        public boolean isLogToErrorLog()
        Return whether the exception shall be logged to the application error log
        Returns:
        the logToErrorLog flag
      • setLogToErrorLog

        public void setLogToErrorLog​(boolean logToErrorLog)
        Determine whether the exception shall be logged to the application error log.
        Parameters:
        logToErrorLog - the logToErrorLog flag
      • getMessageKey

        public String getMessageKey()
        Return the key that can be used to look up message details in a resource bundle (applies only if logToErrorLog = false)
        Returns:
        the message key
      • setMessageKey

        public void setMessageKey​(String messageKey)
        Set the key that can be used to look up message details in a resource bundle (applies only if logToErrorLog = false).
        Parameters:
        messageKey - the message key
      • getFormXml

        public String getFormXml()
        Return the submission form XML.
        Returns:
        the submission form XML
      • setFormXml

        public void setFormXml​(String formXml)
        Set the submission form XML.
        Parameters:
        formXml - the submission form XML
      • getClient

        public Client getClient()
        Return the client.
        Returns:
        the client
      • setClient

        public void setClient​(Client client)
        Set the client.
        Parameters:
        client - the client
      • getGroovyServiceLog

        public GroovyServiceLog getGroovyServiceLog()
        Return the GroovyServiceLog object.
        Returns:
        the GroovyServiceLog object.
        Since:
        4.2.0
      • setGroovyServiceLog

        public void setGroovyServiceLog​(GroovyServiceLog groovyServiceLog)
        Set the GroovyServiceLog object.
        Parameters:
        groovyServiceLog - the GroovyServiceLog object.
        Since:
        4.2.0
      • getRequestKey

        public String getRequestKey()
        Returns:
        the requestKey
        Since:
        4.3.4
      • setRequestKey

        public void setRequestKey​(String requestKey)
        Parameters:
        requestKey - the requestKey to set
        Since:
        4.3.4
      • toString

        public String toString()
        Return a String representation of the ApplicationException. It consists of the name and, if set, the user message.
        Overrides:
        toString in class Throwable
        Returns:
        a String representation of the exception