001: /*
002: * Copyright 2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.kuali.module.gl.service;
017:
018: import java.io.File;
019: import java.io.InputStream;
020: import java.util.List;
021:
022: import org.kuali.module.gl.util.EnterpriseFeederStatus;
023: import org.kuali.module.gl.util.Message;
024:
025: /**
026: * A service that is used to provide notification about the status of an enterprise feed. The implementation may use a variety of
027: * other services to perform notification, ranging from simply logging data to sending emails, etc.
028: */
029: public interface EnterpriseFeederNotificationService {
030: /**
031: * Performs notification about the status of the upload (i.e. feeding) of a single file set (i.e. done file, data file, and
032: * recon file).
033: *
034: * @param feederProcessName The name of the feeder process; this may correspond to the name of the Spring definition of the
035: * feeder step, but each implementation may define how to use the value of this parameter and/or restrictions on its
036: * value.
037: * @param event The event/status of the upload of the file set
038: * @param doneFile The done file
039: * @param dataFile The data file
040: * @param reconFile The recon file
041: * @param errorMessages Any error messages for which to provide notification
042: */
043: public void notifyFileFeedStatus(String feederProcessName,
044: EnterpriseFeederStatus status, File doneFile,
045: File dataFile, File reconFile, List<Message> errorMessages);
046:
047: /**
048: * Performs notification about the status of the upload (i.e. feeding) of a single file set (i.e. done file, data file, and
049: * recon file). This method is useful when the file sets are not <b>NOTE:</b> the CALLER MUST CLOSE all of the input streams
050: * that are passed in. In addition, the input streams may be used by implementations of this method, and no assumption about the
051: * state of the input streams should be made after this method returns.
052: *
053: * @param feederProcessName The name of the feeder process; this may correspond to the name of the Spring definition of the
054: * feeder step, but each implementation may define how to use the value of this parameter and/or restrictions on its
055: * value.
056: * @param event The event/status of the upload of the file set
057: * @param doneFileDescription The description of the done file to be output during notification
058: * @param doneFileContents An input stream for the contents of the done file. If the implementation does not require the
059: * contents of the file, then <code>null</code> may be passed in.
060: * @param dataFileDescription The description of the done file to be output during notification
061: * @param dataFileContents An input stream for the contents of the data file. If the implementation does not require the
062: * contents of the file, then <code>null</code> may be passed in.
063: * @param reconFileDescription The description of the done file to be output during notification
064: * @param reconFileContents An input stream for the contents of the recon file. If the implementation does not require the
065: * contents of the file, then <code>null</code> may be passed in.
066: * @param errorMessages Any error messages for which to provide notification
067: */
068: public void notifyFileFeedStatus(String feederProcessName,
069: EnterpriseFeederStatus status, String doneFileDescription,
070: InputStream doneFileContents, String dataFileDescription,
071: InputStream dataFileContents, String reconFileDescription,
072: InputStream reconFileContents, List<Message> errorMessages);
073:
074: /**
075: * Generates the status message that would be generated by a call to notifyFileFeedStatus with the same parameters.
076: *
077: * @param feederProcessName The name of the feeder process; this may correspond to the name of the Spring definition of the
078: * feeder step, but each implementation may define how to use the value of this parameter and/or restrictions on its
079: * value.
080: * @param event The event/status of the upload of the file set
081: * @param doneFile The done file
082: * @param dataFile The data file
083: * @param reconFile The recon file
084: * @param errorMessages Any error messages for which to provide notification
085: */
086: public String getFileFeedStatusMessage(String feederProcessName,
087: EnterpriseFeederStatus status, File doneFile,
088: File dataFile, File reconFile, List<Message> errorMessages);
089:
090: /**
091: * Generates the status message that would be generated by a call to notifyFileFeedStatus with the same parameters. <b>NOTE:</b>
092: * the CALLER MUST CLOSE all of the input streams that are passed in. In addition, the input streams may be used by
093: * implementations of this method, and no assumption about the state of the input streams should be made after this method
094: * returns.
095: *
096: * @param feederProcessName The name of the feeder process; this may correspond to the name of the Spring definition of the
097: * feeder step, but each implementation may define how to use the value of this parameter and/or restrictions on its
098: * value.
099: * @param event The event/status of the upload of the file set
100: * @param doneFileDescription The description of the done file to be output during notification
101: * @param doneFileContents An input stream for the contents of the done file. If the implementation does not require the
102: * contents of the file, then <code>null</code> may be passed in.
103: * @param dataFileDescription The description of the done file to be output during notification
104: * @param dataFileContents An input stream for the contents of the data file. If the implementation does not require the
105: * contents of the file, then <code>null</code> may be passed in.
106: * @param reconFileDescription The description of the done file to be output during notification
107: * @param reconFileContents An input stream for the contents of the recon file. If the implementation does not require the
108: * contents of the file, then <code>null</code> may be passed in.
109: * @param errorMessages Any error messages for which to provide notification
110: */
111: public String getFileFeedStatusMessage(String feederProcessName,
112: EnterpriseFeederStatus status, String doneFileDescription,
113: InputStream doneFileContents, String dataFileDescription,
114: InputStream dataFileContents, String reconFileDescription,
115: InputStream reconFileContents, List<Message> errorMessages);
116: }
|