2 * BioJava development code
4 * This code may be freely distributed and modified under the
5 * terms of the GNU Lesser General Public Licence. This should
6 * be distributed with the code. If you do not have a copy,
9 * http://www.gnu.org/copyleft/lesser.html
11 * Copyright for this code is held jointly by the individual
12 * authors. These should be listed in @author doc comments.
14 * For more information on the BioJava project and its aims,
15 * or to join the biojava-l mailing list, visit the home page
18 * http://www.biojava.org/
20 * Created on 15.04.2004
21 * @author Andreas Prlic
24 package org.biojava.dasobert.dasregistry;
28 //import org.biojava.dasobert.das2.io.DasSourceWriter;
29 //import org.biojava.dasobert.das2.io.DasSourceWriterImpl;
30 //import org.biojava.utils.xml.PrettyXMLWriter;
33 /** a simple Bean class to be returned via SOAP
34 * @author Andreas Prlic
37 public class Das1Source
41 protected String nickname;
44 DasCoordinateSystem[] coordinateSystem;
45 String[] capabilities;
55 public static String EMPTY_ID = "UNK:-1";
65 coordinateSystem = new DasCoordinateSystem[0];
66 //coordinateSystem[0] = new DasCoordinateSystem();
67 capabilities = new String[0];
68 labels = new String[0];
69 //capabilities[0] = empty ;
70 registerDate = new Date();
71 leaseDate = new Date();
76 public boolean equals(DasSource other)
78 System.out.println("Das1Source equals, comparing with other DasSource");
79 if (! (other instanceof Das1Source))
84 Das1Source ods = (Das1Source) other;
86 if (ods.getUrl().equals(url))
90 if (ods.getNickname().equals(nickname))
101 h = 31 * h + (null == nickname ? 0 : nickname.hashCode());
102 h = 31 * h + (null == url ? 0 : url.hashCode());
107 /** the DAS2 string representation of this DAS source
109 public String toString() {
111 StringWriter writer = new StringWriter();
113 PrintWriter pw = new PrintWriter(writer);
114 PrettyXMLWriter xw = new PrettyXMLWriter(pw);
116 DasSourceWriter dswriter = new DasSourceWriterImpl();
118 dswriter.writeDasSource(xw,this);
119 } catch (IOException e){
123 return writer.toString();
127 public void setLocal(boolean flag)
132 public boolean isLocal()
137 public void setId(String i)
142 /** get a the Id of the DasSource. The Id is a unique db
143 * identifier. The public DAS-Registry has Auto_Ids that look like
144 * DASSOURCE:12345; public look like XYZ:12345, where the XYZ
145 * prefix can be configured in the config file.
147 public String getId()
152 public void setNickname(String name)
157 public String getNickname()
162 public void setUrl(String u)
164 char lastChar = u.charAt(u.length() - 1);
173 public void setAdminemail(String u)
178 public void setDescription(String u)
183 public void setCoordinateSystem(DasCoordinateSystem[] u)
185 coordinateSystem = u;
188 public void setCapabilities(String[] u)
193 public String getUrl()
198 public String getAdminemail()
203 public String getDescription()
208 public String[] getCapabilities()
213 public DasCoordinateSystem[] getCoordinateSystem()
215 return coordinateSystem;
218 public void setRegisterDate(Date d)
223 public Date getRegisterDate()
228 public void setLeaseDate(Date d)
233 public Date getLeaseDate()
238 public void setLabels(String[] ls)
243 public String[] getLabels()
248 public void setHelperurl(String url)
253 public String getHelperurl()
258 public void setAlertAdmin(boolean flag)
263 public boolean getAlertAdmin()