[MOBY-guts] biomoby commit
Martin Senger
senger at pub.open-bio.org
Wed Nov 9 16:23:32 UTC 2005
senger
Wed Nov 9 11:23:32 EST 2005
Update of /home/repository/moby/moby-live/Java/src/Clients
In directory pub.open-bio.org:/tmp/cvs-serv32177/src/Clients
Modified Files:
CacheRegistryClient.java
Log Message:
moby-live/Java/src/Clients CacheRegistryClient.java,1.5,1.6
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/10/27 04:15:23 1.5
+++ /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/11/09 16:23:32 1.6
@@ -1,13 +1,17 @@
// CacheRegistryClient.java
-// A command-line client dealing with a registry cache.
//
-// senger at ebi.ac.uk
-// November 2004
+// Created: November 2004
+//
+// This file is a component of the BioMoby project.
+// Copyright Martin Senger (martin.senger at gmail.com).
//
import org.biomoby.shared.*;
import org.biomoby.client.*;
+import org.biomoby.shared.event.LogListener;
+import org.biomoby.shared.event.Notifier;
+
import org.tulsoft.tools.BaseCmdLine;
import org.tulsoft.shared.FileUtils;
import org.tulsoft.shared.GException;
@@ -26,7 +30,7 @@
* org.biomoby.client.CentralDigestCachedImpl CentralDigestCachedImpl}
* - which is a real caching worker. <p>
*
- * @author <A HREF="mailto:senger at ebi.ac.uk">Martin Senger</A>
+ * @author <A HREF="mailto:martin.senger at gmail.com">Martin Senger</A>
* @version $Id$
*/
@@ -70,14 +74,17 @@
System.exit (1);
}
- verbose = !cmd.hasOption ("-q");
-
// where is a Moby registry
CentralAll worker =
new CentralDigestCachedImpl (cmd.getParam ("-e"),
cmd.getParam ("-uri"),
cacheDir);
CentralDigestCachedImpl castWorker = (CentralDigestCachedImpl)worker;
+
+ // how much to show
+ verbose = cmd.hasOption ("-v");
+ if (! cmd.hasOption ("-q"))
+ ((Notifier)castWorker).addNotificationListener (new LogListener());
if (cmd.hasOption ("-debug")) {
worker.setDebug (true);
@@ -126,6 +133,26 @@
}
//
+ // update the cache
+ //
+ if (cmd.hasOption ("-update") || cmd.hasOption ("-update-d")) {
+ decorationLn ("Updating data types...");
+ castWorker.updateCache (CentralDigestCachedImpl.CACHE_PART_DATATYPES);
+ }
+ if (cmd.hasOption ("-update") || cmd.hasOption ("-update-s")) {
+ decorationLn ("Updating services...");
+ castWorker.updateCache (CentralDigestCachedImpl.CACHE_PART_SERVICES);
+ }
+ if (cmd.hasOption ("-update") || cmd.hasOption ("-update-t")) {
+ decorationLn ("Updating service types...");
+ castWorker.updateCache (CentralDigestCachedImpl.CACHE_PART_SERVICETYPES);
+ }
+ if (cmd.hasOption ("-update") || cmd.hasOption ("-update-n")) {
+ decorationLn ("Updating namespaces...");
+ castWorker.updateCache (CentralDigestCachedImpl.CACHE_PART_NAMESPACES);
+ }
+
+ //
// remove the cache
//
if (cmd.hasOption ("-remove") || cmd.hasOption ("-remove-d")) {
@@ -171,10 +198,10 @@
* Print 'msg' but only if in verbose mode
*************************************************************************/
static void decoration (String msg) {
- if (verbose) System.out.print (msg);
+ if (verbose) System.out.print (msg);
}
static void decorationLn (String msg) {
- if (verbose) System.out.println (msg);
+ if (verbose) System.out.println (msg);
}
}
More information about the MOBY-guts
mailing list