import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
+import jalview.bin.Cache;
import jalview.datamodel.AlignmentView;
import jalview.gui.AlignFrame;
import jalview.gui.AlignViewport;
}
protected static Vector<String> services=null;
+ public static final String RSBS_SERVICES="RSBS_SERVICES";
public static RestClient[] getRestClients()
{
if (services==null)
{
services = new Vector<String>();
try {
- for (RestServiceDescription descr: RestServiceDescription.parseDescriptions(jalview.bin.Cache.getDefault("RSBS_SERVICES",makeShmmrRestClient().service.toString())))
+ for (RestServiceDescription descr: RestServiceDescription.parseDescriptions(jalview.bin.Cache.getDefault(RSBS_SERVICES,makeShmmrRestClient().service.toString())))
{
services.add(descr.toString());
}
public static void setRsbsServices(Vector<String> rsbsUrls)
{
- // TODO: consider validating services ?
- services = new Vector<String>(rsbsUrls);
+ if (rsbsUrls!=null)
+ {
+ // TODO: consider validating services ?
+ services = new Vector<String>(rsbsUrls);
+ StringBuffer sprop = new StringBuffer();
+ for (String s:services)
+ {
+ sprop.append(s);
+ }
+ Cache.setProperty(RSBS_SERVICES, sprop.toString());
+ }
+ else
+ {
+ Cache.removeProperty(RSBS_SERVICES);
+ }
}
}