org.kuali.kfs.gl.batch.service.impl
Class EnterpriseFeederNotificationServiceImpl

java.lang.Object
  extended by org.kuali.kfs.gl.batch.service.impl.EnterpriseFeederNotificationServiceImpl
All Implemented Interfaces:
EnterpriseFeederNotificationService

public class EnterpriseFeederNotificationServiceImpl
extends Object
implements EnterpriseFeederNotificationService

The base implementation of EnterpriseFeederNotificationService; performs email-based notifications


Constructor Summary
EnterpriseFeederNotificationServiceImpl()
           
 
Method Summary
protected  String buildFileFeedStatusMessage(String doneFileName, String dataFileName, String reconFileName, List<Message> errorMessages, String feederProcessName, EnterpriseFeederStatus status)
          Builds the status message for the status of a feed.
protected  String generateFromEmailAddress(String feederProcessName, EnterpriseFeederStatus status, String doneFileDescription, String dataFileDescription, String reconFileDescription, List<Message> errorMessages)
          Generates the "From:" address for the email
protected  Set<String> generateToEmailAddresses(String feederProcessName, EnterpriseFeederStatus status, String doneFileDescription, String dataFileDescription, String reconFileDescription, List<Message> errorMessages)
          Generates the destination address(s) for the email notifications, possibly depending on the parameter values
 String getFileFeedStatusMessage(String feederProcessName, EnterpriseFeederStatus status, File doneFile, File dataFile, File reconFile, List<Message> errorMessages)
          Generates the status message that would be generated by a call to notifyFileFeedStatus with the same parameters.
 String getFileFeedStatusMessage(String feederProcessName, EnterpriseFeederStatus status, String doneFileDescription, InputStream doneFileContents, String dataFileDescription, InputStream dataFileContents, String reconFileDescription, InputStream reconFileContents, List<Message> errorMessages)
          Generates the status message that would be generated by a call to notifyFileFeedStatus with the same parameters.
protected  String getSubjectLine(String doneFileDescription, String dataFileDescription, String reconFileDescription, List<Message> errorMessages, String feederProcessName, EnterpriseFeederStatus status)
          Builds the status message for the status of a feed.
protected  boolean isStatusNotifiable(String feederProcessName, EnterpriseFeederStatus status, String doneFileDescription, String dataFileDescription, String reconFileDescription, List<Message> errorMessages)
          Returns whether a notification is necessary given the values of the parameters
 void notifyFileFeedStatus(String feederProcessName, EnterpriseFeederStatus status, File doneFile, File dataFile, File reconFile, List<Message> errorMessages)
          Performs notification about the status of the upload (i.e.
 void notifyFileFeedStatus(String feederProcessName, EnterpriseFeederStatus status, String doneFileDescription, InputStream doneFileContents, String dataFileDescription, InputStream dataFileContents, String reconFileDescription, InputStream reconFileContents, List<Message> errorMessages)
          Performs notifications
 void setConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService configurationService)
           
 void setMailService(org.kuali.rice.kns.service.MailService mailService)
          Sets the mailService attribute value.
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnterpriseFeederNotificationServiceImpl

public EnterpriseFeederNotificationServiceImpl()
Method Detail

notifyFileFeedStatus

public void notifyFileFeedStatus(String feederProcessName,
                                 EnterpriseFeederStatus status,
                                 File doneFile,
                                 File dataFile,
                                 File reconFile,
                                 List<Message> errorMessages)
Performs notification about the status of the upload (i.e. feeding) of a single file set (i.e. done file, data file, and recon file).

Specified by:
notifyFileFeedStatus in interface EnterpriseFeederNotificationService
Parameters:
feederProcessName - The name of the feeder process; this may correspond to the name of the Spring definition of the feeder step, but each implementation may define how to use the value of this parameter and/or restrictions on its value.
event - The event/status of the upload of the file set
doneFile - The done file
dataFile - The data file
reconFile - The recon file
errorMessages - Any error messages for which to provide notification
See Also:
org.kuali.kfs.gl.batch.service.EnterpriseFeederNotificationService#notifyFileFeedStatus(java.lang.String, org.kuali.module.gl.util.EnterpriseFeederEvent, java.io.File, java.io.File, java.io.File, java.util.List)

notifyFileFeedStatus

public void notifyFileFeedStatus(String feederProcessName,
                                 EnterpriseFeederStatus status,
                                 String doneFileDescription,
                                 InputStream doneFileContents,
                                 String dataFileDescription,
                                 InputStream dataFileContents,
                                 String reconFileDescription,
                                 InputStream reconFileContents,
                                 List<Message> errorMessages)
Performs notifications

Specified by:
notifyFileFeedStatus in interface EnterpriseFeederNotificationService
Parameters:
feederProcessName - The name of the feeder process; this may correspond to the name of the Spring definition of the feeder step, but each implementation may define how to use the value of this parameter and/or restrictions on its value.
status - The event/status of the upload of the file set
doneFileDescription - The file name
doneFileContents - Not used; can be set to null
dataFileDescription - The file name
dataFileContents - Not used; can be set to null
reconFileDescription - The file name
reconFileContents - Not used; can be set to null
errorMessages - Any error messages for which to provide notification
See Also:
org.kuali.kfs.gl.batch.service.EnterpriseFeederNotificationService#notifyFileFeedStatus(java.lang.String, org.kuali.module.gl.util.EnterpriseFeederEvent, java.lang.String, java.io.InputStream, java.lang.String, java.io.InputStream, java.lang.String, java.io.InputStream, java.util.List)

generateToEmailAddresses

protected Set<String> generateToEmailAddresses(String feederProcessName,
                                               EnterpriseFeederStatus status,
                                               String doneFileDescription,
                                               String dataFileDescription,
                                               String reconFileDescription,
                                               List<Message> errorMessages)
Generates the destination address(s) for the email notifications, possibly depending on the parameter values

Parameters:
feederProcessName - The name of the feeder process; this may correspond to the name of the Spring definition of the feeder step, but each implementation may define how to use the value of this parameter and/or restrictions on its value.
status - The event/status of the upload of the file set
doneFileDescription - The file name
dataFileDescription - The file name
reconFileDescription - The file name
errorMessages - Any error messages for which to provide notification
Returns:
the destination addresses

generateFromEmailAddress

protected String generateFromEmailAddress(String feederProcessName,
                                          EnterpriseFeederStatus status,
                                          String doneFileDescription,
                                          String dataFileDescription,
                                          String reconFileDescription,
                                          List<Message> errorMessages)
Generates the "From:" address for the email

Parameters:
feederProcessName - The name of the feeder process; this may correspond to the name of the Spring definition of the feeder step, but each implementation may define how to use the value of this parameter and/or restrictions on its value.
status - The event/status of the upload of the file set
doneFileDescription - The file name
dataFileDescription - The file name
reconFileDescription - The file name
errorMessages - Any error messages for which to provide notification
Returns:
the source address

getFileFeedStatusMessage

public String getFileFeedStatusMessage(String feederProcessName,
                                       EnterpriseFeederStatus status,
                                       File doneFile,
                                       File dataFile,
                                       File reconFile,
                                       List<Message> errorMessages)
Generates the status message that would be generated by a call to notifyFileFeedStatus with the same parameters.

Specified by:
getFileFeedStatusMessage in interface EnterpriseFeederNotificationService
Parameters:
feederProcessName - The name of the feeder process; this may correspond to the name of the Spring definition of the feeder step, but each implementation may define how to use the value of this parameter and/or restrictions on its value.
event - The event/status of the upload of the file set
doneFile - The done file
dataFile - The data file
reconFile - The recon file
errorMessages - Any error messages for which to provide notification
See Also:
org.kuali.kfs.gl.batch.service.EnterpriseFeederNotificationService#getFileFeedStatusMessage(java.lang.String, org.kuali.module.gl.util.EnterpriseFeederEvent, java.io.File, java.io.File, java.io.File, java.util.List)

getFileFeedStatusMessage

public String getFileFeedStatusMessage(String feederProcessName,
                                       EnterpriseFeederStatus status,
                                       String doneFileDescription,
                                       InputStream doneFileContents,
                                       String dataFileDescription,
                                       InputStream dataFileContents,
                                       String reconFileDescription,
                                       InputStream reconFileContents,
                                       List<Message> errorMessages)
Description copied from interface: EnterpriseFeederNotificationService
Generates the status message that would be generated by a call to notifyFileFeedStatus with the same parameters. NOTE: the CALLER MUST CLOSE all of the input streams that are passed in. In addition, the input streams may be used by implementations of this method, and no assumption about the state of the input streams should be made after this method returns.

Specified by:
getFileFeedStatusMessage in interface EnterpriseFeederNotificationService
Parameters:
feederProcessName - The name of the feeder process; this may correspond to the name of the Spring definition of the feeder step, but each implementation may define how to use the value of this parameter and/or restrictions on its value.
doneFileDescription - The description of the done file to be output during notification
doneFileContents - An input stream for the contents of the done file. If the implementation does not require the contents of the file, then null may be passed in.
dataFileDescription - The description of the done file to be output during notification
dataFileContents - An input stream for the contents of the data file. If the implementation does not require the contents of the file, then null may be passed in.
reconFileDescription - The description of the done file to be output during notification
reconFileContents - An input stream for the contents of the recon file. If the implementation does not require the contents of the file, then null may be passed in.
errorMessages - Any error messages for which to provide notification
See Also:
org.kuali.kfs.gl.batch.service.EnterpriseFeederNotificationService#getFileFeedStatusMessage(java.lang.String, org.kuali.module.gl.util.EnterpriseFeederEvent, java.lang.String, java.io.InputStream, java.lang.String, java.io.InputStream, java.lang.String, java.io.InputStream, java.util.List)

getSubjectLine

protected String getSubjectLine(String doneFileDescription,
                                String dataFileDescription,
                                String reconFileDescription,
                                List<Message> errorMessages,
                                String feederProcessName,
                                EnterpriseFeederStatus status)
Builds the status message for the status of a feed.

Parameters:
doneFileDescription - the name of the done file
dataFileDescription - the name of the file to read data from
reconFileDescription - the name of the reconciliation file
errorMessages - a List of error messages
feederProcessName - the name of the feeder process
Returns:
the String of the subject line

buildFileFeedStatusMessage

protected String buildFileFeedStatusMessage(String doneFileName,
                                            String dataFileName,
                                            String reconFileName,
                                            List<Message> errorMessages,
                                            String feederProcessName,
                                            EnterpriseFeederStatus status)
Builds the status message for the status of a feed.

Parameters:
doneFileName - the name of the done file
dataFileName - the name of the file to get data from
reconFileName - the reconciliation file
errorMessages - a List of error messages generated during the process
feederProcessName - the name of the feeder process
Returns:
a String with the status message

isStatusNotifiable

protected boolean isStatusNotifiable(String feederProcessName,
                                     EnterpriseFeederStatus status,
                                     String doneFileDescription,
                                     String dataFileDescription,
                                     String reconFileDescription,
                                     List<Message> errorMessages)
Returns whether a notification is necessary given the values of the parameters

Parameters:
feederProcessName - the name of the process that invoked the feeder
status - the status of the feed
doneFileDescription - the done file description
dataFileDescription - the data file description
reconFileDescription - the recon file description
errorMessages - a list of error messages
Returns:
whether to notify

setMailService

public void setMailService(org.kuali.rice.kns.service.MailService mailService)
Sets the mailService attribute value.

Parameters:
mailService - The mailService to set.

setConfigurationService

public void setConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService configurationService)

setParameterService

public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)


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