X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Forg%2Fbiojava%2Fdasobert%2Fdasregistry%2FDas1Source.java;h=c46d709ac3f0b2c7415b1f255c20450149a1fae0;hb=506d60f0e188723ddc91c26824b41ac7034df3fe;hp=e7541b417e8c8a2d21d5e0611cb86834484d30e2;hpb=60f2d6c034560415fd0139c8bc7df0c19cae1186;p=jalview.git diff --git a/src/org/biojava/dasobert/dasregistry/Das1Source.java b/src/org/biojava/dasobert/dasregistry/Das1Source.java index e7541b4..c46d709 100755 --- a/src/org/biojava/dasobert/dasregistry/Das1Source.java +++ b/src/org/biojava/dasobert/dasregistry/Das1Source.java @@ -25,31 +25,44 @@ package org.biojava.dasobert.dasregistry; import java.util.*; -//import org.biojava.dasobert.das2.io.DasSourceWriter; -//import org.biojava.dasobert.das2.io.DasSourceWriterImpl; -//import org.biojava.utils.xml.PrettyXMLWriter; +// import org.biojava.dasobert.das2.io.DasSourceWriter; +// import org.biojava.dasobert.das2.io.DasSourceWriterImpl; +// import org.biojava.utils.xml.PrettyXMLWriter; - -/** a simple Bean class to be returned via SOAP +/** + * a simple Bean class to be returned via SOAP + * * @author Andreas Prlic */ -public class Das1Source - implements DasSource +public class Das1Source implements DasSource { String url; + protected String nickname; + String adminemail; + String description; + DasCoordinateSystem[] coordinateSystem; + String[] capabilities; + String[] labels; + String helperurl; + Date registerDate; + Date leaseDate; + String id; + boolean local; + Map properties; + boolean alertAdmin; public static String EMPTY_ID = "UNK:-1"; @@ -60,13 +73,13 @@ public class Das1Source url = ""; adminemail = ""; description = ""; - //String empty = "" ; + // String empty = "" ; nickname = ""; coordinateSystem = new DasCoordinateSystem[0]; - //coordinateSystem[0] = new DasCoordinateSystem(); + // coordinateSystem[0] = new DasCoordinateSystem(); capabilities = new String[0]; labels = new String[0]; - //capabilities[0] = empty ; + // capabilities[0] = empty ; registerDate = new Date(); leaseDate = new Date(); helperurl = ""; @@ -76,7 +89,7 @@ public class Das1Source public boolean equals(DasSource other) { System.out.println("Das1Source equals, comparing with other DasSource"); - if (! (other instanceof Das1Source)) + if (!(other instanceof Das1Source)) { return false; } @@ -104,25 +117,22 @@ public class Das1Source return h; } - /** the DAS2 string representation of this DAS source - * - public String toString() { - - StringWriter writer = new StringWriter(); - - PrintWriter pw = new PrintWriter(writer); - PrettyXMLWriter xw = new PrettyXMLWriter(pw); - - DasSourceWriter dswriter = new DasSourceWriterImpl(); - try { - dswriter.writeDasSource(xw,this); - } catch (IOException e){ - e.printStackTrace(); - } - - return writer.toString(); - - } + /** + * the DAS2 string representation of this DAS source + * + * public String toString() { + * + * StringWriter writer = new StringWriter(); + * + * PrintWriter pw = new PrintWriter(writer); PrettyXMLWriter xw = new + * PrettyXMLWriter(pw); + * + * DasSourceWriter dswriter = new DasSourceWriterImpl(); try { + * dswriter.writeDasSource(xw,this); } catch (IOException e){ + * e.printStackTrace(); } + * + * return writer.toString(); + * } */ public void setLocal(boolean flag) { @@ -139,10 +149,10 @@ public class Das1Source id = i; } - /** get a the Id of the DasSource. The Id is a unique db - * identifier. The public DAS-Registry has Auto_Ids that look like - * DASSOURCE:12345; public look like XYZ:12345, where the XYZ - * prefix can be configured in the config file. + /** + * get a the Id of the DasSource. The Id is a unique db identifier. The public + * DAS-Registry has Auto_Ids that look like DASSOURCE:12345; public look like + * XYZ:12345, where the XYZ prefix can be configured in the config file. */ public String getId() { @@ -209,19 +219,23 @@ public class Das1Source { return capabilities; } - /** test if a this source has a particular capability - * - * @param testCapability - * @return true if the server has this capability. - */ - public boolean hasCapability(String testCapability){ - for (int i=0 ; i< capabilities.length;i++){ - String cap = capabilities[i]; - if ( cap.equals(testCapability)) - return true; - } - return false; + + /** + * test if a this source has a particular capability + * + * @param testCapability + * @return true if the server has this capability. + */ + public boolean hasCapability(String testCapability) + { + for (int i = 0; i < capabilities.length; i++) + { + String cap = capabilities[i]; + if (cap.equals(testCapability)) + return true; } + return false; + } public DasCoordinateSystem[] getCoordinateSystem() { @@ -276,12 +290,16 @@ public class Das1Source public boolean getAlertAdmin() { return alertAdmin; - } - public Map getProperties() { - return properties; - } - public void setProperties(Map properties) { - this.properties = properties; - } + } + + public Map getProperties() + { + return properties; + } + + public void setProperties(Map properties) + { + this.properties = properties; + } }