247bfe24233bd275587d86db6b7ce5ea6a784f9d
[jalview.git] / src / jalview / ws / params / ParamDatastoreI.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3  * Copyright (C) 2014 The Jalview Authors
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  * The Jalview Authors are detailed in the 'AUTHORS' file.
18  */
19 package jalview.ws.params;
20
21 import java.io.IOException;
22 import java.util.List;
23
24 public interface ParamDatastoreI
25 {
26
27   public List<WsParamSetI> getPresets();
28
29   public WsParamSetI getPreset(String name);
30
31   public List<ArgumentI> getServiceParameters();
32
33   public boolean presetExists(String name);
34
35   public void deletePreset(String name);
36
37   /**
38    * writes or overwrites the record for a modifiable WsParamSetI entry with a
39    * given name in the datastore.
40    * 
41    * @param presetName
42    * @param text
43    * @param jobParams
44    *          may throw an illegal argument RunTimeException if the presetName
45    *          overwrites an existing, unmodifiable preset.
46    */
47   public void storePreset(String presetName, String text,
48           List<ArgumentI> jobParams);
49
50   /**
51    * update an existing instance with a new name, descriptive text and
52    * parameters.
53    * 
54    * @param oldName
55    * @param presetName
56    * @param text
57    * @param jobParams
58    */
59   public void updatePreset(String oldName, String presetName, String text,
60           List<ArgumentI> jobParams);
61
62   /**
63    * factory method - builds a service specific parameter object using the given
64    * data
65    * 
66    * @param name
67    * @param description
68    * @param applicable
69    *          URLs
70    * @param parameterfile
71    *          Service specific jalview parameter file (as returned from new
72    *          method)
73    * @return null or valid WsParamSetI object for this service.
74    */
75
76   public WsParamSetI parseServiceParameterFile(String name,
77           String description, String[] serviceURL, String parameters)
78           throws IOException;
79
80   /**
81    * create the service specific parameter file for this pset object.
82    * 
83    * @param pset
84    * @return string representation of the parameters specified by this set.
85    * @throws IOException
86    */
87   public String generateServiceParameterFile(WsParamSetI pset)
88           throws IOException;
89
90 }