You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by sm...@apache.org on 2019/04/16 23:13:32 UTC
[directory-fortress-enmasse] 01/01: FC-267 - New Configuration
entity
This is an automated email from the ASF dual-hosted git repository.
smckinney pushed a commit to branch FC-267
in repository https://gitbox.apache.org/repos/asf/directory-fortress-enmasse.git
commit 962a686ad137ca25532eb98e8f66294b207a9ace
Author: Shawn McKinney <sm...@apache.org>
AuthorDate: Tue Apr 16 18:13:26 2019 -0500
FC-267 - New Configuration entity
---
.../directory/fortress/rest/ConfigMgrImpl.java | 32 ++++++++--------------
1 file changed, 12 insertions(+), 20 deletions(-)
diff --git a/src/main/java/org/apache/directory/fortress/rest/ConfigMgrImpl.java b/src/main/java/org/apache/directory/fortress/rest/ConfigMgrImpl.java
index 0e3850e..b3c6ec9 100644
--- a/src/main/java/org/apache/directory/fortress/rest/ConfigMgrImpl.java
+++ b/src/main/java/org/apache/directory/fortress/rest/ConfigMgrImpl.java
@@ -21,6 +21,7 @@ package org.apache.directory.fortress.rest;
import org.apache.directory.fortress.core.ConfigMgr;
import org.apache.directory.fortress.core.ConfigMgrFactory;
+import org.apache.directory.fortress.core.model.Configuration;
import org.apache.directory.fortress.core.model.Props;
import org.apache.directory.fortress.core.model.FortRequest;
import org.apache.directory.fortress.core.model.FortResponse;
@@ -47,17 +48,14 @@ class ConfigMgrImpl extends AbstractMgrImpl
/* No qualifier */ FortResponse addConfig(FortRequest request)
{
FortResponse response = createResponse();
-
try
{
ConfigMgr configMgr = ConfigMgrFactory.createInstance();
- Properties inProperties = RestUtils.getProperties( (Props)request.getEntity() );
- Properties outProperties = configMgr.add( request.getValue(), inProperties );
- Props retProps = RestUtils.getProps( outProperties );
-
- if ( retProps != null )
+ Configuration inCfg = (Configuration)request.getEntity();
+ Configuration outCfg = configMgr.add( inCfg );
+ if ( outCfg != null )
{
- response.setEntity( retProps );
+ response.setEntity( outCfg );
}
}
catch ( SecurityException se )
@@ -77,17 +75,14 @@ class ConfigMgrImpl extends AbstractMgrImpl
/* No qualifier */ FortResponse updateConfig(FortRequest request)
{
FortResponse response = createResponse();
-
try
{
ConfigMgr configMgr = ConfigMgrFactory.createInstance();
- Properties inProperties = RestUtils.getProperties( (Props)request.getEntity() );
- Properties outProperties = configMgr.update( request.getValue(), inProperties );
- Props retProps = RestUtils.getProps( outProperties );
-
- if ( retProps != null )
+ Configuration inCfg = (Configuration)request.getEntity();
+ Configuration outCfg = configMgr.update( inCfg );
+ if ( outCfg != null )
{
- response.setEntity( retProps );
+ response.setEntity( outCfg );
}
}
catch ( SecurityException se )
@@ -139,16 +134,13 @@ class ConfigMgrImpl extends AbstractMgrImpl
/* No qualifier */ FortResponse readConfig(FortRequest request)
{
FortResponse response = createResponse();
-
try
{
ConfigMgr configMgr = ConfigMgrFactory.createInstance();
- Properties properties = configMgr.read( request.getValue() );
- Props props = RestUtils.getProps( properties );
-
- if ( properties != null )
+ Configuration outCfg = configMgr.read( request.getValue() );
+ if ( outCfg != null )
{
- response.setEntity( props );
+ response.setEntity( outCfg );
}
}
catch ( SecurityException se )