View Javadoc

1   /*
2    * Copyright 2007 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.gl.batch.service;
17  
18  import java.io.File;
19  import java.io.InputStream;
20  import java.util.List;
21  
22  import org.kuali.ole.gl.batch.service.impl.EnterpriseFeederStatus;
23  import org.kuali.ole.sys.Message;
24  
25  /**
26   * A service that is used to provide notification about the status of an enterprise feed. The implementation may use a variety of
27   * other services to perform notification, ranging from simply logging data to sending emails, etc.
28   */
29  public interface EnterpriseFeederNotificationService {
30      /**
31       * Performs notification about the status of the upload (i.e. feeding) of a single file set (i.e. done file, data file, and
32       * recon file).
33       * 
34       * @param feederProcessName The name of the feeder process; this may correspond to the name of the Spring definition of the
35       *        feeder step, but each implementation may define how to use the value of this parameter and/or restrictions on its
36       *        value.
37       * @param event The event/status of the upload of the file set
38       * @param doneFile The done file
39       * @param dataFile The data file
40       * @param reconFile The recon file
41       * @param errorMessages Any error messages for which to provide notification
42       */
43      public void notifyFileFeedStatus(String feederProcessName, EnterpriseFeederStatus status, File doneFile, File dataFile, File reconFile, List<Message> errorMessages);
44  
45  
46      /**
47       * Performs notification about the status of the upload (i.e. feeding) of a single file set (i.e. done file, data file, and
48       * recon file). This method is useful when the file sets are not <b>NOTE:</b> the CALLER MUST CLOSE all of the input streams
49       * that are passed in. In addition, the input streams may be used by implementations of this method, and no assumption about the
50       * state of the input streams should be made after this method returns.
51       * 
52       * @param feederProcessName The name of the feeder process; this may correspond to the name of the Spring definition of the
53       *        feeder step, but each implementation may define how to use the value of this parameter and/or restrictions on its
54       *        value.
55       * @param event The event/status of the upload of the file set
56       * @param doneFileDescription The description of the done file to be output during notification
57       * @param doneFileContents An input stream for the contents of the done file. If the implementation does not require the
58       *        contents of the file, then <code>null</code> may be passed in.
59       * @param dataFileDescription The description of the done file to be output during notification
60       * @param dataFileContents An input stream for the contents of the data file. If the implementation does not require the
61       *        contents of the file, then <code>null</code> may be passed in.
62       * @param reconFileDescription The description of the done file to be output during notification
63       * @param reconFileContents An input stream for the contents of the recon file. If the implementation does not require the
64       *        contents of the file, then <code>null</code> may be passed in.
65       * @param errorMessages Any error messages for which to provide notification
66       */
67      public void notifyFileFeedStatus(String feederProcessName, EnterpriseFeederStatus status, String doneFileDescription, InputStream doneFileContents, String dataFileDescription, InputStream dataFileContents, String reconFileDescription, InputStream reconFileContents, List<Message> errorMessages);
68  
69      /**
70       * Generates the status message that would be generated by a call to notifyFileFeedStatus with the same parameters.
71       * 
72       * @param feederProcessName The name of the feeder process; this may correspond to the name of the Spring definition of the
73       *        feeder step, but each implementation may define how to use the value of this parameter and/or restrictions on its
74       *        value.
75       * @param event The event/status of the upload of the file set
76       * @param doneFile The done file
77       * @param dataFile The data file
78       * @param reconFile The recon file
79       * @param errorMessages Any error messages for which to provide notification
80       */
81      public String getFileFeedStatusMessage(String feederProcessName, EnterpriseFeederStatus status, File doneFile, File dataFile, File reconFile, List<Message> errorMessages);
82  
83      /**
84       * Generates the status message that would be generated by a call to notifyFileFeedStatus with the same parameters. <b>NOTE:</b>
85       * the CALLER MUST CLOSE all of the input streams that are passed in. In addition, the input streams may be used by
86       * implementations of this method, and no assumption about the state of the input streams should be made after this method
87       * returns.
88       * 
89       * @param feederProcessName The name of the feeder process; this may correspond to the name of the Spring definition of the
90       *        feeder step, but each implementation may define how to use the value of this parameter and/or restrictions on its
91       *        value.
92       * @param event The event/status of the upload of the file set
93       * @param doneFileDescription The description of the done file to be output during notification
94       * @param doneFileContents An input stream for the contents of the done file. If the implementation does not require the
95       *        contents of the file, then <code>null</code> may be passed in.
96       * @param dataFileDescription The description of the done file to be output during notification
97       * @param dataFileContents An input stream for the contents of the data file. If the implementation does not require the
98       *        contents of the file, then <code>null</code> may be passed in.
99       * @param reconFileDescription The description of the done file to be output during notification
100      * @param reconFileContents An input stream for the contents of the recon file. If the implementation does not require the
101      *        contents of the file, then <code>null</code> may be passed in.
102      * @param errorMessages Any error messages for which to provide notification
103      */
104     public String getFileFeedStatusMessage(String feederProcessName, EnterpriseFeederStatus status, String doneFileDescription, InputStream doneFileContents, String dataFileDescription, InputStream dataFileContents, String reconFileDescription, InputStream reconFileContents, List<Message> errorMessages);
105 }