directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject directory-fortress-core git commit: FC-40 - Use the LDAP API constants instead of GlobalIDs constants when possible
Date Sun, 21 Dec 2014 17:15:43 GMT
Repository: directory-fortress-core
Updated Branches:
  refs/heads/1.0-RC40 04f0a1a26 -> 8c5a6c613


FC-40 - Use the LDAP API constants instead of GlobalIDs constants when possible


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/8c5a6c61
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/8c5a6c61
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/8c5a6c61

Branch: refs/heads/1.0-RC40
Commit: 8c5a6c6139784b62fd7ea5ffefe05a0a10692586
Parents: 04f0a1a
Author: Shawn McKinney <smckinney@apache.org>
Authored: Sun Dec 21 11:15:27 2014 -0600
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Sun Dec 21 11:15:27 2014 -0600

----------------------------------------------------------------------
 .../core/ldap/container/OrganizatiionalUnitDAO.java    |  6 ++++--
 .../apache/directory/fortress/core/rbac/PermDAO.java   |  4 ++--
 .../apache/directory/fortress/core/rbac/RoleDAO.java   | 13 ++++++-------
 3 files changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/8c5a6c61/src/main/java/org/apache/directory/fortress/core/ldap/container/OrganizatiionalUnitDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ldap/container/OrganizatiionalUnitDAO.java
b/src/main/java/org/apache/directory/fortress/core/ldap/container/OrganizatiionalUnitDAO.java
index b25699d..c6efdbd 100644
--- a/src/main/java/org/apache/directory/fortress/core/ldap/container/OrganizatiionalUnitDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/ldap/container/OrganizatiionalUnitDAO.java
@@ -68,11 +68,13 @@ final class OrganizationalUnitDAO extends ApacheDsDataProvider
 {
     private static final String CLS_NM = OrganizationalUnitDAO.class.getName();
     private static final Logger LOG = LoggerFactory.getLogger( CLS_NM );
-    private static final String ORGUNIT_CLASS = "organizationalunit";
+    //private static final String ORGUNIT_CLASS = "organizationalunit";
+/*
     private static final String[] ORGUNIT_OBJ_CLASS =
         {
             ORGUNIT_CLASS
         };
+*/
 
 
     /**
@@ -111,7 +113,7 @@ final class OrganizationalUnitDAO extends ApacheDsDataProvider
             LOG.info( "create container dn [{}]",  nodeDn );
 
             Entry myEntry = new DefaultEntry( nodeDn,
-                SchemaConstants.OBJECT_CLASS, ORGUNIT_CLASS,
+                SchemaConstants.OBJECT_CLASS, SchemaConstants.ORGANIZATIONAL_UNIT_OC,
                 SchemaConstants.OU_AT, oe.getName(),
                 SchemaConstants.DESCRIPTION_AT, oe.getDescription() );
 

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/8c5a6c61/src/main/java/org/apache/directory/fortress/core/rbac/PermDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/PermDAO.java b/src/main/java/org/apache/directory/fortress/core/rbac/PermDAO.java
index cd55062..6d9d6c4 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/PermDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/PermDAO.java
@@ -157,7 +157,7 @@ final class PermDAO extends ApacheDsDataProvider
     private static final String PERM_OBJ_OBJ_CLASS[] =
         {
             SchemaConstants.TOP_OC,
-            "organizationalunit",
+            SchemaConstants.ORGANIZATIONAL_UNIT_OC,
             PERM_OBJ_OBJECT_CLASS_NAME,
             GlobalIds.PROPS_AUX_OBJECT_CLASS_NAME,
             GlobalIds.FT_MODIFIER_AUX_OBJECT_CLASS_NAME
@@ -166,7 +166,7 @@ final class PermDAO extends ApacheDsDataProvider
     private static final String PERM_OP_OBJ_CLASS[] =
         {
             SchemaConstants.TOP_OC,
-            "organizationalrole",
+            SchemaConstants.ORGANIZATIONAL_ROLE_OC,
             PERM_OP_OBJECT_CLASS_NAME,
             GlobalIds.PROPS_AUX_OBJECT_CLASS_NAME,
             GlobalIds.FT_MODIFIER_AUX_OBJECT_CLASS_NAME

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/8c5a6c61/src/main/java/org/apache/directory/fortress/core/rbac/RoleDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/RoleDAO.java b/src/main/java/org/apache/directory/fortress/core/rbac/RoleDAO.java
index e5ed548..677893c 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/RoleDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/RoleDAO.java
@@ -103,7 +103,6 @@ final class RoleDAO extends ApacheDsDataProvider
       *  **  OpenAccessMgr ROLE STATICS
       *  ************************************************************************
       */
-    private static final String ROLE_OCCUPANT = "roleOccupant";
     private static final String ROLE_NM = "ftRoleName";
 
     private static final String[] ROLE_NM_ATR =
@@ -113,7 +112,7 @@ final class RoleDAO extends ApacheDsDataProvider
 
     private static final String[] ROLE_ATRS =
         {
-            GlobalIds.FT_IID, ROLE_NM, SchemaConstants.DESCRIPTION_AT, GlobalIds.CONSTRAINT,
ROLE_OCCUPANT, GlobalIds.PARENT_NODES
+            GlobalIds.FT_IID, ROLE_NM, SchemaConstants.DESCRIPTION_AT, GlobalIds.CONSTRAINT,
SchemaConstants.ROLE_OCCUPANT_AT, GlobalIds.PARENT_NODES
     };
 
 
@@ -191,7 +190,7 @@ final class RoleDAO extends ApacheDsDataProvider
                 for ( String name : entity.getOccupants() )
                 {
                     mods.add( new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
-                        ROLE_OCCUPANT, entity.getOccupants().toArray( new String[]
+                        SchemaConstants.ROLE_OCCUPANT_AT, entity.getOccupants().toArray(
new String[]
                             {} ) ) );
                 }
             }
@@ -287,7 +286,7 @@ final class RoleDAO extends ApacheDsDataProvider
         {
             //ld = getAdminConnection();
             List<Modification> mods = new ArrayList<Modification>();
-            mods.add( new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, ROLE_OCCUPANT,
userDn ) );
+            mods.add( new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, SchemaConstants.ROLE_OCCUPANT_AT,
userDn ) );
             ld = getAdminConnection();
             modify( ld, dn, mods, entity );
         }
@@ -320,7 +319,7 @@ final class RoleDAO extends ApacheDsDataProvider
         try
         {
             List<Modification> mods = new ArrayList<Modification>();
-            mods.add( new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, ROLE_OCCUPANT,
userDn ) );
+            mods.add( new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, SchemaConstants.ROLE_OCCUPANT_AT,
userDn ) );
             ld = getAdminConnection();
             modify( ld, dn, mods, entity );
         }
@@ -526,7 +525,7 @@ final class RoleDAO extends ApacheDsDataProvider
         try
         {
             String filter = GlobalIds.FILTER_PREFIX + GlobalIds.ROLE_OBJECT_CLASS_NM + ")";
-            filter += "(" + ROLE_OCCUPANT + "=" + userDn + "))";
+            filter += "(" + SchemaConstants.ROLE_OCCUPANT_AT + "=" + userDn + "))";
             ld = getAdminConnection();
             SearchCursor searchResults = search( ld, roleRoot,
                 SearchScope.ONELEVEL, filter, ROLE_NM_ATR, false, GlobalIds.BATCH_SIZE );
@@ -640,7 +639,7 @@ final class RoleDAO extends ApacheDsDataProvider
         entity.setId( getAttribute( le, GlobalIds.FT_IID ) );
         entity.setName( getAttribute( le, ROLE_NM ) );
         entity.setDescription( getAttribute( le, SchemaConstants.DESCRIPTION_AT ) );
-        entity.setOccupants( getAttributes( le, ROLE_OCCUPANT ) );
+        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 ) );


Mime
View raw message