directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject [38/75] [abbrv] [partial] directory-fortress-core git commit: FC-109 - rename rbac package to impl
Date Tue, 09 Jun 2015 03:15:44 GMT
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/ba64d26a/src/main/java/org/apache/directory/fortress/core/impl/ReviewMgrImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/ReviewMgrImpl.java b/src/main/java/org/apache/directory/fortress/core/impl/ReviewMgrImpl.java
new file mode 100755
index 0000000..62fc4a0
--- /dev/null
+++ b/src/main/java/org/apache/directory/fortress/core/impl/ReviewMgrImpl.java
@@ -0,0 +1,941 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.fortress.core.impl;
+
+import org.apache.directory.fortress.core.GlobalErrIds;
+import org.apache.directory.fortress.core.ReviewMgr;
+import org.apache.directory.fortress.core.SecurityException;
+import org.apache.directory.fortress.core.model.OrgUnit;
+import org.apache.directory.fortress.core.model.PermObj;
+import org.apache.directory.fortress.core.model.Permission;
+import org.apache.directory.fortress.core.model.Role;
+import org.apache.directory.fortress.core.model.SDSet;
+import org.apache.directory.fortress.core.model.User;
+import org.apache.directory.fortress.core.model.UserRole;
+import org.apache.directory.fortress.core.model.VUtil;
+import org.apache.directory.fortress.core.util.ObjUtil;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * This class performs administrative review functions on already provisioned Fortress RBAC entities
+ * that reside in LDAP directory.  These APIs map directly to similar named APIs specified by ANSI and NIST RBAC models.
+ * Many of the java doc function descriptions found below were taken directly from ANSI INCITS 359-2004.
+ * The RBAC Functional specification describes administrative operations for the creation
+ * and maintenance of RBAC element sets and relations; administrative review functions for
+ * performing administrative queries; and system functions for creating and managing
+ * RBAC attributes on user sessions and making access control decisions.
+ * <p/>
+ * <hr>
+ * <h4>RBAC0 - Core</h4>
+ * Many-to-many relationship between Users, Roles and Permissions. Selective role activation into sessions.  API to add, update, delete identity data and perform identity and access control decisions during runtime operations.
+ * <p/>
+ * <img src="../doc-files/RbacCore.png">
+ * <hr>
+ * <h4>RBAC1 - General Hierarchical Roles</h4>
+ * Simplifies role engineering tasks using inheritance of one or more parent roles.
+ * <p/>
+ * <img src="../doc-files/RbacHier.png">
+ * <hr>
+ * <h4>RBAC2 - Static Separation of Duty (SSD) Relations</h4>
+ * Enforce mutual membership exclusions across role assignments.  Facilitate dual control policies by restricting which roles may be assigned to users in combination.  SSD provide added granularity for authorization limits which help enterprises meet strict compliance regulations.
+ * <p/>
+ * <img src="../doc-files/RbacSSD.png">
+ * <hr>
+ * <h4>RBAC3 - Dynamic Separation of Duty (DSD) Relations</h4>
+ * Control allowed role combinations to be activated within an RBAC session.  DSD policies fine tune role policies that facilitate authorization dual control and two man policy restrictions during runtime security checks.
+ * <p/>
+ * <img src="../doc-files/RbacDSD.png">
+ * <hr>
+ * <p/>
+ * This class is NOT thread safe if parent instance variables ({@link #contextId} or {@link #adminSess}) are set.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class ReviewMgrImpl extends Manageable implements ReviewMgr
+{
+    private static final String CLS_NM = ReviewMgrImpl.class.getName();
+    private static final UserP userP = new UserP();
+    private static final RoleP roleP = new RoleP();
+    private static final PermP permP = new PermP();
+    private static final SdP ssdP = new SdP();
+
+    /**
+     * This method returns a matching permission entity to caller.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link org.apache.directory.fortress.core.model.Permission#objName} - contains the name of existing object being targeted</li>
+     * <li>{@link org.apache.directory.fortress.core.model.Permission#opName} - contains the name of existing permission operation</li>
+     * </ul>
+     *
+     * @param permission must contain the object, {@link org.apache.directory.fortress.core.model.Permission#objName}, and operation, {@link org.apache.directory.fortress.core.model.Permission#opName}, and optionally object id of targeted permission entity.
+     * @return Permission entity that is loaded with data.
+     * @throws SecurityException if permission not found or system error occurs.
+     */
+    @Override
+    public Permission readPermission(Permission permission)
+        throws SecurityException
+    {
+        String methodName = "readPermission";
+        assertContext(CLS_NM, methodName, permission, GlobalErrIds.PERM_OPERATION_NULL);
+        VUtil.assertNotNullOrEmpty(permission.getObjName(), GlobalErrIds.PERM_OBJECT_NM_NULL, CLS_NM + "." + methodName);
+        VUtil.assertNotNullOrEmpty(permission.getOpName(), GlobalErrIds.PERM_OPERATION_NM_NULL, CLS_NM + "." + methodName);
+        checkAccess(CLS_NM, methodName);
+        return permP.read(permission);
+    }
+
+    /**
+     * Method reads permission object from perm container in directory.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link org.apache.directory.fortress.core.model.PermObj#objName} - contains the name of existing object being targeted</li>
+     * </ul>
+     *
+     * @param permObj entity contains the {@link org.apache.directory.fortress.core.model.PermObj#objName} of target record.
+     * @return PermObj loaded with perm object data.
+     * @throws SecurityException is thrown if object not found or system error.
+     */
+    @Override
+    public PermObj readPermObj(PermObj permObj)
+        throws SecurityException
+    {
+        String methodName = "readPermObj";
+        assertContext(CLS_NM, methodName, permObj, GlobalErrIds.PERM_OBJECT_NULL);
+        VUtil.assertNotNull(permObj.getObjName(), GlobalErrIds.PERM_OBJECT_NM_NULL, CLS_NM + "." + methodName);
+        checkAccess(CLS_NM, methodName);
+        return permP.read(permObj);
+    }
+
+    /**
+     * Method returns a list of type Permission that match the perm object search string.
+     * <h4>optional parameters</h4>
+     * <ul>
+     * <li>{@link Permission#objName} - contains one or more characters of existing object being targeted</li>
+     * <li>{@link Permission#opName} - contains one or more characters of existing permission operation</li>
+     * </ul>
+     *
+     * @param permission contains object and operation name search strings.  Each contains 1 or more leading chars that correspond to object or op name.
+     * @return List of type Permission.  Fortress permissions are object->operation mappings.  The permissions may contain
+     *         assigned user, role or group entities as well.
+     * @throws SecurityException thrown in the event of system error.
+     */
+    @Override
+    public List<Permission> findPermissions(Permission permission)
+        throws SecurityException
+    {
+        String methodName = "findPermissions";
+        assertContext(CLS_NM, methodName, permission, GlobalErrIds.PERM_OPERATION_NULL);
+        checkAccess(CLS_NM, methodName);
+        return permP.search(permission);
+    }
+
+    /**
+     * Method returns a list of type PermObj that match the perm object search string.
+     * <h4>optional parameters</h4>
+     * <ul>
+     * <li>{@link PermObj#objName} - contains one or more characters of existing object being targeted</li>
+     * </ul>
+     *
+     * @param permObj contains object name search string.  The search val contains 1 or more leading chars that correspond to object name.
+     * @return List of type PermObj.  Fortress permissions are object->operation mappings.
+     * @throws org.apache.directory.fortress.core.SecurityException
+     *          thrown in the event of system error.
+     */
+    @Override
+    public List<PermObj> findPermObjs(PermObj permObj)
+        throws SecurityException
+    {
+        String methodName = "findPermObjs";
+        assertContext(CLS_NM, methodName, permObj, GlobalErrIds.PERM_OBJECT_NULL);
+        checkAccess(CLS_NM, methodName);
+        return permP.search(permObj);
+    }
+
+    /**
+     * Method returns a list of type Permission that match the perm object search string.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link org.apache.directory.fortress.core.model.OrgUnit#name} - contains one or more characters of org unit associated with existing object being targeted</li>
+     * </ul>
+     *
+     * @param ou contains org unit name {@link org.apache.directory.fortress.core.model.OrgUnit#name}.  The search val contains the full name of matching ou in OS-P data set.
+     * @return List of type PermObj.  Fortress permissions are object->operation mappings.
+     * @throws org.apache.directory.fortress.core.SecurityException
+     *          thrown in the event of system error.
+     */
+    @Override
+    public List<PermObj> findPermObjs(OrgUnit ou)
+        throws SecurityException
+    {
+        String methodName = "findPermObjs";
+        assertContext(CLS_NM, methodName, ou, GlobalErrIds.ORG_NULL_PERM);
+        checkAccess(CLS_NM, methodName);
+        // pass a "false" which places no restrictions on how many records server returns.
+        return permP.search(ou, false);
+    }
+
+    /**
+     * Method reads Role entity from the role container in directory.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link org.apache.directory.fortress.core.model.Role#name} - contains the name to use for the Role to read.</li>
+     * </ul>
+     *
+     * @param role contains role name, {@link org.apache.directory.fortress.core.model.Role#name}, to be read.
+     * @return Role entity that corresponds with role name.
+     * @throws SecurityException will be thrown if role not found or system error occurs.
+     */
+    @Override
+    public Role readRole(Role role)
+        throws SecurityException
+    {
+        String methodName = "readRole";
+        assertContext(CLS_NM, methodName, role, GlobalErrIds.ROLE_NULL);
+        VUtil.assertNotNullOrEmpty(role.getName(), GlobalErrIds.ROLE_NM_NULL, CLS_NM + "." + methodName);
+        checkAccess(CLS_NM, methodName);
+        return roleP.read(role);
+    }
+
+    /**
+     * Method will return a list of type Role matching all or part of Role name, {@link Role#name}.
+     *
+     * @param searchVal contains all or some of the chars corresponding to role entities stored in directory.
+     * @return List of type Role containing role entities that match the search criteria.
+     * @throws org.apache.directory.fortress.core.SecurityException
+     *          in the event of system error.
+     */
+    @Override
+    public List<Role> findRoles(String searchVal)
+        throws SecurityException
+    {
+        String methodName = "findRoles";
+        VUtil.assertNotNull(searchVal, GlobalErrIds.ROLE_NM_NULL, CLS_NM + "." + methodName);
+        checkAccess(CLS_NM, methodName);
+        Role role = new Role(searchVal);
+        role.setContextId(this.contextId);
+        return roleP.search(role);
+    }
+
+    /**
+     * Method returns a list of roles of type String.  This method can be limited by integer value that indicates max
+     * number of records that may be contained in the result set.  This number can further limit global default but can
+     * not increase the max.  This method is called by the Websphere Realm impl.
+     *
+     * @param searchVal contains all or some leading chars that correspond to roles stored in the role container in the directory.
+     * @param limit     integer value specifies the max records that may be returned in the result set.
+     * @return List of type String containing names of the role entities that match the inbound search criteria.
+     * @throws SecurityException in the event of system error.
+     */
+    @Override
+    public List<String> findRoles(String searchVal, int limit)
+        throws SecurityException
+    {
+        String methodName = "findRoles";
+        VUtil.assertNotNull(searchVal, GlobalErrIds.ROLE_NM_NULL, CLS_NM + "." + methodName);
+        checkAccess(CLS_NM, methodName);
+        Role role = new Role(searchVal);
+        role.setContextId(this.contextId);
+        return roleP.search(role, limit);
+    }
+
+    /**
+     * Method returns matching User entity that is contained within the people container in the directory.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link org.apache.directory.fortress.core.model.User#userId} - contains the userId associated with the User object targeted for read.</li>
+     * </ul>
+     *
+     * @param user entity contains a value {@link org.apache.directory.fortress.core.model.User#userId} that matches record in the directory.  userId is globally unique in
+     *             people container.
+     * @return entity containing matching user data.
+     * @throws org.apache.directory.fortress.core.SecurityException
+     *          if record not found or system error occurs.
+     */
+    @Override
+    public final User readUser(User user)
+        throws SecurityException
+    {
+        String methodName = "readUser";
+        assertContext(CLS_NM, methodName, user, GlobalErrIds.USER_NULL);
+        VUtil.assertNotNullOrEmpty(user.getUserId(), GlobalErrIds.USER_ID_NULL, CLS_NM + "." + methodName);
+        checkAccess(CLS_NM, methodName);
+        return userP.read(user, true);
+    }
+
+    /**
+     * Return a list of type User of all users in the people container that match all or part of the {@link User#userId} field passed in User entity.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link org.apache.directory.fortress.core.model.User#userId} - contains all or some leading chars that match userId(s) stored in the directory.</li>
+     * </ul>
+     *
+     * @param user contains all or some leading chars that match userIds stored in the directory.
+     * @return List of type User.
+     * @throws SecurityException In the event of system error.
+     */
+    @Override
+    public final List<User> findUsers(User user)
+        throws SecurityException
+    {
+        String methodName = "findUsers";
+        assertContext(CLS_NM, methodName, user, GlobalErrIds.USER_NULL);
+        checkAccess(CLS_NM, methodName);
+        return userP.search(user);
+    }
+
+    /**
+     * Return a list of type User of all users in the people container that match the name field passed in OrgUnit entity.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link OrgUnit#name} - contains one or more characters of org unit associated with existing object(s) being targeted</li>
+     * </ul>
+     *
+     * @param ou contains name of User OU, {@link OrgUnit#name} that match ou attribute associated with User entity in the directory.
+     * @return List of type User.
+     * @throws SecurityException In the event of system error.
+     */
+    @Override
+    public List<User> findUsers(OrgUnit ou)
+        throws SecurityException
+    {
+        String methodName = "findUsers";
+        assertContext(CLS_NM, methodName, ou, GlobalErrIds.ORG_NULL_USER);
+        checkAccess(CLS_NM, methodName);
+        // pass a "false" which places no restrictions on how many records server returns.
+        return userP.search(ou, false);
+    }
+
+    /**
+     * Return a list of type String of all users in the people container that match the userId field passed in User entity.
+     * This method is used by the Websphere realm component.  The max number of returned users may be set by the integer limit arg.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link User#userId} - contains the userId associated with the User object targeted for read.</li>
+     * <li>limit - max number of objects to return.</li>
+     * </ul>
+     *
+     * @param user  contains all or some leading chars that correspond to users stored in the directory.
+     * @param limit integer value sets the max returned records.
+     * @return List of type String containing matching userIds.
+     * @throws SecurityException in the event of system error.
+     */
+    @Override
+    public final List<String> findUsers(User user, int limit)
+        throws SecurityException
+    {
+        String methodName = "findUsers";
+        assertContext(CLS_NM, methodName, user, GlobalErrIds.USER_NULL);
+        checkAccess(CLS_NM, methodName);
+        return userP.search(user, limit);
+    }
+
+    /**
+     * This function returns the set of users assigned to a given role. The function is valid if and
+     * only if the role is a member of the ROLES data set.
+     * The max number of users returned is constrained by limit argument.
+     * This method is used by the Websphere realm component.  This method does NOT use hierarchical impl.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link Role#name} - contains the name to use for the Role targeted for search.</li>
+     * <li>limit - max number of objects to return.</li>
+     * </ul>
+     *
+     * @param role  Contains {@link Role#name} of Role entity assigned to user.
+     * @param limit integer value sets the max returned records.
+     * @return List of type String containing userIds assigned to a particular role.
+     * @throws org.apache.directory.fortress.core.SecurityException
+     *          in the event of data validation or system error.
+     */
+    @Override
+    public List<String> assignedUsers(Role role, int limit)
+        throws SecurityException
+    {
+        String methodName = "assignedUsers";
+        assertContext(CLS_NM, methodName, role, GlobalErrIds.ROLE_NULL);
+        checkAccess(CLS_NM, methodName);
+        Role entity = roleP.read(role);
+        // this one retrieves from the role itself.
+        List<String> users = entity.getOccupants();
+        if (users != null && users.size() > limit)
+        {
+            users = users.subList(0, limit);
+        }
+        // No users found for this role.
+        // return empty list to caller:
+        else if (users == null)
+        {
+            users = new ArrayList<>();
+        }
+        return users;
+        // this one does a search across all users:
+        //return userP.getAuthorizedUsers(role, limit);
+    }
+
+    /**
+     * This method returns the data set of all users who are assigned the given role.  This searches the User data set for
+     * Role relationship.  This method does NOT search for hierarchical RBAC Roles relationships.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link Role#name} - contains the name to use for the Role targeted for search.</li>
+     * </ul>
+     *
+     * @param role contains the role name, {@link Role#name} used to search the User data set.
+     * @return List of type User containing the users assigned data.
+     * @throws SecurityException If system error occurs.
+     */
+    @Override
+    public List<User> assignedUsers(Role role)
+        throws SecurityException
+    {
+        String methodName = "assignedUsers";
+        assertContext(CLS_NM, methodName, role, GlobalErrIds.ROLE_NULL);
+        checkAccess(CLS_NM, methodName);
+        return userP.getAssignedUsers(role);
+    }
+
+    /**
+     * This function returns the set of roles assigned to a given user. The function is valid if and
+     * only if the user is a member of the USERS data set.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link User#userId} - contains the userId associated with the User object targeted for search.</li>
+     * </ul>
+     *
+     * @param user contains {@link User#userId} matching User entity targeted in the directory.
+     * @return List of type UserRole containing the Roles assigned to User.
+     * @throws SecurityException If user not found or system error occurs.
+     */
+    @Override
+    public List<UserRole> assignedRoles(User user)
+        throws SecurityException
+    {
+        String methodName = "assignedRoles";
+        assertContext(CLS_NM, methodName, user, GlobalErrIds.USER_NULL);
+        checkAccess(CLS_NM, methodName);
+        User ue = userP.read(user, true);
+        return ue.getRoles();
+    }
+
+    /**
+     * This function returns the set of roles assigned to a given user. The function is valid if and
+     * only if the user is a member of the USERS data set.
+     *
+     * @param userId matches userId stored in the directory.
+     * @return List of type String containing the role names of all roles assigned to user.
+     * @throws SecurityException If user not found or system error occurs.
+     */
+    @Override
+    public List<String> assignedRoles(String userId)
+        throws SecurityException
+    {
+        String methodName = "assignedRoles";
+        VUtil.assertNotNullOrEmpty(userId, GlobalErrIds.USER_NULL, CLS_NM + "." + methodName);
+        checkAccess(CLS_NM, methodName);
+        User user = new User(userId);
+        user.setContextId(this.contextId);
+        return userP.getAssignedRoles(user);
+    }
+
+    /**
+     * This function returns the set of users authorized to a given role, i.e., the users that are assigned to a role that
+     * inherits the given role. The function is valid if and only if the given role is a member of the ROLES data set.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link Role#name} - contains the name to use for the Role targeted for search.</li>
+     * </ul>
+     *
+     * @param role Contains role name, {@link Role#name} of Role entity assigned to User.
+     * @return List of type User containing all user's that having matching role assignment.
+     * @throws SecurityException In the event the role is not present in directory or system error occurs.
+     */
+    @Override
+    public List<User> authorizedUsers(Role role)
+        throws SecurityException
+    {
+        String methodName = "authorizedUsers";
+        assertContext(CLS_NM, methodName, role, GlobalErrIds.ROLE_NULL);
+        checkAccess(CLS_NM, methodName);
+        return userP.getAuthorizedUsers(role);
+    }
+
+    /**
+     * This function returns the set of roles authorized for a given user. The function is valid if
+     * and only if the user is a member of the USERS data set.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link User#userId} - contains the userId associated with the User object targeted for search.</li>
+     * </ul>
+     *
+     * @param user contains the {@link User#userId} matching User entity stored in the directory.
+     * @return Set of type String containing the roles assigned and roles inherited.
+     * @throws SecurityException If user not found or system error occurs.
+     */
+    @Override
+    public Set<String> authorizedRoles(User user)
+        throws SecurityException
+    {
+        String methodName = "authorizedRoles";
+        assertContext(CLS_NM, methodName, user, GlobalErrIds.USER_NULL);
+        checkAccess(CLS_NM, methodName);
+        User ue = userP.read(user, true);
+        List<UserRole> roles = ue.getRoles();
+        Set<String> iRoles = null;
+        if (ObjUtil.isNotNullOrEmpty(roles))
+        {
+            iRoles = RoleUtil.getInheritedRoles( roles, this.contextId );
+        }
+        return iRoles;
+    }
+
+    /**
+     * This function returns the set of all permissions (op, obj), granted to or inherited by a
+     * given role. The function is valid if and only if the role is a member of the ROLES data
+     * set.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link Role#name} - contains the name to use for the Role targeted for search.</li>
+     * </ul>
+     *
+     * @param role contains role name, {@link Role#name} of Role entity Permission is granted to.
+     * @return List of type Permission that contains all perms granted to a role.
+     * @throws SecurityException In the event system error occurs.
+     */
+    @Override
+    public List<Permission> rolePermissions(Role role)
+        throws SecurityException
+    {
+        String methodName = "rolePermissions";
+        assertContext(CLS_NM, methodName, role, GlobalErrIds.ROLE_NULL);
+        checkAccess(CLS_NM, methodName);
+        return permP.search(role);
+    }
+
+    /**
+     * This function returns the set of permissions a given user gets through his/her authorized
+     * roles. The function is valid if and only if the user is a member of the USERS data set.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link User#userId} - contains the userId associated with the User object targeted for search.</li>
+     * </ul>
+     *
+     * @param user contains the {@link User#userId} of User targeted for search.
+     * @return List of type Permission containing matching permission entities.
+     * @throws org.apache.directory.fortress.core.SecurityException
+     *
+     */
+    @Override
+    public List<Permission> userPermissions(User user)
+        throws SecurityException
+    {
+        String methodName = "userPermissions";
+        assertContext(CLS_NM, methodName, user, GlobalErrIds.USER_NULL);
+        checkAccess(CLS_NM, methodName);
+        user = readUser(user);
+        user.setContextId(this.contextId);
+        return permP.search(user);
+    }
+
+    /**
+     * Return a list of type String of all roles that have granted a particular permission.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link Permission#objName} - contains the name of existing object being targeted</li>
+     * <li>{@link Permission#opName} - contains the name of existing permission operation</li>
+     * </ul>
+     *
+     * @param perm must contain the object, {@link org.apache.directory.fortress.core.model.Permission#objName}, and operation, {@link Permission#opName}, and optionally object id of targeted permission entity.
+     * @return List of type string containing the role names that have the matching perm granted.
+     * @throws SecurityException in the event permission not found or system error occurs.
+     */
+    @Override
+    public List<String> permissionRoles(Permission perm)
+        throws SecurityException
+    {
+        String methodName = "permissionRoles";
+        assertContext(CLS_NM, methodName, perm, GlobalErrIds.PERM_OBJECT_NULL);
+        checkAccess(CLS_NM, methodName);
+        Permission pe = permP.read(perm);
+        List<String> retVals;
+        if(pe != null && ObjUtil.isNotNullOrEmpty(pe.getRoles()))
+        {
+            retVals = new ArrayList<>(pe.getRoles());
+        }
+        else
+        {
+            retVals =  new ArrayList<>();
+        }
+        return retVals;
+    }
+
+    /**
+     * Return all role names that have been authorized for a given permission.  This will process role hierarchies to determine set of all Roles who have access to a given permission.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link org.apache.directory.fortress.core.model.Permission#objName} - contains the name of existing object being targeted</li>
+     * <li>{@link Permission#opName} - contains the name of existing permission operation</li>
+     * </ul>
+     *
+     * @param perm must contain the object, {@link Permission#objName}, and operation, {@link Permission#opName}, and optionally object id of targeted permission entity.
+     * @return Set of type String containing all roles names that have been granted a particular permission.
+     * @throws org.apache.directory.fortress.core.SecurityException
+     *          in the event of validation or system error.
+     */
+    @Override
+    public Set<String> authorizedPermissionRoles(Permission perm)
+        throws SecurityException
+    {
+        Set<String> authorizedRoles;
+        String methodName = "authorizedPermissionRoles";
+        assertContext(CLS_NM, methodName, perm, GlobalErrIds.PERM_OPERATION_NULL);
+        checkAccess(CLS_NM, methodName);
+        // Pull the permission from ldap:
+        Permission pe = permP.read(perm);
+
+        // Get all roles that this permission is authorized for:
+        authorizedRoles = authorizeRoles(pe.getRoles());
+        return authorizedRoles;
+    }
+
+    /**
+     * Return all userIds that have been granted (directly) a particular permission.  This will not consider assigned or authorized Roles.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link Permission#objName} - contains the name of existing object being targeted</li>
+     * <li>{@link Permission#opName} - contains the name of existing permission operation</li>
+     * </ul>
+     *
+     * @param perm must contain the object, {@link Permission#objName}, and operation, {@link Permission#opName}, and optionally object id of targeted permission entity.
+     * @return List of type String containing all userIds that have been granted a particular permission.
+     * @throws org.apache.directory.fortress.core.SecurityException
+     *          in the event of validation or system error.
+     */
+    @Override
+    public List<String> permissionUsers(Permission perm)
+        throws SecurityException
+    {
+        String methodName = "permissionUsers";
+        assertContext(CLS_NM, methodName, perm, GlobalErrIds.PERM_OPERATION_NULL);
+        checkAccess(CLS_NM, methodName);
+        Permission pe = permP.read(perm);
+        List<String> retVals;
+        if(pe != null && ObjUtil.isNotNullOrEmpty( pe.getUsers() ))
+        {
+            retVals = new ArrayList<>(pe.getUsers());
+        }
+        else
+        {
+            retVals =  new ArrayList<>();
+        }
+        return retVals;
+    }
+
+    /**
+     * Return all userIds that have been authorized for a given permission.  This will process role hierarchies to determine set of all Users who have access to a given permission.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link Permission#objName} - contains the name of existing object being targeted</li>
+     * <li>{@link Permission#opName} - contains the name of existing permission operation</li>
+     * </ul>
+     *
+     * @param perm must contain the object, {@link Permission#objName}, and operation, {@link Permission#opName}, and optionally object id of targeted permission entity.
+     * @return Set of type String containing all userIds that have been granted a particular permission.
+     * @throws org.apache.directory.fortress.core.SecurityException
+     *          in the event of validation or system error.
+     */
+    @Override
+    public Set<String> authorizedPermissionUsers(Permission perm)
+        throws SecurityException
+    {
+        Set<String> authorizedUsers = null;
+        String methodName = "authorizedPermissionUsers";
+        assertContext(CLS_NM, methodName, perm, GlobalErrIds.PERM_OPERATION_NULL);
+        checkAccess(CLS_NM, methodName);
+        // Pull the permission from ldap:
+        Permission pe = permP.read(perm);
+
+        // Get all roles that this permission is authorized for:
+        Set<String> authorizedRoles = authorizeRoles(pe.getRoles());
+        if (authorizedRoles != null)
+        {
+            // Pull the set of users assigned to descendant or assigned roles from ldap:
+            authorizedUsers = userP.getAssignedUsers(authorizedRoles, this.contextId);
+        }
+        // Now add any users who have been directly assigned to this permission entity:
+        Set<String> assignedUsers = pe.getUsers();
+        if (assignedUsers != null)
+        {
+            // It is possible this dataset has not yet been instantiated (if perm has no assigned roles):
+            if (authorizedUsers == null)
+            {
+                authorizedUsers = new HashSet<>();
+            }
+            authorizedUsers.addAll(assignedUsers);
+        }
+        // The returned list includes all assigned users plus any users assigned via authorized roles.
+        return authorizedUsers;
+    }
+
+    /**
+     * @param assignedRoles
+     * @return Set contains both assigned and descendant role names
+     * @throws SecurityException
+     */
+    private Set<String> authorizeRoles(Set<String> assignedRoles)
+    {
+        Set<String> authorizedRoles = null;
+        if (assignedRoles != null)
+        {
+            // Get the descendant roles of all assigned roles from jgrapht hierarchical roles data set:
+            authorizedRoles = RoleUtil.getDescendantRoles(assignedRoles, this.contextId);
+        }
+        return authorizedRoles;
+    }
+
+    /**
+     * This function returns the list of all SSD role sets that have a particular Role as member or Role's
+     * parent as a member.  If the Role parameter is left blank, function will return all SSD role sets.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link Role#name} - contains the name to use for the Role targeted for search.</li>
+     * </ul>
+     *
+     * @param role Will contain the role name, {@link Role#name}, for targeted SSD set or null to return all
+     * @return List containing all matching SSD's.
+     * @throws org.apache.directory.fortress.core.SecurityException
+     *          in the event of data or system error.
+     */
+    @Override
+    public List<SDSet> ssdRoleSets(Role role)
+        throws SecurityException
+    {
+        String methodName = "ssdRoleSets";
+        assertContext(CLS_NM, methodName, role, GlobalErrIds.ROLE_NULL);
+        checkAccess(CLS_NM, methodName);
+        return ssdP.search(role, SDSet.SDType.STATIC);
+    }
+
+    /**
+     * This function returns the list of SSDs that match a given ssd name value.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link SDSet#name} - contains the name of existing object being targeted</li>
+     * </ul>
+     *
+     * @param ssd contains the name for the SSD set targeted, {@link SDSet#name}.
+     * @return List containing all SSDSets that match a given SSDSet name.
+     * @throws SecurityException in the event of data or system error.
+     */
+    public List<SDSet> ssdSets(SDSet ssd)
+        throws SecurityException
+    {
+        String methodName = "ssdSets";
+        ssd.setType(SDSet.SDType.STATIC);
+        assertContext(CLS_NM, methodName, ssd, GlobalErrIds.SSD_NULL);
+        checkAccess(CLS_NM, methodName);
+        return ssdP.search(ssd);
+    }
+
+    /**
+     * This function returns the SSD data set that matches a particular set name.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link SDSet#name} - contains the name of existing object being targeted</li>
+     * </ul>
+     *
+     * @param set Will contain the name for existing SSD data set
+     * @return SDSet containing all attributes from matching SSD name.
+     * @throws org.apache.directory.fortress.core.SecurityException
+     *          in the event of data or system error.
+     */
+    @Override
+    public SDSet ssdRoleSet(SDSet set)
+        throws SecurityException
+    {
+        String methodName = "ssdRoleSet";
+        assertContext(CLS_NM, methodName, set, GlobalErrIds.SSD_NULL);
+        checkAccess(CLS_NM, methodName);
+        set.setType(SDSet.SDType.STATIC);
+        return ssdP.read(set);
+    }
+
+    /**
+     * This function returns the set of roles of a SSD role set. The function is valid if and only if the
+     * role set exists.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link SDSet#name} - contains the name of existing object being targeted</li>
+     * </ul>
+     *
+     * @param ssd contains the name for the SSD set targeted.
+     * @return Map containing all Roles that are members of SSD data set.
+     * @throws SecurityException in the event of data or system error.
+     */
+    @Override
+    public Set<String> ssdRoleSetRoles(SDSet ssd)
+        throws SecurityException
+    {
+        String methodName = "ssdRoleSetRoles";
+        assertContext(CLS_NM, methodName, ssd, GlobalErrIds.SSD_NULL);
+        checkAccess(CLS_NM, methodName);
+        ssd.setType(SDSet.SDType.STATIC);
+        SDSet se = ssdP.read(ssd);
+        return se.getMembers();
+    }
+
+    /**
+     * This function returns the cardinality associated with a SSD role set. The function is valid if and only if the
+     * role set exists.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link SDSet#name} - contains the name of existing object being targeted</li>
+     * </ul>
+     *
+     * @param ssd contains the name of the SSD set targeted, {@link SDSet#name}.
+     * @return int value containing cardinality of SSD set.
+     * @throws SecurityException in the event of data or system error.
+     */
+    @Override
+    public int ssdRoleSetCardinality(SDSet ssd)
+        throws SecurityException
+    {
+        String methodName = "ssdRoleSetCardinality";
+        assertContext(CLS_NM, methodName, ssd, GlobalErrIds.SSD_NULL);
+        checkAccess(CLS_NM, methodName);
+        SDSet se = ssdP.read(ssd);
+        return se.getCardinality();
+    }
+
+    /**
+     * This function returns the list of all dSD role sets that have a particular Role as member or Role's
+     * parent as a member.  If the Role parameter is left blank, function will return all dSD role sets.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link Role#name} - contains the name to use for the Role targeted for search.</li>
+     * </ul>
+     *
+     * @param role Will contain the role name, {@link Role#name}, for targeted dSD set or null to return all
+     * @return List containing all matching dSD's.
+     * @throws org.apache.directory.fortress.core.SecurityException
+     *          in the event of data or system error.
+     */
+    @Override
+    public List<SDSet> dsdRoleSets(Role role)
+        throws SecurityException
+    {
+        String methodName = "dsdRoleSets";
+        assertContext(CLS_NM, methodName, role, GlobalErrIds.ROLE_NULL);
+        checkAccess(CLS_NM, methodName);
+        return ssdP.search(role, SDSet.SDType.DYNAMIC);
+    }
+
+    /**
+     * This function returns the DSD data set that matches a particular set name.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link SDSet#name} - contains the name of existing object being targeted</li>
+     * </ul>
+     *
+     * @param set Will contain the name for existing DSD data set, {@link SDSet#name}.
+     * @return SDSet containing all attributes from matching DSD name.
+     * @throws org.apache.directory.fortress.core.SecurityException
+     *          in the event of data or system error.
+     */
+    @Override
+    public SDSet dsdRoleSet(SDSet set)
+        throws SecurityException
+    {
+        String methodName = "dsdRoleSet";
+        assertContext(CLS_NM, methodName, set, GlobalErrIds.DSD_NULL);
+        checkAccess(CLS_NM, methodName);
+        set.setType(SDSet.SDType.DYNAMIC);
+        return ssdP.read(set);
+    }
+
+    /**
+     * This function returns the list of DSDs that match a given dsd name value.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link SDSet#name} - contains the name of existing object being targeted</li>
+     * </ul>
+     *
+     * @param ssd contains the name for the SSD set targeted, {@link SDSet#name}.
+     * @return List containing all DSDSets that match a given DSDSet name.
+     * @throws SecurityException in the event of data or system error.
+     */
+    public List<SDSet> dsdSets(SDSet ssd)
+        throws SecurityException
+    {
+        String methodName = "dsdSets";
+        ssd.setType(SDSet.SDType.DYNAMIC);
+        assertContext(CLS_NM, methodName, ssd, GlobalErrIds.DSD_NULL);
+        checkAccess(CLS_NM, methodName);
+        return ssdP.search(ssd);
+    }
+
+    /**
+     * This function returns the set of roles of a DSD role set. The function is valid if and only if the
+     * role set exists.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link SDSet#name} - contains the name of existing object being targeted</li>
+     * </ul>
+     *
+     * @param dsd contains the name for the DSD set targeted, {@link SDSet#name}.
+     * @return List containing all Roles that are members of DSD data set.
+     * @throws SecurityException in the event of data or system error.
+     */
+    @Override
+    public Set<String> dsdRoleSetRoles(SDSet dsd)
+        throws SecurityException
+    {
+        String methodName = "dsdRoleSetRoles";
+        assertContext(CLS_NM, methodName, dsd, GlobalErrIds.DSD_NULL);
+        checkAccess(CLS_NM, methodName);
+        dsd.setType(SDSet.SDType.DYNAMIC);
+        SDSet se = ssdP.read(dsd);
+        return se.getMembers();
+    }
+
+    /**
+     * This function returns the cardinality associated with a DSD role set. The function is valid if and only if the
+     * role set exists.
+     * <h4>required parameters</h4>
+     * <ul>
+     * <li>{@link SDSet#name} - contains the name of existing object being targeted</li>
+     * </ul>
+     *
+     * @param dsd contains the name of the DSD set targeted, {@link SDSet#name}.
+     * @return int value containing cardinality of DSD set.
+     * @throws SecurityException in the event of data or system error.
+     */
+    @Override
+    public int dsdRoleSetCardinality(SDSet dsd)
+        throws SecurityException
+    {
+        String methodName = "dsdRoleSetCardinality";
+        assertContext(CLS_NM, methodName, dsd, GlobalErrIds.DSD_NULL);
+        checkAccess(CLS_NM, methodName);
+        SDSet se = ssdP.read(dsd);
+        return se.getCardinality();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/ba64d26a/src/main/java/org/apache/directory/fortress/core/impl/RoleDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/RoleDAO.java b/src/main/java/org/apache/directory/fortress/core/impl/RoleDAO.java
new file mode 100755
index 0000000..0898911
--- /dev/null
+++ b/src/main/java/org/apache/directory/fortress/core/impl/RoleDAO.java
@@ -0,0 +1,663 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.fortress.core.impl;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.directory.api.ldap.model.constants.SchemaConstants;
+import org.apache.directory.api.ldap.model.cursor.CursorException;
+import org.apache.directory.api.ldap.model.cursor.SearchCursor;
+import org.apache.directory.api.ldap.model.entry.DefaultEntry;
+import org.apache.directory.api.ldap.model.entry.DefaultModification;
+import org.apache.directory.api.ldap.model.entry.Entry;
+import org.apache.directory.api.ldap.model.entry.Modification;
+import org.apache.directory.api.ldap.model.entry.ModificationOperation;
+import org.apache.directory.api.ldap.model.exception.LdapException;
+import org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException;
+import org.apache.directory.api.ldap.model.exception.LdapNoSuchObjectException;
+import org.apache.directory.api.ldap.model.message.SearchScope;
+import org.apache.directory.fortress.core.model.Graphable;
+import org.apache.directory.ldap.client.api.LdapConnection;
+import org.apache.directory.fortress.core.CreateException;
+import org.apache.directory.fortress.core.FinderException;
+import org.apache.directory.fortress.core.GlobalErrIds;
+import org.apache.directory.fortress.core.GlobalIds;
+import org.apache.directory.fortress.core.model.ObjectFactory;
+import org.apache.directory.fortress.core.RemoveException;
+import org.apache.directory.fortress.core.UpdateException;
+import org.apache.directory.fortress.core.ldap.ApacheDsDataProvider;
+import org.apache.directory.fortress.core.model.Role;
+import org.apache.directory.fortress.core.util.time.CUtil;
+
+
+/**
+ * This class perform data access for Fortress Role entity.
+ * <p/>
+ * The Fortress Role entity is a composite of the following other Fortress structural and aux object classes:
+ * <h4>1. ftRls Structural objectclass is used to store the Role information like name and temporal constraint attributes</h4>
+ * <ul>
+ * <li>  ------------------------------------------
+ * <li> <code>objectclass    ( 1.3.6.1.4.1.38088.2.1</code>
+ * <li> <code>NAME 'ftRls'</code>
+ * <li> <code>DESC 'Fortress Role Object Class'</code>
+ * <li> <code>SUP organizationalrole</code>
+ * <li> <code>STRUCTURAL</code>
+ * <li> <code>MUST ( ftId $ ftRoleName )</code>
+ * <li> <code>MAY ( description $ ftCstr ) )</code>
+ * <li>  ------------------------------------------
+ * </ul>
+ * <h4>2. ftProperties AUXILIARY Object Class is used to store client specific name/value pairs on target entity</h4>
+ * <code># This aux object class can be used to store custom attributes.</code><br />
+ * <code># The properties collections consist of name/value pairs and are not constrainted by Fortress.</code><br />
+ * <ul>
+ * <li>  ------------------------------------------
+ * <li> <code>objectclass ( 1.3.6.1.4.1.38088.3.2</code>
+ * <li> <code>NAME 'ftProperties'</code>
+ * <li> <code>DESC 'Fortress Properties AUX Object Class'</code>
+ * <li> <code>AUXILIARY</code>
+ * <li> <code>MAY ( ftProps ) ) </code>
+ * <li>  ------------------------------------------
+ * </ul>
+ * <h4>3. ftMods AUXILIARY Object Class is used to store Fortress audit variables on target entity</h4>
+ * <ul>
+ * <li> <code>objectclass ( 1.3.6.1.4.1.38088.3.4</code>
+ * <li> <code>NAME 'ftMods'</code>
+ * <li> <code>DESC 'Fortress Modifiers AUX Object Class'</code>
+ * <li> <code>AUXILIARY</code>
+ * <li> <code>MAY (</code>
+ * <li> <code>ftModifier $</code>
+ * <li> <code>ftModCode $</code>
+ * <li> <code>ftModId ) )</code>
+ * <li>  ------------------------------------------
+ * </ul>
+ * <p/>
+ * This class is thread safe.
+ *
+ * @author Kevin McKinney
+ */
+final class RoleDAO extends ApacheDsDataProvider
+{
+    /*
+      *  *************************************************************************
+      *  **  OpenAccessMgr ROLE STATICS
+      *  ************************************************************************
+      */
+    private static final String ROLE_NM = "ftRoleName";
+
+    private static final String[] ROLE_NM_ATR =
+        {
+            ROLE_NM
+    };
+
+    private static final String[] ROLE_ATRS =
+        {
+            GlobalIds.FT_IID,
+            ROLE_NM,
+            SchemaConstants.DESCRIPTION_AT,
+            GlobalIds.CONSTRAINT,
+            SchemaConstants.ROLE_OCCUPANT_AT,
+            GlobalIds.PARENT_NODES
+    };
+
+    /**
+     * Defines the object class structure used within Fortress Role processing.
+     */
+    private static final String ROLE_OBJ_CLASS[] =
+        {
+            SchemaConstants.TOP_OC,
+            GlobalIds.ROLE_OBJECT_CLASS_NM,
+            GlobalIds.PROPS_AUX_OBJECT_CLASS_NAME,
+            GlobalIds.FT_MODIFIER_AUX_OBJECT_CLASS_NAME
+    };
+
+
+    /**
+     * @param entity
+     * @return
+     * @throws CreateException
+     */
+    Role create( Role entity ) throws CreateException
+    {
+        LdapConnection ld = null;
+        String dn = getDn( entity.getName(), entity.getContextId() );
+
+        try
+        {
+            Entry entry = new DefaultEntry( dn );
+            entry.add( SchemaConstants.OBJECT_CLASS_AT, ROLE_OBJ_CLASS );
+            entity.setId();
+            entry.add( GlobalIds.FT_IID, entity.getId() );
+            entry.add( ROLE_NM, entity.getName() );
+
+            // description field is optional on this object class:
+            if ( StringUtils.isNotEmpty( entity.getDescription() ) )
+            {
+                entry.add( SchemaConstants.DESCRIPTION_AT, entity.getDescription() );
+            }
+
+            // CN attribute is required for this object class:
+            entry.add( SchemaConstants.CN_AT, entity.getName() );
+            entry.add( GlobalIds.CONSTRAINT, CUtil.setConstraint( entity ) );
+
+            // These multi-valued attributes are optional.  The utility function will return quietly if items are not loaded into collection:
+            loadAttrs( entity.getParents(), entry, GlobalIds.PARENT_NODES );
+
+            ld = getAdminConnection();
+            add( ld, entry, entity );
+        }
+        catch ( LdapException e )
+        {
+            String error = "create role [" + entity.getName() + "] caught LdapException=" + e.getMessage();
+            throw new CreateException( GlobalErrIds.ROLE_ADD_FAILED, error, e );
+        }
+        finally
+        {
+            closeAdminConnection( ld );
+        }
+
+        return entity;
+    }
+
+
+    /**
+     * @param entity
+     * @return
+     * @throws org.apache.directory.fortress.core.UpdateException
+     *
+     */
+    Role update( Role entity ) throws UpdateException
+    {
+        LdapConnection ld = null;
+        String dn = getDn( entity.getName(), entity.getContextId() );
+
+        try
+        {
+            List<Modification> mods = new ArrayList<Modification>();
+
+            if ( StringUtils.isNotEmpty( entity.getDescription() ) )
+            {
+                mods.add( new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
+                    SchemaConstants.DESCRIPTION_AT, entity.getDescription() ) );
+            }
+
+            if ( entity.isTemporalSet() )
+            {
+                String szRawData = CUtil.setConstraint( entity );
+
+                if ( StringUtils.isNotEmpty( szRawData ) )
+                {
+                    mods.add( new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
+                        GlobalIds.CONSTRAINT, szRawData ) );
+                }
+            }
+
+            loadAttrs( entity.getParents(), mods, GlobalIds.PARENT_NODES );
+
+            if ( mods.size() > 0 )
+            {
+                ld = getAdminConnection();
+                modify( ld, dn, mods, entity );
+            }
+        }
+        catch ( LdapException e )
+        {
+            String error = "update name [" + entity.getName() + "] caught LdapException=" + e.getMessage();
+            throw new UpdateException( GlobalErrIds.ROLE_UPDATE_FAILED, error, e );
+        }
+        catch ( Exception e )
+        {
+            String error = "update name [" + entity.getName() + "] caught LdapException=" + e.getMessage();
+            throw new UpdateException( GlobalErrIds.ROLE_UPDATE_FAILED, error, e );
+        }
+        finally
+        {
+            try
+            {
+                closeAdminConnection( ld );
+            }
+            catch ( Exception e )
+            {
+                String error = "update name [" + entity.getName() + "] caught LdapException=" + e.getMessage();
+                throw new UpdateException( GlobalErrIds.ROLE_UPDATE_FAILED, error, e );
+            }
+        }
+
+        return entity;
+    }
+
+
+    /**
+     *
+     * @param entity
+     * @throws UpdateException
+     */
+    void deleteParent( Role entity ) throws UpdateException
+    {
+        LdapConnection ld = null;
+        String dn = getDn( entity.getName(), entity.getContextId() );
+        try
+        {
+            List<Modification> mods = new ArrayList<Modification>();
+            mods.add( new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE,
+                GlobalIds.PARENT_NODES ) );
+            ld = getAdminConnection();
+            modify( ld, dn, mods, entity );
+        }
+        catch ( LdapException e )
+        {
+            String error = "deleteParent name [" + entity.getName() + "] caught LdapException=" + e.getMessage();
+            throw new UpdateException( GlobalErrIds.ROLE_REMOVE_PARENT_FAILED, error, e );
+        }
+        finally
+        {
+            closeAdminConnection( ld );
+        }
+    }
+
+
+    /**
+     * @param entity
+     * @param userDn
+     * @return
+     * @throws org.apache.directory.fortress.core.UpdateException
+     *
+     */
+    Role assign( Role entity, String userDn ) throws UpdateException
+    {
+        LdapConnection ld = null;
+        String dn = getDn( entity.getName(), entity.getContextId() );
+
+        try
+        {
+            //ld = getAdminConnection();
+            List<Modification> mods = new ArrayList<Modification>();
+            mods.add( new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, SchemaConstants.ROLE_OCCUPANT_AT,
+                userDn ) );
+            ld = getAdminConnection();
+            modify( ld, dn, mods, entity );
+        }
+        catch ( LdapException e )
+        {
+            String error = "assign role name [" + entity.getName() + "] user dn [" + userDn + "] caught LdapException="
+                + e.getMessage();
+            throw new UpdateException( GlobalErrIds.ROLE_USER_ASSIGN_FAILED, error, e );
+        }
+        finally
+        {
+            closeAdminConnection( ld );
+        }
+
+        return entity;
+    }
+
+
+    /**
+     * @param entity
+     * @param userDn
+     * @return
+     * @throws org.apache.directory.fortress.core.UpdateException
+     *
+     */
+    Role deassign( Role entity, String userDn ) throws UpdateException
+    {
+        LdapConnection ld = null;
+        String dn = getDn( entity.getName(), entity.getContextId() );
+        try
+        {
+            List<Modification> mods = new ArrayList<Modification>();
+            mods.add( new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE,
+                SchemaConstants.ROLE_OCCUPANT_AT, userDn ) );
+            ld = getAdminConnection();
+            modify( ld, dn, mods, entity );
+        }
+        catch ( LdapException e )
+        {
+            String error = "deassign role name [" + entity.getName() + "] user dn [" + userDn
+                + "] caught LdapException=" + e.getMessage();
+            throw new UpdateException( GlobalErrIds.ROLE_USER_DEASSIGN_FAILED, error, e );
+        }
+        finally
+        {
+            closeAdminConnection( ld );
+        }
+
+        return entity;
+    }
+
+
+    /**
+     * @param role
+     * @throws RemoveException
+     */
+    void remove( Role role )
+        throws RemoveException
+    {
+        LdapConnection ld = null;
+        String dn = getDn( role.getName(), role.getContextId() );
+
+        try
+        {
+            ld = getAdminConnection();
+            delete( ld, dn, role );
+        }
+        catch ( LdapException e )
+        {
+            String error = "remove role name=" + role.getName() + " LdapException=" + e.getMessage();
+            throw new RemoveException( GlobalErrIds.ROLE_DELETE_FAILED, error, e );
+        }
+        finally
+        {
+            closeAdminConnection( ld );
+        }
+    }
+
+
+    /**
+     * @param role
+     * @return
+     * @throws org.apache.directory.fortress.core.FinderException
+     *
+     */
+    Role getRole( Role role )
+        throws FinderException
+    {
+        Role entity = null;
+        LdapConnection ld = null;
+        String dn = getDn( role.getName(), role.getContextId() );
+
+        try
+        {
+            ld = getAdminConnection();
+            Entry findEntry = read( ld, dn, ROLE_ATRS );
+            if ( findEntry != null )
+            {
+                entity = unloadLdapEntry( findEntry, 0, role.getContextId() );
+            }
+            if ( entity == null )
+            {
+                String warning = "getRole no entry found dn [" + dn + "]";
+                throw new FinderException( GlobalErrIds.ROLE_NOT_FOUND, warning );
+            }
+        }
+        catch ( LdapNoSuchObjectException e )
+        {
+            String warning = "getRole Obj COULD NOT FIND ENTRY for dn [" + dn + "]";
+            throw new FinderException( GlobalErrIds.ROLE_NOT_FOUND, warning );
+        }
+        catch ( LdapException e )
+        {
+            String error = "getRole dn [" + dn + "] LEXCD=" + e;
+            throw new FinderException( GlobalErrIds.ROLE_READ_FAILED, error, e );
+        }
+        finally
+        {
+            closeAdminConnection( ld );
+        }
+
+        return entity;
+    }
+
+
+    /**
+     * @param role
+     * @return
+     * @throws org.apache.directory.fortress.core.FinderException
+     *
+     */
+    List<Role> findRoles( Role role )
+        throws FinderException
+    {
+        List<Role> roleList = new ArrayList<>();
+        LdapConnection ld = null;
+        String roleRoot = getRootDn( role.getContextId(), GlobalIds.ROLE_ROOT );
+        String filter = null;
+
+        try
+        {
+            String searchVal = encodeSafeText( role.getName(), GlobalIds.ROLE_LEN );
+            filter = GlobalIds.FILTER_PREFIX + GlobalIds.ROLE_OBJECT_CLASS_NM + ")("
+                + ROLE_NM + "=" + searchVal + "*))";
+            ld = getAdminConnection();
+            SearchCursor searchResults = search( ld, roleRoot,
+                SearchScope.ONELEVEL, filter, ROLE_ATRS, false, GlobalIds.BATCH_SIZE );
+            long sequence = 0;
+
+            while ( searchResults.next() )
+            {
+                roleList.add( unloadLdapEntry( searchResults.getEntry(), sequence++, role.getContextId() ) );
+            }
+        }
+        catch ( LdapException e )
+        {
+            String error = "findRoles filter [" + filter + "] caught LdapException=" + e.getMessage();
+            throw new FinderException( GlobalErrIds.ROLE_SEARCH_FAILED, error, e );
+        }
+        catch ( CursorException e )
+        {
+            String error = "findRoles filter [" + filter + "] caught CursorException=" + e.getMessage();
+            throw new FinderException( GlobalErrIds.ROLE_SEARCH_FAILED, error, e );
+        }
+        finally
+        {
+            closeAdminConnection( ld );
+        }
+
+        return roleList;
+    }
+
+
+    /**
+     * @param role
+     * @param limit
+     * @return
+     * @throws org.apache.directory.fortress.core.FinderException
+     *
+     */
+    List<String> findRoles( Role role, int limit )
+        throws FinderException
+    {
+        List<String> roleList = new ArrayList<>();
+        LdapConnection ld = null;
+        String roleRoot = getRootDn( role.getContextId(), GlobalIds.ROLE_ROOT );
+        String filter = null;
+
+        try
+        {
+            String searchVal = encodeSafeText( role.getName(), GlobalIds.ROLE_LEN );
+            filter = GlobalIds.FILTER_PREFIX + GlobalIds.ROLE_OBJECT_CLASS_NM + ")("
+                + ROLE_NM + "=" + searchVal + "*))";
+            ld = getAdminConnection();
+            SearchCursor searchResults = search( ld, roleRoot,
+                SearchScope.ONELEVEL, filter, ROLE_NM_ATR, false, GlobalIds.BATCH_SIZE, limit );
+
+            while ( searchResults.next() )
+            {
+                Entry entry = searchResults.getEntry();
+                roleList.add( getAttribute( entry, ROLE_NM ) );
+            }
+        }
+        catch ( LdapException e )
+        {
+            String error = "findRoles filter [" + filter + "] caught LdapException=" + e.getMessage();
+            throw new FinderException( GlobalErrIds.ROLE_SEARCH_FAILED, error, e );
+        }
+        catch ( CursorException e )
+        {
+            String error = "findRoles filter [" + filter + "] caught CursorException=" + e.getMessage();
+            throw new FinderException( GlobalErrIds.ROLE_SEARCH_FAILED, error, e );
+        }
+        finally
+        {
+            closeAdminConnection( ld );
+        }
+
+        return roleList;
+    }
+
+
+    /**
+     *
+     * @param userDn
+     * @param contextId
+     * @return
+     * @throws FinderException
+     */
+    List<String> findAssignedRoles( String userDn, String contextId )
+        throws FinderException
+    {
+        List<String> roleNameList = new ArrayList<>();
+        LdapConnection ld = null;
+        String roleRoot = getRootDn( contextId, GlobalIds.ROLE_ROOT );
+
+        try
+        {
+            String filter = GlobalIds.FILTER_PREFIX + GlobalIds.ROLE_OBJECT_CLASS_NM + ")";
+            filter += "(" + SchemaConstants.ROLE_OCCUPANT_AT + "=" + userDn + "))";
+            ld = getAdminConnection();
+            SearchCursor searchResults = search( ld, roleRoot,
+                SearchScope.ONELEVEL, filter, ROLE_NM_ATR, false, GlobalIds.BATCH_SIZE );
+
+            while ( searchResults.next() )
+            {
+                roleNameList.add( getAttribute( searchResults.getEntry(), ROLE_NM ) );
+            }
+        }
+        catch ( LdapException e )
+        {
+            String error = "findAssignedRoles userDn [" + userDn + "] caught LdapException=" + e.getMessage();
+            throw new FinderException( GlobalErrIds.ROLE_OCCUPANT_SEARCH_FAILED, error, e );
+        }
+        catch ( CursorException e )
+        {
+            String error = "findAssignedRoles userDn [" + userDn + "] caught CursorException=" + e.getMessage();
+            throw new FinderException( GlobalErrIds.ROLE_OCCUPANT_SEARCH_FAILED, error, e );
+        }
+        finally
+        {
+            closeAdminConnection( ld );
+        }
+
+        return roleNameList;
+    }
+
+
+    /**
+     *
+     * @param contextId
+     * @return
+     * @throws FinderException
+     */
+    List<Graphable> getAllDescendants( String contextId )
+        throws FinderException
+    {
+        String[] DESC_ATRS =
+            { ROLE_NM, GlobalIds.PARENT_NODES };
+        List<Graphable> descendants = new ArrayList<>();
+        LdapConnection ld = null;
+        String roleRoot = getRootDn( contextId, GlobalIds.ROLE_ROOT );
+        String filter = null;
+
+        try
+        {
+            filter = GlobalIds.FILTER_PREFIX + GlobalIds.ROLE_OBJECT_CLASS_NM + ")("
+                + GlobalIds.PARENT_NODES + "=*))";
+            ld = getAdminConnection();
+            SearchCursor searchResults = search( ld, roleRoot,
+                SearchScope.ONELEVEL, filter, DESC_ATRS, false, GlobalIds.BATCH_SIZE );
+            long sequence = 0;
+
+            while ( searchResults.next() )
+            {
+                descendants.add( unloadDescendants( searchResults.getEntry(), sequence++, contextId ) );
+            }
+        }
+        catch ( LdapException e )
+        {
+            String error = "getAllDescendants filter [" + filter + "] caught LdapException=" + e.getMessage();
+            throw new FinderException( GlobalErrIds.ROLE_SEARCH_FAILED, error, e );
+        }
+        catch ( CursorException e )
+        {
+            String error = "getAllDescendants filter [" + filter + "] caught CursorException=" + e.getMessage();
+            throw new FinderException( GlobalErrIds.ROLE_SEARCH_FAILED, error, e );
+        }
+        finally
+        {
+            closeAdminConnection( ld );
+        }
+
+        return descendants;
+    }
+
+
+    /**
+     *
+     * @param le
+     * @param sequence
+     * @param contextId
+     * @return
+     * @throws LdapInvalidAttributeValueException 
+     * @throws LdapException
+     */
+    private Graphable unloadDescendants( Entry le, long sequence, String contextId )
+        throws LdapInvalidAttributeValueException
+    {
+        Role entity = new ObjectFactory().createRole();
+        entity.setSequenceId( sequence );
+        entity.setName( getAttribute( le, ROLE_NM ) );
+        entity.setParents( getAttributeSet( le, GlobalIds.PARENT_NODES ) );
+        return entity;
+    }
+
+
+    /**
+     *
+     * @param le
+     * @param sequence
+     * @param contextId
+     * @return
+     * @throws LdapInvalidAttributeValueException 
+     * @throws LdapException
+     */
+    private Role unloadLdapEntry( Entry le, long sequence, String contextId ) throws LdapInvalidAttributeValueException
+    {
+        Role entity = new ObjectFactory().createRole();
+        entity.setSequenceId( sequence );
+        entity.setId( getAttribute( le, GlobalIds.FT_IID ) );
+        entity.setName( getAttribute( le, ROLE_NM ) );
+        entity.setDescription( getAttribute( le, SchemaConstants.DESCRIPTION_AT ) );
+        entity.setOccupants( getAttributes( le, SchemaConstants.ROLE_OCCUPANT_AT ) );
+        //entity.setParents(RoleUtil.getParents(entity.getName().toUpperCase(), contextId));
+        entity.setChildren( RoleUtil.getChildren( entity.getName().toUpperCase(), contextId ) );
+        entity.setParents( getAttributeSet( le, GlobalIds.PARENT_NODES ) );
+        unloadTemporal( le, entity );
+
+        return entity;
+    }
+
+
+    private String getDn( String name, String contextId )
+    {
+        return SchemaConstants.CN_AT + "=" + name + "," + getRootDn( contextId, GlobalIds.ROLE_ROOT );
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/ba64d26a/src/main/java/org/apache/directory/fortress/core/impl/RoleP.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/RoleP.java b/src/main/java/org/apache/directory/fortress/core/impl/RoleP.java
new file mode 100755
index 0000000..eaef3e5
--- /dev/null
+++ b/src/main/java/org/apache/directory/fortress/core/impl/RoleP.java
@@ -0,0 +1,311 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.fortress.core.impl;
+
+
+import java.util.List;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.directory.fortress.core.FinderException;
+import org.apache.directory.fortress.core.GlobalErrIds;
+import org.apache.directory.fortress.core.GlobalIds;
+import org.apache.directory.fortress.core.SecurityException;
+import org.apache.directory.fortress.core.ValidationException;
+import org.apache.directory.fortress.core.model.Graphable;
+import org.apache.directory.fortress.core.model.Role;
+import org.apache.directory.fortress.core.model.UserRole;
+import org.apache.directory.fortress.core.model.VUtil;
+import org.apache.directory.fortress.core.util.ObjUtil;
+
+
+/**
+ * Process module for the Role entity.  This class performs data validations and error mapping.  It is typically called
+ * by internal Fortress manager classes ({@link AdminMgrImpl}, {@link AccessMgrImpl},
+ * {@link ReviewMgrImpl}, ...) and not intended for external non-Fortress clients.  This class will accept,
+ * {@link org.apache.directory.fortress.core.model.Role}, validate its contents and forward on to it's corresponding DAO class {@link RoleDAO}.
+ * <p>
+ * Class will throw {@link SecurityException} to caller in the event of security policy, data constraint violation or system
+ * error internal to DAO object. This class will forward DAO exceptions ({@link org.apache.directory.fortress.core.FinderException},
+ * {@link org.apache.directory.fortress.core.CreateException},{@link org.apache.directory.fortress.core.UpdateException},{@link org.apache.directory.fortress.core.RemoveException}),
+ *  or {@link org.apache.directory.fortress.core.ValidationException} as {@link SecurityException}s with appropriate
+ * error id from {@link org.apache.directory.fortress.core.GlobalErrIds}.
+ * <p>
+ * This class is thread safe.
+ * </p>
+
+ *
+ * @author Kevin McKinney
+ */
+public final class RoleP
+{
+    private static RoleDAO rDao = new RoleDAO();
+
+
+    /**
+     * Package private
+     */
+    RoleP()
+    {
+    }
+
+
+    /**
+     * Return a fully populated Role entity for a given RBAC role name.  If matching record not found a
+     * SecurityException will be thrown.
+     *
+     * @param role contains full role name for RBAC role in directory.
+     * @return Role entity containing all attributes associated with Role in directory.
+     * @throws SecurityException in the event Role not found or DAO search error.
+     */
+    Role read( Role role ) throws SecurityException
+    {
+        return rDao.getRole( role );
+    }
+
+
+    /**
+     * Takes a search string that contains full or partial RBAC Role name in directory.
+     *
+     * @param role contains full or partial RBAC role name.
+     * @return List of type Role containing fully populated matching RBAC Role entities.  If no records found this will be empty.
+     * @throws SecurityException in the event of DAO search error.
+     */
+    List<Role> search( Role role ) throws SecurityException
+    {
+        return rDao.findRoles( role );
+    }
+
+
+    /**
+     * Takes a search string that contains full or partial RBAC Role name in directory.
+     * This search is used by RealmMgr for Websphere.
+     *
+     * @param role contains full or partial RBAC role name.
+     * @param limit     specify the max number of records to return in result set.
+     * @return List of type String containing RBAC Role name of all matching User entities.  If no records found this will be empty.
+     * @throws SecurityException in the event of DAO search error.
+     */
+    List<String> search( Role role, int limit ) throws SecurityException
+    {
+        return rDao.findRoles( role, limit );
+    }
+
+
+    /**
+     * Return all Roles that have a parent assignment.  This used for hierarchical processing.
+     *
+     * @param contextId maps to sub-tree in DIT, for example ou=contextId, dc=jts, dc = com.
+     * @return List of type Role containing {@link Role#name} and {@link Role#parents} populated.
+     * @throws SecurityException in the event of DAO search error.
+     */
+    List<Graphable> getAllDescendants( String contextId ) throws SecurityException
+    {
+        return rDao.getAllDescendants( contextId );
+    }
+
+
+    /**
+     * Adds a new Role entity to directory.  The Role entity input object will be validated to ensure that:
+     * role name is present, and reasonability checks on all of the other populated values.
+     *
+     * @param entity Role entity contains data targeted for insertion.
+     * @return Role entity copy of input + additional attributes (internalId) that were added by op.
+     * @throws SecurityException in the event of data validation or DAO system error.
+     */
+    Role add( Role entity ) throws SecurityException
+    {
+        validate( entity );
+        return rDao.create( entity );
+    }
+
+
+    /**
+     * Updates existing Role entity in directory.  For example the Role description and temporal constraints
+     * updated.
+     *
+     * @param entity Role entity contains data targeted for updating.
+     * @return Role entity contains fully populated updated entity.
+     * @throws SecurityException in the event of data validation or DAO system error.
+     */
+    Role update( Role entity ) throws SecurityException
+    {
+        validate( entity );
+        return rDao.update( entity );
+    }
+
+
+    /**
+     * Removes parent role assignments from Role entity in directory.
+     * updated.
+     *
+     * @param entity Role entity contains data targeted for updating.
+     * @throws SecurityException in the event of data validation or DAO system error.
+     */
+    void deleteParent( Role entity ) throws SecurityException
+    {
+        validate( entity );
+        rDao.deleteParent( entity );
+    }
+
+
+    /**
+     * Method will add the "roleOccupant" attribute on OpenLDAP entry which represents an RBAC Role assignment in Fortress.
+     *
+     * @param entity contains the role name targeted.
+     * @param userDn String contains the dn for the user entry that is being assigned the RBAC Role.
+     * @return Role containing copy of input data.
+     * @throws SecurityException in the event of data validation or DAO system error.
+     */
+    Role assign( Role entity, String userDn ) throws SecurityException
+    {
+        return rDao.assign( entity, userDn );
+    }
+
+
+    /**
+     * Method will remove the "roleOccupant" attribute on OpenLDAP entry which represents an RBAC Role assignment in Fortress.
+     *
+     * @param entity contains the role name targeted.
+     * @param userDn String contains the dn for the user entry that is being assigned the RBAC Role.
+     * @return Role containing copy of input data.
+     * @throws SecurityException in the event of data validation or DAO system error.
+     */
+    Role deassign( Role entity, String userDn ) throws SecurityException
+    {
+        entity = rDao.deassign( entity, userDn );
+        return entity;
+    }
+
+
+    /**
+     * Add the User dn occupant attribute to the OrganizationalRole entity in ldap.  This method is called by AdminMgrImpl
+     * when the User is being added.
+     *
+     * @param uRoles contains a collection of UserRole being targeted for assignment.
+     * @param userDn contains the userId targeted for addition.
+     * @param contextId maps to sub-tree in DIT, for example ou=contextId, dc=jts, dc = com.
+     * @throws SecurityException in the event of DAO search error.
+     */
+    void addOccupant( List<UserRole> uRoles, String userDn, String contextId ) throws SecurityException
+    {
+        if ( ObjUtil.isNotNullOrEmpty( uRoles ) )
+        {
+            for ( UserRole uRole : uRoles )
+            {
+                Role role = new Role( uRole.getName() );
+                role.setContextId( contextId );
+                assign( role, userDn );
+            }
+        }
+    }
+
+
+    /**
+     * Remove the User dn occupant attribute from the OrganizationalRole entity in ldap.  This method is called by AdminMgrImpl
+     * when the User is being deleted.
+     *
+     * @param userDn contains the userId targeted for attribute removal.
+     * @param contextId maps to sub-tree in DIT, for example ou=contextId, dc=jts, dc = com.
+     * @throws SecurityException in the event of DAO search error.
+     */
+    void removeOccupant( String userDn, String contextId ) throws SecurityException
+    {
+        List<String> list;
+        try
+        {
+            list = rDao.findAssignedRoles( userDn, contextId );
+            for ( String roleNm : list )
+            {
+                Role role = new Role( roleNm );
+                role.setContextId( contextId );
+                deassign( role, userDn );
+            }
+        }
+        catch ( FinderException fe )
+        {
+            String error = "removeOccupant userDn [" + userDn + "] caught FinderException=" + fe;
+            throw new SecurityException( GlobalErrIds.ROLE_REMOVE_OCCUPANT_FAILED, error, fe );
+        }
+    }
+
+
+    /**
+     * This method performs a "hard" delete.  It completely the RBAC Role node from the ldap directory.
+     * RBAC Role entity must exist in directory prior to making this call else exception will be thrown.
+     *
+     * @param entity Contains the name of the RBAC Role targeted for deletion.
+     * @throws SecurityException in the event of data validation or DAO system error.
+     */
+    void delete( Role entity ) throws SecurityException
+    {
+        rDao.remove( entity );
+    }
+
+
+    /**
+     * Method will perform simple validations to ensure the integrity of the RBAC Role entity targeted for insertion
+     * or updating in directory.  For example the Role temporal constraints will be validated.  Data reasonability
+     * checks will be performed on all non-null attributes.
+     *
+     * @param entity contains data targeted for insertion or update.
+     * @throws org.apache.directory.fortress.core.ValidationException in the event of data validation error or Org validation.
+     */
+    private void validate( Role entity )
+        throws ValidationException
+    {
+        VUtil.safeText( entity.getName(), GlobalIds.ROLE_LEN );
+        if ( StringUtils.isNotEmpty( entity.getDescription() ) )
+        {
+            VUtil.description( entity.getDescription() );
+        }
+        if ( ObjUtil.isNotNullOrEmpty( entity.getTimeout() ) )
+        {
+            VUtil.timeout( entity.getTimeout() );
+        }
+        if ( StringUtils.isNotEmpty( entity.getBeginTime() ) )
+        {
+            VUtil.beginTime( entity.getBeginTime() );
+        }
+        if ( StringUtils.isNotEmpty( entity.getEndTime() ) )
+        {
+            VUtil.endTime( entity.getEndTime() );
+        }
+        if ( StringUtils.isNotEmpty( entity.getBeginDate() ) )
+        {
+            VUtil.beginDate( entity.getBeginDate() );
+        }
+        if ( StringUtils.isNotEmpty( entity.getEndDate() ) )
+        {
+            VUtil.endDate( entity.getEndDate() );
+        }
+        if ( StringUtils.isNotEmpty( entity.getDayMask() ) )
+        {
+            VUtil.dayMask( entity.getDayMask() );
+        }
+        if ( StringUtils.isNotEmpty( entity.getBeginLockDate() ) )
+        {
+            VUtil.beginDate( entity.getBeginDate() );
+        }
+        if ( StringUtils.isNotEmpty( entity.getEndLockDate() ) )
+        {
+            VUtil.endDate( entity.getEndLockDate() );
+        }
+    }
+}
\ No newline at end of file


Mime
View raw message