[MOBY-guts] biomoby commit

Martin Senger senger at pub.open-bio.org
Thu Oct 27 04:15:24 UTC 2005


senger
Thu Oct 27 00:15:23 EDT 2005
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared
In directory pub.open-bio.org:/tmp/cvs-serv2749/src/main/org/biomoby/shared

Modified Files:
	Central.java CentralDigest.java MobyNamespace.java 
	MobyServiceType.java 
Log Message:


moby-live/Java/src/main/org/biomoby/shared Central.java,1.12,1.13 CentralDigest.java,1.2,1.3 MobyNamespace.java,1.2,1.3 MobyServiceType.java,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java	2005/08/07 06:40:39	1.12
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java	2005/10/27 04:15:23	1.13
@@ -162,8 +162,11 @@
 	throws MobyException;
 
     /**************************************************************************
-     * Get the list of all registered namespaces.
-     *<p>
+     * Get the list of all registered namespaces. <p>
+     *
+     * @deprecated Replaced by {@link #getFullNamespaces} that gives
+     * more information for the same price. <p>
+     *
      * @return a hash table where keys are names of namespaces while
      *         values are their descriptions
      * @throws MobyException if communication with the Moby Registry fails
@@ -172,6 +175,16 @@
 	throws MobyException;
 
     /**************************************************************************
+     * Get the list of all registered namespaces, with all their
+     * attributes. <p>
+     *
+     * @return array of namespaces
+     * @throws MobyException if communication with the Moby Registry fails
+     *************************************************************************/
+    MobyNamespace[]  getFullNamespaces()
+	throws MobyException;
+
+    /**************************************************************************
      * Get the list of all registered data types.
      *<p>
      * @return a hash table where keys are names of data types while

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java	2005/09/22 16:07:09	1.2
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java	2005/10/27 04:15:23	1.3
@@ -46,17 +46,6 @@
 	throws MobyException;
 
     /*************************************************************************
-     * Get definition of all known namespaces. It differs from the
-     * {@link Central#getNamespaces} because it returns an array of
-     * full definitions of namespaces, and not just their names and
-     * descriptions. <p>
-     *
-     * @throws MobyException if communication with the Moby Registry fails
-     *************************************************************************/
-    MobyNamespace[] getFullNamespaces()
-	throws MobyException;
-
-    /*************************************************************************
      * Get definition of all registered service instances. It is a
      * cumulation of many individual calls to {@link
      * Central#findService(MobyService) findService by name} for all

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java	2005/09/22 16:07:09	1.2
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java	2005/10/27 04:15:23	1.3
@@ -20,14 +20,23 @@
  * @version $Id$
  */
 
-public class MobyNamespace {
+public class MobyNamespace
+    implements Comparable {
 
     protected String name;
     protected String authority = "";
     protected String emailContact = "";
     protected String description = "";
+    protected String lsid = null;
     protected String id = null;
 
+    public int compareTo (Object obj) {
+	return name.compareToIgnoreCase ( ((MobyNamespace)obj).getName() );
+    }
+    public boolean equals (Object obj) {
+	return name.equals ( ((MobyNamespace)obj).getName() );
+    }
+
     /**************************************************************************
      * Default constructor. Other characteristics are empty - which is usually
      * wrong - therefore use 'set' method to fill them.
@@ -47,6 +56,13 @@
 	id = value;
     }
 
+    public String getLSID() {
+	return lsid;
+    }
+    public void setLSID (String value) {
+	lsid = value;
+    }
+
     public String getAuthority() {
 	return authority;
     }
@@ -70,10 +86,12 @@
 
     public String toString() {
 	StringBuffer buf = new StringBuffer();
-	buf.append ("Name: " + name);
+	buf.append (name);
 	if (UUtils.notEmpty (authority))
 	    buf.append (", Auth: " + authority);
-	if (id != null) buf.append (", ID: " + id);
+	if (UUtils.notEmpty (emailContact))
+	    buf.append (", Contact: " + emailContact);
+	if (lsid != null) buf.append (", " + lsid);
 	if (UUtils.notEmpty (description))
 	    buf.append ("\n\t" + description);
 	return new String (buf);

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyServiceType.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyServiceType.java	2004/10/18 14:35:06	1.2
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyServiceType.java	2005/10/27 04:15:23	1.3
@@ -6,6 +6,7 @@
 //
 
 package org.biomoby.shared;
+import org.tulsoft.shared.UUtils;
 
 /**
  * A container representing a service type used in the Moby registry.
@@ -19,7 +20,8 @@
  * @version $Id$
  */
 
-public class MobyServiceType {
+public class MobyServiceType
+    implements Comparable {
 
     protected String name;
     protected String description = "";
@@ -27,6 +29,14 @@
     protected String authority = "";
     protected String[] parentNames = new String[] { };
     protected String id = null;
+    protected String lsid = null;
+
+    public int compareTo (Object obj) {
+	return name.compareToIgnoreCase ( ((MobyServiceType)obj).getName() );
+    }
+    public boolean equals (Object obj) {
+	return name.equals ( ((MobyServiceType)obj).getName() );
+    }
 
     /**************************************************************************
      * Default constructor.
@@ -57,6 +67,13 @@
 	id = value;
     }
 
+    public String getLSID() {
+	return lsid;
+    }
+    public void setLSID (String value) {
+	lsid = value;
+    }
+
     public String getDescription() {
 	return description;
     }
@@ -109,14 +126,19 @@
 
     public String toString() {
 	StringBuffer buf = new StringBuffer();
-	buf.append ("Name:    " + name + "\n");
-	buf.append ("Desc:    " + description + "\n");
-	buf.append ("ID:      " + id + "\n");
-	buf.append ("Parents:\n");
-	for (int i = 0 ; i < parentNames.length; i++) {
-	    buf.append (Utils.format (null, 1));
-	    buf.append (parentNames [i]);
-	    buf.append ("\n");
+	buf.append (name);
+	if (UUtils.notEmpty (authority))
+	    buf.append (", Auth: " + authority);
+	if (UUtils.notEmpty (emailContact))
+	    buf.append (", Contact: " + emailContact);
+	if (lsid != null) buf.append (", " + lsid);
+	if (UUtils.notEmpty (description))
+	    buf.append ("\n\t" + description);
+	if (parentNames.length > 0) {
+	    buf.append ("\n\tParents: ");
+	    for (int i = 0 ; i < parentNames.length; i++) {
+		buf.append (parentNames [i] + " ");
+	    }
 	}
 	return new String (buf);
     }




More information about the MOBY-guts mailing list