78ca8fc89c87ebf334373e06ff6990ad33100262
[jalview.git] / src / jalview / ws / params / ParamDatastoreI.java
1 package jalview.ws.params;
2
3 import java.io.IOException;
4 import java.util.List;
5
6 public interface ParamDatastoreI
7 {
8
9   public List<WsParamSetI> getPresets();
10
11   public WsParamSetI getPreset(String name);
12
13   public List<ArgumentI> getServiceParameters();
14
15   public boolean presetExists(String name);
16
17   public void deletePreset(String name);
18
19   /**
20    * writes or overwrites the record for a modifiable WsParamSetI entry with a given name in the
21    * datastore.
22    * 
23    * @param presetName
24    * @param text
25    * @param jobParams
26    *          may throw an illegal argument RunTimeException if the presetName
27    *          overwrites an existing, unmodifiable preset.
28    */
29   public void storePreset(String presetName, String text,
30           List<ArgumentI> jobParams);
31
32   /**
33    * update an existing instance with a new name, descriptive text and parameters.
34    * @param oldName
35    * @param presetName
36    * @param text
37    * @param jobParams
38    */
39   public void updatePreset(String oldName, String presetName, String text,
40            List<ArgumentI> jobParams);
41
42   /**
43    * factory method - builds a service specific parameter object using the given
44    * data
45    * 
46    * @param name
47    * @param description
48    * @param applicable
49    *          URLs
50    * @param parameterfile
51    *          Service specific jalview parameter file (as returned from new
52    *          method)
53    * @return null or valid WsParamSetI object for this service.
54    */
55
56   public WsParamSetI parseServiceParameterFile(String name,
57           String description, String[] serviceURL, String parameters)
58           throws IOException;
59
60   /**
61    * create the service specific parameter file for this pset object.
62    * 
63    * @param pset
64    * @return string representation of the parameters specified by this set.
65    * @throws IOException
66    */
67   public String generateServiceParameterFile(WsParamSetI pset)
68           throws IOException;
69
70 }