directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject [2/3] directory-fortress-core git commit: FC-109 - move Config to util, move ObjectFactort to model
Date Tue, 02 Jun 2015 14:41:05 GMT
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/model/ObjectFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/model/ObjectFactory.java b/src/main/java/org/apache/directory/fortress/core/model/ObjectFactory.java
new file mode 100755
index 0000000..05fba58
--- /dev/null
+++ b/src/main/java/org/apache/directory/fortress/core/model/ObjectFactory.java
@@ -0,0 +1,595 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.fortress.core.model;
+
+
+import org.apache.directory.fortress.core.ldap.group.Group;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ *
+ * This class contains factory methods for each Java content interface and Java element interface
+ * generated in the org.apache.directory.fortress packages.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups.  Factory methods for each of these are
+ * provided in this class.
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ *
+ */
+@XmlRegistry
+public class ObjectFactory
+{
+    private static final QName FORTUSER_QNAME = new QName( "", "fortUser" );
+    private static final QName FORTSESSION_QNAME = new QName( "", "fortSession" );
+    private static final QName FORTROLE_QNAME = new QName( "", "fortRole" );
+    private static final QName FORTGRANT_QNAME = new QName( "", "fortGrant" );
+    private static final QName FORTORGUNIT_QNAME = new QName( "", "fortOrgUnit" );
+    private static final QName FORTENTITY_QNAME = new QName( "", "fortEntity" );
+    private static final QName FORTADMINROLE_QNAME = new QName( "", "fortAdminRole" );
+    private static final QName FORTUSERROLE_QNAME = new QName( "", "fortUserRole" );
+    private static final QName FORTOBJECT_QNAME = new QName( "", "fortObject" );
+    private static final QName FORTPERMISSION_QNAME = new QName( "", "fortPermission" );
+    private static final QName FORTROLERELATIONSHIP_QNAME = new QName( "", "fortRoleRelationship" );
+    private static final QName FORTSET_QNAME = new QName( "", "fortSet" );
+    private static final QName FORTPOLICY_QNAME = new QName( "", "fortPolicy" );
+    private static final QName FORTUSERADMINROLE_QNAME = new QName( "", "fortUserAdminRole" );
+    private static final QName FORTADMINROLERELATIONSHIP_QNAME = new QName( "", "fortAdminRoleRelationship" );
+    private static final QName FORTORGUNITRELATIONSHIP_QNAME = new QName( "", "fortOrgUnitRelationship" );
+    private static final QName FORTBIND_QNAME = new QName( "", "fortBind" );
+    private static final QName FORTUSERAUDIT_QNAME = new QName( "", "fortUserAudit" );
+    private static final QName FORTAUTHZ_QNAME = new QName( "", "fortAuthZ" );
+    private static final QName FORTMOD_QNAME = new QName( "", "fortMod" );
+    private static final QName FORTROLEPERM_QNAME = new QName( "", "fortRolePerm" );
+    private static final QName FORTRESPONSE_QNAME = new QName( "", "fortResponse" );
+    private static final QName FORTREQUEST_QNAME = new QName( "", "fortRequest" );
+    private static final QName FORTADDRESS_QNAME = new QName( "", "fortAddress" );
+    private static final QName FORTPROPS_QNAME = new QName( "", "fortProps" );
+    private static final QName FORTWARNING_QNAME = new QName( "", "fortWarning" );
+    private static final QName FORTGROUP_QNAME = new QName( "", "fortGroup" );
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.FortEntity }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortEntity")
+    public JAXBElement<FortEntity> createFortEntity( FortEntity value )
+    {
+        return new JAXBElement<>( FORTENTITY_QNAME, FortEntity.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link FortResponse }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortResponse")
+    public JAXBElement<FortResponse> createFortResponse( FortResponse value )
+    {
+        return new JAXBElement<>( FORTRESPONSE_QNAME, FortResponse.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link FortRequest }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortRequest")
+    public JAXBElement<FortRequest> createFortRequest( FortRequest value )
+    {
+        return new JAXBElement<>( FORTREQUEST_QNAME, FortRequest.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.SDSet }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortSet")
+    public JAXBElement<SDSet> createFortSet( SDSet value )
+    {
+        return new JAXBElement<>( FORTSET_QNAME, SDSet.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.PwPolicy }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortPolicy")
+    public JAXBElement<PwPolicy> createFortPolicy( PwPolicy value )
+    {
+        return new JAXBElement<>( FORTPOLICY_QNAME, PwPolicy.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.Session }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortSession")
+    public JAXBElement<Session> createFortSession( Session value )
+    {
+        return new JAXBElement<>( FORTSESSION_QNAME, Session.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.User }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortUser")
+    public JAXBElement<User> createFortUser( User value )
+    {
+        return new JAXBElement<>( FORTUSER_QNAME, User.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.UserRole }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortUserRole")
+    public JAXBElement<UserRole> createFortUserRole( UserRole value )
+    {
+        return new JAXBElement<>( FORTUSERROLE_QNAME, UserRole.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.OrgUnit }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortOrgUnit")
+    public JAXBElement<OrgUnit> createFortOrgUnit( OrgUnit value )
+    {
+        return new JAXBElement<>( FORTORGUNIT_QNAME, OrgUnit.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.Role }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortRole")
+    public JAXBElement<Role> createFortRole( Role value )
+    {
+        return new JAXBElement<>( FORTROLE_QNAME, Role.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.PermGrant }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortGrant")
+    public JAXBElement<PermGrant> createFortGrant( PermGrant value )
+    {
+        return new JAXBElement<>( FORTGRANT_QNAME, PermGrant.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.AdminRoleRelationship}{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortAdminRoleRelationship")
+    public JAXBElement<AdminRoleRelationship> createFortAdminRoleRelationship( AdminRoleRelationship value )
+    {
+        return new JAXBElement<>( FORTADMINROLERELATIONSHIP_QNAME, AdminRoleRelationship.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.OrgUnitRelationship}{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortOrgUnitRelationship")
+    public JAXBElement<OrgUnitRelationship> createFortOrgUnitRelationship( OrgUnitRelationship value )
+    {
+        return new JAXBElement<>( FORTORGUNITRELATIONSHIP_QNAME, OrgUnitRelationship.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.RoleRelationship}{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortRoleRelationship")
+    public JAXBElement<RoleRelationship> createFortRoleRelationship( RoleRelationship value )
+    {
+        return new JAXBElement<>( FORTROLERELATIONSHIP_QNAME, RoleRelationship.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.Role }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortAdminRole")
+    public JAXBElement<AdminRole> createFortAdminRole( AdminRole value )
+    {
+        return new JAXBElement<>( FORTADMINROLE_QNAME, AdminRole.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.UserAdminRole }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortUserAdminRole")
+    public JAXBElement<UserAdminRole> createFortUserRole( UserAdminRole value )
+    {
+        return new JAXBElement<>( FORTUSERADMINROLE_QNAME, UserAdminRole.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.PermObj }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortObject")
+    public JAXBElement<PermObj> createFortObject( PermObj value )
+    {
+        return new JAXBElement<>( FORTOBJECT_QNAME, PermObj.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.Permission }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortPermission")
+    public JAXBElement<Permission> createFortPermission( Permission value )
+    {
+        return new JAXBElement<>( FORTPERMISSION_QNAME, Permission.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.Bind }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortBind")
+    public JAXBElement<Bind> createFortEntity( Bind value )
+    {
+        return new JAXBElement<>( FORTBIND_QNAME, Bind.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.UserAudit }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortUserAudit")
+    public JAXBElement<UserAudit> createFortUserAudit( UserAudit value )
+    {
+        return new JAXBElement<>( FORTUSERAUDIT_QNAME, UserAudit.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.AuthZ }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortAuthZ")
+    public JAXBElement<AuthZ> createFortAuthZ( AuthZ value )
+    {
+        return new JAXBElement<>( FORTAUTHZ_QNAME, AuthZ.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.Mod }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortMod")
+    public JAXBElement<Mod> createFortMod( Mod value )
+    {
+        return new JAXBElement<>( FORTMOD_QNAME, Mod.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.RolePerm }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortRolePerm")
+    public JAXBElement<RolePerm> createFortRolePerm( RolePerm value )
+    {
+        return new JAXBElement<>( FORTROLEPERM_QNAME, RolePerm.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.Address }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortAddress")
+    public JAXBElement<Address> createFortAddress( Address value )
+    {
+        return new JAXBElement<>( FORTADDRESS_QNAME, Address.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.Props }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortProps")
+    public JAXBElement<Props> createFortProps( Props value )
+    {
+        return new JAXBElement<>( FORTPROPS_QNAME, Props.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.model.Warning }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortWarning")
+    public JAXBElement<Warning> createFortWarning( Warning value )
+    {
+        return new JAXBElement<Warning>( FORTWARNING_QNAME, Warning.class, null, value );
+    }
+
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link org.apache.directory.fortress.core.ldap.group.Group }{@code >}}
+     */
+    @XmlElementDecl(namespace = "", name = "fortGroup")
+    public JAXBElement<Group> createFortGroup( Group value )
+    {
+        return new JAXBElement<>( FORTGROUP_QNAME, Group.class, null, value );
+    }
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.apache.directory.fortress.model2
+     */
+    public ObjectFactory()
+    {
+    }
+
+    /**
+     * Create an instance of {@link User}
+     */
+    public User createUser()
+    {
+        return new User();
+    }
+
+
+    /**
+     * Create an instance of {@link org.apache.directory.fortress.core.model.PwPolicy }
+     */
+    public PwPolicy createPswdPolicy()
+    {
+        return new PwPolicy();
+    }
+
+
+    /**
+     * Create an instance of {@link Session}
+     */
+    public Session createSession()
+    {
+        return new Session();
+    }
+
+
+    /**
+     * Create an instance of {@link SDSet}
+     */
+    public SDSet createSDset()
+    {
+        return new SDSet();
+    }
+
+
+    /**
+     * Create an instance of {@link Role}
+     */
+    public Role createRole()
+    {
+        return new Role();
+    }
+
+
+    /**
+     * Create an instance of {@link Group}
+     */
+    public Group createGroup()
+    {
+        return new Group();
+    }
+
+
+    /**
+     * Create an instance of {@link PermGrant}
+     */
+    public PermGrant createPermGrant()
+    {
+        return new PermGrant();
+    }
+
+
+    /**
+     * Create an instance of {@link RoleRelationship}
+     */
+    public RoleRelationship createRoleRelationship()
+    {
+        return new RoleRelationship();
+    }
+
+
+    /**
+     * Create an instance of {@link AdminRoleRelationship}
+     */
+    public AdminRoleRelationship createAdminRoleRelationship()
+    {
+        return new AdminRoleRelationship();
+    }
+
+
+    /**
+     * Create an instance of {@link OrgUnitRelationship}
+     */
+    public OrgUnitRelationship createOrgUnitRelationship()
+    {
+        return new OrgUnitRelationship();
+    }
+
+
+    /**
+     * Create an instance of {@link PermObj}
+     */
+    public PermObj createPermObj()
+    {
+        return new PermObj();
+    }
+
+
+    /**
+     * Create an instance of {@link Permission}
+     */
+    public Permission createPermission()
+    {
+        return new Permission();
+    }
+
+
+    /**
+     * Create an instance of {@link Role}
+     */
+    public AdminRole createAdminRole()
+    {
+        return new AdminRole();
+    }
+
+
+    /**
+     * Create an instance of {@link org.apache.directory.fortress.core.model.UserRole}
+     */
+    public UserRole createUserRole()
+    {
+        return new UserRole();
+    }
+
+
+    /**
+     * Create an instance of {@link OrgUnit}
+     */
+    public OrgUnit createOrgUnit()
+    {
+        return new OrgUnit();
+    }
+
+
+    /**
+     * Create an instance of {@link UserAdminRole}
+     */
+    public UserAdminRole createUserAdminRole()
+    {
+        return new UserAdminRole();
+    }
+
+
+    /**
+     * Create an instance of {@link UserAudit}
+     */
+    public UserAudit createUserAudit()
+    {
+        return new UserAudit();
+    }
+
+
+    /**
+     * Create an instance of {@link Bind}
+     */
+    public Bind createBind()
+    {
+        return new Bind();
+    }
+
+
+    /**
+     * Create an instance of {@link AuthZ}
+     */
+    public AuthZ createAuthZ()
+    {
+        return new AuthZ();
+    }
+
+
+    /**
+     * Create an instance of {@link Mod}
+     */
+    public Mod createMod()
+    {
+        return new Mod();
+    }
+
+
+    /**
+     * Create an instance of {@link RolePerm}
+     */
+    public RolePerm createRolePerm()
+    {
+        return new RolePerm();
+    }
+
+
+    /**
+     * Create an instance of {@link FortResponse}
+     */
+    public FortResponse createFortResponse()
+    {
+        return new FortResponse();
+    }
+
+
+    /**
+     * Create an instance of {@link FortRequest}
+     */
+    public FortRequest createFortRequest()
+    {
+        return new FortRequest();
+    }
+
+
+    /**
+     * Create an instance of {@link Address}
+     */
+    public Address createAddress()
+    {
+        return new Address();
+    }
+
+
+    /**
+     * Create an instance of {@link Props}
+     */
+    public Props createProps()
+    {
+        return new Props();
+    }
+
+
+    /**
+     * Create an instance of {@link Warning}
+     */
+    public Warning createWarning( int id, String msg, Warning.Type type )
+    {
+        return new Warning( id, msg, type );
+    }
+
+
+    /**
+     * Create an instance of {@link Warning}
+     */
+    public Warning createWarning( int id, String msg, Warning.Type type, String name )
+    {
+        return new Warning( id, msg, type, name );
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rbac/AdminRoleDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/AdminRoleDAO.java b/src/main/java/org/apache/directory/fortress/core/rbac/AdminRoleDAO.java
index 334c118..2738539 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/AdminRoleDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/AdminRoleDAO.java
@@ -39,7 +39,7 @@ import org.apache.directory.fortress.core.CreateException;
 import org.apache.directory.fortress.core.FinderException;
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.GlobalIds;
-import org.apache.directory.fortress.core.ObjectFactory;
+import org.apache.directory.fortress.core.model.ObjectFactory;
 import org.apache.directory.fortress.core.RemoveException;
 import org.apache.directory.fortress.core.UpdateException;
 import org.apache.directory.fortress.core.ldap.ApacheDsDataProvider;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rbac/AttrHelper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/AttrHelper.java b/src/main/java/org/apache/directory/fortress/core/rbac/AttrHelper.java
deleted file mode 100755
index 8b08944..0000000
--- a/src/main/java/org/apache/directory/fortress/core/rbac/AttrHelper.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- *   Licensed to the Apache Software Foundation (ASF) under one
- *   or more contributor license agreements.  See the NOTICE file
- *   distributed with this work for additional information
- *   regarding copyright ownership.  The ASF licenses this file
- *   to you under the Apache License, Version 2.0 (the
- *   "License"); you may not use this file except in compliance
- *   with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing,
- *   software distributed under the License is distributed on an
- *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *   KIND, either express or implied.  See the License for the
- *   specific language governing permissions and limitations
- *   under the License.
- *
- */
-package org.apache.directory.fortress.core.rbac;
-
-import org.apache.directory.api.ldap.model.exception.LdapInvalidDnException;
-import org.apache.directory.api.ldap.model.name.Dn;
-import org.apache.directory.api.ldap.model.name.Rdn;
-import org.apache.directory.api.util.DateUtils;
-import org.apache.directory.fortress.core.GlobalIds;
-import org.apache.directory.fortress.core.model.Administrator;
-import org.apache.directory.fortress.core.model.AuthZ;
-import org.apache.directory.fortress.core.model.Permission;
-import org.apache.directory.fortress.core.util.attr.VUtil;
-
-import java.text.ParseException;
-import java.util.Date;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.Properties;
-
-/**
- * Class contains static utilities for various conversions of ldap data to application entity and back.  These methods are called by the
- * Fortress DAO's, i.e. {@link org.apache.directory.fortress.core.rbac.UserDAO}.
- * These are low-level data utilities and no validations are performed.  These apis should not be called by outside programs.
- * <p/>
- * This class is thread safe.
- * <p/>
-
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- */
-public final class AttrHelper
-{
-
-    /**
-     * Private constructor
-     *
-     */
-    private AttrHelper()
-    {
-    }
-
-    /**
-     * Perform copy on ARBAC attributes.  This is used during assignment of {@link org.apache.directory.fortress.core.model.AdminRole} to {@link org.apache.directory.fortress.core.model.User}.
-     * This method does not perform input validations.
-     *
-     * @param srcR contains source attributes to copy.
-     * @param trgR contains the target reference.
-     */
-    public static void copyAdminAttrs(Administrator srcR, Administrator trgR)
-    {
-        trgR.setBeginInclusive(srcR.isBeginInclusive());
-        trgR.setEndInclusive(srcR.isEndInclusive());
-        trgR.setBeginRange(srcR.getBeginRange());
-        trgR.setEndRange(srcR.getEndRange());
-        // copy the user and perm pools:
-        trgR.setOsP(srcR.getOsP());
-        trgR.setOsU(srcR.getOsU());
-    }
-
-    /**
-     * Convert from a {@link java.util.List} of properties stored as name:value pairs to
-     * a {@link java.util.Properties}.
-     *
-     * @param propList contains a list of name-value pairs separated by a ':'.
-     * @return reference to a Properties collection.
-     */
-    public static Properties getProperties(List<String> propList)
-    {
-        return getProperties(propList, GlobalIds.PROP_SEP );
-    }
-
-    /**
-     * Convert from a {@link java.util.List} of properties stored as name:value pairs to
-     * a {@link java.util.Properties}.
-     *
-     * @param propList contains a list of name-value pairs separated by a ':'.
-     * @param separator contains char to be used to separate key and value.
-     * @return reference to a Properties collection.
-     */
-    public static Properties getProperties( List<String> propList, char separator )
-    {
-        Properties props = null;
-        if (propList != null && propList.size() > 0)
-        {
-            props = new Properties();
-            propList.size();
-            for (String raw : propList)
-            {
-                int indx = raw.indexOf(separator);
-                if (indx >= 1)
-                {
-                    props.setProperty(raw.substring(0, indx), raw.substring(indx + 1));
-                }
-            }
-        }
-        return props;
-    }
-
-    /**
-     * Convert from a comma delimited list of name-value pairs separated by a ':'.  Return the pros as {@link java.util.Properties}.
-     *
-     * @param inputString contains comma delimited list of properties.
-     * @return java collection class containing props.
-     */
-    public static Properties getProperties( String inputString )
-    {
-        return getProperties( inputString, GlobalIds.PROP_SEP );
-    }
-
-    /**
-     * Convert from a comma delimited list of name-value pairs separated by a ':'.  Return the pros as {@link java.util.Properties}.
-     *
-     * @param inputString contains comma delimited list of properties.
-     * @param separator contains char to be used to separate key and value.
-     * @return java collection class containing props.
-     */
-    public static Properties getProperties( String inputString, char separator )
-    {
-        return getProperties( inputString, separator, GlobalIds.DELIMITER );
-    }
-
-    /**
-     * Convert from a comma delimited list of name-value pairs separated by a ':'.  Return the pros as {@link java.util.Properties}.
-     *
-     * @param inputString contains comma delimited list of properties.
-     * @param separator contains char to be used to separate key and value.
-     * @param delimiter contains a single char specifying delimiter between properties.
-     * @return java collection class containing props.
-     */
-    public static Properties getProperties( String inputString, char separator, String delimiter )
-    {
-        Properties props = new Properties();
-        if (inputString != null && inputString.length() > 0)
-        {
-            StringTokenizer maxTkn = new StringTokenizer(inputString, delimiter);
-            if (maxTkn.countTokens() > 0)
-            {
-                while (maxTkn.hasMoreTokens())
-                {
-                    String val = maxTkn.nextToken();
-                    int indx = val.indexOf(separator);
-                    if (indx >= 1)
-                    {
-                        String name = val.substring(0, indx).trim();
-                        String value = val.substring(indx + 1).trim();
-                        props.setProperty(name, value);
-                    }
-                }
-            }
-        }
-        return props;
-    }
-
-    /**
-     * Parse a raw slapd access log format data string for userId.
-     *
-     * @param inputString raw slapd access log data.
-     * @return string containing userId.
-     */
-    public static String getAuthZId(String inputString)
-    {
-        //reqAuthzID               <uid=fttu3user4,ou=people,dc=jts,dc=com>
-        String userId = null;
-        if (inputString != null && inputString.length() > 0)
-        {
-            StringTokenizer maxTkn = new StringTokenizer(inputString, ",");
-            if (maxTkn.countTokens() > 0)
-            {
-                String val = maxTkn.nextToken();
-                int indx = val.indexOf('=');
-                if (indx >= 1)
-                {
-                    userId = val.substring(indx + 1);
-                }
-            }
-        }
-        return userId;
-    }
-
-
-    /**
-     * Break the authZ eqDn attribute into 1. permission object name, 2. op name and 3. object id (optional).
-     *
-     * @param authZ contains the raw dn format from openldap slapo access log data
-     * @return Permisison containing objName, opName and optionally the objId populated from the raw data.
-     */
-    public static Permission getAuthZPerm(AuthZ authZ) throws LdapInvalidDnException
-    {
-        // This will be returned to the caller:
-        Permission pOp = new Permission();
-        // Break dn into rdns for leaf and parent.  Use the 'type' field in rdn.
-        // The objId value is optional.  If present it will be part of the parent's relative distinguished name..
-        // Here the sample reqDN=ftOpNm=TOP2_2+ftObjId=002,ftObjNm=TOB2_1,ou=Permissions,ou=RBAC,dc=example,dc=com
-        // Will be mapped to objName=TOB2_1, opName=TOP2_2, objId=002, in the returned permission object.
-        Dn dn = new Dn( authZ.getReqDN() );
-        if(dn != null && dn.getRdns() != null && VUtil.isNotNullOrEmpty( dn.getRdns() ) )
-        {
-            for( Rdn rdn : dn.getRdns() )
-            {
-                // The rdn type attribute will be mapped to objName, opName and objId fields.
-                switch ( rdn.getType() )
-                {
-                    case GlobalIds.POP_NAME:
-                        pOp.setOpName( rdn.getType() );
-                        break;
-                    case GlobalIds.POBJ_NAME:
-                        pOp.setObjName( rdn.getType() );
-                        break;
-                    case GlobalIds.POBJ_ID:
-                        pOp.setObjId( rdn.getType() );
-                        break;
-                }
-            }
-        }
-        return pOp;
-    }
-
-
-    /**
-     * Convert from raw ldap generalized time format to {@link java.util.Date}.
-     * to decode the string.
-     *
-     * @param inputString containing raw ldap generalized time formatted string.
-     * @return converted to {@link java.util.Date}.
-     */
-    public static Date decodeGeneralizedTime(String inputString) throws ParseException
-    {
-        Date aDate = null;
-        aDate = DateUtils.getDate( inputString );
-        return aDate;
-    }
-
-
-    /**
-     * Convert from java date {@link java.util.Date} format to raw ldap generalized time format.
-     * to encode the string.
-     *
-     * @param date reference to standard java date.
-     * @return converted to standardized ldap generalized time format.
-     */
-    public static String encodeGeneralizedTime(Date date)
-    {
-        String szTime = null;
-        szTime = DateUtils.getGeneralizedTime( date );
-        return szTime;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rbac/AuditDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/AuditDAO.java b/src/main/java/org/apache/directory/fortress/core/rbac/AuditDAO.java
index 9632330..23bdfa2 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/AuditDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/AuditDAO.java
@@ -34,12 +34,13 @@ import org.apache.directory.fortress.core.model.AuthZ;
 import org.apache.directory.fortress.core.model.Bind;
 import org.apache.directory.fortress.core.model.Mod;
 import org.apache.directory.fortress.core.model.UserAudit;
+import org.apache.directory.fortress.core.util.attr.AttrHelper;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.fortress.core.FinderException;
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.GlobalIds;
-import org.apache.directory.fortress.core.ObjectFactory;
-import org.apache.directory.fortress.core.cfg.Config;
+import org.apache.directory.fortress.core.model.ObjectFactory;
+import org.apache.directory.fortress.core.util.Config;
 import org.apache.directory.fortress.core.ldap.ApacheDsDataProvider;
 import org.apache.directory.fortress.core.util.attr.VUtil;
 

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rbac/DSDChecker.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/DSDChecker.java b/src/main/java/org/apache/directory/fortress/core/rbac/DSDChecker.java
index 898b7ea..8f40b8b 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/DSDChecker.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/DSDChecker.java
@@ -31,7 +31,7 @@ import org.apache.directory.fortress.core.model.Warning;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.directory.fortress.core.GlobalErrIds;
-import org.apache.directory.fortress.core.ObjectFactory;
+import org.apache.directory.fortress.core.model.ObjectFactory;
 import org.apache.directory.fortress.core.util.time.Constraint;
 import org.apache.directory.fortress.core.util.time.Time;
 import org.apache.directory.fortress.core.util.time.Validator;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rbac/DelAccessMgrImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/DelAccessMgrImpl.java b/src/main/java/org/apache/directory/fortress/core/rbac/DelAccessMgrImpl.java
index d745ea8..a3f9b89 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/DelAccessMgrImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/DelAccessMgrImpl.java
@@ -21,7 +21,7 @@ package org.apache.directory.fortress.core.rbac;
 
 import org.apache.directory.fortress.core.DelAccessMgr;
 import org.apache.directory.fortress.core.GlobalErrIds;
-import org.apache.directory.fortress.core.cfg.Config;
+import org.apache.directory.fortress.core.util.Config;
 import org.apache.directory.fortress.core.model.PermObj;
 import org.apache.directory.fortress.core.model.Permission;
 import org.apache.directory.fortress.core.model.Role;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rbac/DelAdminMgrImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/DelAdminMgrImpl.java b/src/main/java/org/apache/directory/fortress/core/rbac/DelAdminMgrImpl.java
index 993f71b..aa041d6 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/DelAdminMgrImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/DelAdminMgrImpl.java
@@ -32,6 +32,7 @@ import org.apache.directory.fortress.core.model.Permission;
 import org.apache.directory.fortress.core.model.Relationship;
 import org.apache.directory.fortress.core.model.User;
 import org.apache.directory.fortress.core.model.UserAdminRole;
+import org.apache.directory.fortress.core.util.attr.AttrHelper;
 import org.apache.directory.fortress.core.util.time.CUtil;
 import org.apache.directory.fortress.core.util.attr.VUtil;
 
@@ -280,7 +281,7 @@ public final class DelAdminMgrImpl extends Manageable implements DelAdminMgr
         CUtil.validateOrCopy(validRole, uAdminRole);
 
         // copy the ARBAC AdminRole attributes to UserAdminRole:
-        AttrHelper.copyAdminAttrs(validRole, uAdminRole);
+        AttrHelper.copyAdminAttrs( validRole, uAdminRole );
         String dn = userP.assign(uAdminRole);
         // copy the admin session info to AdminRole:
         setAdminData(CLS_NM, methodName, validRole);

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rbac/OrgUnitDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/OrgUnitDAO.java b/src/main/java/org/apache/directory/fortress/core/rbac/OrgUnitDAO.java
index 7dc8a93..bf7f403 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/OrgUnitDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/OrgUnitDAO.java
@@ -49,7 +49,7 @@ import org.apache.directory.fortress.core.CreateException;
 import org.apache.directory.fortress.core.FinderException;
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.GlobalIds;
-import org.apache.directory.fortress.core.ObjectFactory;
+import org.apache.directory.fortress.core.model.ObjectFactory;
 import org.apache.directory.fortress.core.RemoveException;
 import org.apache.directory.fortress.core.UpdateException;
 import org.apache.directory.fortress.core.ldap.ApacheDsDataProvider;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/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 1e881ad..f79af81 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
@@ -47,12 +47,13 @@ import org.apache.directory.fortress.core.model.Permission;
 import org.apache.directory.fortress.core.model.Role;
 import org.apache.directory.fortress.core.model.Session;
 import org.apache.directory.fortress.core.model.User;
+import org.apache.directory.fortress.core.util.attr.AttrHelper;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.fortress.core.CreateException;
 import org.apache.directory.fortress.core.FinderException;
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.GlobalIds;
-import org.apache.directory.fortress.core.ObjectFactory;
+import org.apache.directory.fortress.core.model.ObjectFactory;
 import org.apache.directory.fortress.core.RemoveException;
 import org.apache.directory.fortress.core.UpdateException;
 import org.apache.directory.fortress.core.ldap.ApacheDsDataProvider;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rbac/PolicyDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/PolicyDAO.java b/src/main/java/org/apache/directory/fortress/core/rbac/PolicyDAO.java
index fc01976..b0e8fc0 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/PolicyDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/PolicyDAO.java
@@ -42,7 +42,7 @@ import org.apache.directory.fortress.core.CreateException;
 import org.apache.directory.fortress.core.FinderException;
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.GlobalIds;
-import org.apache.directory.fortress.core.ObjectFactory;
+import org.apache.directory.fortress.core.model.ObjectFactory;
 import org.apache.directory.fortress.core.RemoveException;
 import org.apache.directory.fortress.core.UpdateException;
 import org.apache.directory.fortress.core.ldap.ApacheDsDataProvider;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/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 9a33f48..b710ac8 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
@@ -41,7 +41,7 @@ import org.apache.directory.fortress.core.CreateException;
 import org.apache.directory.fortress.core.FinderException;
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.GlobalIds;
-import org.apache.directory.fortress.core.ObjectFactory;
+import org.apache.directory.fortress.core.model.ObjectFactory;
 import org.apache.directory.fortress.core.RemoveException;
 import org.apache.directory.fortress.core.UpdateException;
 import org.apache.directory.fortress.core.ldap.ApacheDsDataProvider;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rbac/SDUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/SDUtil.java b/src/main/java/org/apache/directory/fortress/core/rbac/SDUtil.java
index b8b0bd3..468b012 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/SDUtil.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/SDUtil.java
@@ -25,7 +25,7 @@ import org.apache.directory.fortress.core.GlobalIds;
 import org.apache.directory.fortress.core.ReviewMgrFactory;
 import org.apache.directory.fortress.core.SecurityException;
 import org.apache.directory.fortress.core.ReviewMgr;
-import org.apache.directory.fortress.core.cfg.Config;
+import org.apache.directory.fortress.core.util.Config;
 import org.apache.directory.fortress.core.model.Role;
 import org.apache.directory.fortress.core.model.SDSet;
 import org.apache.directory.fortress.core.model.Session;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rbac/SdDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/SdDAO.java b/src/main/java/org/apache/directory/fortress/core/rbac/SdDAO.java
index c85338d..eaae106 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/SdDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/SdDAO.java
@@ -43,7 +43,7 @@ import org.apache.directory.fortress.core.CreateException;
 import org.apache.directory.fortress.core.FinderException;
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.GlobalIds;
-import org.apache.directory.fortress.core.ObjectFactory;
+import org.apache.directory.fortress.core.model.ObjectFactory;
 import org.apache.directory.fortress.core.RemoveException;
 import org.apache.directory.fortress.core.UpdateException;
 import org.apache.directory.fortress.core.ldap.ApacheDsDataProvider;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/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 d9197f5..debe582 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
@@ -56,6 +56,7 @@ import org.apache.directory.fortress.core.model.User;
 import org.apache.directory.fortress.core.model.UserAdminRole;
 import org.apache.directory.fortress.core.model.UserRole;
 import org.apache.directory.fortress.core.model.Warning;
+import org.apache.directory.fortress.core.util.attr.AttrHelper;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -63,12 +64,12 @@ import org.apache.directory.fortress.core.CreateException;
 import org.apache.directory.fortress.core.FinderException;
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.GlobalIds;
-import org.apache.directory.fortress.core.ObjectFactory;
+import org.apache.directory.fortress.core.model.ObjectFactory;
 import org.apache.directory.fortress.core.PasswordException;
 import org.apache.directory.fortress.core.RemoveException;
 import org.apache.directory.fortress.core.SecurityException;
 import org.apache.directory.fortress.core.UpdateException;
-import org.apache.directory.fortress.core.cfg.Config;
+import org.apache.directory.fortress.core.util.Config;
 import org.apache.directory.fortress.core.ldap.ApacheDsDataProvider;
 import org.apache.directory.fortress.core.util.attr.VUtil;
 import org.apache.directory.fortress.core.util.time.CUtil;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rbac/UserP.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/UserP.java b/src/main/java/org/apache/directory/fortress/core/rbac/UserP.java
index 5fd9790..a2c5905 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/UserP.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/UserP.java
@@ -32,12 +32,13 @@ import org.apache.directory.fortress.core.model.Session;
 import org.apache.directory.fortress.core.model.User;
 import org.apache.directory.fortress.core.model.UserAdminRole;
 import org.apache.directory.fortress.core.model.UserRole;
+import org.apache.directory.fortress.core.util.attr.AttrHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.GlobalIds;
-import org.apache.directory.fortress.core.ObjectFactory;
+import org.apache.directory.fortress.core.model.ObjectFactory;
 import org.apache.directory.fortress.core.PasswordException;
 import org.apache.directory.fortress.core.SecurityException;
 import org.apache.directory.fortress.core.ValidationException;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rest/AccessMgrRestImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rest/AccessMgrRestImpl.java b/src/main/java/org/apache/directory/fortress/core/rest/AccessMgrRestImpl.java
index 258f91a..01edf4a 100644
--- a/src/main/java/org/apache/directory/fortress/core/rest/AccessMgrRestImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/rest/AccessMgrRestImpl.java
@@ -22,6 +22,8 @@ package org.apache.directory.fortress.core.rest;
 import org.apache.directory.fortress.core.AccessMgr;
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.SecurityException;
+import org.apache.directory.fortress.core.model.FortRequest;
+import org.apache.directory.fortress.core.model.FortResponse;
 import org.apache.directory.fortress.core.rbac.AccessMgrImpl;
 import org.apache.directory.fortress.core.rbac.Manageable;
 import org.apache.directory.fortress.core.model.Permission;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rest/AdminMgrRestImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rest/AdminMgrRestImpl.java b/src/main/java/org/apache/directory/fortress/core/rest/AdminMgrRestImpl.java
index fd40dbe..e599566 100644
--- a/src/main/java/org/apache/directory/fortress/core/rest/AdminMgrRestImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/rest/AdminMgrRestImpl.java
@@ -23,6 +23,8 @@ package org.apache.directory.fortress.core.rest;
 import org.apache.directory.fortress.core.AdminMgr;
 import org.apache.directory.fortress.core.SecurityException;
 import org.apache.directory.fortress.core.GlobalErrIds;
+import org.apache.directory.fortress.core.model.FortRequest;
+import org.apache.directory.fortress.core.model.FortResponse;
 import org.apache.directory.fortress.core.model.PermGrant;
 import org.apache.directory.fortress.core.model.PermObj;
 import org.apache.directory.fortress.core.model.Permission;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rest/AuditMgrRestImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rest/AuditMgrRestImpl.java b/src/main/java/org/apache/directory/fortress/core/rest/AuditMgrRestImpl.java
index d73180a..f05a037 100644
--- a/src/main/java/org/apache/directory/fortress/core/rest/AuditMgrRestImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/rest/AuditMgrRestImpl.java
@@ -24,6 +24,8 @@ import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.SecurityException;
 import org.apache.directory.fortress.core.model.AuthZ;
 import org.apache.directory.fortress.core.model.Bind;
+import org.apache.directory.fortress.core.model.FortRequest;
+import org.apache.directory.fortress.core.model.FortResponse;
 import org.apache.directory.fortress.core.rbac.Manageable;
 import org.apache.directory.fortress.core.model.Mod;
 import org.apache.directory.fortress.core.model.UserAudit;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rest/ConfigMgrRestImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rest/ConfigMgrRestImpl.java b/src/main/java/org/apache/directory/fortress/core/rest/ConfigMgrRestImpl.java
index 64ebce6..4d07dbc 100644
--- a/src/main/java/org/apache/directory/fortress/core/rest/ConfigMgrRestImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/rest/ConfigMgrRestImpl.java
@@ -22,6 +22,8 @@ package org.apache.directory.fortress.core.rest;
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.SecurityException;
 import org.apache.directory.fortress.core.ConfigMgr;
+import org.apache.directory.fortress.core.model.FortRequest;
+import org.apache.directory.fortress.core.model.FortResponse;
 import org.apache.directory.fortress.core.model.Props;
 import org.apache.directory.fortress.core.util.attr.VUtil;
 

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rest/DelAccessMgrRestImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rest/DelAccessMgrRestImpl.java b/src/main/java/org/apache/directory/fortress/core/rest/DelAccessMgrRestImpl.java
index 45d4efc..b5562ff 100644
--- a/src/main/java/org/apache/directory/fortress/core/rest/DelAccessMgrRestImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/rest/DelAccessMgrRestImpl.java
@@ -20,6 +20,8 @@
 package org.apache.directory.fortress.core.rest;
 
 import org.apache.directory.fortress.core.GlobalErrIds;
+import org.apache.directory.fortress.core.model.FortRequest;
+import org.apache.directory.fortress.core.model.FortResponse;
 import org.apache.directory.fortress.core.model.RolePerm;
 import org.apache.directory.fortress.core.model.UserAdminRole;
 import org.apache.directory.fortress.core.DelAccessMgr;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rest/DelAdminMgrRestImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rest/DelAdminMgrRestImpl.java b/src/main/java/org/apache/directory/fortress/core/rest/DelAdminMgrRestImpl.java
index e164183..a75b07d 100644
--- a/src/main/java/org/apache/directory/fortress/core/rest/DelAdminMgrRestImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/rest/DelAdminMgrRestImpl.java
@@ -23,6 +23,8 @@ import org.apache.directory.fortress.core.DelAdminMgr;
 import org.apache.directory.fortress.core.SecurityException;
 import org.apache.directory.fortress.core.model.AdminRole;
 import org.apache.directory.fortress.core.model.AdminRoleRelationship;
+import org.apache.directory.fortress.core.model.FortRequest;
+import org.apache.directory.fortress.core.model.FortResponse;
 import org.apache.directory.fortress.core.rbac.Manageable;
 import org.apache.directory.fortress.core.model.OrgUnit;
 import org.apache.directory.fortress.core.model.OrgUnitRelationship;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rest/DelReviewMgrRestImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rest/DelReviewMgrRestImpl.java b/src/main/java/org/apache/directory/fortress/core/rest/DelReviewMgrRestImpl.java
index a6fc1b9..26757d5 100644
--- a/src/main/java/org/apache/directory/fortress/core/rest/DelReviewMgrRestImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/rest/DelReviewMgrRestImpl.java
@@ -23,6 +23,8 @@ import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.SecurityException;
 import org.apache.directory.fortress.core.DelReviewMgr;
 import org.apache.directory.fortress.core.model.AdminRole;
+import org.apache.directory.fortress.core.model.FortRequest;
+import org.apache.directory.fortress.core.model.FortResponse;
 import org.apache.directory.fortress.core.rbac.Manageable;
 import org.apache.directory.fortress.core.model.OrgUnit;
 import org.apache.directory.fortress.core.model.UserAdminRole;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rest/FortRequest.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rest/FortRequest.java b/src/main/java/org/apache/directory/fortress/core/rest/FortRequest.java
deleted file mode 100644
index 561df45..0000000
--- a/src/main/java/org/apache/directory/fortress/core/rest/FortRequest.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- *   Licensed to the Apache Software Foundation (ASF) under one
- *   or more contributor license agreements.  See the NOTICE file
- *   distributed with this work for additional information
- *   regarding copyright ownership.  The ASF licenses this file
- *   to you under the Apache License, Version 2.0 (the
- *   "License"); you may not use this file except in compliance
- *   with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing,
- *   software distributed under the License is distributed on an
- *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *   KIND, either express or implied.  See the License for the
- *   specific language governing permissions and limitations
- *   under the License.
- *
- */
-package org.apache.directory.fortress.core.rest;
-
-import org.apache.directory.fortress.core.model.FortEntity;
-import org.apache.directory.fortress.core.model.Session;
-
-import javax.xml.bind.annotation.*;
-
-/**
- * This class is used to pass request data to En Masse server.
- * </p>
- * This class is not thread safe.
- *
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- */
-@XmlRootElement(name = "FortRequest")
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "fortRequest", propOrder =
-{
-    "entity",
-    "value",
-    "limit",
-    "contextId",
-    "session"
-})
-public class FortRequest
-{
-    @XmlElement(nillable = true)
-    private FortEntity entity;
-    @XmlElement(nillable = true)
-    private Session session;
-    private String value;
-    @XmlElement(nillable = true)
-    private Integer limit;
-    private String contextId;
-
-    public FortEntity getEntity()
-    {
-        return entity;
-    }
-
-    public void setEntity(FortEntity entity)
-    {
-        this.entity = entity;
-    }
-
-    public String getValue()
-    {
-        return value;
-    }
-
-    public void setValue(String value)
-    {
-        this.value = value;
-    }
-
-    public Session getSession()
-    {
-        return session;
-    }
-
-    public void setSession(Session session)
-    {
-        this.session = session;
-    }
-
-    public Integer getLimit()
-    {
-        return limit;
-    }
-
-    public void setLimit(Integer limit)
-    {
-        this.limit = limit;
-    }
-
-    public String getContextId()
-    {
-        return contextId;
-    }
-
-    public void setContextId(String contextId)
-    {
-        this.contextId = contextId;
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rest/FortResponse.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rest/FortResponse.java b/src/main/java/org/apache/directory/fortress/core/rest/FortResponse.java
deleted file mode 100755
index 49173b1..0000000
--- a/src/main/java/org/apache/directory/fortress/core/rest/FortResponse.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- *   Licensed to the Apache Software Foundation (ASF) under one
- *   or more contributor license agreements.  See the NOTICE file
- *   distributed with this work for additional information
- *   regarding copyright ownership.  The ASF licenses this file
- *   to you under the Apache License, Version 2.0 (the
- *   "License"); you may not use this file except in compliance
- *   with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing,
- *   software distributed under the License is distributed on an
- *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *   KIND, either express or implied.  See the License for the
- *   specific language governing permissions and limitations
- *   under the License.
- *
- */
-package org.apache.directory.fortress.core.rest;
-
-import org.apache.directory.fortress.core.model.FortEntity;
-import org.apache.directory.fortress.core.model.Session;
-
-import javax.xml.bind.annotation.*;
-import java.util.List;
-import java.util.Set;
-
-/**
- * This class is used to return response data from En Masse server.
- * </p>
- * This class is not thread safe.
- *
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- */
-@XmlRootElement(name = "FortResponse")
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "fortResponse", propOrder =
-{
-    "errorCode",
-    "errorMessage",
-    "entity",
-    "entities",
-    "values",
-    "valueSet",
-    "isAuthorized",
-    "session"
-})
-public class FortResponse
-{
-    private int errorCode;
-    @XmlElement(nillable = true)
-    private Boolean isAuthorized;
-    private String errorMessage;
-    @XmlElement(nillable = true)
-    private FortEntity entity;
-    @XmlElement(nillable = true)
-    private List<FortEntity> entities;
-    @XmlElement(nillable = true)
-    private List<String> values;
-    @XmlElement(nillable = true)
-    private Set<String> valueSet;
-    @XmlElement(nillable = true)
-    private Session session;
-
-    public FortEntity getEntity()
-    {
-        return entity;
-    }
-
-    public void setEntity(FortEntity entity)
-    {
-        this.entity = entity;
-    }
-
-    public String getErrorMessage()
-    {
-        return errorMessage;
-    }
-
-    public void setErrorMessage(String errorMessage)
-    {
-        this.errorMessage = errorMessage;
-    }
-
-    public int getErrorCode()
-    {
-        return errorCode;
-    }
-
-    public Boolean getAuthorized()
-    {
-        return isAuthorized;
-    }
-
-    public void setAuthorized(Boolean authorized)
-    {
-        isAuthorized = authorized;
-    }
-
-    public void setErrorCode(int errorCode)
-    {
-        this.errorCode = errorCode;
-    }
-
-    public <T extends FortEntity> List<T> getEntities()
-    {
-        return (List<T>)entities;
-    }
-
-    public <T extends FortEntity> void setEntities(List<T> entities)
-    {
-        this.entities = (List<FortEntity>)entities;
-    }
-
-    public List<String> getValues()
-    {
-        return values;
-    }
-
-    public void setValues(List<String> values)
-    {
-        this.values = values;
-    }
-
-    public Set<String> getValueSet()
-    {
-        return valueSet;
-    }
-
-    public void setValueSet(Set<String> valueSet)
-    {
-        this.valueSet = valueSet;
-    }
-
-    public Session getSession()
-    {
-        return session;
-    }
-
-    public void setSession(Session session)
-    {
-        this.session = session;
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rest/PwPolicyMgrRestImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rest/PwPolicyMgrRestImpl.java b/src/main/java/org/apache/directory/fortress/core/rest/PwPolicyMgrRestImpl.java
index 5201a6b..45b0509 100644
--- a/src/main/java/org/apache/directory/fortress/core/rest/PwPolicyMgrRestImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/rest/PwPolicyMgrRestImpl.java
@@ -23,6 +23,8 @@ package org.apache.directory.fortress.core.rest;
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.PwPolicyMgr;
 import org.apache.directory.fortress.core.SecurityException;
+import org.apache.directory.fortress.core.model.FortRequest;
+import org.apache.directory.fortress.core.model.FortResponse;
 import org.apache.directory.fortress.core.rbac.Manageable;
 import org.apache.directory.fortress.core.model.PwPolicy;
 import org.apache.directory.fortress.core.util.attr.VUtil;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/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 cae9306..c6c60e7 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
@@ -43,13 +43,15 @@ import org.apache.commons.httpclient.methods.RequestEntity;
 import org.apache.commons.httpclient.methods.StringRequestEntity;
 import org.apache.cxf.common.util.Base64Utility;
 import org.apache.cxf.helpers.IOUtils;
+import org.apache.directory.fortress.core.model.FortRequest;
+import org.apache.directory.fortress.core.model.FortResponse;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.directory.fortress.core.GlobalErrIds;
-import org.apache.directory.fortress.core.ObjectFactory;
+import org.apache.directory.fortress.core.model.ObjectFactory;
 import org.apache.directory.fortress.core.RestException;
-import org.apache.directory.fortress.core.cfg.Config;
+import org.apache.directory.fortress.core.util.Config;
 import org.apache.directory.fortress.core.model.Props;
 import org.apache.directory.fortress.core.util.crypto.EncryptUtil;
 

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/src/main/java/org/apache/directory/fortress/core/rest/ReviewMgrRestImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rest/ReviewMgrRestImpl.java b/src/main/java/org/apache/directory/fortress/core/rest/ReviewMgrRestImpl.java
index 52233bd..e45597b 100755
--- a/src/main/java/org/apache/directory/fortress/core/rest/ReviewMgrRestImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/rest/ReviewMgrRestImpl.java
@@ -22,6 +22,8 @@ package org.apache.directory.fortress.core.rest;
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.ReviewMgr;
 import org.apache.directory.fortress.core.SecurityException;
+import org.apache.directory.fortress.core.model.FortRequest;
+import org.apache.directory.fortress.core.model.FortResponse;
 import org.apache.directory.fortress.core.rbac.Manageable;
 import org.apache.directory.fortress.core.model.OrgUnit;
 import org.apache.directory.fortress.core.model.PermObj;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/04169701/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
new file mode 100755
index 0000000..a598a93
--- /dev/null
+++ b/src/main/java/org/apache/directory/fortress/core/util/Config.java
@@ -0,0 +1,504 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.fortress.core.util;
+
+
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.Properties;
+
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.directory.fortress.core.ConfigMgr;
+import org.apache.directory.fortress.core.ConfigMgrFactory;
+import org.apache.directory.fortress.core.util.attr.VUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.directory.fortress.core.CfgException;
+import org.apache.directory.fortress.core.CfgRuntimeException;
+import org.apache.directory.fortress.core.GlobalErrIds;
+import org.apache.directory.fortress.core.GlobalIds;
+import org.apache.directory.fortress.core.SecurityException;
+
+/**
+ * This class wraps <a href="http://commons.apache.org/cfg/">Apache Commons Config</a> utility and is used by internal components to retrieve name-value
+ * pair properties from its cfg context.  The class will combine properties that it finds in its local property
+ * file along with data that is retrieved by name from the ldap server if name is specified within
+ * the {@link org.apache.directory.fortress.core.GlobalIds#CONFIG_REALM} switch.
+ * <p>
+ * The class will bootstrap itself during startup and must initialize correctly for the Fortress APIs to work correctly.
+ * <p>
+ * This object is thread safe but stores a static reference to Apache Commons Configuration {@link #config} object.
+ * </p>
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public final class Config
+{
+    private static final String propFile = "fortress.properties";
+    private static final String userPropFile = "fortress.user.properties";
+    private static final String EXT_LDAP_HOST = "fortress.host";
+    private static final String EXT_LDAP_PORT = "fortress.port";
+    private static final String EXT_LDAP_ADMIN_POOL_UID = "fortress.admin.user";
+    private static final String EXT_LDAP_ADMIN_POOL_PW = "fortress.admin.pw";
+    private static final String EXT_LDAP_ADMIN_POOL_MIN = "fortress.min.admin.conn";
+    private static final String EXT_LDAP_ADMIN_POOL_MAX = "fortress.max.admin.conn";
+    private static final String EXT_ENABLE_LDAP_SSL = "fortress.enable.ldap.ssl";
+    private static final String EXT_ENABLE_LDAP_SSL_DEBUG = "fortress.enable.ldap.ssl.debug";
+    private static final String EXT_TRUST_STORE = "fortress.trust.store";
+    private static final String EXT_TRUST_STORE_PW = "fortress.trust.store.password";
+    private static final String EXT_SET_TRUST_STORE_PROP = "fortress.trust.store.set.prop";
+    private static final String EXT_CONFIG_REALM = "fortress.config.realm";
+    private static final String EXT_SERVER_TYPE = "fortress.ldap.server.type";
+    private static final PropertiesConfiguration config;
+    private static final String CLS_NM = Config.class.getName();
+    private static final Logger LOG = LoggerFactory.getLogger( CLS_NM );
+
+    static
+    {
+        try
+        {
+            // Load the system config file.
+            URL fUrl = Config.class.getClassLoader().getResource( propFile );
+
+            if ( fUrl == null )
+            {
+                String error = "static init: Error, null cfg file: " + propFile;
+                LOG.error( error );
+                throw new java.lang.RuntimeException( error );
+            }
+
+            LOG.info( "static init: found from: {} path: {}", propFile, fUrl.getPath() );
+
+            config = new PropertiesConfiguration();
+            config.setDelimiterParsingDisabled( true );
+            config.load( fUrl );
+            LOG.info( "static init: loading from: {}", propFile );
+
+            URL fUserUrl = Config.class.getClassLoader().getResource( userPropFile );
+            if ( fUserUrl != null )
+            {
+                LOG.info( "static init: found user properties from: {} path: {}",
+                    userPropFile, fUserUrl.getPath() );
+                config.load( fUserUrl );
+            }
+
+            // Check to see if any of the ldap connection parameters have been overridden:
+            getExternalConfig();
+
+            // Retrieve parameters from the config node stored in target LDAP DIT:
+            String realmName = config.getString( GlobalIds.CONFIG_REALM );
+            if ( realmName != null && realmName.length() > 0 )
+            {
+                LOG.info( "static init: load config realm [{}]", realmName );
+                Properties props = getRemoteConfig( realmName );
+                if ( props != null )
+                {
+                    for ( Enumeration<?> e = props.propertyNames(); e.hasMoreElements(); )
+                    {
+                        String key = ( String ) e.nextElement();
+                        String val = props.getProperty( key );
+                        config.addProperty( key, val );
+                    }
+                }
+            }
+            else
+            {
+                LOG.info( "static init: config realm not setup" );
+            }
+        }
+        catch ( org.apache.commons.configuration.ConfigurationException ex )
+        {
+            String error = "static init: Error loading from cfg file: [" + propFile
+                + "] ConfigurationException=" + ex;
+            LOG.error( error );
+            throw new CfgRuntimeException( GlobalErrIds.FT_CONFIG_BOOTSTRAP_FAILED, error, ex );
+        }
+        catch ( SecurityException se )
+        {
+            String error = "static init: Error loading from cfg file: [" + propFile + "] SecurityException="
+                + se;
+            LOG.error( error );
+            throw new CfgRuntimeException( GlobalErrIds.FT_CONFIG_INITIALIZE_FAILED, error, se );
+        }
+    }
+
+    /**
+     * Private constructor
+     *
+     */
+    private Config()
+    {
+    }
+
+    /**
+     * Gets the prop attribute as String value from the apache commons cfg component.
+     *
+     * @param name contains the name of the property.
+     * @return contains the value associated with the property or null if not not found.
+     */
+    public static String getProperty( String name )
+    {
+        String value = null;
+        if ( config != null )
+        {
+            value = ( String ) config.getProperty( name );
+            LOG.debug( "getProperty name [{}] value [{}]", name, value );
+        }
+        else
+        {
+            LOG.error( "getProperty invalid config, can't read prop [{}]", name );
+        }
+        return value;
+    }
+
+
+    /**
+     * Get the property value from the apache commons config but specify a default value if not found.
+     *
+     * @param name         contains the name of the property.
+     * @param defaultValue specified by client will be returned if property value is not found.
+     * @return contains the value for the property as a String.
+     */
+    public static String getProperty( String name, String defaultValue )
+    {
+        String value = null;
+        if ( config != null )
+        {
+            value = ( String ) config.getProperty( name );
+        }
+        else
+        {
+            String warn = "getProperty invalid config, can't read prop [" + name + "]";
+            LOG.warn( warn );
+        }
+        if ( value == null || value.length() == 0 )
+        {
+            value = defaultValue;
+        }
+        return value;
+    }
+
+
+    /**
+     * Gets the prop attribute as char value from the apache commons cfg component.
+     *
+     * @param name contains the name of the property.
+     * @return contains the value associated with the property or 0 if not not found.
+     */
+    public static char getChar( String name )
+    {
+        char value = 0;
+        if ( config != null )
+        {
+            value = ( char ) config.getProperty( name );
+            LOG.debug( "getChar name [{}] value [{}]", name, value );
+        }
+        else
+        {
+            LOG.error( "getChar invalid config, can't read prop [{}]", name );
+        }
+        return value;
+    }
+
+
+    /**
+     * Get the property value from the apache commons config but specify a default value if not found.
+     *
+     * @param name         contains the name of the property.
+     * @param defaultValue specified by client will be returned if property value is not found.
+     * @return contains the value for the property as a char.
+     */
+    public static char getChar( String name, char defaultValue )
+    {
+        char value = 0;
+        if ( config != null )
+        {
+            value = ( char ) config.getProperty( name );
+        }
+        else
+        {
+            String warn = "getChar invalid config, can't read prop [" + name + "]";
+            LOG.warn( warn );
+        }
+        if ( value == 0 )
+        {
+            value = defaultValue;
+        }
+        return value;
+    }
+
+
+    /**
+     * Gets the int attribute of the Config class, or 0 if not found.
+     *
+     * @param key name of the property name.
+     * @return The int value or 0 if not found.
+     */
+    public static int getInt( String key )
+    {
+        int value = 0;
+        if ( config != null )
+        {
+            value = config.getInt( key );
+        }
+        else
+        {
+            String warn = "getInt invalid config, can't read prop [" + key + "]";
+            LOG.warn( warn );
+        }
+        return value;
+    }
+
+
+    /**
+     * Gets the int attribute of the Config class or default value if not found.
+     *
+     * @param key          name of the property name.
+     * @param defaultValue to use if property not found.
+     * @return The int value or default value if not found.
+     */
+    public static int getInt( String key, int defaultValue )
+    {
+        int value = 0;
+        if ( config != null )
+        {
+            value = config.getInt( key, defaultValue );
+        }
+        else
+        {
+            String warn = "getInt invalid config, can't read prop [" + key + "]";
+            LOG.warn( warn );
+        }
+        return value;
+    }
+
+
+    /**
+     * Gets the boolean attribute associated with the name or false if not found.
+     *
+     * @param key name of the property name.
+     * @return The boolean value or false if not found.
+     */
+    public static boolean getBoolean( String key )
+    {
+        boolean value = false;
+        if ( config != null )
+        {
+            value = config.getBoolean( key );
+        }
+        else
+        {
+            String warn = "getBoolean - invalid config, can't read prop [" + key + "]";
+            LOG.warn( warn );
+        }
+        return value;
+    }
+
+
+    /**
+     * Gets the boolean attribute associated with the name or false if not found.
+     *
+     * @param key          name of the property name.
+     * @param defaultValue specified by client will be returned if property value is not found.
+     * @return The boolean value or false if not found.
+     */
+    public static boolean getBoolean( String key, boolean defaultValue )
+    {
+        boolean value = defaultValue;
+        if ( config != null )
+        {
+            value = config.getBoolean( key, defaultValue );
+        }
+        else
+        {
+            String warn = "getBoolean - invalid config, can't read prop [" + key + "]";
+            LOG.warn( warn );
+        }
+        return value;
+    }
+
+
+    /**
+     * Set the property String value to the apache commons config.
+     *
+     * @param name         contains the name of the property.
+     * @param value        contains the String value of the property.
+     */
+    public static void setProperty( String name, String value )
+    {
+        if ( config != null )
+        {
+            config.setProperty( name, value );
+        }
+        else
+        {
+            String warn = "setProperty invalid config, can't set prop name [" + name + "], value [" + value + "]";
+            LOG.warn( warn );
+        }
+    }
+
+
+    /**
+     * Fetch the remote cfg params from ldap with given name.
+     *
+     * @param realmName required attribute contains the name of config node name on ldap.
+     * @return {@link Properties} containing collection of name/value pairs found in directory.
+     * @throws org.apache.directory.fortress.core.SecurityException
+     *          in the event of system or validation error.
+     */
+    private static Properties getRemoteConfig( String realmName ) throws SecurityException
+    {
+        Properties props = null;
+        try
+        {
+            ConfigMgr cfgMgr = ConfigMgrFactory.createInstance();
+            props = cfgMgr.read( realmName );
+        }
+        catch ( CfgException ce )
+        {
+            if ( ce.getErrorId() == GlobalErrIds.FT_CONFIG_NOT_FOUND )
+            {
+                String warning = "getRemoteConfig could not find cfg entry";
+                LOG.warn( warning );
+            }
+            else
+            {
+                throw ce;
+            }
+        }
+        return props;
+    }
+
+
+    /**
+     * This method is called during configuration initialization.  It determines if
+     * the ldap connection coordinates have been overridden as system properties.
+     */
+    private static void getExternalConfig()
+    {
+        String PREFIX = "getExternalConfig override name [{}] value [{}]";
+        // Check to see if the ldap host has been overridden by a system property:
+        String szValue = System.getProperty( EXT_LDAP_HOST );
+        if( VUtil.isNotNullOrEmpty( szValue ))
+        {
+            config.setProperty( GlobalIds.LDAP_HOST, szValue );
+            LOG.info( PREFIX, GlobalIds.LDAP_HOST, szValue );
+        }
+        // Check to see if the ldap port has been overridden by a system property:
+        szValue = System.getProperty( EXT_LDAP_PORT );
+        if( VUtil.isNotNullOrEmpty( szValue ))
+        {
+            config.setProperty( GlobalIds.LDAP_PORT, szValue );
+            LOG.info( PREFIX, GlobalIds.LDAP_PORT, szValue );
+        }
+
+        // Check to see if the admin pool uid has been overridden by a system property:
+        szValue = System.getProperty( EXT_LDAP_ADMIN_POOL_UID );
+        if( VUtil.isNotNullOrEmpty( szValue ))
+        {
+            config.setProperty( GlobalIds.LDAP_ADMIN_POOL_UID, szValue );
+            // never display ldap admin userid name to log:
+            LOG.info( "getExternalConfig override name [{}]", GlobalIds.LDAP_ADMIN_POOL_UID );
+        }
+
+        // Check to see if the admin pool pw has been overridden by a system property:
+        szValue = System.getProperty( EXT_LDAP_ADMIN_POOL_PW );
+        if( VUtil.isNotNullOrEmpty( szValue ))
+        {
+            config.setProperty( GlobalIds.LDAP_ADMIN_POOL_PW, szValue );
+            // never display password of any type to log:
+            LOG.info( "getExternalConfig override name [{}]", GlobalIds.LDAP_ADMIN_POOL_PW );
+        }
+
+        // Check to see if the admin pool min connections has been overridden by a system property:
+        szValue = System.getProperty( EXT_LDAP_ADMIN_POOL_MIN );
+        if( VUtil.isNotNullOrEmpty( szValue ))
+        {
+            config.setProperty( GlobalIds.LDAP_ADMIN_POOL_MIN, szValue );
+            LOG.info( PREFIX, GlobalIds.LDAP_ADMIN_POOL_MIN, szValue );
+        }
+
+        // Check to see if the admin pool max connections has been overridden by a system property:
+        szValue = System.getProperty( EXT_LDAP_ADMIN_POOL_MAX );
+        if( VUtil.isNotNullOrEmpty( szValue ))
+        {
+            config.setProperty( GlobalIds.LDAP_ADMIN_POOL_MAX, Integer.valueOf( szValue ) );
+            LOG.info( PREFIX, GlobalIds.LDAP_ADMIN_POOL_MAX, szValue );
+        }
+
+        // Check to see if ssl enabled parameter has been overridden by a system property:
+        szValue = System.getProperty( EXT_ENABLE_LDAP_SSL );
+        if( VUtil.isNotNullOrEmpty( szValue ))
+        {
+            config.setProperty( GlobalIds.ENABLE_LDAP_SSL, szValue );
+            LOG.info( PREFIX, GlobalIds.ENABLE_LDAP_SSL, szValue );
+        }
+
+        // Check to see if the ssl debug enabled parameter has been overridden by a system property:
+        szValue = System.getProperty( EXT_ENABLE_LDAP_SSL_DEBUG );
+        if( VUtil.isNotNullOrEmpty( szValue ))
+        {
+            config.setProperty( GlobalIds.ENABLE_LDAP_SSL_DEBUG, szValue );
+            LOG.info( PREFIX, GlobalIds.ENABLE_LDAP_SSL_DEBUG, szValue );
+        }
+
+        // Check to see if the trust store location has been overridden by a system property:
+        szValue = System.getProperty( EXT_TRUST_STORE );
+        if( VUtil.isNotNullOrEmpty( szValue ))
+        {
+            config.setProperty( GlobalIds.TRUST_STORE, szValue );
+            LOG.info( PREFIX, GlobalIds.TRUST_STORE, szValue );
+        }
+
+        // Check to see if the trust store password has been overridden by a system property:
+        szValue = System.getProperty( EXT_TRUST_STORE_PW );
+        if( VUtil.isNotNullOrEmpty( szValue ))
+        {
+            config.setProperty( GlobalIds.TRUST_STORE_PW, szValue );
+            // never display password value to log:
+            LOG.info( "getExternalConfig override name [{}]", GlobalIds.TRUST_STORE_PW );
+        }
+
+        // Check to see if the trust store set parameter has been overridden by a system property:
+        szValue = System.getProperty( EXT_SET_TRUST_STORE_PROP );
+        if( VUtil.isNotNullOrEmpty( szValue ))
+        {
+            config.setProperty( GlobalIds.SET_TRUST_STORE_PROP, szValue );
+            LOG.info( PREFIX, GlobalIds.SET_TRUST_STORE_PROP, szValue );
+        }
+
+        // Check to see if the config realm name has been overridden by a system property:
+        szValue = System.getProperty( EXT_CONFIG_REALM );
+        if( VUtil.isNotNullOrEmpty( szValue ))
+        {
+            config.setProperty( GlobalIds.CONFIG_REALM, szValue );
+            LOG.info( PREFIX, GlobalIds.CONFIG_REALM, szValue );
+        }
+
+        // Check to see if the ldap server type has been overridden by a system property:
+        szValue = System.getProperty( EXT_SERVER_TYPE  );
+        if( VUtil.isNotNullOrEmpty( szValue ))
+        {
+            config.setProperty( GlobalIds.SERVER_TYPE, szValue );
+            LOG.info( PREFIX, GlobalIds.SERVER_TYPE, szValue );
+        }
+    }
+}
\ No newline at end of file


Mime
View raw message