[Swift-commit] r3233 - trunk/src/org/globus/swift/data

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Tue Feb 9 17:28:09 CST 2010


Author: wozniak
Date: 2010-02-09 17:28:09 -0600 (Tue, 09 Feb 2010)
New Revision: 3233

Modified:
   trunk/src/org/globus/swift/data/Director.java
   trunk/src/org/globus/swift/data/Query.java
Log:
Allow Karajan to query CDM properties. 


Modified: trunk/src/org/globus/swift/data/Director.java
===================================================================
--- trunk/src/org/globus/swift/data/Director.java	2010-02-09 21:40:25 UTC (rev 3232)
+++ trunk/src/org/globus/swift/data/Director.java	2010-02-09 23:28:09 UTC (rev 3233)
@@ -101,6 +101,13 @@
     	return Policy.DEFAULT;
     }
     
+    public static String property(String name) {
+        String result = properties.get(name);
+        if (result == null) 
+            result = "UNSET";
+        return result;
+    }
+    
     public static boolean broadcasted(String file, String dir) {
         return broadcasted.contains(dir+"/"+file);
     }
@@ -134,5 +141,5 @@
             e.printStackTrace();
             System.exit(2);
         }
-    }   
+    }
 }

Modified: trunk/src/org/globus/swift/data/Query.java
===================================================================
--- trunk/src/org/globus/swift/data/Query.java	2010-02-09 21:40:25 UTC (rev 3232)
+++ trunk/src/org/globus/swift/data/Query.java	2010-02-09 23:28:09 UTC (rev 3233)
@@ -15,9 +15,11 @@
 public class Query extends FunctionsCollection {
 
     public static final Arg PA_QUERY = new Arg.Positional("query");
+    public static final Arg PA_NAME  = new Arg.Positional("name");
 
     static {
         setArguments("cdm_query", new Arg[]{ PA_QUERY });
+        setArguments("cdm_name", new Arg[]{ PA_NAME });
         setArguments("cdm_file", new Arg[]{});
     }
 
@@ -27,6 +29,12 @@
         return policy.toString();
     }
 
+    public String cdm_property(VariableStack stack) throws ExecutionException {
+        String name  = (String) PA_NAME.getValue(stack);
+        String value = Director.property(name);
+        return value;
+    }
+    
     public String cdm_file(VariableStack stack) throws ExecutionException {
         String file = "";
         if (Director.policyFile != null)




More information about the Swift-commit mailing list