2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.ws.params;
23 import java.io.IOException;
24 import java.util.List;
26 public interface ParamDatastoreI
29 public List<WsParamSetI> getPresets();
31 public WsParamSetI getPreset(String name);
34 * Returns if the service has presets.
35 * @return {@code true} if service has presets
37 public default boolean hasPresets()
39 var presets = getPresets();
40 return presets != null && presets.size() > 0;
43 public List<ArgumentI> getServiceParameters();
46 * Returns if the service has parameters.
47 * @return {@code true} if service has parameters
49 public default boolean hasParameters()
51 var parameters = getServiceParameters();
52 return parameters != null && parameters.size() > 0;
55 public boolean presetExists(String name);
57 public void deletePreset(String name);
60 * writes or overwrites the record for a modifiable WsParamSetI entry with a
61 * given name in the datastore.
66 * may throw an illegal argument RunTimeException if the presetName
67 * overwrites an existing, unmodifiable preset.
69 public void storePreset(String presetName, String text,
70 List<ArgumentI> jobParams);
73 * update an existing instance with a new name, descriptive text and
81 public void updatePreset(String oldName, String presetName, String text,
82 List<ArgumentI> jobParams);
85 * factory method - builds a service specific parameter object using the given
92 * @param parameterfile
93 * Service specific jalview parameter file (as returned from new
95 * @return null or valid WsParamSetI object for this service.
98 public WsParamSetI parseServiceParameterFile(String name,
99 String description, String[] serviceURL, String parameters)
103 * create the service specific parameter file for this pset object.
106 * @return string representation of the parameters specified by this set.
107 * @throws IOException
109 public String generateServiceParameterFile(WsParamSetI pset)