[MOBY-guts] biomoby commit

Martin Senger senger at pub.open-bio.org
Thu Nov 10 08:54:31 UTC 2005


senger
Thu Nov 10 03:54:31 EST 2005
Update of /home/repository/moby/moby-live/Java/src/Clients
In directory pub.open-bio.org:/tmp/cvs-serv3825/src/Clients

Modified Files:
	CacheRegistryClient.java 
Log Message:


moby-live/Java/src/Clients CacheRegistryClient.java,1.6,1.7
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java	2005/11/09 16:23:32	1.6
+++ /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java	2005/11/10 08:54:31	1.7
@@ -91,24 +91,6 @@
 	    }
 
 	    //
-	    // how old is the current cache?
-	    //
-	    if (cmd.hasOption ("-age") || cmd.hasOption ("-rawage") || cmd.hasOption ("-agediff")) {
-		decorationLn ("Cache age for " + worker.getRegistryEndpoint() + ":");
-		long age = castWorker.getCacheAge();
-		if (age < 0)
-		    decorationLn ("(cache is empty)");
-		else {
-		    if (cmd.hasOption ("-age"))
-			System.out.println (new Date (age).toString());
-		    if (cmd.hasOption ("-agediff"))
-			System.out.println (ms2Human (new Date().getTime() - age));
-		    if (cmd.hasOption ("-ageraw"))
-			System.out.println (age);
-		}
-	    }
-
-	    //
 	    // [re-]fill the cache
 	    //
 	    if (cmd.hasOption ("-fill") || cmd.hasOption ("-fill-d")) {
@@ -172,6 +154,30 @@
 		decorationLn ("Cache for namespaces removed.");
 	    }
 
+	    //
+	    // cache info
+	    //
+	    if (cmd.hasOption ("-info") || cmd.hasOption ("-info-d")) {
+		decorationLn ("Cache for data types...");
+		System.out.println
+		    (castWorker.getCacheInfoFormatted (CentralDigestCachedImpl.CACHE_PART_DATATYPES));
+	    }
+	    if (cmd.hasOption ("-info") || cmd.hasOption ("-info-s")) {
+		decorationLn ("Cache for service authorities...");
+		System.out.println
+		    (castWorker.getCacheInfoFormatted (CentralDigestCachedImpl.CACHE_PART_SERVICES));
+	    }
+	    if (cmd.hasOption ("-info") || cmd.hasOption ("-info-t")) {
+		decorationLn ("Cache for service types...");
+		System.out.println
+		    (castWorker.getCacheInfoFormatted (CentralDigestCachedImpl.CACHE_PART_SERVICETYPES));
+	    }
+	    if (cmd.hasOption ("-info") || cmd.hasOption ("-info-n")) {
+		decorationLn ("Cache for namespaces...");
+		System.out.println
+		    (castWorker.getCacheInfoFormatted (CentralDigestCachedImpl.CACHE_PART_NAMESPACES));
+	    }
+
 	} catch (Exception e) {
 	    System.err.println ("===ERROR===");
 	    e.printStackTrace();
@@ -180,21 +186,6 @@
     }
 
     /*************************************************************************
-     * Give me an elapsed time (given in milllis) in a human readable form.
-     *************************************************************************/
-    public static String ms2Human (long millis) {
-	StringBuffer buf = new StringBuffer (100);
-	long seconds = millis / 1000;
-	long minutes = seconds / 60;
-	long hours = minutes / 60;
-	long days = hours / 24;
-	if (days > 0)
-	    buf.append (days + " days and ");
-	buf.append ((hours % 24) + ":" + (minutes % 60) + ":" + (seconds % 60) + "." + (millis % 1000));
-	return new String (buf);
-    }
-
-    /*************************************************************************
      * Print 'msg' but only if in verbose mode
      *************************************************************************/
     static void decoration (String msg) {




More information about the MOBY-guts mailing list