[MOBY-guts] biomoby commit

Eddie Kawas kawas at pub.open-bio.org
Tue May 31 18:15:14 UTC 2005


kawas
Tue May 31 14:15:14 EDT 2005
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties
In directory pub.open-bio.org:/tmp/cvs-serv6440/org/biomoby/registry/properties

Modified Files:
	MobyProperties.java MobyCentralConfig.java 
Log Message:
Made the properties more consistent with how Mark uses mobycentral.config in Perl. Eddie

moby-live/Java/src/main/org/biomoby/registry/properties MobyProperties.java,1.1,1.2 MobyCentralConfig.java,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/MobyProperties.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/MobyProperties.java	2005/04/07 16:42:26	1.1
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/MobyProperties.java	2005/05/31 18:15:14	1.2
@@ -31,8 +31,12 @@
 package org.biomoby.registry.properties;
 
 import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.Properties;
 
+import org.biomoby.shared.MobyException;
+
 /**
  * @author Eddie Kawas
  * <p>This class was created to provide classes that depend on external variables a way to retrieve these variables.
@@ -51,10 +55,110 @@
      */
     public final static Properties PROPERTIES() {
         try {
-            properties.load(MobyProperties.class.getClassLoader().getResourceAsStream("org/biomoby/client/properties/biomoby.properties"));
+            properties.load(MobyProperties.class.getClassLoader().getResourceAsStream("org/biomoby/registry/properties/biomoby.properties"));
         } catch (IOException e) {
             System.err.println("Biomoby properties file cannot be found!");
         }
         return properties;
     }
+    
+    /**
+     * 
+     * Retrieve the properties for [mobyobject] in mobycentral.conf 
+     * <p><b>PRE:The file org/biomoby/registry/properties/biomoby.properties exists and is valid.</b>
+     * <p><b>POST:The properties contained in mobycentral.conf for [mobyobject] are returned in a Properties object.</b>
+     * @return Properties contained in the mobycentral.conf file.
+     */
+    public final static Properties OBJECT_PROPERTIES() {
+        Map map = new HashMap();
+        try {
+            map = MobyCentralConfig.getMobyObject();
+        } catch (MobyException e) {
+            System.err.println("Error retrieving Moby Object Properties.\n" + e);
+        }
+        Properties p = new Properties();
+        p.putAll(map);
+        return p;
+    }
+    
+    /**
+     * 
+     * Retrieve the properties for [mobycentral] in mobycentral.conf 
+     * <p><b>PRE:The file org/biomoby/registry/properties/biomoby.properties exists and is valid.</b>
+     * <p><b>POST:The properties contained in mobycentral.conf for [mobycentral] are returned in a Properties object.</b>
+     * @return Properties contained in the mobycentral.conf file.
+     */
+    public final static Properties SERVICE_INSTANCE_PROPERTIES() {
+        Map map = new HashMap();
+        try {
+            map = MobyCentralConfig.getMobyCentral();
+        } catch (MobyException e) {
+            System.err.println("Error retrieving Moby Service Instance Properties.\n" + e);
+        }
+        Properties p = new Properties();
+        p.putAll(map);
+        return p;
+    }
+    
+    /**
+     * 
+     * Retrieve the properties for [mobyservice] in mobycentral.conf 
+     * <p><b>PRE:The file org/biomoby/registry/properties/biomoby.properties exists and is valid.</b>
+     * <p><b>POST:The properties contained in mobycentral.conf for [mobyservice] are returned in a Properties object.</b>
+     * @return Properties contained in the mobycentral.conf file.
+     */
+    public final static Properties SERVICE_PROPERTIES() {
+        Map map = new HashMap();
+        try {
+            map = MobyCentralConfig.getMobyService();
+        } catch (MobyException e) {
+            System.err.println("Error retrieving Moby Service Properties.\n" + e);
+        }
+        Properties p = new Properties();
+        p.putAll(map);
+        return p;
+    }
+    
+    /**
+     * 
+     * Retrieve the properties for [mobynamespace] in mobycentral.conf 
+     * <p><b>PRE:The file org/biomoby/registry/properties/biomoby.properties exists and is valid.</b>
+     * <p><b>POST:The properties contained in mobycentral.conf for [mobynamespace] are returned in a Properties object.</b>
+     * @return Properties contained in the mobycentral.conf file.
+     */
+    public final static Properties NAMESPACE_PROPERTIES() {
+        Map map = new HashMap();
+        try {
+            map = MobyCentralConfig.getMobyNamespace();
+        } catch (MobyException e) {
+            System.err.println("Error retrieving Moby Namespace Properties.\n" + e);
+        }
+        Properties p = new Properties();
+        p.putAll(map);
+        return p;
+    }
+    
+    /**
+     * 
+     * Retrieve the properties for [mobyrelationship] in mobycentral.conf 
+     * <p><b>PRE:The file org/biomoby/registry/properties/biomoby.properties exists and is valid.</b>
+     * <p><b>POST:The properties contained in mobycentral.conf for [mobyrelationship] are returned in a Properties object.</b>
+     * @return Properties contained in the mobycentral.conf file.
+     */
+    public final static Properties RELATIONSHIP_PROPERTIES() {
+        Map map = new HashMap();
+        try {
+            map = MobyCentralConfig.getMobyRelationship();
+        } catch (MobyException e) {
+            System.err.println("Error retrieving Moby Relationship Properties.\n" + e);
+        }
+        Properties p = new Properties();
+        p.putAll(map);
+        return p;
+    }
+    
+    /* a little test method*/
+    public static void main(String[] args) {
+        System.out.println(NAMESPACE_PROPERTIES());
+    }
 }

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/MobyCentralConfig.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/registry/properties/MobyCentralConfig.java	2005/04/20 21:42:10	1.2
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/MobyCentralConfig.java	2005/05/31 18:15:14	1.3
@@ -127,7 +127,6 @@
                             String key = parse(line, 1);
                             String value = parse(line, 2);
                             map.put(key, value);
-                            System.out.println(key+"->"+value);
                         }
                     }
                 }




More information about the MOBY-guts mailing list