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-105 - make static and change names
Date Fri, 29 May 2015 20:54:38 GMT
Repository: directory-fortress-core
Updated Branches:
  refs/heads/master bd1e6b42f -> 7d3d46dd5


FC-105 - make static and change names


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

Branch: refs/heads/master
Commit: 7d3d46dd5e503edacbb34c0abddae1d45a36d127
Parents: bd1e6b4
Author: Shawn McKinney <smckinney@apache.org>
Authored: Fri May 29 15:54:29 2015 -0500
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Fri May 29 15:54:29 2015 -0500

----------------------------------------------------------------------
 .../fortress/core/rbac/UserAdminRole.java       | 14 ++++----
 .../directory/fortress/core/rbac/UserDAO.java   | 36 ++++++++------------
 .../fortress/core/util/cache/CacheMgr.java      | 16 ++++-----
 .../fortress/core/util/crypto/EncryptUtil.java  |  2 +-
 4 files changed, 31 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/7d3d46dd/src/main/java/org/apache/directory/fortress/core/rbac/UserAdminRole.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/UserAdminRole.java b/src/main/java/org/apache/directory/fortress/core/rbac/UserAdminRole.java
index 529230a..e1aad22 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/UserAdminRole.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/UserAdminRole.java
@@ -110,13 +110,13 @@ public class UserAdminRole extends UserRole implements Administrator
     private Set<String> parents;
 
     // Used for formatting raw data:
-    private static String P = "P";
-    private static String U = "U";
-    private static String R = "R";
-    private static String LEFT_PAREN = "(";
-    private static String RIGHT_PAREN = ")";
-    private static String LEFT_BRACKET = "[";
-    private static String RIGHT_BRACKET = "]";
+    private static final String P = "P";
+    private static final String U = "U";
+    private static final String R = "R";
+    private static final String LEFT_PAREN = "(";
+    private static final String RIGHT_PAREN = ")";
+    private static final String LEFT_BRACKET = "[";
+    private static final String RIGHT_BRACKET = "]";
 
 
     /**

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/7d3d46dd/src/main/java/org/apache/directory/fortress/core/rbac/UserDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/UserDAO.java b/src/main/java/org/apache/directory/fortress/core/rbac/UserDAO.java
index a5332de..da88fd1 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/UserDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/UserDAO.java
@@ -207,8 +207,8 @@ final class UserDAO extends ApacheDsDataProvider
         { SchemaConstants.UID_AT };
 
     // These will be loaded in static initializer that follows:
-    private static String[] AUTHN_ATRS = null;
-    private static String[] DEFAULT_ATRS = null;
+    private static String[] authnAtrs = null;
+    private static String[] defaultAtrs = null;
 
     static
     {
@@ -220,7 +220,7 @@ final class UserDAO extends ApacheDsDataProvider
         if ( GlobalIds.IS_OPENLDAP )
         {
             // This default set of attributes contains all and is used for search operations.
-            DEFAULT_ATRS = new String[]
+            defaultAtrs = new String[]
                 {
                     GlobalIds.FT_IID,
                     SchemaConstants.UID_AT,
@@ -264,7 +264,7 @@ final class UserDAO extends ApacheDsDataProvider
                 */};
 
             // This smaller result set of attributes are needed for user validation and authentication
operations.
-            AUTHN_ATRS = new String[]
+            authnAtrs = new String[]
                 {
                     GlobalIds.FT_IID,
                     SchemaConstants.UID_AT,
@@ -281,7 +281,7 @@ final class UserDAO extends ApacheDsDataProvider
 
         else
         {
-            DEFAULT_ATRS = new String[]
+            defaultAtrs = new String[]
                 {
                     GlobalIds.FT_IID,
                     SchemaConstants.UID_AT,
@@ -313,7 +313,7 @@ final class UserDAO extends ApacheDsDataProvider
                     JPEGPHOTO, };
 
             // This smaller result set of attributes are needed for user validation and authentication
operations.
-            AUTHN_ATRS = new String[]
+            authnAtrs = new String[]
                 {
                     GlobalIds.FT_IID,
                     SchemaConstants.UID_AT,
@@ -330,7 +330,7 @@ final class UserDAO extends ApacheDsDataProvider
 
     // This default set of attributes contains all and is used for search operations.
     /*
-        private static final String[] DEFAULT_ATRS =
+        private static final String[] defaultAtrs =
             {
                 GlobalIds.FT_IID,
                 SchemaConstants.UID_AT, SchemaConstants.USER_PASSWORD_AT,
@@ -801,13 +801,13 @@ final class UserDAO extends ApacheDsDataProvider
         if ( isRoles )
         {
             // Retrieve the User's assigned RBAC and Admin Role attributes from directory.
-            uATTRS = DEFAULT_ATRS;
+            uATTRS = defaultAtrs;
 
         }
         else
         {
             // Do not retrieve the User's assigned RBAC and Admin Role attributes from directory.
-            uATTRS = AUTHN_ATRS;
+            uATTRS = authnAtrs;
         }
 
         Entry findEntry = null;
@@ -1159,8 +1159,7 @@ final class UserDAO extends ApacheDsDataProvider
             }
 
             ld = getAdminConnection();
-            SearchCursor searchResults = search( ld, userRoot, SearchScope.ONELEVEL, filterbuf.toString(),
-                DEFAULT_ATRS, false,
+            SearchCursor searchResults = search( ld, userRoot, SearchScope.ONELEVEL, filterbuf.toString(),
defaultAtrs, false,
                 GlobalIds.BATCH_SIZE );
             long sequence = 0;
 
@@ -1292,8 +1291,7 @@ final class UserDAO extends ApacheDsDataProvider
 
             filterbuf.append( ")" );
             ld = getAdminConnection();
-            SearchCursor searchResults = search( ld, userRoot, SearchScope.ONELEVEL, filterbuf.toString(),
-                DEFAULT_ATRS, false,
+            SearchCursor searchResults = search( ld, userRoot, SearchScope.ONELEVEL, filterbuf.toString(),
defaultAtrs, false,
                 GlobalIds.BATCH_SIZE );
             long sequence = 0;
 
@@ -1347,8 +1345,7 @@ final class UserDAO extends ApacheDsDataProvider
             filterbuf.append( "))" );
 
             ld = getAdminConnection();
-            SearchCursor searchResults = search( ld, userRoot, SearchScope.ONELEVEL, filterbuf.toString(),
-                DEFAULT_ATRS, false,
+            SearchCursor searchResults = search( ld, userRoot, SearchScope.ONELEVEL, filterbuf.toString(),
defaultAtrs, false,
                 GlobalIds.BATCH_SIZE );
             long sequence = 0;
 
@@ -1467,8 +1464,7 @@ final class UserDAO extends ApacheDsDataProvider
             filterbuf.append( "))" );
 
             ld = getAdminConnection();
-            SearchCursor searchResults = search( ld, userRoot, SearchScope.ONELEVEL, filterbuf.toString(),
-                DEFAULT_ATRS, false,
+            SearchCursor searchResults = search( ld, userRoot, SearchScope.ONELEVEL, filterbuf.toString(),
defaultAtrs, false,
                 GlobalIds.BATCH_SIZE );
             long sequence = 0;
 
@@ -1578,8 +1574,7 @@ final class UserDAO extends ApacheDsDataProvider
             filterbuf.append( "*))" );
 
             ld = getAdminConnection();
-            SearchCursor searchResults = search( ld, userRoot, SearchScope.ONELEVEL, filterbuf.toString(),
-                DEFAULT_ATRS, false,
+            SearchCursor searchResults = search( ld, userRoot, SearchScope.ONELEVEL, filterbuf.toString(),
defaultAtrs, false,
                 GlobalIds.BATCH_SIZE );
             long sequence = 0;
 
@@ -1641,8 +1636,7 @@ final class UserDAO extends ApacheDsDataProvider
             }
 
             ld = getAdminConnection();
-            SearchCursor searchResults = search( ld, userRoot, SearchScope.ONELEVEL, filterbuf.toString(),
-                DEFAULT_ATRS, false,
+            SearchCursor searchResults = search( ld, userRoot, SearchScope.ONELEVEL, filterbuf.toString(),
defaultAtrs, false,
                 GlobalIds.BATCH_SIZE, maxLimit );
             long sequence = 0;
 

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/7d3d46dd/src/main/java/org/apache/directory/fortress/core/util/cache/CacheMgr.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/util/cache/CacheMgr.java b/src/main/java/org/apache/directory/fortress/core/util/cache/CacheMgr.java
index 217f75e..5fbb809 100644
--- a/src/main/java/org/apache/directory/fortress/core/util/cache/CacheMgr.java
+++ b/src/main/java/org/apache/directory/fortress/core/util/cache/CacheMgr.java
@@ -35,12 +35,12 @@ import org.slf4j.LoggerFactory;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CacheMgr
+public final class CacheMgr
 {
     private static final Logger LOG = LoggerFactory.getLogger( CacheMgr.class.getName() );
     private static final String EHCACHE_CONFIG_FILE = "ehcache.config.file";
-    private final CacheManager m_ehCacheImpl;
-    private static CacheMgr m_ftCacheImpl;
+    private final CacheManager mEhCacheImpl;
+    private static CacheMgr mFtCacheImpl;
 
     static
     {
@@ -52,7 +52,7 @@ public class CacheMgr
             // 2. Requires location of ehcache's config file as parameter.
             // 3. The CacheManager reference then gets passed to constructor of self.
             // 4. Store the reference of self as a static member variable of this class.
-            m_ftCacheImpl = new CacheMgr( new CacheManager( ClassUtil.resourceAsStream( cacheConfig
) ) );
+            mFtCacheImpl = new CacheMgr( new CacheManager( ClassUtil.resourceAsStream( cacheConfig
) ) );
         }
         catch(CfgException ce)
         {
@@ -69,7 +69,7 @@ public class CacheMgr
      */
     private CacheMgr( CacheManager cacheMangerImpl )
     {
-        m_ehCacheImpl = cacheMangerImpl;
+        mEhCacheImpl = cacheMangerImpl;
     }
 
     /**
@@ -78,7 +78,7 @@ public class CacheMgr
      */
     public static CacheMgr getInstance()
     {
-        return m_ftCacheImpl;
+        return mFtCacheImpl;
     }
 
     /**
@@ -89,7 +89,7 @@ public class CacheMgr
      */
     public Cache getCache( String cacheName )
     {
-        return CacheFactory.createInstance( cacheName, m_ehCacheImpl );
+        return CacheFactory.createInstance( cacheName, mEhCacheImpl );
     }
 
     /**
@@ -98,6 +98,6 @@ public class CacheMgr
      */
     public void clearAll()
     {
-        m_ehCacheImpl.clearAll();
+        mEhCacheImpl.clearAll();
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/7d3d46dd/src/main/java/org/apache/directory/fortress/core/util/crypto/EncryptUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/util/crypto/EncryptUtil.java
b/src/main/java/org/apache/directory/fortress/core/util/crypto/EncryptUtil.java
index 8ee1484..617bc97 100755
--- a/src/main/java/org/apache/directory/fortress/core/util/crypto/EncryptUtil.java
+++ b/src/main/java/org/apache/directory/fortress/core/util/crypto/EncryptUtil.java
@@ -30,7 +30,7 @@ import org.jasypt.util.text.BasicTextEncryptor;
 public final class EncryptUtil
 {
     private static final BasicTextEncryptor textEncryptor;
-    private static String CRYPTO_PROP = "crypto.prop";
+    private static final String CRYPTO_PROP = "crypto.prop";
     static
     {
         textEncryptor = new BasicTextEncryptor();


Mime
View raw message