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.protectedApplicationException(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 ClientgetClient()Return the client.StringgetContext()Return the user context to record any parameters that may be relevant to the exception.ErrorLoggetErrorLog()StringgetFormXml()Return the submission form XML.GroovyServiceLoggetGroovyServiceLog()Return the GroovyServiceLog object.StringgetMessageKey()Return the key that can be used to look up message details in a resource bundle (applies only if logToErrorLog = false)StringgetName()Return the name of the exception.StringgetRequestKey()StringgetSolution()Return the suggested solution for this problem.StringgetUserMessage()Return the user message.booleanisLogToErrorLog()Return whether the exception shall be logged to the application error logvoidsetClient(Client client)Set the client.voidsetContext(String context)Set the user context to record any parameters that may be relevant to the exception.voidsetErrorLog(ErrorLog errorLog)Set the associated error log, if the exception has been logged.voidsetFormXml(String formXml)Set the submission form XML.voidsetGroovyServiceLog(GroovyServiceLog groovyServiceLog)Set the GroovyServiceLog object.voidsetLogToErrorLog(boolean logToErrorLog)Determine whether the exception shall be logged to the application error log.voidsetMessageKey(String messageKey)Set the key that can be used to look up message details in a resource bundle (applies only if logToErrorLog = false).voidsetRequestKey(String requestKey)voidsetSolution(String solution)Set the suggested solution for this problem.voidsetUserMessage(String userMessage)Set the user message.StringtoString()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
-
-