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.
22 package jalview.fts.api;
24 import jalview.fts.api.FTSDataColumnI.FTSDataColumnGroupI;
25 import jalview.fts.core.FTSDataColumnPreferences.PreferenceSource;
26 import jalview.fts.core.FTSRestRequest;
27 import jalview.fts.core.FTSRestResponse;
29 import java.util.Collection;
32 * Methods for FTS Rest client.
36 public interface FTSRestClientI
40 * Execute a given FTS request, process the response and return it as an
41 * FTSRestResponse object
43 * @param ftsRestRequest
44 * the FTS request to execute
45 * @return FTSRestResponse - the response after executing an FTS request
48 public FTSRestResponse executeRequest(FTSRestRequest ftsRequest)
52 * Return the resource file path for the data columns configuration file
56 public String getColumnDataConfigFileName();
59 * Fetch FTSDataColumnGroupI by the group's Id
62 * @return FTSDataColumnGroupI
65 public FTSDataColumnGroupI getDataColumnGroupById(String groupId)
69 * Fetch FTSDataColumnI by name or code
72 * @return FTSDataColumnI
75 public FTSDataColumnI getDataColumnByNameOrCode(String nameOrCode)
79 * Convert collection of FTSDataColumnI objects to a comma delimited string of
83 * the collection of FTSDataColumnI to process
84 * @return the generated comma delimited string from the supplied
85 * FTSDataColumnI collection
87 public String getDataColumnsFieldsAsCommaDelimitedString(
88 Collection<FTSDataColumnI> wantedFields);
91 * Fetch index of the primary key column for the dynamic table TODO: consider
92 * removing 'hasRefSeq' - never used in code
95 * the available table columns
97 * true if the data columns has an additional column for reference
99 * @return index of the primary key column
102 public int getPrimaryKeyColumIndex(
103 Collection<FTSDataColumnI> wantedFields, boolean hasRefSeq)
107 * Fetch the primary key data column object
109 * @return the FTSDataColumnI object for the primary key column
111 public FTSDataColumnI getPrimaryKeyColumn();
114 * Returns list of FTSDataColumnI objects to be displayed by default
116 * @return list of columns to display by default
118 public Collection<FTSDataColumnI> getAllDefaultDisplayedFTSDataColumns();
121 * Return list of FTSDataColumnI objects that can be used to perform a search
124 * @return list of searchable FTSDataColumnI object
126 public Collection<FTSDataColumnI> getSearchableDataColumns();
129 * Return list of all available FTSDataColumnI object
131 * @return list of all FTSColumnI objcet
133 public Collection<FTSDataColumnI> getAllFTSDataColumns();
136 * Return the default response page limit
138 * @return the default response page size
140 public int getDefaultResponsePageSize();
142 public String[] getPreferencesColumnsFor(PreferenceSource source);