You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by cp...@apache.org on 2016/05/05 13:49:30 UTC

[13/15] directory-fortress-core git commit: moved isRest into initial load and fixed URL loading in rest utils

moved isRest into initial load and fixed URL loading in rest utils


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

Branch: refs/heads/master
Commit: 8fde6e7417e94c6bbe4f9e748bcf7196a67f82a9
Parents: b09d805
Author: clp207 <cl...@psu.edu>
Authored: Wed May 4 15:12:28 2016 -0400
Committer: clp207 <cl...@psu.edu>
Committed: Wed May 4 15:12:28 2016 -0400

----------------------------------------------------------------------
 .../apache/directory/fortress/core/rest/RestUtils.java    | 10 ++++++----
 .../org/apache/directory/fortress/core/util/Config.java   |  8 ++++----
 2 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/8fde6e74/src/main/java/org/apache/directory/fortress/core/rest/RestUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rest/RestUtils.java b/src/main/java/org/apache/directory/fortress/core/rest/RestUtils.java
index 0325b35..a5dacfa 100644
--- a/src/main/java/org/apache/directory/fortress/core/rest/RestUtils.java
+++ b/src/main/java/org/apache/directory/fortress/core/rest/RestUtils.java
@@ -77,9 +77,9 @@ public class RestUtils
     private String HTTP_HOST;
     private String HTTP_PORT;
     private String HTTP_PROTOCOL;
-    private static final String VERSION = System.getProperty( "version" );
-    private static final String SERVICE = "fortress-rest-" + VERSION;
-    private String URI = HTTP_PROTOCOL + "://" + HTTP_HOST + ":" + HTTP_PORT + "/" + SERVICE + "/";
+    private String VERSION;
+    private String SERVICE;
+    private String URI;
     private static final int HTTP_OK = 200;
     private static final int HTTP_401_UNAUTHORIZED = 401;
     private static final int HTTP_403_FORBIDDEN = 403;
@@ -121,7 +121,9 @@ public class RestUtils
         IS_SET_TRUST_STORE_PROP = (
             Config.getInstance().getProperty( SET_TRUST_STORE_PROP ) != null &&
             Config.getInstance().getProperty( SET_TRUST_STORE_PROP ).equalsIgnoreCase( "true" ) );
-
+        VERSION = System.getProperty( "version" );
+        SERVICE = "fortress-rest-" + VERSION;
+        URI = HTTP_PROTOCOL + "://" + HTTP_HOST + ":" + HTTP_PORT + "/" + SERVICE + "/";
         
         if ( IS_SET_TRUST_STORE_PROP )
         {

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/8fde6e74/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 446531a..79c316b 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
@@ -131,6 +131,8 @@ public final class Config
                 config.load( fUserUrl );
             }
 
+            restEnabled = ( ( getProperty( GlobalIds.ENABLE_REST ) != null ) && ( getProperty( GlobalIds.ENABLE_REST ).equalsIgnoreCase( "true" ) ) );
+            
             // Check to see if any of the ldap connection parameters have been overridden:
             getExternalConfig();
         }
@@ -306,8 +308,6 @@ public final class Config
 
             	auditDisabled = ( ( getProperty( GlobalIds.DISABLE_AUDIT ) != null ) && ( getProperty( GlobalIds.DISABLE_AUDIT ).equalsIgnoreCase( "true" ) ) );
             	
-            	restEnabled = ( ( getProperty( GlobalIds.ENABLE_REST ) != null ) && ( getProperty( GlobalIds.ENABLE_REST ).equalsIgnoreCase( "true" ) ) );
-            	
             	realm = GlobalIds.REALM_TYPE.equalsIgnoreCase( getProperty( GlobalIds.AUTHENTICATION_TYPE ) );
             	
             	openldap = ( ( getProperty( GlobalIds.SERVER_TYPE ) != null ) && ( getProperty( GlobalIds.SERVER_TYPE ).equalsIgnoreCase( "openldap" ) ) );    	    	
@@ -601,9 +601,9 @@ public final class Config
         try
         {
         	String configClassName = this.getProperty( GlobalIds.CONFIG_IMPLEMENTATION );
-        	boolean IS_REST = ((this.getProperty(ConfigMgrFactory.ENABLE_REST) != null) && (this.getProperty(ConfigMgrFactory.ENABLE_REST).equalsIgnoreCase("true")));        	
+        	//boolean IS_REST = ((this.getProperty(ConfigMgrFactory.ENABLE_REST) != null) && (this.getProperty(ConfigMgrFactory.ENABLE_REST).equalsIgnoreCase("true")));        	
         	
-            ConfigMgr cfgMgr = ConfigMgrFactory.createInstance(configClassName, IS_REST);                       
+            ConfigMgr cfgMgr = ConfigMgrFactory.createInstance(configClassName, false);                       
             props = cfgMgr.read( realmName );
         }
         catch ( CfgException ce )