package jalview.ws.jws2; import jalview.ws.jws2.Jws2Discoverer.Jws2Instance; import jalview.ws.params.ArgumentI; import jalview.ws.params.WsParamSetI; import java.util.List; import compbio.metadata.Preset; public class JabaPreset implements WsParamSetI { Preset p=null; Jws2Instance service; public JabaPreset(Jws2Instance svc, Preset preset) { service=svc; p=preset; } @Override public String getName() { return p.getName(); } @Override public String getDescription() { return p.getDescription(); } @Override public String[] getApplicableUrls() { return new String[] { service.getUri()}; } @Override public String getSourceFile() { return null; } @Override public boolean isModifiable() { return false; } @Override public void setSourceFile(String newfile) { throw new Error("Cannot set source file for "+getClass()); } @Override public List getArguments() { try { return JabaParamStore.getJwsArgsfromJaba(p.getArguments(service.getRunnerConfig())); } catch (Exception e) { e.printStackTrace(); throw new Error("Probable mismatch between service instance and preset!"); } } @Override public void setArguments(List args) { throw new Error("Cannot set Parameters for a Jaba Web service's preset"); } }