directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject [01/20] git commit: Added a method assertContext that takes a methodName, instead of constructing it inside the body of the method.
Date Wed, 05 Nov 2014 17:33:08 GMT
Repository: directory-fortress-core
Updated Branches:
  refs/heads/master c464c7305 -> 1a4d9716a


Added a method assertContext that takes a methodName, instead of
constructing it inside the body of the method.

Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/commit/29cf8aa4
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/29cf8aa4
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/29cf8aa4

Branch: refs/heads/master
Commit: 29cf8aa4f9f30ab6315d6efea21ebe47ee00f880
Parents: 40f6d2f
Author: Emmanuel L├ęcharny <elecharny@symas.com>
Authored: Sun Nov 2 16:50:41 2014 +0100
Committer: Emmanuel L├ęcharny <elecharny@symas.com>
Committed: Sun Nov 2 16:50:41 2014 +0100

----------------------------------------------------------------------
 .../fortress/core/rbac/Manageable.java          | 29 ++++++++++++++++----
 1 file changed, 23 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/29cf8aa4/src/main/java/org/apache/directory/fortress/core/rbac/Manageable.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/Manageable.java b/src/main/java/org/apache/directory/fortress/core/rbac/Manageable.java
index 196c2e6..8971961 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/Manageable.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/Manageable.java
@@ -64,6 +64,7 @@ public abstract class Manageable implements org.apache.directory.fortress.core.M
         this.contextId = contextId;
     }
 
+    
     /**
      * Set A/RBAC session on entity and perform authorization on behalf of the caller if
the {@link #adminSess} is set.
      *
@@ -83,7 +84,8 @@ public abstract class Manageable implements org.apache.directory.fortress.core.M
             AdminUtil.setEntitySession( this.adminSess, perm, entity, this.contextId );
         }
     }
-
+    
+    
     /**
      * Every Fortress Manager API (e.g. addUser, updateUser, addRole, ...) will perform authorization
on behalf of the caller IFF the {@link AuditMgrImpl#adminSess} has been set before invocation.
      *
@@ -128,19 +130,34 @@ public abstract class Manageable implements org.apache.directory.fortress.core.M
         entity.setContextId(this.contextId);
     }
 
+    
     /**
      * Method will throw exception if entity reference is null, otherwise will set the contextId
of the tenant onto the supplied entity reference.
      * @param className contains the class name of caller.
      * @param opName contains operation name of caller.
      * @param entity  used here to pass the tenant id into the Fortress DAO layer..
      * @param errorCode contains the error id to use if null.
-     * @throws org.apache.directory.fortress.core.ValidationException in the event object
is null.
+     * @throws ValidationException in the event object is null.
      */
-    protected final void assertContext(String className, String opName, FortEntity entity,
int errorCode)
-        throws ValidationException
+    protected final void assertContext( String className, String opName, FortEntity entity,
int errorCode ) throws ValidationException
     {
-        VUtil.assertNotNull(entity, errorCode, getFullMethodName(className, opName));
-        entity.setContextId(this.contextId);
+        VUtil.assertNotNull( entity, errorCode, getFullMethodName( className, opName ) );
+        entity.setContextId( contextId );
+    }
+
+    
+    /**
+     * Method will throw exception if entity reference is null, otherwise will set the contextId
of the tenant onto the supplied entity reference.
+     * 
+     * @param methodName contains the full method name of caller.
+     * @param entity  used here to pass the tenant id into the Fortress DAO layer..
+     * @param errorCode contains the error id to use if null.
+     * @throws ValidationException in the event object is null.
+     */
+    protected final void assertContext( String methodName, FortEntity entity, int errorCode
) throws ValidationException
+    {
+        VUtil.assertNotNull( entity, errorCode, methodName );
+        entity.setContextId( contextId );
     }
 
     /**


Mime
View raw message