*/
package jalview.fts.service.pdb;
+import jalview.bin.Instance;
import jalview.datamodel.SequenceI;
import jalview.fts.api.FTSData;
import jalview.fts.api.FTSDataColumnI;
public class PDBFTSRestClient extends FTSRestClient
{
- private static FTSRestClientI instance = null;
+ public static FTSRestClientI getInstance()
+ {
+ Instance j = Instance.getInstance();
+ return (j.pdbFTSRestClient == null
+ ? j.pdbFTSRestClient = new PDBFTSRestClient()
+ : j.pdbFTSRestClient);
+ }
public static final String PDB_SEARCH_ENDPOINT = "https://www.ebi.ac.uk/pdbe/search/pdb/select?";
- protected PDBFTSRestClient()
+ private PDBFTSRestClient()
{
+ // singleton
}
/**
// Get the JSON string from the response object or directly from the
// client (JavaScript)
- Map<String, Object> jsonObj = (status == 200
+ Map<String, Object> jsonObj = (Platform.isJS() && status == 200
? clientResponse.getEntity(Map.class)
: null);
String responseString = (jsonObj == null
return "/fts/pdb_data_columns.txt";
}
- public static FTSRestClientI getInstance()
- {
- if (instance == null)
- {
- instance = new PDBFTSRestClient();
- }
- return instance;
- }
-
private Collection<FTSDataColumnI> allDefaultDisplayedStructureDataColumns;
public Collection<FTSDataColumnI> getAllDefaultDisplayedStructureDataColumns()