directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject [11/11] directory-fortress-enmasse git commit: change package structure and names, pom improvements, license
Date Tue, 11 Nov 2014 20:38:50 GMT
change package structure and names, pom improvements, license


Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/commit/99852b55
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/tree/99852b55
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/diff/99852b55

Branch: refs/heads/master
Commit: 99852b55d0bd5b66e79cc2665780f4ef56c6b8ff
Parents: f10f295
Author: Shawn McKinney <smckinney@apache.org>
Authored: Tue Nov 11 14:38:26 2014 -0600
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Tue Nov 11 14:38:26 2014 -0600

----------------------------------------------------------------------
 ENMASSE-SUBMISSION-OPENLDAP.txt                 |   38 -
 LICENSE                                         |   47 -
 LICENSE.ttx                                     |  176 +
 NOTICE.txt                                      |   42 +-
 README.txt                                      |   42 +-
 pom.xml                                         |  179 +-
 src/main/assembly/distsrc.xml                   |   33 +-
 .../directory/fortress/rest/AccessMgrImpl.java  |  282 ++
 .../directory/fortress/rest/AdminMgrImpl.java   |  991 ++++
 .../directory/fortress/rest/AuditMgrImpl.java   |  176 +
 .../directory/fortress/rest/ConfigMgrImpl.java  |  159 +
 .../fortress/rest/DelegatedAccessMgrImpl.java   |  269 ++
 .../fortress/rest/DelegatedAdminMgrImpl.java    |  386 ++
 .../fortress/rest/DelegatedReviewMgrImpl.java   |  176 +
 .../fortress/rest/FortressInterceptor.java      |  192 +
 .../fortress/rest/FortressService.java          | 3421 ++++++++++++++
 .../fortress/rest/FortressServiceImpl.java      | 4375 ++++++++++++++++++
 .../fortress/rest/PswdPolicyMgrImpl.java        |  192 +
 .../directory/fortress/rest/ReviewMgrImpl.java  |  679 +++
 .../rest/SecurityOutFaultInterceptor.java       |   72 +
 .../fortress/rest/fortress-javadoc.css          |   33 +
 .../directory/fortress/rest/overview.html       |   97 +
 .../apache/directory/fortress/rest/package.html |   29 +
 .../org/openldap/enmasse/AccessMgrImpl.java     |  277 --
 .../java/org/openldap/enmasse/AdminMgrImpl.java |  986 ----
 .../java/org/openldap/enmasse/AuditMgrImpl.java |  171 -
 .../org/openldap/enmasse/ConfigMgrImpl.java     |  154 -
 .../enmasse/DelegatedAccessMgrImpl.java         |  264 --
 .../openldap/enmasse/DelegatedAdminMgrImpl.java |  381 --
 .../enmasse/DelegatedReviewMgrImpl.java         |  171 -
 .../openldap/enmasse/FortressInterceptor.java   |  176 -
 .../org/openldap/enmasse/FortressService.java   | 3416 --------------
 .../openldap/enmasse/FortressServiceImpl.java   | 4370 -----------------
 .../org/openldap/enmasse/PswdPolicyMgrImpl.java |  187 -
 .../org/openldap/enmasse/ReviewMgrImpl.java     |  674 ---
 .../enmasse/SecurityOutFaultInterceptor.java    |   67 -
 .../org/openldap/enmasse/fortress-javadoc.css   |   33 -
 .../java/org/openldap/enmasse/overview.html     |   93 -
 src/main/java/org/openldap/enmasse/package.html |   27 -
 src/main/resources/FortressRestServerRoles.xml  |   68 +
 src/main/resources/META-INF/context.xml         |   23 +-
 src/main/resources/applicationContext.xml       |   27 +-
 src/main/resources/ehcache.xml                  |   32 +-
 src/main/resources/fortress.properties          |   24 +-
 src/main/resources/log4j.xml                    |   21 +-
 src/main/webapp/WEB-INF/web.xml                 |   82 +-
 src/site/apt/README.apt                         |    2 +-
 .../apache/directory/fortress/rest/Client.java  |  688 +++
 .../apache/directory/fortress/rest/EmTest.java  |  445 ++
 src/test/java/org/openldap/enmasse/Client.java  |  683 ---
 src/test/java/org/openldap/enmasse/EmTest.java  |  439 --
 src/test/resources/addEmRole1.xml               |   32 +-
 src/test/resources/addEmRole2Ascendent.xml      |   32 +-
 src/test/resources/addEmTestObj1.xml            |   34 +-
 src/test/resources/addEmTestPermission.xml      |   34 +-
 src/test/resources/addEmUser1.xml               |   32 +-
 src/test/resources/addPermGrant1.xml            |   32 +-
 src/test/resources/assignEmUser1.xml            |   32 +-
 src/test/resources/createSession.xml            |   32 +-
 src/test/resources/delEmRole2.xml               |   32 +-
 src/test/resources/delEmUser1.xml               |   32 +-
 src/test/resources/emRoleDelInheritance.xml     |   32 +-
 src/test/resources/emTestAuthN.xml              |   32 +-
 src/test/resources/emTestCheckAccess.xml        |   34 +-
 src/test/resources/emTestOrg1.xml               |   32 +-
 src/test/resources/emTestPermOrg1.xml           |   32 +-
 66 files changed, 13499 insertions(+), 13054 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/blob/99852b55/ENMASSE-SUBMISSION-OPENLDAP.txt
----------------------------------------------------------------------
diff --git a/ENMASSE-SUBMISSION-OPENLDAP.txt b/ENMASSE-SUBMISSION-OPENLDAP.txt
deleted file mode 100755
index ae4680a..0000000
--- a/ENMASSE-SUBMISSION-OPENLDAP.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-Hello,
-
-We have created a new application, called EnMasse.  
-
-EnMasse is a web application that implements RESTful Web services to interface with
-Fortress/OpenLDAP. EnMasse was built using established Open Source technologies including
-Apache CXF (web services stack), Spring Framework (glue), Maven (dependencies) and JAXB (data
-binding layer) and runs inside any reasonably compliant Java Servlets container. EnMasse’s service
-access decisions are made using declarative Java EE and Spring security policy hooks that are wired to
-connect back to the Fortress RBAC component itself.
- 
-This product has not been published and we would like to release it as one of
-the products under OpenLDAP family of products. 
-
-What we would like from OpenLDAP foundation is the following:
-
-1. Separate GIT project called EnMasse.
-2. Mailing list for developers and users to communicate with project team.
-3. Issue tracking for EnMasse project.
-4. Project page for overview and how to find out more information.
-
-I have uploaded one package, entitled enmasse-openldap-submission.zip to our FTP server that contains the source, documentation and other items for you to look at.
-host: joshuatreesoftware.us
-user: jtreeguest
-pw: Guest123
-
-Everything under the target folder contain generated project artifacts including deployable web archive (war) and javadoc and will not be checked into GIT.
-The source is located /src folder in the package.
-
-Statement of origin for submitted works:
-
-The contributed EnMasse works described above were provided by JoshuaTree Software, LLC and referenced in this ITS were created by JoshuaTree Software, LLC, 
-who is the exclusive owner of the contributed works.  The contributed works are made available as indicated in the copyright and license statements attached to the work.
-
-Sincerely,
-
-Shawn McKinney
-Principal, JoshuaTree Software, LLC

http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/blob/99852b55/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
deleted file mode 100755
index 6295703..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,47 +0,0 @@
-The OpenLDAP Public License
-  Version 2.8, 17 August 2003
-
-Redistribution and use of this software and associated documentation
-("Software"), with or without modification, are permitted provided
-that the following conditions are met:
-
-1. Redistributions in source form must retain copyright statements
-   and notices,
-
-2. Redistributions in binary form must reproduce applicable copyright
-   statements and notices, this list of conditions, and the following
-   disclaimer in the documentation and/or other materials provided
-   with the distribution, and
-
-3. Redistributions must contain a verbatim copy of this document.
-
-The OpenLDAP Foundation may revise this license from time to time.
-Each revision is distinguished by a version number.  You may use
-this Software under terms of this license revision or under the
-terms of any subsequent revision of the license.
-
-THIS SOFTWARE IS PROVIDED BY THE OPENLDAP FOUNDATION AND ITS
-CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT
-SHALL THE OPENLDAP FOUNDATION, ITS CONTRIBUTORS, OR THE AUTHOR(S)
-OR OWNER(S) OF THE SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-The names of the authors and copyright holders must not be used in
-advertising or otherwise to promote the sale, use or other dealing
-in this Software without specific, written prior permission.  Title
-to copyright in this Software shall at all times remain with copyright
-holders.
-
-OpenLDAP is a registered trademark of the OpenLDAP Foundation.
-
-Copyright 1999-2003 The OpenLDAP Foundation, Redwood City,
-California, USA.  All Rights Reserved.  Permission to copy and
-distribute verbatim copies of this document is granted.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/blob/99852b55/LICENSE.ttx
----------------------------------------------------------------------
diff --git a/LICENSE.ttx b/LICENSE.ttx
new file mode 100755
index 0000000..6512b11
--- /dev/null
+++ b/LICENSE.ttx
@@ -0,0 +1,176 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+      
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+          
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/blob/99852b55/NOTICE.txt
----------------------------------------------------------------------
diff --git a/NOTICE.txt b/NOTICE.txt
index 1132c9c..46dc66a 100755
--- a/NOTICE.txt
+++ b/NOTICE.txt
@@ -1,18 +1,32 @@
-Fortress EnMasse Web Application
-Copyright (c) 2011-2014 JoshuaTree.  All rights reserved.
+#
+#   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.
+#
+Apache Directory Fortress Web
 
-This product distribution source code was developed by JoshuaTree (http://jts.us/).
+The purpose of this NOTICE.txt file is to include notices that are required by the copyright owner and their license. Some of the accompanying products have an attribution requirement, so see below. Other accompanying products do not require attribution, so are not listed.
 
-The purpose of this NOTICE.txt file is to include notices that are required by the copyright owner and their license. Some of the accompanying products have an attribution requirement, so see below. Other accompanying products do not require attribution, so are not listed. 
-
-This product includes open source software developed by the following:
+This product includes software developed by:
 
 1. The Apache Software Foundation (http://www.apache.org/)
-2. UnBoundID Corp (http://www.unboundid.com/)
-3. The Eigenbase Project (http://www.eigenbase.org/)
-4. JUnit.org (http://www.junit.org/)
-5. The Java Community Process (http://www.jcp.org/)
-6. SLF4J (http://www.slf4j.org/)
-7. Terracotta (http://www.terracotta.org/TPL)
-8. Spring (http://www.springsource.org/)
-9. AspectJ (http://www.eclipse.org/aspectj/)
+2. The Eigenbase Project (http://www.eigenbase.org/)
+3. JUnit.org (http://www.junit.org/)
+4. The Java Community Process (http://www.jcp.org/)
+5. SLF4J (http://www.slf4j.org/)
+6. Terracotta (http://www.terracotta.org/TPL)
+7. Spring (http://www.springsource.org/)
+8. AspectJ (http://www.eclipse.org/aspectj/)

http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/blob/99852b55/README.txt
----------------------------------------------------------------------
diff --git a/README.txt b/README.txt
index 7af24d2..6bab8d0 100755
--- a/README.txt
+++ b/README.txt
@@ -1,16 +1,22 @@
 #
-# This work is part of OpenLDAP Software <http://www.openldap.org/>.
+#   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
 #
-# Copyright 1998-2014 The OpenLDAP Foundation.
-# All rights reserved.
+#     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.
 #
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted only as authorized by the OpenLDAP
-# Public License.
 #
-# A copy of this license is available in the file LICENSE in the
-# top-level directory of the distribution or, alternatively, at
-# <http://www.OpenLDAP.org/license.html>.
 #
 # Fortress slapd.conf default settings.
 # Note: Directives that begin with '@' are substitution parms for Fortress' build.xml 'init-slapd' target.
@@ -173,15 +179,15 @@ http.host=localhost
 http.port=80
 
 # These will override default and enable client to call REST implementations:
-reviewmgr.implementation=org.openldap.fortress.rest.ReviewMgrRestImpl
-adminmgr.implementation=org.openldap.fortress.rest.AdminMgrRestImpl
-accessmgr.implementation=org.openldap.fortress.rest.AccessMgrRestImpl
-delegated.adminmgr.implementation=org.openldap.fortress.rest.DelegatedAdminMgrRestImpl
-delegated.reviewmgr.implementation=org.openldap.fortress.rest.DelegatedReviewMgrRestImpl
-policymgr.implementation=org.openldap.fortress.rest.PswdPolicyMgrRestImpl
-delegated.accessmgr.implementation=org.openldap.fortress.rest.DelegatedAccessMgrRestImpl
-auditmgr.implementation=org.openldap.fortress.rest.AuditMgrRestImpl
-configmgr.implementation=org.openldap.fortress.rest.ConfigMgrRestImpl
+reviewmgr.implementation=org.apache.directory.fortress.core.rest.ReviewMgrRestImpl
+adminmgr.implementation=org.apache.directory.fortress.core.rest.AdminMgrRestImpl
+accessmgr.implementation=org.apache.directory.fortress.core.rest.AccessMgrRestImpl
+delegated.adminmgr.implementation=org.apache.directory.fortress.core.rest.DelegatedAdminMgrRestImpl
+delegated.reviewmgr.implementation=org.apache.directory.fortress.core.rest.DelegatedReviewMgrRestImpl
+policymgr.implementation=org.apache.directory.fortress.core.rest.PswdPolicyMgrRestImpl
+delegated.accessmgr.implementation=org.apache.directory.fortress.core.rest.DelegatedAccessMgrRestImpl
+auditmgr.implementation=org.apache.directory.fortress.core.rest.AuditMgrRestImpl
+configmgr.implementation=org.apache.directory.fortress.core.rest.ConfigMgrRestImpl
 
 ___________________________________________________________________________________
 ###################################################################################

http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/blob/99852b55/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c425ca4..6c4a11f 100755
--- a/pom.xml
+++ b/pom.xml
@@ -1,53 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
-  ~ This work is part of OpenLDAP Software <http://www.openldap.org/>.
-  ~
-  ~ Copyright 1998-2014 The OpenLDAP Foundation.
-  ~ All rights reserved.
-  ~
-  ~ Redistribution and use in source and binary forms, with or without
-  ~ modification, are permitted only as authorized by the OpenLDAP
-  ~ Public License.
-  ~
-  ~ A copy of this license is available in the file LICENSE in the
-  ~ top-level directory of the distribution or, alternatively, at
-  ~ <http://www.OpenLDAP.org/license.html>.
-  -->
+   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.
+-->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
    http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
-    <groupId>org.openldap</groupId>
-    <artifactId>enmasse</artifactId>
+    <groupId>org.apache.directory</groupId>
+    <artifactId>fortress-rest</artifactId>
     <packaging>war</packaging>
-    <version>1.0-RC39</version>
-    <name>Fortress EnMasse</name>
-    <url>http://www.openldap.org/fortress/</url>
-    <description>EnMasse is a Web application that provides a RESTful implementation of Fortress' ANSI RBAC INCITS 359 engine.</description>
+    <version>1.0-RC40</version>
+    <name>Apache Fortress Web</name>
+    <url>http://directory.apache.org/foress/</url>
+    <description>Fortress Rest provides a RESTful implementation of Fortress' ANSI RBAC INCITS 359 engine</description>
     <licenses>
         <license>
-            <name>OpenLDAP Public License</name>
-            <url>http://www.OpenLDAP.org/license.html</url>
-            <distribution>repo</distribution>
+            <name>Apache License 2.0</name>
+            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
         </license>
     </licenses>
 
     <scm>
-        <url>http://www.openldap.org/software/repo/openldap-fortress-enmasse.git/</url>
-        <connection>git://git.openldap.org/openldap-fortress-enmasse.git</connection>
+        <connection>scm:git:http://git-wip-us.apache.org/repos/asf/directory-fortress-rest.git</connection>
+        <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/directory-fortress-rest.git
+        </developerConnection>
+        <tag>HEAD</tag>
     </scm>
 
+    <issueManagement>
+        <system>jira</system>
+        <url>https://issues.apache.org/jira/browse/DIRFORTRESS</url>
+    </issueManagement>
+
+    <!-- ====================================================== -->
+    <!-- The list of current developers                        -->
+    <!-- ====================================================== -->
+    <developers>
+        <developer>
+            <id>smckinney</id>
+            <name>Shawn McKinney</name>
+            <email>smckinney@apache.org</email>
+        </developer>
+    </developers>
+
     <parent>
         <groupId>org.sonatype.oss</groupId>
         <artifactId>oss-parent</artifactId>
         <version>7</version>
     </parent>
 
-    <issueManagement>
-        <system>EnMasse JIRA</system>
-        <url>https://fortress.atlassian.net/browse/EN/</url>
-    </issueManagement>
-
     <mailingLists>
         <mailingList>
             <name>openldap-fortress -- OpenLDAP Fortress Discussion list</name>
@@ -56,24 +73,15 @@
         </mailingList>
     </mailingLists>
 
-    <developers>
-        <developer>
-            <id>smckinney</id>
-            <name>Shawn McKinney</name>
-            <email>smckinney@symas.com</email>
-            <roles>
-                <role>Developer</role>
-            </roles>
-            <organization>jts.us</organization>
-            <timezone>-5</timezone>
-        </developer>
-    </developers>
-
     <properties>
+        <title>${project.name} ${project.version}</title>
+
         <!-- leave this hardcoded, else get cyclic version error from maven -->
-        <version>1.0-RC39</version>
+<!--        <version>1.0-RC39</version>-->
         <spring.security.version>3.1.4.RELEASE</spring.security.version>
         <spring.version>3.0.4.RELEASE</spring.version>
+        <version.log4j>1.2.17</version.log4j>
+        <version.slf4j.log4j12>1.7.7</version.slf4j.log4j12>
         <java.version>1.7</java.version>
         <javadoc.version>2.9.1</javadoc.version>
         <servlet-api.version>2.5.0</servlet-api.version>
@@ -82,25 +90,37 @@
         <base.dir>.</base.dir>
         <src.java.dir>${base.dir}/src/main/java</src.java.dir>
         <!--cxf.surefire.fork.mode>pertest</cxf.surefire.fork.mode-->
-        <test>org.openldap.enmasse.EmTest</test>
+        <test>org.apache.directory.fortress.rest.EmTest</test>
         <javadoc.stylesheet>${basedir}/src/main/java/org/openldap/enmasse/fortress-javadoc.css</javadoc.stylesheet>
         <title>${name} ${version}</title>
         <skipTests>true</skipTests>
     </properties>
 
     <dependencies>
-        <!-- Fortress -->
+        <!-- Fortress Realm pulls in Fortress Core for RBAC 'CRUD' & policy enforcement apis. -->
         <dependency>
-            <groupId>org.openldap</groupId>
-            <artifactId>sentry</artifactId>
-            <version>1.0-RC39</version>
+            <groupId>org.apache.directory</groupId>
+            <artifactId>fortress-realm-impl</artifactId>
+            <version>${project.version}</version>
         </dependency>
+
         <!-- EnMasse Dependencies -->
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-bundle</artifactId>
             <version>2.5.0</version>
         </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>${version.log4j}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>${version.slf4j.log4j12}</version>
+        </dependency>
 
         <!-- Spring Dependencies -->
         <dependency>
@@ -186,7 +206,8 @@
     </dependencies>
 
     <build>
-        <finalName>enmasse-${version}</finalName>
+        <finalName>${artifactId}-${version}</finalName>
+<!--        <finalName>enmasse-${version}</finalName>-->
         <plugins>
 
             <plugin>
@@ -265,7 +286,8 @@
                     <warFile>target/${project.artifactId}.war</warFile>
                     <server>local-tomcat</server>
                     <url>http://localhost:8080/manager/html</url>
-                    <path>/enmasse-${version}</path>
+                    <path>/${artifactId}-${version}</path>
+<!--                    <path>/enmasse-${version}</path>-->
                     <!-- Warning the tomcat manager creds here are for deploying into a demo environment only. -->
                     <username>tcmanager</username>
                     <password>m@nager123</password>
@@ -280,7 +302,7 @@
                     <stylesheet>java</stylesheet>
                     <bottom>&lt;small&gt;Copyright &amp;copy; 1998-2014 The OpenLDAP Foundation. All Rights Reserved.
                         Generated ${maven.build.timestamp}.&lt;/small&gt;</bottom>
-                    <overview>src/main/java/org/openldap/enmasse/overview.html</overview>
+                    <overview>src/main/java/org/apache/directory/fortress/rest/overview.html</overview>
                     <version>true</version>
                     <author>true</author>
                     <doctitle>${title}</doctitle>
@@ -366,6 +388,61 @@
                 </executions>
             </plugin>
 
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>1.7</version>
+                <executions>
+                    <execution>
+                        <phase>test</phase>
+                        <configuration>
+                            <target name="fortress-load"
+                                    unless="noload"
+                                    description="Loads fortress rest rbac policy into ldap">
+                                <echo message="###############  Run Fortress Ant script to load policy  ###############"/>
+                                <java
+                                        classname="org.apache.tools.ant.launch.Launcher"
+                                        fork="true"
+                                        failonerror="true"
+                                        dir="${basedir}"
+                                        timeout="4000000"
+                                        taskname="startAnt">
+                                    <classpath>
+                                        <pathelement location="./src/main/resources"/>
+                                        <pathelement location="${org.apache.ant:ant-launcher:jar}"/>
+                                        <pathelement location="${org.apache.ant:ant:jar}"/>
+                                        <pathelement location="${org.apache.directory:fortress-core:jar}"/>
+                                        <pathelement location="${org.openldap:accelerator-api:jar}"/>
+                                        <pathelement location="${org.openldap:accelerator-impl:jar}"/>
+                                        <pathelement location="${log4j:log4j:jar}"/>
+                                        <pathelement location="${org.apache.directory.api:api-all:jar}"/>
+                                        <pathelement location="${org.apache.mina:mina-core:jar}"/>
+                                        <pathelement location="${org.jgrapht:jgrapht-jdk1.5:jar}"/>
+                                        <pathelement location="${org.jasypt:jasypt:jar}"/>
+                                        <pathelement location="${commons-configuration:commons-configuration:jar}"/>
+                                        <pathelement location="${commons-lang:commons-lang:jar}"/>
+                                        <pathelement location="${commons-collections:commons-collections:jar}"/>
+                                        <pathelement location="${commons-logging:commons-logging:jar}"/>
+                                        <pathelement location="${commons-io:commons-io:jar}"/>
+                                        <pathelement location="${commons-pool:commons-pool:jar}"/>
+                                        <pathelement location="${net.sf.ehcache:ehcache-core:jar}"/>
+                                        <pathelement location="${org.slf4j:slf4j-api:jar}"/>
+                                        <pathelement location="${org.slf4j:slf4j-log4j12:jar}"/>
+                                        <pathelement location="${antlr:antlr:jar}"/>
+                                    </classpath>
+                                    <sysproperty key="version" value="${project.version}"/>
+                                    <sysproperty key="tenant" value="HOME"/>
+                                    <arg value="-buildfile"/>
+                                    <arg file="./src/main/resources/FortressRestServerRoles.xml"/>
+                                </java>
+                            </target>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
         </plugins>
     </build>
 

http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/blob/99852b55/src/main/assembly/distsrc.xml
----------------------------------------------------------------------
diff --git a/src/main/assembly/distsrc.xml b/src/main/assembly/distsrc.xml
index be44303..715961d 100644
--- a/src/main/assembly/distsrc.xml
+++ b/src/main/assembly/distsrc.xml
@@ -1,18 +1,22 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  ~ This work is part of OpenLDAP Software <http://www.openldap.org/>.
-  ~
-  ~ Copyright 1998-2014 The OpenLDAP Foundation.
-  ~ All rights reserved.
-  ~
-  ~ Redistribution and use in source and binary forms, with or without
-  ~ modification, are permitted only as authorized by the OpenLDAP
-  ~ Public License.
-  ~
-  ~ A copy of this license is available in the file LICENSE in the
-  ~ top-level directory of the distribution or, alternatively, at
-  ~ <http://www.OpenLDAP.org/license.html>.
-  -->
+   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.
+-->
 
 <assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/xsd/assembly-1.1.1.xsd">
@@ -23,9 +27,6 @@
     <fileSets>
         <fileSet>
             <directory>.</directory>
-            <!--<outputDirectory>.</outputDirectory>-->
-            <!--<includeBaseDirectory>false</includeBaseDirectory>-->
-            <!--<baseDirectory>enmasse</baseDirectory>-->
             <includes>
                 <include>pom.xml</include>
                 <include>README.txt</include>

http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/blob/99852b55/src/main/java/org/apache/directory/fortress/rest/AccessMgrImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/rest/AccessMgrImpl.java b/src/main/java/org/apache/directory/fortress/rest/AccessMgrImpl.java
new file mode 100644
index 0000000..98ab26f
--- /dev/null
+++ b/src/main/java/org/apache/directory/fortress/rest/AccessMgrImpl.java
@@ -0,0 +1,282 @@
+/*
+ *   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.rest;
+
+import org.apache.directory.fortress.core.AccessMgr;
+import org.apache.directory.fortress.core.AccessMgrFactory;
+import org.apache.directory.fortress.core.SecurityException;
+import org.apache.directory.fortress.core.rbac.Permission;
+import org.apache.directory.fortress.core.rbac.Session;
+import org.apache.directory.fortress.core.rbac.User;
+import org.apache.directory.fortress.core.rbac.UserRole;
+import org.apache.directory.fortress.core.rest.FortRequest;
+import org.apache.directory.fortress.core.rest.FortResponse;
+import org.apache.log4j.Logger;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Utility for EnMasse Server.  This class is thread safe.
+ *
+ * @author Shawn McKinney
+ */
+class AccessMgrImpl
+{
+    private static final String CLS_NM = AccessMgrImpl.class.getName();
+    private static final Logger log = Logger.getLogger(CLS_NM);
+
+    /**
+     * ************************************************************************************************************************************
+     * BEGIN ACCESSMGR
+     * **************************************************************************************************************************************
+     */
+
+    FortResponse authenticate(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            User inUser = (User) request.getEntity();
+            Session outSession = accessMgr.authenticate(inUser.getUserId(), inUser.getPassword());
+            response.setSession(outSession);
+            response.setErrorCode(0);
+        }
+        catch (org.apache.directory.fortress.core.SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse createSession(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            User inUser = (User) request.getEntity();
+            Session outSession = accessMgr.createSession(inUser, false);
+            response.setSession(outSession);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse createSessionTrusted(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            User inUser = (User) request.getEntity();
+            Session outSession = accessMgr.createSession(inUser, true);
+            response.setSession(outSession);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse checkAccess(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            Permission perm = (Permission)request.getEntity();
+            perm.setAdmin(false);
+            Session session = request.getSession();
+            boolean result = accessMgr.checkAccess(session, perm);
+            response.setSession(session);
+            response.setAuthorized(result);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse sessionPermissions(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            Session session = request.getSession();
+            List<Permission> perms = accessMgr.sessionPermissions(session);
+            response.setSession(session);
+            response.setEntities(perms);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse sessionRoles(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            Session session = request.getSession();
+            List<UserRole> roles = accessMgr.sessionRoles(session);
+            response.setEntities(roles);
+            response.setSession(session);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse authorizedSessionRoles(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            Session session = request.getSession();
+            Set<String> roles = accessMgr.authorizedRoles(session);
+            response.setValueSet(roles);
+            response.setSession(session);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse addActiveRole(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            UserRole uRole = (UserRole)request.getEntity();
+            Session session = request.getSession();
+            accessMgr.addActiveRole(session, uRole);
+            response.setSession(session);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse dropActiveRole(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            UserRole uRole = (UserRole)request.getEntity();
+            Session session = request.getSession();
+            accessMgr.dropActiveRole(session, uRole);
+            response.setSession(session);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse getUserId(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            Session session = request.getSession();
+            String userId = accessMgr.getUserId(session);
+            User outUser = new User(userId);
+            response.setSession(session);
+            response.setEntity(outUser);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse getUser(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            Session session = request.getSession();
+            User outUser = accessMgr.getUser(session);
+            response.setSession(session);
+            response.setEntity(outUser);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/blob/99852b55/src/main/java/org/apache/directory/fortress/rest/AdminMgrImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/rest/AdminMgrImpl.java b/src/main/java/org/apache/directory/fortress/rest/AdminMgrImpl.java
new file mode 100644
index 0000000..c12bb59
--- /dev/null
+++ b/src/main/java/org/apache/directory/fortress/rest/AdminMgrImpl.java
@@ -0,0 +1,991 @@
+/*
+ *   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.rest;
+
+import org.apache.directory.fortress.core.AdminMgr;
+import org.apache.directory.fortress.core.AdminMgrFactory;
+import org.apache.directory.fortress.core.DelAdminMgr;
+import org.apache.directory.fortress.core.DelAdminMgrFactory;
+import org.apache.directory.fortress.core.ReviewMgr;
+import org.apache.directory.fortress.core.ReviewMgrFactory;
+import org.apache.directory.fortress.core.SecurityException;
+import org.apache.directory.fortress.core.rbac.AdminRole;
+import org.apache.directory.fortress.core.rbac.PermGrant;
+import org.apache.directory.fortress.core.rbac.PermObj;
+import org.apache.directory.fortress.core.rbac.Permission;
+import org.apache.directory.fortress.core.rbac.Role;
+import org.apache.directory.fortress.core.rbac.RoleRelationship;
+import org.apache.directory.fortress.core.rbac.SDSet;
+import org.apache.directory.fortress.core.rbac.User;
+import org.apache.directory.fortress.core.rbac.UserRole;
+import org.apache.directory.fortress.core.rest.FortRequest;
+import org.apache.directory.fortress.core.rest.FortResponse;
+import org.apache.log4j.Logger;
+
+/**
+ * Utility for EnMasse Server.  This class is thread safe.
+ *
+ * @author Shawn McKinney
+ */
+class AdminMgrImpl
+{
+    private static final String CLS_NM = AdminMgrImpl.class.getName();
+    private static final Logger log = Logger.getLogger(CLS_NM);
+
+    FortResponse addUser(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            User inUser = (User) request.getEntity();
+            User outUser = adminMgr.addUser(inUser);
+            response.setEntity(outUser);
+            response.setErrorCode(0);
+        }
+        catch (org.apache.directory.fortress.core.SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse deleteUser(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            User inUser = (User) request.getEntity();
+            adminMgr.deleteUser(inUser);
+            response.setErrorCode(0);
+            response.setEntity(inUser);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse disableUser(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            User inUser = (User) request.getEntity();
+            adminMgr.disableUser(inUser);
+            response.setErrorCode(0);
+            response.setEntity(inUser);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse updateUser(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            User inUser = (User) request.getEntity();
+            User outUser = adminMgr.updateUser(inUser);
+            response.setEntity(outUser);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse changePassword(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            User inUser = (User) request.getEntity();
+            adminMgr.changePassword(inUser, inUser.getNewPassword());
+            ReviewMgr reviewMgr = ReviewMgrFactory.createInstance(request.getContextId());
+            User outUser = reviewMgr.readUser(inUser);
+            response.setEntity(outUser);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse lockUserAccount(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            User inUser = (User) request.getEntity();
+            adminMgr.lockUserAccount(inUser);
+            ReviewMgr reviewMgr = ReviewMgrFactory.createInstance(request.getContextId());
+            User outUser = reviewMgr.readUser(inUser);
+            response.setEntity(outUser);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse unlockUserAccount(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            User inUser = (User) request.getEntity();
+            adminMgr.unlockUserAccount(inUser);
+            ReviewMgr reviewMgr = ReviewMgrFactory.createInstance(request.getContextId());
+            User outUser = reviewMgr.readUser(inUser);
+            response.setEntity(outUser);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse resetPassword(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            User inUser = (User) request.getEntity();
+            adminMgr.resetPassword(inUser, inUser.getNewPassword());
+            ReviewMgr reviewMgr = ReviewMgrFactory.createInstance(request.getContextId());
+            User outUser = reviewMgr.readUser(inUser);
+            response.setEntity(outUser);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse addRole(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            Role inRole = (Role) request.getEntity();
+            Role outRole = adminMgr.addRole(inRole);
+            response.setEntity(outRole);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse deleteRole(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            Role inRole = (Role) request.getEntity();
+            adminMgr.deleteRole(inRole);
+            response.setEntity(inRole);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse updateRole(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            Role inRole = (Role) request.getEntity();
+            Role outRole = adminMgr.updateRole(inRole);
+            response.setEntity(outRole);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse assignUser(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            UserRole inRole = (UserRole) request.getEntity();
+            adminMgr.assignUser(inRole);
+            response.setEntity(inRole);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse deassignUser(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            UserRole inRole = (UserRole) request.getEntity();
+            adminMgr.deassignUser(inRole);
+            response.setEntity(inRole);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse addPermission(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            Permission inPerm = (Permission) request.getEntity();
+            Permission outPerm = adminMgr.addPermission(inPerm);
+            response.setEntity(outPerm);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse updatePermission(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            Permission inPerm = (Permission) request.getEntity();
+            Permission outPerm = adminMgr.updatePermission(inPerm);
+            response.setEntity(outPerm);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse deletePermission(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            Permission inPerm = (Permission) request.getEntity();
+            adminMgr.deletePermission(inPerm);
+            response.setEntity(inPerm);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse addPermObj(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            PermObj inObj = (PermObj) request.getEntity();
+            PermObj outObj = adminMgr.addPermObj(inObj);
+            response.setEntity(outObj);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse updatePermObj(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            PermObj inObj = (PermObj) request.getEntity();
+            PermObj outObj = adminMgr.updatePermObj(inObj);
+            response.setEntity(outObj);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse deletePermObj(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            PermObj inObj = (PermObj) request.getEntity();
+            adminMgr.deletePermObj(inObj);
+            response.setEntity(inObj);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    private void grantPerm(FortRequest request) throws SecurityException
+    {
+        PermGrant permGrant = (PermGrant) request.getEntity();
+        AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+        adminMgr.setAdmin(request.getSession());
+        Role role = new Role(permGrant.getRoleNm());
+        Permission perm = new Permission(permGrant.getObjName(), permGrant.getOpName(), permGrant.getObjId());
+        perm.setAdmin(false);
+        adminMgr.grantPermission(perm, role);
+    }
+
+    private void grantAdminPerm(FortRequest request) throws SecurityException
+    {
+        PermGrant permGrant = (PermGrant) request.getEntity();
+        DelAdminMgr delegatedAdminMgr = DelAdminMgrFactory.createInstance(request.getContextId());
+        delegatedAdminMgr.setAdmin(request.getSession());
+        AdminRole role = new AdminRole(permGrant.getRoleNm());
+        Permission perm = new Permission(permGrant.getObjName(), permGrant.getOpName(), permGrant.getObjId());
+        perm.setAdmin(true);
+        delegatedAdminMgr.grantPermission(perm, role);
+    }
+
+    private void revokePerm(FortRequest request) throws SecurityException
+    {
+        PermGrant permGrant = (PermGrant) request.getEntity();
+        AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+        adminMgr.setAdmin(request.getSession());
+        Role role = new Role(permGrant.getRoleNm());
+        Permission perm = new Permission(permGrant.getObjName(), permGrant.getOpName(), permGrant.getObjId());
+        perm.setAdmin(false);
+        adminMgr.revokePermission(perm, role);
+    }
+
+    private void revokeAdminPerm(FortRequest request) throws SecurityException
+    {
+        PermGrant permGrant = (PermGrant) request.getEntity();
+        DelAdminMgr delegatedAdminMgr = DelAdminMgrFactory.createInstance(request.getContextId());
+        delegatedAdminMgr.setAdmin(request.getSession());
+        AdminRole role = new AdminRole(permGrant.getRoleNm());
+        Permission perm = new Permission(permGrant.getObjName(), permGrant.getOpName(), permGrant.getObjId());
+        perm.setAdmin(true);
+        delegatedAdminMgr.revokePermission(perm, role);
+    }
+
+    private void grantUserPerm(FortRequest request) throws SecurityException
+    {
+        PermGrant permGrant = (PermGrant) request.getEntity();
+        AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+        adminMgr.setAdmin(request.getSession());
+        User user = new User(permGrant.getUserId());
+        Permission perm = new Permission(permGrant.getObjName(), permGrant.getOpName(), permGrant.getObjId());
+        perm.setAdmin(false);
+        adminMgr.grantPermission(perm, user);
+    }
+
+    private void grantAdminUserPerm(FortRequest request) throws SecurityException
+    {
+        PermGrant permGrant = (PermGrant) request.getEntity();
+        DelAdminMgr delegatedAdminMgr = DelAdminMgrFactory.createInstance(request.getContextId());
+        delegatedAdminMgr.setAdmin(request.getSession());
+        User user = new User(permGrant.getUserId());
+        Permission perm = new Permission(permGrant.getObjName(), permGrant.getOpName(), permGrant.getObjId());
+        perm.setAdmin(true);
+        delegatedAdminMgr.grantPermission(perm, user);
+    }
+
+    private void revokeUserPerm(FortRequest request) throws SecurityException
+    {
+        PermGrant permGrant = (PermGrant) request.getEntity();
+        AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+        adminMgr.setAdmin(request.getSession());
+        User user = new User(permGrant.getUserId());
+        Permission perm = new Permission(permGrant.getObjName(), permGrant.getOpName(), permGrant.getObjId());
+        perm.setAdmin(false);
+        adminMgr.revokePermission(perm, user);
+    }
+
+    private void revokeAdminUserPerm(FortRequest request) throws SecurityException
+    {
+        PermGrant permGrant = (PermGrant) request.getEntity();
+        DelAdminMgr delegatedAdminMgr = DelAdminMgrFactory.createInstance(request.getContextId());
+        delegatedAdminMgr.setAdmin(request.getSession());
+        User user = new User(permGrant.getUserId());
+        Permission perm = new Permission(permGrant.getObjName(), permGrant.getOpName(), permGrant.getObjId());
+        perm.setAdmin(true);
+        delegatedAdminMgr.revokePermission(perm, user);
+    }
+
+    FortResponse grant(FortRequest request, FortressServiceImpl fortressService)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            PermGrant permGrant = (PermGrant) request.getEntity();
+            if (permGrant.isAdmin())
+            {
+                grantAdminPerm(request);
+            }
+            else
+            {
+                grantPerm(request);
+            }
+            response.setEntity(permGrant);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse revoke(FortRequest request, FortressServiceImpl fortressService)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            PermGrant permGrant = (PermGrant) request.getEntity();
+            if (permGrant.isAdmin())
+            {
+                revokeAdminPerm(request);
+            }
+            else
+            {
+                revokePerm(request);
+            }
+            response.setEntity(permGrant);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse grantUser(FortRequest request, FortressServiceImpl fortressService)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            PermGrant permGrant = (PermGrant) request.getEntity();
+            if (permGrant.isAdmin())
+            {
+                grantAdminUserPerm(request);
+            }
+            else
+            {
+                grantUserPerm(request);
+            }
+            response.setEntity(permGrant);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse revokeUser(FortRequest request, FortressServiceImpl fortressService)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            PermGrant permGrant = (PermGrant) request.getEntity();
+            if (permGrant.isAdmin())
+            {
+                revokeAdminUserPerm(request);
+            }
+            else
+            {
+                revokeUserPerm(request);
+            }
+            response.setEntity(permGrant);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse addDescendant(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            RoleRelationship relationship = (RoleRelationship) request.getEntity();
+            adminMgr.addDescendant(relationship.getParent(), relationship.getChild());
+            response.setEntity(relationship);
+            response.setErrorCode(0);
+
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse addAscendant(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            RoleRelationship relationship = (RoleRelationship) request.getEntity();
+            adminMgr.addAscendant(relationship.getChild(), relationship.getParent());
+            response.setEntity(relationship);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse addInheritance(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            RoleRelationship relationship = (RoleRelationship) request.getEntity();
+            adminMgr.addInheritance(relationship.getParent(), relationship.getChild());
+            response.setEntity(relationship);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse deleteInheritance(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            RoleRelationship relationship = (RoleRelationship) request.getEntity();
+            adminMgr.deleteInheritance(relationship.getParent(), relationship.getChild());
+            response.setEntity(relationship);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse createSsdSet(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            SDSet inSet = (SDSet) request.getEntity();
+            SDSet outSet = adminMgr.createSsdSet(inSet);
+            response.setEntity(outSet);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse updateSsdSet(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            SDSet inSet = (SDSet) request.getEntity();
+            SDSet outSet = adminMgr.updateSsdSet(inSet);
+            response.setEntity(outSet);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse addSsdRoleMember(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            SDSet inSet = (SDSet) request.getEntity();
+            Role role = new Role(request.getValue());
+            SDSet outSet = adminMgr.addSsdRoleMember(inSet, role);
+            response.setEntity(outSet);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse deleteSsdRoleMember(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            SDSet inSet = (SDSet) request.getEntity();
+            Role role = new Role(request.getValue());
+            SDSet outSet = adminMgr.deleteSsdRoleMember(inSet, role);
+            response.setEntity(outSet);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse deleteSsdSet(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            SDSet inSet = (SDSet) request.getEntity();
+            SDSet outSet = adminMgr.deleteSsdSet(inSet);
+            response.setEntity(outSet);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse setSsdSetCardinality(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            SDSet inSet = (SDSet) request.getEntity();
+            SDSet outSet = adminMgr.setSsdSetCardinality(inSet, inSet.getCardinality());
+            response.setEntity(outSet);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse createDsdSet(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            SDSet inSet = (SDSet) request.getEntity();
+            SDSet outSet = adminMgr.createDsdSet(inSet);
+            response.setEntity(outSet);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse updateDsdSet(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            SDSet inSet = (SDSet) request.getEntity();
+            SDSet outSet = adminMgr.updateDsdSet(inSet);
+            response.setEntity(outSet);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse addDsdRoleMember(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            SDSet inSet = (SDSet) request.getEntity();
+            Role role = new Role(request.getValue());
+            SDSet outSet = adminMgr.addDsdRoleMember(inSet, role);
+            response.setEntity(outSet);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse deleteDsdRoleMember(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            SDSet inSet = (SDSet) request.getEntity();
+            Role role = new Role(request.getValue());
+            SDSet outSet = adminMgr.deleteDsdRoleMember(inSet, role);
+            response.setEntity(outSet);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse deleteDsdSet(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            SDSet inSet = (SDSet) request.getEntity();
+            SDSet outSet = adminMgr.deleteDsdSet(inSet);
+            response.setEntity(outSet);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+
+    FortResponse setDsdSetCardinality(FortRequest request)
+    {
+        FortResponse response = new FortResponse();
+        try
+        {
+            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
+            adminMgr.setAdmin(request.getSession());
+            SDSet inSet = (SDSet) request.getEntity();
+            SDSet outSet = adminMgr.setDsdSetCardinality(inSet, inSet.getCardinality());
+            response.setEntity(outSet);
+            response.setErrorCode(0);
+        }
+        catch (SecurityException se)
+        {
+            log.info(CLS_NM + " caught " + se);
+            response.setErrorCode(se.getErrorId());
+            response.setErrorMessage(se.getMessage());
+        }
+        return response;
+    }
+}
\ No newline at end of file


Mime
View raw message