org.kuali.rice.krad.exception
Class ExceptionIncident

java.lang.Object
  extended by org.kuali.rice.krad.exception.ExceptionIncident
All Implemented Interfaces:
KualiExceptionIncident

public class ExceptionIncident
extends Object
implements KualiExceptionIncident

This class contains the exception incident information, exception, form and session user. It is constructed and saved into the HTTP Request for passing to the jsp when an exception occurs.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
static String GENERIC_SYSTEM_ERROR_MESSAGE
           
protected  Map<String,String> properties
          Basic exception information is initialized and contained in this class instance.
 
Fields inherited from interface org.kuali.rice.krad.exception.KualiExceptionIncident
COMPONENT_NAME, DESCRIPTION, DISPLAY_MESSAGE, DOCUMENT_ID, EXCEPTION_HIDE_INCIDENT_REPORT, EXCEPTION_MESSAGE, EXCEPTION_REPORT_MESSAGE, EXCEPTION_REPORT_SUBJECT, STACK_TRACE, USER_EMAIL, USER_NAME, UUID
 
Constructor Summary
ExceptionIncident(Exception exception, Map<String,String> properties)
          This constructs list of key-value pairs from the caught exception and current settings.
ExceptionIncident(Map<String,String> inputs)
          This constructs an instance of this class from list of name-value pairs.
 
Method Summary
 String getDisplayMessage(Exception exception)
          This overridden method return the exception if the ixception type is in the defined list.
 String getExceptionStackTrace(Exception thrownException)
          This method return the thrown exception stack trace as string.
 String getProperty(String key)
          This overridden method returns value of the found property key.
 Map<String,String> toProperties()
          This overridden method return current internal properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GENERIC_SYSTEM_ERROR_MESSAGE

public static final String GENERIC_SYSTEM_ERROR_MESSAGE
See Also:
Constant Field Values

properties

protected Map<String,String> properties
Basic exception information is initialized and contained in this class instance. Additional setting and other information can be added when exception is caught. Also, an JSP is displayed to collect additional user information and the returned parameters from the JSP can be used to initialize this class instance for reporting.

Note: The mechanism for passing data to and receiving data from the JSP uses java.util.Map. Therefore, the exception is not passed to JSP using HttpRequest. But rather a Map instance.

Constructor Detail

ExceptionIncident

public ExceptionIncident(Exception exception,
                         Map<String,String> properties)
This constructs list of key-value pairs from the caught exception and current settings.

Parameters:
exception - Caught exception
exceptionNames - List of Kuali exception for determining the display exception message
properties - Input information when the exception is caught

Example:

  • DOCUMENT_ID
  • USER_EMAIL
  • USER_NAME
  • COMPONENT_NAME

ExceptionIncident

public ExceptionIncident(Map<String,String> inputs)
This constructs an instance of this class from list of name-value pairs.

Parameters:
inputs - List of exception information such as
  • DOCUMENT_ID - If it's document form
  • USER_EMAIL - Session user email
  • USER_NAME - Session user name
  • COMPONENT_NAME - Document or lookup or inquiry form
  • attribute of GlobalVariables
  • EXCEPTION_REPORT_SUBJECT - Exception error message and current settings
  • EXCEPTION_MESSAGE - Exception error message
  • STACK_TRACE - Exception stack trace
  • DESCRIPTION - Information input by user or blank
Method Detail

getExceptionStackTrace

public String getExceptionStackTrace(Exception thrownException)
This method return the thrown exception stack trace as string.

Parameters:
thrownException -
Returns:

getDisplayMessage

public String getDisplayMessage(Exception exception)
This overridden method return the exception if the ixception type is in the defined list. Otherwise, it returns the GENERIC_SYSTEM_ERROR_MESSAGE.

Specified by:
getDisplayMessage in interface KualiExceptionIncident
Returns:
See Also:
KualiExceptionIncident.getDisplayMessage(Exception)

getProperty

public String getProperty(String key)
This overridden method returns value of the found property key. Except the property EXCEPTION_REPORT_MESSAGE

Specified by:
getProperty in interface KualiExceptionIncident
Returns:
null is return if not found
See Also:
KualiExceptionIncident.getProperty(java.lang.String)

toProperties

public Map<String,String> toProperties()
This overridden method return current internal properties.

Specified by:
toProperties in interface KualiExceptionIncident
Returns:

Example: documentId, 2942084 userEmail, someone@somewhere userName, some name componentFormName, Form that threw exception name exceptionMessage, Error message from exception displayMessage, Either exception error message or generic exception error message stackTrace, Exception stack trace here

See Also:
KualiExceptionIncident.toProperties()


Copyright © 2005-2011 The Kuali Foundation. All Rights Reserved.