Jalview 2.6 source licence
[jalview.git] / src / jalview / ws / params / ParamDatastoreI.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
3  * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
10  * 
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 package jalview.ws.params;
19
20 import java.io.IOException;
21 import java.util.List;
22
23 public interface ParamDatastoreI
24 {
25
26   public List<WsParamSetI> getPresets();
27
28   public WsParamSetI getPreset(String name);
29
30   public List<ArgumentI> getServiceParameters();
31
32   public boolean presetExists(String name);
33
34   public void deletePreset(String name);
35
36   /**
37    * writes or overwrites the record for a modifiable WsParamSetI entry with a given name in the
38    * datastore.
39    * 
40    * @param presetName
41    * @param text
42    * @param jobParams
43    *          may throw an illegal argument RunTimeException if the presetName
44    *          overwrites an existing, unmodifiable preset.
45    */
46   public void storePreset(String presetName, String text,
47           List<ArgumentI> jobParams);
48
49   /**
50    * update an existing instance with a new name, descriptive text and parameters.
51    * @param oldName
52    * @param presetName
53    * @param text
54    * @param jobParams
55    */
56   public void updatePreset(String oldName, String presetName, String text,
57            List<ArgumentI> jobParams);
58
59   /**
60    * factory method - builds a service specific parameter object using the given
61    * data
62    * 
63    * @param name
64    * @param description
65    * @param applicable
66    *          URLs
67    * @param parameterfile
68    *          Service specific jalview parameter file (as returned from new
69    *          method)
70    * @return null or valid WsParamSetI object for this service.
71    */
72
73   public WsParamSetI parseServiceParameterFile(String name,
74           String description, String[] serviceURL, String parameters)
75           throws IOException;
76
77   /**
78    * create the service specific parameter file for this pset object.
79    * 
80    * @param pset
81    * @return string representation of the parameters specified by this set.
82    * @throws IOException
83    */
84   public String generateServiceParameterFile(WsParamSetI pset)
85           throws IOException;
86
87 }