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.sys.batch.service;
17  
18  import java.io.InputStream;
19  import java.util.Map;
20  
21  import org.kuali.ole.sys.batch.BatchInputFileSetType;
22  import org.kuali.ole.sys.batch.InitiateDirectory;
23  import org.kuali.ole.sys.exception.FileStorageException;
24  import org.kuali.rice.kim.api.identity.Person;
25  import org.kuali.rice.krad.exception.AuthorizationException;
26  
27  /**
28   * This interface defines the methods needed to save/download/delete file sets in the batch upload system
29   */
30  public interface BatchInputFileSetService extends InitiateDirectory{
31  
32      /**
33       * Stores the input streams (the values in the Map parameter) as files on the server, identified by the given user file name and
34       * file user identifier
35       * 
36       * @param user - user who is requesting the save
37       * @param inputType - instance of a BatchInputFileSetType
38       * @param fileUserIdentifer - file identifier specified by user
39       * @param typeToStreamMap - contents of the uploaded files, keyed by the input file type
40       * @return a Map of type to file name mappings of the saved files
41       * @throws FileStorageException - if errors were encountered while attempting to write the file
42       */
43      public Map<String, String> save(Person user, BatchInputFileSetType inputType, String fileUserIdentifer, Map<String, InputStream> typeToStreamMap) throws AuthorizationException, FileStorageException;
44  
45      /**
46       * Checks if the batch input type is active (can be used for upload).
47       * 
48       * @param BatchInputFileSetType - input type to check is active
49       * @return boolean - true if type is active, false if not active
50       */
51      public boolean isBatchInputTypeActive(BatchInputFileSetType batchInputFileSetType);
52  
53      /**
54       * Returns whether a file set identifier is properly formatted.
55       * 
56       * @param fileUserIdentifier
57       * @return
58       */
59      public boolean isFileUserIdentifierProperlyFormatted(String fileUserIdentifier);
60  }
61