JAL-3515 Extract core WSDiscoverer methods to a separate interface
[jalview.git] / src / jalview / ws / WSDiscovererI.java
diff --git a/src/jalview/ws/WSDiscovererI.java b/src/jalview/ws/WSDiscovererI.java
new file mode 100644 (file)
index 0000000..e5b94f0
--- /dev/null
@@ -0,0 +1,34 @@
+package jalview.ws;
+
+import jalview.ws.api.ServiceWithParameters;
+
+import java.beans.PropertyChangeListener;
+import java.net.URL;
+import java.util.List;
+
+public interface WSDiscovererI extends WSMenuEntryProviderI
+{
+  public static final int STATUS_OK = 1;
+  public static final int STATUS_NO_SERVICES = 0;
+  public static final int STATUS_INVALID = -1;
+  public static final int STATUS_UNKNOWN = -2;
+
+  public void setServiceUrls(List<String> wsUrls);
+
+  public List<String> getServiceUrls();
+
+  public List<ServiceWithParameters> getServices();
+
+  public boolean testServiceUrl(URL url);
+
+  public int getServerStatusFor(String url);
+
+  // TODO: should not return Thread but something generic providing isRunning method
+  public Thread startDiscoverer(PropertyChangeListener changeListener);
+
+  public String getErrorMessages();
+
+  public boolean hasServices();
+
+  public boolean isRunning();
+}