[MOBY-guts] biomoby commit
senger@ebi.ac.uk
senger at pub.open-bio.org
Fri May 9 15:51:12 UTC 2003
senger
Fri May 9 11:51:11 EDT 2003
Update of /home/repository/moby/moby-live/Java/org/biomoby/shared
In directory pub.open-bio.org:/tmp/cvs-serv9113/org/biomoby/shared
Modified Files:
Central.java Makefile MobyDataType.java MobyNamespace.java
MobyService.java MobyServiceType.java Utils.java package.html
Added Files:
MobyData.java MobyPrimaryDataSet.java
MobyPrimaryDataSimple.java MobySecondaryData.java
PendingCurationException.java
Log Message:
changes reflecting the main API change in BioMoby
moby-live/Java/org/biomoby/shared MobyData.java,NONE,1.1 MobyPrimaryDataSet.java,NONE,1.1 MobyPrimaryDataSimple.java,NONE,1.1 MobySecondaryData.java,NONE,1.1 PendingCurationException.java,NONE,1.1 Central.java,1.2,1.3 Makefile,1.2,1.3 MobyDataType.java,1.1,1.2 MobyNamespace.java,1.1,1.2 MobyService.java,1.1,1.2 MobyServiceType.java,1.1,1.2 Utils.java,1.2,1.3 package.html,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Java/org/biomoby/shared/Central.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/org/biomoby/shared/Central.java 2003/03/02 20:48:26 1.2
+++ /home/repository/moby/moby-live/Java/org/biomoby/shared/Central.java 2003/05/09 15:51:11 1.3
@@ -30,8 +30,8 @@
*<p>
*
* For details describing and explaining the methods see the original documentation at
- * <a href="http://biomoby.org/Documentation/MOBY_Central.html" target="_top">
- * http://biomoby.org/Documentation/MOBY_Central.html</a>.
+ * <a href="http://biomoby.org/" target="_top">
+ * http://biomoby.org</a>.
*<p>
*
* @author <A HREF="mailto:senger at ebi.ac.uk">Martin Senger</A>
@@ -96,8 +96,8 @@
* @throws MobyException if communication with the Moby Registry fails
* @throws NoSuccessException if 'dataTypeName' was not found
*************************************************************************/
- String getDataType (String dataTypeName)
- throws MobyException, NoSuccessException;
+// String getDataType (String dataTypeName)
+// throws MobyException, NoSuccessException;
/*************************************************************************
* Get WSDL defining a service given by its name and its authority.
@@ -131,7 +131,7 @@
* @throws NoSuccessException if registration failed
*************************************************************************/
void registerDataType (MobyDataType dataType)
- throws MobyException, NoSuccessException;
+ throws MobyException, NoSuccessException, PendingCurationException;
/*************************************************************************
* Unregister given Moby data type. Note that it may not work if the
@@ -142,7 +142,7 @@
* @throws NoSuccessException if unregistration failed
*************************************************************************/
void unregisterDataType (MobyDataType dataType)
- throws MobyException, NoSuccessException;
+ throws MobyException, NoSuccessException, PendingCurationException;
/*************************************************************************
* Register new service type. It also updates 'serviceType' with an ID
@@ -156,7 +156,7 @@
* @throws NoSuccessException if registration failed
*************************************************************************/
void registerServiceType (MobyServiceType serviceType)
- throws MobyException, NoSuccessException;
+ throws MobyException, NoSuccessException, PendingCurationException;
/*************************************************************************
* Unregister given Moby service type. Note that it may not work if the
@@ -167,7 +167,7 @@
* @throws NoSuccessException if unregistration failed
*************************************************************************/
void unregisterServiceType (MobyServiceType serviceType)
- throws MobyException, NoSuccessException;
+ throws MobyException, NoSuccessException, PendingCurationException;
/*************************************************************************
* Register new namespace. It also updates 'namespace' with an ID
@@ -180,7 +180,7 @@
* @throws NoSuccessException if registration failed
*************************************************************************/
void registerNamespace (MobyNamespace namespace)
- throws MobyException, NoSuccessException;
+ throws MobyException, NoSuccessException, PendingCurationException;
/*************************************************************************
* Unregister given Moby namespace. Note that it may not work if the
@@ -191,7 +191,7 @@
* @throws NoSuccessException if unregistration failed
*************************************************************************/
void unregisterNamespace (MobyNamespace namespace)
- throws MobyException, NoSuccessException;
+ throws MobyException, NoSuccessException, PendingCurationException;
/*************************************************************************
* Register a new service. It also updates 'service' with an ID
@@ -205,7 +205,7 @@
* @throws NoSuccessException if registration failed
*************************************************************************/
void registerService (MobyService service)
- throws MobyException, NoSuccessException;
+ throws MobyException, NoSuccessException, PendingCurationException;
/*************************************************************************
* Unregister given Moby service. Note that it may not work if the
@@ -216,7 +216,7 @@
* @throws NoSuccessException if unregistration failed
*************************************************************************/
void unregisterService (MobyService service)
- throws MobyException, NoSuccessException;
+ throws MobyException, NoSuccessException, PendingCurationException;
/**************************************************************************
* Find services of the given type and its sub-types.
@@ -240,14 +240,8 @@
throws MobyException;
/**************************************************************************
- * Find services by their input and/or output data types. If the 'pattern'
- * has a non-empty array of input data types, it looks for services with
- * such inputs. If the 'pattern' has a non-empty array of output data
- * types, it looks for services with such outputs. If both input and
- * output data types are present, the returned set is a intersection.
- *<p>
- * Note that some other fields of the 'pattern' must be filled as well
- * (at the moment of writting this these fields are: type and authority).
+ * Find services matching whatever is non-empty in the given 'pattern'.
+ * If more fields are given the logical AND is applied on them.
*<p>
* @throws MobyException if communication with the Moby Registry fails
*************************************************************************/
@@ -255,6 +249,13 @@
throws MobyException;
/**************************************************************************
+ * Find service matching both all non-empty fields in the 'pattern' and
+ * the 'keywords'.
+ *************************************************************************/
+ MobyService[] findService (MobyService pattern, String[] keywords)
+ throws MobyException;
+
+ /**************************************************************************
* Call Moby registry's method with given XML as input and return whatever
* you get back. If 'inputXML' is null or empty, the method is called
* without any parameters.
@@ -263,4 +264,11 @@
*************************************************************************/
String call (String methodName, String inputXML)
throws MobyException;
+
+ /**************************************************************************
+ * Ask the implementation to create more verbose logs or messages about
+ * what is going on. The behaviour is completely implementation dependent.
+ *************************************************************************/
+ void setDebug (boolean debug);
+
}
===================================================================
RCS file: /home/repository/moby/moby-live/Java/org/biomoby/shared/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/org/biomoby/shared/Makefile 2003/03/02 20:48:26 1.2
+++ /home/repository/moby/moby-live/Java/org/biomoby/shared/Makefile 2003/05/09 15:51:11 1.3
@@ -4,9 +4,11 @@
#
# -----------------------------------------------------------------------------
-SOURCE += MobyException NoSuccessException
+SOURCE += MobyException NoSuccessException PendingCurationException
SOURCE += Utils
SOURCE += MobyDataType MobyNamespace
+SOURCE += MobyData
+SOURCE += MobyPrimaryDataSimple MobyPrimaryDataSet MobySecondaryData
SOURCE += MobyServiceType MobyService
SOURCE += Central
===================================================================
RCS file: /home/repository/moby/moby-live/Java/org/biomoby/shared/MobyDataType.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/org/biomoby/shared/MobyDataType.java 2003/03/02 20:48:26 1.1
+++ /home/repository/moby/moby-live/Java/org/biomoby/shared/MobyDataType.java 2003/05/09 15:51:11 1.2
@@ -7,6 +7,9 @@
package org.biomoby.shared;
+import java.util.*;
+
+
/**
* A container representing a data type used in the Moby registry.
* The Moby data types are used to specify what types of inputs and
@@ -26,9 +29,10 @@
protected String name;
protected String authority = "";
+ protected String emailContact = "";
protected String description = "";
- protected String xsd = "";
protected String[] parentNames = new String[] { };
+ protected Hashtable children = new Hashtable();
protected String id = null;
/**************************************************************************
@@ -57,6 +61,13 @@
authority = (value == null ? "" : value);
}
+ public String getEmailContact() {
+ return emailContact;
+ }
+ public void setEmailContact (String value) {
+ emailContact = (value == null ? "" : value);
+ }
+
public String getDescription() {
return description;
}
@@ -64,13 +75,6 @@
description = (value == null ? "" : value);
}
- public String getXSD() {
- return xsd;
- }
- public void setXSD (String value) {
- xsd = (value == null ? "" : value);
- }
-
public String[] getParentNames() {
synchronized (parentNames) {
String[] names = new String [parentNames.length];
@@ -100,22 +104,58 @@
}
}
+ /**
+ * Describes what children this data type has (expressing ontology
+ * term HAS-A). The returned value is a hashtable with:
+ * key is a name of a data type (an existing or a basic type)
+ * value is a name of this child; note that this value may be
+ * int some cases be equal to the 'key' (this happens
+ * especially for the basic data types - but we do not care)
+ *
+ */
+ public Hashtable getChildren() {
+ return children;
+ }
+ public void setChildren (Hashtable value) {
+ children = (value == null ? new Hashtable() : value);
+ }
+ /**
+ * 'name' is a name given to this child (attribute)
+ * 'typeName' is a name of a type represented byte this child
+ */
+ public void addChild (String name, String typeName) {
+ if (typeName != null) {
+ if (name == null || name.equals (""))
+ name = typeName;
+ children.put (typeName, name);
+ }
+ }
+
+
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append ("Name: " + name + "\n");
buf.append ("Auth: " + authority + "\n");
buf.append ("Desc: " + description + "\n");
+ buf.append ("Contact: " + emailContact + "\n");
buf.append ("ID: " + id + "\n");
- buf.append ("Parents: ");
+ buf.append ("Parents:\n");
for (int i = 0 ; i < parentNames.length; i++) {
+ buf.append (Utils.format (null, 1));
buf.append (parentNames [i]);
- if (i < parentNames.length - 1)
- buf.append (", ");
+ buf.append ("\n");
+ }
+ buf.append ("Children:\n");
+ for (Enumeration en = children.keys(); en.hasMoreElements(); ) {
+ buf.append (Utils.format (null, 1));
+ buf.append ((String)en.nextElement());
+ buf.append ("\n");
}
- buf.append ("\n");
- buf.append ("XSD:\n");
- buf.append (xsd);
return new String (buf);
}
+ public String format (int indent) {
+ return Utils.format (this, indent);
+ }
+
}
===================================================================
RCS file: /home/repository/moby/moby-live/Java/org/biomoby/shared/MobyNamespace.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/org/biomoby/shared/MobyNamespace.java 2003/03/02 20:48:26 1.1
+++ /home/repository/moby/moby-live/Java/org/biomoby/shared/MobyNamespace.java 2003/05/09 15:51:11 1.2
@@ -23,6 +23,7 @@
protected String name;
protected String authority = "";
+ protected String emailContact = "";
protected String description = "";
protected String id = null;
@@ -52,6 +53,13 @@
authority = (value == null ? "" : value);
}
+ public String getEmailContact() {
+ return emailContact;
+ }
+ public void setEmailContact (String value) {
+ emailContact = (value == null ? "" : value);
+ }
+
public String getDescription() {
return description;
}
@@ -67,5 +75,8 @@
buf.append ("ID: " + id + "\n");
return new String (buf);
}
+ public String format (int indent) {
+ return Utils.format (this, indent);
+ }
}
===================================================================
RCS file: /home/repository/moby/moby-live/Java/org/biomoby/shared/MobyService.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/org/biomoby/shared/MobyService.java 2003/03/02 20:48:26 1.1
+++ /home/repository/moby/moby-live/Java/org/biomoby/shared/MobyService.java 2003/05/09 15:51:11 1.2
@@ -7,6 +7,8 @@
package org.biomoby.shared;
+import java.util.*;
+
/**
* A container representing a service.
*<p>
@@ -24,14 +26,18 @@
protected String name;
protected String category = "moby";
protected String authority = "";
+ protected String emailContact = "";
protected String type = "";
protected String description = "";
protected String url = "";
- protected String[] inputTypes = new String[] { };
- protected String[] namespaces = new String[] { };
- protected String[] outputTypes = new String[] { };
+ protected boolean authoritativeService = true;
protected String id = null;
+ // the elements of these Vectors are of type MobyData
+ protected Vector primaryInputs = new Vector();
+ protected Vector secondaryInputs = new Vector();
+ protected Vector primaryOutputs = new Vector();
+
/**************************************************************************
* Default constructor. Other characteristics are empty - which is usually
* wrong - therefore use 'set' method to fill them.
@@ -51,6 +57,13 @@
id = value;
}
+ public boolean isAuthoritative() {
+ return authoritativeService;
+ }
+ public void setAuthoritative (boolean value) {
+ authoritativeService = value;
+ }
+
public String getAuthority() {
return authority;
}
@@ -58,6 +71,13 @@
authority = (value == null ? "" : value);
}
+ public String getEmailContact() {
+ return emailContact;
+ }
+ public void setEmailContact (String value) {
+ emailContact = (value == null ? "" : value);
+ }
+
public String getCategory() {
return category;
}
@@ -86,83 +106,66 @@
url = (value == null ? "" : value);
}
- public String[] getInputTypes() {
- synchronized (inputTypes) {
- String[] types = new String [inputTypes.length];
- System.arraycopy (inputTypes, 0, types, 0, inputTypes.length);
- return types;
- }
- }
- public String[] getInputNamespaces() {
- synchronized (namespaces) {
- String[] names = new String [namespaces.length];
- System.arraycopy (namespaces, 0, names, 0, namespaces.length);
- return names;
- }
- }
- public void setInputs (String[] types, String[] names) {
- synchronized (inputTypes) {
- if (types == null) {
- inputTypes = new String[] { };
- namespaces = new String[] { };
- } else {
- int len = types.length;
- if (names != null && names.length < len)
- len = names.length;
- inputTypes = new String [len];
- System.arraycopy (types, 0, inputTypes, 0, len);
- namespaces = new String [len];
- System.arraycopy (names, 0, namespaces, 0, len);
+ public void setInputs (MobyData[] value) {
+ if (value == null) {
+ primaryInputs.clear();
+ secondaryInputs.clear();
+ } else {
+ for (int i = 0 ; i < value.length; i++) {
+ if (value[i].isPrimary())
+ primaryInputs.addElement (value[i]);
+ else
+ secondaryInputs.addElement (value[i]);
}
}
}
- public void addInput (String inputType, String namespace) {
- if (inputType != null) {
- synchronized (inputTypes) {
- int len = inputTypes.length + 1;
-
- // add new input type
- String[] newTypes = new String [len];
- System.arraycopy (inputTypes, 0, newTypes, 0, len-1);
- newTypes [len - 1] = inputType;
-
- // add new namespace
- String[] newNamespaces = new String [len];
- System.arraycopy (namespaces, 0, newNamespaces, 0, len-1);
- newNamespaces [len - 1] = namespace;
+ public void addInput (MobyData value) {
+ if (value != null) {
+ if (value.isPrimary())
+ primaryInputs.addElement (value);
+ else
+ secondaryInputs.addElement (value);
+ }
+ }
- inputTypes = newTypes;
- namespaces = newNamespaces;
+ public void setOutputs (MobyData[] value) {
+ if (value == null) {
+ primaryOutputs.clear();
+ } else {
+ for (int i = 0 ; i < value.length; i++) {
+ if (value[i].isPrimary())
+ primaryOutputs.addElement (value[i]);
}
}
}
+ public void addOutput (MobyData value) {
+ if (value != null) {
+ if (value.isPrimary())
+ primaryOutputs.addElement (value);
+ }
+ }
- public String[] getOutputTypes() {
- synchronized (outputTypes) {
- String[] types = new String [outputTypes.length];
- System.arraycopy (outputTypes, 0, types, 0, outputTypes.length);
- return types;
+ public MobyData[] getPrimaryInputs() {
+ synchronized (primaryInputs) {
+ MobyData[] results = new MobyData [primaryInputs.size()];
+ primaryInputs.copyInto (results);
+ return results;
}
}
- public void setOutputTypes (String[] value) {
- synchronized (outputTypes) {
- if (value == null)
- outputTypes = new String[] { };
- else {
- outputTypes = new String [value.length];
- System.arraycopy (value, 0, outputTypes, 0, value.length);
- }
+
+ public MobyData[] getSecondaryInputs() {
+ synchronized (secondaryInputs) {
+ MobyData[] results = new MobyData [secondaryInputs.size()];
+ secondaryInputs.copyInto (results);
+ return results;
}
}
- public void addOutputType (String value) {
- if (value != null) {
- synchronized (outputTypes) {
- int len = outputTypes.length + 1;
- String[] newTypes = new String [len];
- System.arraycopy (outputTypes, 0, newTypes, 0, len-1);
- newTypes [len - 1] = value;
- setOutputTypes (newTypes);
- }
+
+ public MobyData[] getPrimaryOutputs() {
+ synchronized (primaryOutputs) {
+ MobyData[] results = new MobyData [primaryOutputs.size()];
+ primaryOutputs.copyInto (results);
+ return results;
}
}
@@ -178,24 +181,24 @@
buf.append ("Auth: " + authority + "\n");
buf.append ("Desc: " + description + "\n");
buf.append ("URL: " + url + "\n");
+ buf.append ("Contact: " + emailContact + "\n");
buf.append ("ID: " + id + "\n");
- synchronized (inputTypes) {
- buf.append ("Inputs: ");
- for (int i = 0 ; i < inputTypes.length; i++) {
- buf.append (inputTypes [i]);
- buf.append (" (" + namespaces[i] + ")");
- if (i < inputTypes.length - 1)
- buf.append (", ");
- }
- buf.append ("\n");
- }
- buf.append ("Outputs: ");
- for (int i = 0 ; i < outputTypes.length; i++) {
- buf.append (outputTypes [i]);
- if (i < outputTypes.length - 1)
- buf.append (", ");
- }
+
+ buf.append ("\nPrimary inputs:\n");
+ for (Enumeration en = primaryInputs.elements(); en.hasMoreElements(); )
+ buf.append (((MobyData)en.nextElement()).format (1));
+ buf.append ("\n");
+
+ buf.append ("\nSecondary inputs:\n");
+ for (Enumeration en = secondaryInputs.elements(); en.hasMoreElements(); )
+ buf.append (en.nextElement().toString());
buf.append ("\n");
+
+ buf.append ("\nOutputs:\n");
+ for (Enumeration en = primaryOutputs.elements(); en.hasMoreElements(); )
+ buf.append (en.nextElement().toString());
+ buf.append ("\n");
+
return new String (buf);
}
===================================================================
RCS file: /home/repository/moby/moby-live/Java/org/biomoby/shared/MobyServiceType.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/org/biomoby/shared/MobyServiceType.java 2003/03/02 20:48:26 1.1
+++ /home/repository/moby/moby-live/Java/org/biomoby/shared/MobyServiceType.java 2003/05/09 15:51:11 1.2
@@ -23,6 +23,8 @@
protected String name;
protected String description = "";
+ protected String emailContact = "";
+ protected String authority = "";
protected String[] parentNames = new String[] { };
protected String id = null;
@@ -81,19 +83,36 @@
}
}
+ public String getEmailContact() {
+ return emailContact;
+ }
+ public void setEmailContact (String value) {
+ emailContact = (value == null ? "" : value);
+ }
+
+ public String getAuthority() {
+ return authority;
+ }
+ public void setAuthority (String value) {
+ authority = (value == null ? "" : value);
+ }
+
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: ");
+ buf.append ("Parents:\n");
for (int i = 0 ; i < parentNames.length; i++) {
+ buf.append (Utils.format (null, 1));
buf.append (parentNames [i]);
- if (i < parentNames.length - 1)
- buf.append (", ");
+ buf.append ("\n");
}
- buf.append ("\n");
return new String (buf);
}
+ public String format (int indent) {
+ return Utils.format (this, indent);
+ }
+
}
===================================================================
RCS file: /home/repository/moby/moby-live/Java/org/biomoby/shared/Utils.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/org/biomoby/shared/Utils.java 2003/03/02 20:48:26 1.2
+++ /home/repository/moby/moby-live/Java/org/biomoby/shared/Utils.java 2003/05/09 15:51:11 1.3
@@ -101,6 +101,26 @@
return buf.toString();
}
+
+ /*************************************************************************
+ *
+ *************************************************************************/
+ static public String format (Object objectToBeFormatted, int indent) {
+ StringBuffer buf = new StringBuffer();
+ while (indent-- > 0) {
+ buf.append (" ");
+ }
+ String strIndent = new String (buf);
+ if (objectToBeFormatted == null)
+ return strIndent;
+ String result = strIndent +
+ replace (objectToBeFormatted.toString(), "\n", "\n" + strIndent);
+ if (result.endsWith (strIndent))
+ return result.substring (0, result.length() - strIndent.length());
+ else
+ return result;
+ }
+
/*************************************************************************
* Find and return an instance of a DOM parser wrapper. A parser
* wrapper is a class allowing a uniform access to DOM parsers -
===================================================================
RCS file: /home/repository/moby/moby-live/Java/org/biomoby/shared/package.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/org/biomoby/shared/package.html 2003/03/02 20:48:26 1.1
+++ /home/repository/moby/moby-live/Java/org/biomoby/shared/package.html 2003/05/09 15:51:11 1.2
@@ -10,14 +10,8 @@
The cornerstone piece is the interface {@link org.biomoby.shared.Central} that
defines how to access Moby registry without any knowledge of
the used transport protocol (SOAP, XML, etc.). This interface
-uses several "containers" representing pieces of the Moby mosaic
-(classes {@link org.biomoby.shared.MobyService}, {@link org.biomoby.shared.MobyDataType},
-{@link org.biomoby.shared.MobyServiceType}, and {@link org.biomoby.shared.MobyNamespace}).
+uses several "containers" representing pieces of the Moby mosaic -
+but most of them may not be necessary for the client.
<p>
-The idea is that a client developers does need only classes from package
-{@link org.biomoby.client} and from this package while the server developer
-may need only package <tt>org.biomoby.registry</tt> and again this package.
-
-
</body> </html>
More information about the MOBY-guts
mailing list