directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cp...@apache.org
Subject [12/15] directory-fortress-core git commit: changed vars in config to private and added getters
Date Thu, 05 May 2016 13:49:29 GMT
changed vars in config to private and added getters


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

Branch: refs/heads/master
Commit: b09d80594ed3cff92fdce00151ba287e9b341f37
Parents: e9c143f
Author: clp207 <clp207@psu.edu>
Authored: Tue May 3 14:40:05 2016 -0400
Committer: clp207 <clp207@psu.edu>
Committed: Tue May 3 14:40:05 2016 -0400

----------------------------------------------------------------------
 .../fortress/core/AccessMgrFactory.java         |  2 +-
 .../fortress/core/AdminMgrFactory.java          |  2 +-
 .../fortress/core/AuditMgrFactory.java          |  2 +-
 .../fortress/core/DelAccessMgrFactory.java      |  2 +-
 .../fortress/core/DelAdminMgrFactory.java       |  2 +-
 .../fortress/core/DelReviewMgrFactory.java      |  2 +-
 .../fortress/core/PwPolicyMgrFactory.java       |  2 +-
 .../fortress/core/ReviewMgrFactory.java         |  2 +-
 .../directory/fortress/core/impl/PermDAO.java   |  2 +-
 .../directory/fortress/core/impl/UserDAO.java   | 20 +++++-----
 .../fortress/core/ldap/LdapDataProvider.java    |  4 +-
 .../fortress/core/model/ConstraintUtil.java     |  8 ++--
 .../directory/fortress/core/model/PropUtil.java |  2 +-
 .../fortress/core/model/UserAdminRole.java      |  4 +-
 .../directory/fortress/core/model/UserRole.java |  4 +-
 .../directory/fortress/core/util/Config.java    | 40 +++++++++++++++-----
 .../fortress/core/impl/FortressJUnitTest.java   | 16 ++++----
 17 files changed, 69 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b09d8059/src/main/java/org/apache/directory/fortress/core/AccessMgrFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/AccessMgrFactory.java b/src/main/java/org/apache/directory/fortress/core/AccessMgrFactory.java
index 3d4a98a..8a06376 100755
--- a/src/main/java/org/apache/directory/fortress/core/AccessMgrFactory.java
+++ b/src/main/java/org/apache/directory/fortress/core/AccessMgrFactory.java
@@ -68,7 +68,7 @@ public final class AccessMgrFactory
         AccessMgr accessMgr;
         if ( StringUtils.isEmpty( accessClassName ) )
         {
-            if(Config.getInstance().IS_REST)
+            if(Config.getInstance().isRestEnabled())
             {
                 accessMgr = new AccessMgrRestImpl();
             }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b09d8059/src/main/java/org/apache/directory/fortress/core/AdminMgrFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/AdminMgrFactory.java b/src/main/java/org/apache/directory/fortress/core/AdminMgrFactory.java
index b17dae7..f07fe22 100755
--- a/src/main/java/org/apache/directory/fortress/core/AdminMgrFactory.java
+++ b/src/main/java/org/apache/directory/fortress/core/AdminMgrFactory.java
@@ -71,7 +71,7 @@ public final class AdminMgrFactory
 
         if ( StringUtils.isEmpty( adminClassName ) )
         {
-            if(Config.getInstance().IS_REST)
+            if(Config.getInstance().isRestEnabled())
             {
                 adminMgr = new AdminMgrRestImpl();
             }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b09d8059/src/main/java/org/apache/directory/fortress/core/AuditMgrFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/AuditMgrFactory.java b/src/main/java/org/apache/directory/fortress/core/AuditMgrFactory.java
index 57864a8..c578598 100755
--- a/src/main/java/org/apache/directory/fortress/core/AuditMgrFactory.java
+++ b/src/main/java/org/apache/directory/fortress/core/AuditMgrFactory.java
@@ -70,7 +70,7 @@ public final class AuditMgrFactory
 
         if ( StringUtils.isEmpty( auditClassName ) )
         {
-            if(Config.getInstance().IS_REST)
+            if(Config.getInstance().isRestEnabled())
             {
                 auditMgr = new AuditMgrRestImpl();
             }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b09d8059/src/main/java/org/apache/directory/fortress/core/DelAccessMgrFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/DelAccessMgrFactory.java b/src/main/java/org/apache/directory/fortress/core/DelAccessMgrFactory.java
index 98e546c..6eeb227 100755
--- a/src/main/java/org/apache/directory/fortress/core/DelAccessMgrFactory.java
+++ b/src/main/java/org/apache/directory/fortress/core/DelAccessMgrFactory.java
@@ -70,7 +70,7 @@ public final class DelAccessMgrFactory
 
         if ( StringUtils.isEmpty( accessClassName ) )
         {
-            if(Config.getInstance().IS_REST)
+            if(Config.getInstance().isRestEnabled())
             {
                 accessMgr = new DelAccessMgrRestImpl();
             }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b09d8059/src/main/java/org/apache/directory/fortress/core/DelAdminMgrFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/DelAdminMgrFactory.java b/src/main/java/org/apache/directory/fortress/core/DelAdminMgrFactory.java
index b5b0d2e..9720fe3 100755
--- a/src/main/java/org/apache/directory/fortress/core/DelAdminMgrFactory.java
+++ b/src/main/java/org/apache/directory/fortress/core/DelAdminMgrFactory.java
@@ -71,7 +71,7 @@ public final class DelAdminMgrFactory
 
         if ( Strings.isEmpty( dAdminClassName ) )
         {
-            if ( Config.getInstance().IS_REST )
+            if ( Config.getInstance().isRestEnabled() )
             {
                 delAdminMgr = new DelAdminMgrRestImpl();
             }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b09d8059/src/main/java/org/apache/directory/fortress/core/DelReviewMgrFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/DelReviewMgrFactory.java b/src/main/java/org/apache/directory/fortress/core/DelReviewMgrFactory.java
index 7e35055..d958ce6 100755
--- a/src/main/java/org/apache/directory/fortress/core/DelReviewMgrFactory.java
+++ b/src/main/java/org/apache/directory/fortress/core/DelReviewMgrFactory.java
@@ -68,7 +68,7 @@ public final class DelReviewMgrFactory
 
         if ( StringUtils.isEmpty( dReviewClassName ) )
         {
-            if(Config.getInstance().IS_REST)
+            if(Config.getInstance().isRestEnabled())
             {
                 delReviewMgr = new DelReviewMgrRestImpl();
             }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b09d8059/src/main/java/org/apache/directory/fortress/core/PwPolicyMgrFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/PwPolicyMgrFactory.java b/src/main/java/org/apache/directory/fortress/core/PwPolicyMgrFactory.java
index f32d1b7..7cbef5e 100755
--- a/src/main/java/org/apache/directory/fortress/core/PwPolicyMgrFactory.java
+++ b/src/main/java/org/apache/directory/fortress/core/PwPolicyMgrFactory.java
@@ -69,7 +69,7 @@ public final class PwPolicyMgrFactory
 
         if ( StringUtils.isEmpty( policyClassName ) )
         {
-            if(Config.getInstance().IS_REST)
+            if(Config.getInstance().isRestEnabled())
             {
                 policyMgr = new PwPolicyMgrRestImpl();
             }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b09d8059/src/main/java/org/apache/directory/fortress/core/ReviewMgrFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ReviewMgrFactory.java b/src/main/java/org/apache/directory/fortress/core/ReviewMgrFactory.java
index 720b504..a0e6018 100755
--- a/src/main/java/org/apache/directory/fortress/core/ReviewMgrFactory.java
+++ b/src/main/java/org/apache/directory/fortress/core/ReviewMgrFactory.java
@@ -69,7 +69,7 @@ public final class ReviewMgrFactory
 
         if ( StringUtils.isEmpty( reviewClassName ) )
         {
-            if(Config.getInstance().IS_REST)
+            if(Config.getInstance().isRestEnabled())
             {
                 reviewMgr = new ReviewMgrRestImpl();
             }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b09d8059/src/main/java/org/apache/directory/fortress/core/impl/PermDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/PermDAO.java b/src/main/java/org/apache/directory/fortress/core/impl/PermDAO.java
index 326d18c..8b3e594 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/PermDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/PermDAO.java
@@ -921,7 +921,7 @@ final class PermDAO extends LdapDataProvider
         throws FinderException
     {
         // Audit can be turned off here with fortress config param: 'disable.audit=true'
-        if ( Config.getInstance().IS_OPENLDAP && ! Config.getInstance().IS_AUDIT_DISABLED
)
+        if ( Config.getInstance().isOpenldap() && ! Config.getInstance().isAuditDisabled()
)
         {
             try
             {

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b09d8059/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java b/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
index 21f2e39..8cef25f 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
@@ -228,12 +228,14 @@ final class UserDAO extends LdapDataProvider
             //            POSIX_ACCOUNT_OBJECT_CLASS_NAME
         };
     	
-        LOG.debug( "GlobalIds.IS_OPENLDAP: " + Config.getInstance().IS_OPENLDAP );
-        LOG.debug( "GlobalIds.IS_OPENLDAP ? OPENLDAP_PW_RESET : null: " + ( Config.getInstance().IS_OPENLDAP
? OPENLDAP_PW_RESET
+        boolean isOpenldap = Config.getInstance().isOpenldap();
+        
+        LOG.debug( "GlobalIds.IS_OPENLDAP: " + isOpenldap );
+        LOG.debug( "GlobalIds.IS_OPENLDAP ? OPENLDAP_PW_RESET : null: " + ( isOpenldap ?
OPENLDAP_PW_RESET
             : null ) );
-        LOG.debug( "GlobalIds.IS_OPENLDAP: " + Config.getInstance().IS_OPENLDAP );
+        LOG.debug( "GlobalIds.IS_OPENLDAP: " + isOpenldap );
 
-        if ( Config.getInstance().IS_OPENLDAP )
+        if ( isOpenldap )
         {
             // This default set of attributes contains all and is used for search operations.
             defaultAtrs = new String[]
@@ -497,7 +499,7 @@ final class UserDAO extends LdapDataProvider
                 myEntry.add( SYSTEM_USER, entity.isSystem().toString().toUpperCase() );
             }
 
-            if ( Config.getInstance().IS_OPENLDAP && StringUtils.isNotEmpty( entity.getPwPolicy()
) )
+            if ( Config.getInstance().isOpenldap() && StringUtils.isNotEmpty( entity.getPwPolicy()
) )
             {
                 String pwdPolicyDn = GlobalIds.POLICY_NODE_TYPE + "=" + entity.getPwPolicy()
+ "," + getRootDn(
                     entity.getContextId(), GlobalIds.PPOLICY_ROOT );
@@ -602,7 +604,7 @@ final class UserDAO extends LdapDataProvider
                     entity.getTitle() ) );
             }
 
-            if ( Config.getInstance().IS_OPENLDAP && StringUtils.isNotEmpty( entity.getPwPolicy()
) )
+            if ( Config.getInstance().isOpenldap() && StringUtils.isNotEmpty( entity.getPwPolicy()
) )
             {
                 String szDn = GlobalIds.POLICY_NODE_TYPE + "=" + entity.getPwPolicy() + ","
+ getRootDn( entity
                     .getContextId(), GlobalIds.PPOLICY_ROOT );
@@ -1056,7 +1058,7 @@ final class UserDAO extends LdapDataProvider
                             case CHANGE_AFTER_RESET:
                                 // Don't throw exception if authenticating in J2EE Realm
- The Web application must
                                 // give user a chance to modify their password.
-                                if ( !Config.getInstance().IS_REALM )
+                                if ( !Config.getInstance().isRealm() )
                                 {
                                     errMsg = msgHdr + "PASSWORD HAS BEEN RESET BY LDAP_ADMIN_POOL_UID";
                                     rc = GlobalErrIds.USER_PW_RESET;
@@ -1712,7 +1714,7 @@ final class UserDAO extends LdapDataProvider
             modify( ld, userDn, mods );
 
             // This modify update audit attributes on the User entry (if enabled):
-            if ( Config.getInstance().IS_OPENLDAP && ! Config.getInstance().IS_AUDIT_DISABLED
)
+            if ( Config.getInstance().isOpenldap() && ! Config.getInstance().isAuditDisabled()
)
             {
                 mods = new ArrayList<>();
                 modify( ld, userDn, mods, entity );
@@ -2088,7 +2090,7 @@ final class UserDAO extends LdapDataProvider
 
         entity.addProperties( PropUtil.getProperties( getAttributes( entry, GlobalIds.PROPS
) ) );
 
-        if ( Config.getInstance().IS_OPENLDAP )
+        if ( Config.getInstance().isOpenldap() )
         {
             szBoolean = getAttribute( entry, OPENLDAP_PW_RESET );
             if ( szBoolean != null && szBoolean.equalsIgnoreCase( "true" ) )

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b09d8059/src/main/java/org/apache/directory/fortress/core/ldap/LdapDataProvider.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ldap/LdapDataProvider.java b/src/main/java/org/apache/directory/fortress/core/ldap/LdapDataProvider.java
index 908b9fb..c2b955e 100644
--- a/src/main/java/org/apache/directory/fortress/core/ldap/LdapDataProvider.java
+++ b/src/main/java/org/apache/directory/fortress/core/ldap/LdapDataProvider.java
@@ -240,7 +240,7 @@ public abstract class LdapDataProvider
     {
         COUNTERS.incrementAdd();
 
-        if ( !Config.getInstance().IS_AUDIT_DISABLED && ( entity != null ) &&
( entity.getAdminSession() != null ) )
+        if ( !Config.getInstance().isAuditDisabled() && ( entity != null ) &&
( entity.getAdminSession() != null ) )
         {
             if ( StringUtils.isNotEmpty( entity.getAdminSession().getInternalUserId() ) )
             {
@@ -501,7 +501,7 @@ public abstract class LdapDataProvider
      */
     private void audit( List<Modification> mods, FortEntity entity )
     {
-        if ( !Config.getInstance().IS_AUDIT_DISABLED && ( entity != null ) &&
( entity.getAdminSession() != null ) )
+        if ( !Config.getInstance().isAuditDisabled() && ( entity != null ) &&
( entity.getAdminSession() != null ) )
         {
             if ( StringUtils.isNotEmpty( entity.getAdminSession().getInternalUserId() ) )
             {

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b09d8059/src/main/java/org/apache/directory/fortress/core/model/ConstraintUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/model/ConstraintUtil.java b/src/main/java/org/apache/directory/fortress/core/model/ConstraintUtil.java
index a1eb7db..35327b7 100644
--- a/src/main/java/org/apache/directory/fortress/core/model/ConstraintUtil.java
+++ b/src/main/java/org/apache/directory/fortress/core/model/ConstraintUtil.java
@@ -134,7 +134,7 @@ public class ConstraintUtil
     {
         if ( StringUtils.isNotEmpty( inputString ) )
         {
-            StringTokenizer tkn = new StringTokenizer( inputString, Config.getInstance().DELIMITER,
true );
+            StringTokenizer tkn = new StringTokenizer( inputString, Config.getInstance().getDelimiter(),
true );
             if ( tkn.countTokens() > 0 )
             {
                 int count = tkn.countTokens();
@@ -143,11 +143,11 @@ public class ConstraintUtil
                 for ( int i = 0; i < count; i++ )
                 {
                     String szValue = tkn.nextToken();
-                    if ( szValue.equals( Config.getInstance().DELIMITER ) && !previousTokenWasDelimiter
)
+                    if ( szValue.equals( Config.getInstance().getDelimiter() ) &&
!previousTokenWasDelimiter )
                     {
                         previousTokenWasDelimiter = true;
                     }
-                    else if ( szValue.equals( Config.getInstance().DELIMITER ) )
+                    else if ( szValue.equals( Config.getInstance().getDelimiter() ) )
                     {
                         previousTokenWasDelimiter = true;
                         index++;
@@ -206,7 +206,7 @@ public class ConstraintUtil
     public static String setConstraint( Constraint constraint )
     {
         String szConstraint = null;
-        String delimiter = Config.getInstance().DELIMITER;
+        String delimiter = Config.getInstance().getDelimiter();
         if ( constraint != null )
         {
             StringBuilder sb = new StringBuilder();

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b09d8059/src/main/java/org/apache/directory/fortress/core/model/PropUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/model/PropUtil.java b/src/main/java/org/apache/directory/fortress/core/model/PropUtil.java
index 3fb2b87..914f989 100644
--- a/src/main/java/org/apache/directory/fortress/core/model/PropUtil.java
+++ b/src/main/java/org/apache/directory/fortress/core/model/PropUtil.java
@@ -92,7 +92,7 @@ public final class PropUtil
      */
     public static Properties getProperties( String inputString, char separator )
     {
-        return getProperties( inputString, separator, Config.getInstance().DELIMITER );
+        return getProperties( inputString, separator, Config.getInstance().getDelimiter()
);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b09d8059/src/main/java/org/apache/directory/fortress/core/model/UserAdminRole.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/model/UserAdminRole.java b/src/main/java/org/apache/directory/fortress/core/model/UserAdminRole.java
index e064a12..84e7d8d 100755
--- a/src/main/java/org/apache/directory/fortress/core/model/UserAdminRole.java
+++ b/src/main/java/org/apache/directory/fortress/core/model/UserAdminRole.java
@@ -163,7 +163,7 @@ public class UserAdminRole extends UserRole implements Administrator
     {
         if ( ( szRawData != null ) && ( szRawData.length() > 0 ) )
         {
-            String[] tokens = StringUtils.splitPreserveAllTokens( szRawData, Config.getInstance().DELIMITER
);
+            String[] tokens = StringUtils.splitPreserveAllTokens( szRawData, Config.getInstance().getDelimiter()
);
             for ( int i = 0; i < tokens.length; i++ )
             {
                 if ( StringUtils.isNotEmpty( tokens[i] ) )
@@ -247,7 +247,7 @@ public class UserAdminRole extends UserRole implements Administrator
     public String getRawData()
     {
         String szRole;
-        String delimeter = Config.getInstance().DELIMITER;
+        String delimeter = Config.getInstance().getDelimiter();
         StringBuilder sb = new StringBuilder();
         sb.append( name );
         sb.append( delimeter );

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b09d8059/src/main/java/org/apache/directory/fortress/core/model/UserRole.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/model/UserRole.java b/src/main/java/org/apache/directory/fortress/core/model/UserRole.java
index e769699..27c0d70 100755
--- a/src/main/java/org/apache/directory/fortress/core/model/UserRole.java
+++ b/src/main/java/org/apache/directory/fortress/core/model/UserRole.java
@@ -152,7 +152,7 @@ public class UserRole extends FortEntity implements Serializable, Constraint
     {
         if ( ( szRawData != null ) && ( szRawData.length() > 0 ) )
         {
-            String[] tokens = StringUtils.splitPreserveAllTokens( szRawData, Config.getInstance().DELIMITER
);
+            String[] tokens = StringUtils.splitPreserveAllTokens( szRawData, Config.getInstance().getDelimiter()
);
             for ( int i = 0; i < tokens.length; i++ )
             {
                 if ( StringUtils.isNotEmpty( tokens[i] ) )
@@ -211,7 +211,7 @@ public class UserRole extends FortEntity implements Serializable, Constraint
     @Override
     public String getRawData()
     {
-    	String delimeter = Config.getInstance().DELIMITER;
+    	String delimeter = Config.getInstance().getDelimiter();
         StringBuilder sb = new StringBuilder();
 
         sb.append( name );

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b09d8059/src/main/java/org/apache/directory/fortress/core/util/Config.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/util/Config.java b/src/main/java/org/apache/directory/fortress/core/util/Config.java
index 355fce9..446531a 100755
--- a/src/main/java/org/apache/directory/fortress/core/util/Config.java
+++ b/src/main/java/org/apache/directory/fortress/core/util/Config.java
@@ -75,20 +75,20 @@ public final class Config
     
     private boolean remoteConfigLoaded = false;
     
-    public boolean IS_REST;
-    public boolean IS_AUDIT_DISABLED;
-    public boolean IS_OPENLDAP;
+    private boolean restEnabled;
+    private boolean auditDisabled;
+    private boolean openldap;
     /**
      * This constant is used during authentication to determine if runtime is security realm.
 If IS_REALM == true,
      * the authentication module will not throw SecurityException on password resets.  This
is to enable the authentication
      * event to succeed allowing the application to prompt user to change their password.
      */
-    public boolean IS_REALM;
+    private boolean realm;
     /**
      * Fortress stores complex attribute types within a single attribute in ldap.  Usually
a delimiter of '$' is used for string tokenization.
      * format: {@code part1$part2$part3....}  Stored in fortress.properties as 'attr.delimiter=$'
      */
-    public String DELIMITER;    
+    private String delimiter;    
     
     
     private static volatile Config INSTANCE = null;    
@@ -304,15 +304,15 @@ public final class Config
                     //ignore
                 }
 
-            	IS_AUDIT_DISABLED = ( ( getProperty( GlobalIds.DISABLE_AUDIT ) != null ) &&
( getProperty( GlobalIds.DISABLE_AUDIT ).equalsIgnoreCase( "true" ) ) );
+            	auditDisabled = ( ( getProperty( GlobalIds.DISABLE_AUDIT ) != null ) &&
( getProperty( GlobalIds.DISABLE_AUDIT ).equalsIgnoreCase( "true" ) ) );
             	
-            	IS_REST = ( ( getProperty( GlobalIds.ENABLE_REST ) != null ) && ( getProperty(
GlobalIds.ENABLE_REST ).equalsIgnoreCase( "true" ) ) );
+            	restEnabled = ( ( getProperty( GlobalIds.ENABLE_REST ) != null ) &&
( getProperty( GlobalIds.ENABLE_REST ).equalsIgnoreCase( "true" ) ) );
             	
-            	IS_REALM = GlobalIds.REALM_TYPE.equalsIgnoreCase( getProperty( GlobalIds.AUTHENTICATION_TYPE
) );
+            	realm = GlobalIds.REALM_TYPE.equalsIgnoreCase( getProperty( GlobalIds.AUTHENTICATION_TYPE
) );
             	
-            	IS_OPENLDAP = ( ( getProperty( GlobalIds.SERVER_TYPE ) != null ) &&
( getProperty( GlobalIds.SERVER_TYPE ).equalsIgnoreCase( "openldap" ) ) );    	    	
+            	openldap = ( ( getProperty( GlobalIds.SERVER_TYPE ) != null ) && ( getProperty(
GlobalIds.SERVER_TYPE ).equalsIgnoreCase( "openldap" ) ) );    	    	
             	
-            	DELIMITER = getProperty( "attr.delimiter", "$" );
+            	delimiter = getProperty( "attr.delimiter", "$" );
                 
                 remoteConfigLoaded = true;
             }
@@ -624,4 +624,24 @@ public final class Config
 	public boolean isRemoteConfigLoaded() {
 		return remoteConfigLoaded;
 	}
+
+	public boolean isRestEnabled() {
+		return restEnabled;
+	}
+
+	public boolean isAuditDisabled() {
+		return auditDisabled;
+	}
+
+	public boolean isOpenldap() {
+		return openldap;
+	}
+
+	public boolean isRealm() {
+		return realm;
+	}
+
+	public String getDelimiter() {
+		return delimiter;
+	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b09d8059/src/test/java/org/apache/directory/fortress/core/impl/FortressJUnitTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/impl/FortressJUnitTest.java
b/src/test/java/org/apache/directory/fortress/core/impl/FortressJUnitTest.java
index 5429386..c590b68 100755
--- a/src/test/java/org/apache/directory/fortress/core/impl/FortressJUnitTest.java
+++ b/src/test/java/org/apache/directory/fortress/core/impl/FortressJUnitTest.java
@@ -105,7 +105,7 @@ public class FortressJUnitTest extends TestCase
         if ( !isFirstRun() )
         {
             // PwPolicyMgr PW Policy Teardown:
-            if ( Config.getInstance().IS_OPENLDAP )
+            if ( Config.getInstance().isOpenldap() )
             {
                 suite.addTest( new PswdPolicyMgrImplTest( "testDeletePasswordPolicy" ) );
             }
@@ -126,7 +126,7 @@ public class FortressJUnitTest extends TestCase
             suite.addTest( new AdminMgrImplTest( "testDelRoleDescendant" ) );
             suite.addTest( new AdminMgrImplTest( "testDelRoleAscendant" ) );
             suite.addTest( new AdminMgrImplTest( "testDeleteRole" ) );
-            if ( Config.getInstance().IS_OPENLDAP )
+            if ( Config.getInstance().isOpenldap() )
             {
                 suite.addTest( new PswdPolicyMgrImplTest( "testDelete" ) );
             }
@@ -151,7 +151,7 @@ public class FortressJUnitTest extends TestCase
         /* 2. Build Up                                             */
         /***********************************************************/
         // PW PolicyMgr APIs:
-        if ( Config.getInstance().IS_OPENLDAP )
+        if ( Config.getInstance().isOpenldap() )
         {
             suite.addTest( new PswdPolicyMgrImplTest( "testAdd" ) );
             suite.addTest( new PswdPolicyMgrImplTest( "testUpdate" ) );
@@ -188,7 +188,7 @@ public class FortressJUnitTest extends TestCase
         suite.addTest( new AdminMgrImplTest( "testUpdateRole" ) );
         suite.addTest( new AdminMgrImplTest( "testAddUser" ) );
         suite.addTest( new AdminMgrImplTest( "testUpdateUser" ) );
-        if ( Config.getInstance().IS_OPENLDAP )
+        if ( Config.getInstance().isOpenldap() )
         {
             suite.addTest( new PswdPolicyMgrImplTest( "testUpdatePasswordPolicy" ) );
         }
@@ -210,7 +210,7 @@ public class FortressJUnitTest extends TestCase
         suite.addTest( new DelegatedMgrImplTest( "testSearchAdminRole" ) );
 
         // ReviewMgr RBAC:
-        if ( Config.getInstance().IS_OPENLDAP )
+        if ( Config.getInstance().isOpenldap() )
         {
             suite.addTest( new PswdPolicyMgrImplTest( "testRead" ) );
             suite.addTest( new PswdPolicyMgrImplTest( "testSearch" ) );
@@ -253,7 +253,7 @@ public class FortressJUnitTest extends TestCase
         // AccessMgr RBAC:
         suite.addTest( new AccessMgrImplTest( "testGetUserId" ) );
         suite.addTest( new AccessMgrImplTest( "testGetUser" ) );
-        if ( Config.getInstance().IS_OPENLDAP )
+        if ( Config.getInstance().isOpenldap() )
         {
             // These tests are reliant on OpenLDAP's pwpolicy overlay:
             suite.addTest( new AdminMgrImplTest( "testResetPassword" ) );
@@ -279,7 +279,7 @@ public class FortressJUnitTest extends TestCase
         suite.addTest( new AccessMgrImplTest( "testCreateSessionWithRolesTrusted" ) );
 
         // PwPolicyMgr PW Policy checks:
-        if ( Config.getInstance().IS_OPENLDAP )
+        if ( Config.getInstance().isOpenldap() )
         {
             // These tests are reliant on OpenLDAP's pwpolicy overlay:
             suite.addTest( new PswdPolicyMgrImplTest( "testMinAge" ) );
@@ -301,7 +301,7 @@ public class FortressJUnitTest extends TestCase
         /* 5. Audit Checks                                         */
         /***********************************************************/
         //suite.addTest(new AuditMgrImplTest("testSearchAuthNInvalid"));
-        if ( Config.getInstance().IS_OPENLDAP )
+        if ( Config.getInstance().isOpenldap() )
         {
             // These tests reliant on OpenLDAP's slapo access log overlay:
             suite.addTest( new AuditMgrImplTest( "testSearchBinds" ) );


Mime
View raw message