[Bedework-commit] access r151 - releases/bedework-3.7/src/edu/rpi/cmt/access

svnadmin at bedework.org svnadmin at bedework.org
Tue Mar 1 00:51:56 EST 2011


Author: douglm
Date: 2011-03-01 00:51:55 -0500 (Tue, 01 Mar 2011)
New Revision: 151

Modified:
   releases/bedework-3.7/src/edu/rpi/cmt/access/EvaluatedAccessCache.java
Log:
Fixes to icalendar schema

Fix the exsynch schema

Small fixes to reduce number of compiler warnings

Modified: releases/bedework-3.7/src/edu/rpi/cmt/access/EvaluatedAccessCache.java
===================================================================
--- releases/bedework-3.7/src/edu/rpi/cmt/access/EvaluatedAccessCache.java	2011-03-01 05:51:10 UTC (rev 150)
+++ releases/bedework-3.7/src/edu/rpi/cmt/access/EvaluatedAccessCache.java	2011-03-01 05:51:55 UTC (rev 151)
@@ -55,8 +55,16 @@
 
   private static Object synch = new Object();
 
-  private static Map<String, Map> ownerHrefs = new HashMap<String, Map>();
+  private static class AccessMap extends HashMap<String, CurrentAccess>{};
 
+  private static class PrivMap extends HashMap<PrivilegeSet, AccessMap>{};
+
+  private static class PrivSetMap extends HashMap<PrivilegeSet, PrivMap>{};
+
+  private static class AccessorsMap extends HashMap<String, PrivSetMap>{};
+
+  private static Map<String, AccessorsMap> ownerHrefs = new HashMap<String, AccessorsMap>();
+
   /* Back end of the queue is the most recently referenced. */
   private static LinkedList<String> accessorQueue = new LinkedList<String>();
 
@@ -93,15 +101,15 @@
    * @param acl
    * @return CurrentAccess or null
    */
-  public static CurrentAccess get(String ownerHref,
-                                  String accessorHref,
-                                  PrivilegeSet desiredPriv,
-                                  PrivilegeSet maxAccess,
-                                  String acl) {
+  public static CurrentAccess get(final String ownerHref,
+                                  final String accessorHref,
+                                  final PrivilegeSet desiredPriv,
+                                  final PrivilegeSet maxAccess,
+                                  final String acl) {
     numGets.count++;
 
     synchronized (synch) {
-      Map<String, Map> accessors = ownerHrefs.get(ownerHref);
+      AccessorsMap accessors = ownerHrefs.get(ownerHref);
 
       if (accessors == null) {
         return null;
@@ -109,7 +117,7 @@
 
       /* ===================== desired priv ================== */
 
-      Map<PrivilegeSet, Map> desiredPrivs = accessors.get(accessorHref);
+      PrivSetMap desiredPrivs = accessors.get(accessorHref);
 
       if (desiredPrivs == null) {
         return null;
@@ -120,7 +128,7 @@
 
       /* ===================== max priv ================== */
 
-      Map<PrivilegeSet, Map> maxPrivs = desiredPrivs.get(desiredPriv);
+      PrivMap maxPrivs = desiredPrivs.get(desiredPriv);
 
       if (maxPrivs == null) {
         return null;
@@ -128,7 +136,7 @@
 
       /* ===================== acl ================== */
 
-      Map<String, CurrentAccess> acls = maxPrivs.get(maxAccess);
+      AccessMap acls = maxPrivs.get(maxAccess);
 
       if (acls == null) {
         return null;
@@ -154,20 +162,20 @@
    * @param acl
    * @param ca
    */
-  public static void put(String ownerHref,
-                         String accessorHref,
-                         PrivilegeSet desiredPriv,
-                         PrivilegeSet maxAccess,
-                         String acl,
-                         CurrentAccess ca) {
+  public static void put(final String ownerHref,
+                         final String accessorHref,
+                         final PrivilegeSet desiredPriv,
+                         final PrivilegeSet maxAccess,
+                         final String acl,
+                         final CurrentAccess ca) {
     boolean found = true;
 
 
     synchronized (synch) {
-      Map<String, Map> accessors = ownerHrefs.get(ownerHref);
+      AccessorsMap accessors = ownerHrefs.get(ownerHref);
 
       if (accessors == null) {
-        accessors = new HashMap<String, Map>();
+        accessors = new AccessorsMap();
         ownerHrefs.put(ownerHref, accessors);
         found = false;
       }
@@ -177,42 +185,42 @@
 
       /* ===================== desired priv ================== */
 
-      Map<PrivilegeSet, Map> desiredPrivs = null;
+      PrivSetMap desiredPrivs = null;
       if (found) {
         // Try a search
         desiredPrivs = accessors.get(accessorHref);
       }
 
       if (desiredPrivs == null) {
-        desiredPrivs = new HashMap<PrivilegeSet, Map>();
+        desiredPrivs = new PrivSetMap();
         accessors.put(accessorHref, desiredPrivs);
         found = false;
       }
 
       /* ===================== max priv ================== */
 
-      Map<PrivilegeSet, Map> maxPrivs = null;
+      PrivMap maxPrivs = null;
       if (found) {
         // Try a search
         maxPrivs = desiredPrivs.get(desiredPriv);
       }
 
       if (maxPrivs == null) {
-        maxPrivs = new HashMap<PrivilegeSet, Map>();
+        maxPrivs = new PrivMap();
         desiredPrivs.put(desiredPriv, maxPrivs);
         found = false;
       }
 
       /* ===================== acl ================== */
 
-      Map<String, CurrentAccess> acls = null;
+      AccessMap acls = null;
       if (found) {
         // Try a search
         acls = maxPrivs.get(maxAccess);
       }
 
       if (acls == null) {
-        acls = new HashMap<String, CurrentAccess>();
+        acls = new AccessMap();
         maxPrivs.put(maxAccess, acls);
         numAclTables.count++;
         found = false;
@@ -256,7 +264,7 @@
     return log;
   }
 
-  private static void error(String msg) {
+  private static void error(final String msg) {
     getLog().error(msg);
   }
 }
\ No newline at end of file



More information about the Bedework-commit mailing list