org.kuali.rice.krad.service.impl
Class KualiExceptionIncidentServiceImpl

java.lang.Object
  extended by org.kuali.rice.krad.service.impl.KualiExceptionIncidentServiceImpl
All Implemented Interfaces:
KualiExceptionIncidentService

public class KualiExceptionIncidentServiceImpl
extends Object
implements KualiExceptionIncidentService

This is a basic implementation of the KualiReporterService. Currently, it only has a mail service as reporting mechanism.

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

Field Summary
private  String incidentMailingList
          An list to send incident emails to.
private  org.apache.log4j.Logger LOG
           
private  Mailer mailer
          A Mailer for sending report.
private  MailMessage messageTemplate
          An email template is used to construct an email to be sent by the mail service.
static String REPORT_MAIL_LIST
          This property must be defined in the base configuration file for specifying the mailing list for the report to be sent.
 
Constructor Summary
KualiExceptionIncidentServiceImpl()
           
 
Method Summary
private  MailMessage createMailMessage(String subject, String message)
          This method create an instance of MailMessage from the inputs using the given template.
 void emailReport(String subject, String message)
          This mails the report using the mail service from the mail template.
 KualiExceptionIncident getExceptionIncident(Exception exception, Map<String,String> properties)
          This overridden method create an instance of the KualiExceptionIncident.
 KualiExceptionIncident getExceptionIncident(Map<String,String> properties)
          This overridden method create an instance of ExceptionIncident from list of name-value pairs as exception incident information.
 String getIncidentMailingList()
           
 MailMessage getMessageTemplate()
           
 void report(KualiExceptionIncident exceptionIncident)
          This overridden method send email to the specified list of addresses.
 void setIncidentMailingList(String incidentMailingList)
           
 void setMailer(Mailer mailer)
          The injected Mailer.
 void setMessageTemplate(MailMessage messageTemplate)
           
 List<String> split(String s, String token)
          This method first separate a composite string of the format "string token string".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private org.apache.log4j.Logger LOG

incidentMailingList

private String incidentMailingList
An list to send incident emails to.


REPORT_MAIL_LIST

public static final String REPORT_MAIL_LIST
This property must be defined in the base configuration file for specifying the mailing list for the report to be sent.

Example: a@y,b@z


mailer

private Mailer mailer
A Mailer for sending report.


messageTemplate

private MailMessage messageTemplate
An email template is used to construct an email to be sent by the mail service.

Constructor Detail

KualiExceptionIncidentServiceImpl

public KualiExceptionIncidentServiceImpl()
Method Detail

setMailer

public final void setMailer(Mailer mailer)
The injected Mailer.

Parameters:
mailService - the mailService to set

emailReport

public void emailReport(String subject,
                        String message)
                 throws Exception
This mails the report using the mail service from the mail template.

Specified by:
emailReport in interface KualiExceptionIncidentService
Throws:
Exception
See Also:
KualiExceptionIncidentService.emailReport(java.lang.String, java.lang.String)

createMailMessage

private MailMessage createMailMessage(String subject,
                                      String message)
                               throws Exception
This method create an instance of MailMessage from the inputs using the given template.

Parameters:
subject -
message -
Returns:
Throws:
Exception

report

public void report(KualiExceptionIncident exceptionIncident)
            throws Exception
This overridden method send email to the specified list of addresses.

Specified by:
report in interface KualiExceptionIncidentService
Throws:
Exception
See Also:
KualiExceptionIncidentService.report(org.kuali.rice.krad.exception.KualiExceptionIncident)

split

public List<String> split(String s,
                          String token)
This method first separate a composite string of the format "string token string".

Example: 1,2,a,b where ',' is the token

Parameters:
s -
token -
Returns:

getMessageTemplate

public final MailMessage getMessageTemplate()
Returns:
the messageTemplate

setMessageTemplate

public final void setMessageTemplate(MailMessage messageTemplate)
Parameters:
messageTemplate - the messageTemplate to set

getExceptionIncident

public KualiExceptionIncident getExceptionIncident(Exception exception,
                                                   Map<String,String> properties)
This overridden method create an instance of the KualiExceptionIncident.

Specified by:
getExceptionIncident in interface KualiExceptionIncidentService
properties - Additional information when the exception is thrown

example:

  • Document id
  • User email
  • User name
  • Component name
Returns:
See Also:
KualiExceptionIncidentService.getExceptionIncident( java.lang.Exception,java.util.Map)

getExceptionIncident

public KualiExceptionIncident getExceptionIncident(Map<String,String> properties)
This overridden method create an instance of ExceptionIncident from list of name-value pairs as exception incident information.

Specified by:
getExceptionIncident in interface KualiExceptionIncidentService
Parameters:
properties - The list of name-value pairs containing the thrown exception information
Returns:
See Also:
KualiExceptionIncidentService.getExceptionIncident(java.util.Map)

getIncidentMailingList

public String getIncidentMailingList()
Returns:
the incidentMailingList

setIncidentMailingList

public void setIncidentMailingList(String incidentMailingList)
Parameters:
incidentMailingList - the incidentMailingList to set


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