Package com.avoka.fc.core.util
Class ApplicationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.avoka.fc.core.util.ApplicationException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ApplicationEmailException
,ApplicationFileUploadException
,DuplicateSubmissionException
,PaymentResponseException
,SubmissionCompleteProcessorException
,SubmissionException
,UnsupportedVersionException
public class ApplicationException extends RuntimeException
Provides the base SmartForm Manager application exception.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description ApplicationException(Class<?> aClass, String context, String userMessage, String solution)
Create an application exception object.ApplicationException(Class<?> aClass, Throwable cause, String context, String userMessage)
Create an application exception object.ApplicationException(Class<?> aClass, Throwable cause, String context, String userMessage, String solution)
Create an application exception object.ApplicationException(Class aClass, String context, String userMessage)
Create an application exception object.protected
ApplicationException(String name)
ApplicationException(String name, String context, String userMessage)
Create an application exception object.ApplicationException(String name, String context, String userMessage, String solution)
Create an application exception object.ApplicationException(String name, String context, String userMessage, String solution, boolean doNotRecord, String messageKey)
Create an application exception object.ApplicationException(String name, Throwable cause, String context, String userMessage, String solution)
Create an application exception object.ApplicationException(String name, Throwable cause, String context, String userMessage, String solution, boolean doNotRecord, String messageKey)
Create an application exception object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Client
getClient()
Return the client.String
getContext()
Return the user context to record any parameters that may be relevant to the exception.ErrorLog
getErrorLog()
String
getFormXml()
Return the submission form XML.GroovyServiceLog
getGroovyServiceLog()
Return the GroovyServiceLog object.String
getMessageKey()
Return the key that can be used to look up message details in a resource bundle (applies only if logToErrorLog = false)String
getName()
Return the name of the exception.String
getRequestKey()
String
getSolution()
Return the suggested solution for this problem.String
getUserMessage()
Return the user message.boolean
isLogToErrorLog()
Return whether the exception shall be logged to the application error logvoid
setClient(Client client)
Set the client.void
setContext(String context)
Set the user context to record any parameters that may be relevant to the exception.void
setErrorLog(ErrorLog errorLog)
Set the associated error log, if the exception has been logged.void
setFormXml(String formXml)
Set the submission form XML.void
setGroovyServiceLog(GroovyServiceLog groovyServiceLog)
Set the GroovyServiceLog object.void
setLogToErrorLog(boolean logToErrorLog)
Determine whether the exception shall be logged to the application error log.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).void
setRequestKey(String requestKey)
void
setSolution(String solution)
Set the suggested solution for this problem.void
setUserMessage(String userMessage)
Set the user message.String
toString()
Return a String representation of the ApplicationException.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
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 exceptioncause
- the Throwable causing the errorcontext
- a message describing the context in which the error occurreduserMessage
- a detail message about the error intended for the usersolution
- 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 exceptioncontext
- a message describing the context in which the error occurreduserMessage
- a detail message about the error intended for the usersolution
- 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 exceptioncontext
- a message describing the context in which the error occurreduserMessage
- a detail message about the error intended for the usersolution
- 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 exceptioncontext
- a message describing the context in which the error occurreduserMessage
- 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 exceptioncontext
- a message describing the context in which the error occurreduserMessage
- 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 exceptioncause
- the Throwable causing the errorcontext
- a message describing the context in which the error occurreduserMessage
- a detail message about the error intended for the usersolution
- an optional message outlining a solution to the problemdoNotRecord
- can be used to avoid the exception being logged to the error logmessageKey
- 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 exceptioncause
- the Throwable causing the errorcontext
- a message describing the context in which the error occurreduserMessage
- a detail message about the error intended for the usersolution
- 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 exceptioncause
- the Throwable causing the errorcontext
- a message describing the context in which the error occurreduserMessage
- 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 exceptioncontext
- a message describing the context in which the error occurreduserMessage
- a detail message about the error intended for the usersolution
- an optional message outlining a solution to the problemdoNotRecord
- can be used to avoid the exception being logged to the error logmessageKey
- 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
-
-