directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject [2/6] directory-fortress-enmasse git commit: o Inherits from the AbstractImpl class o Added /* no qualifier */ for package protected methods o Called the createResponse() and createError() method o Formatting the code o Added some Javadoc
Date Mon, 24 Nov 2014 11:16:03 GMT
o Inherits from the AbstractImpl class
o Added /* no qualifier */ for  package protected methods
o Called the createResponse() and createError() method
o Formatting the code
o Added some Javadoc

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

Branch: refs/heads/master
Commit: 04e9383423b9ccf2079af76d242bde661d416709
Parents: c0cbc35
Author: Emmanuel L├ęcharny <elecharny@symas.com>
Authored: Sat Nov 22 10:09:58 2014 +0100
Committer: Emmanuel L├ęcharny <elecharny@symas.com>
Committed: Sat Nov 22 10:09:58 2014 +0100

----------------------------------------------------------------------
 .../directory/fortress/rest/AccessMgrImpl.java  |  283 ++---
 .../directory/fortress/rest/AdminMgrImpl.java   | 1039 +++++++++---------
 .../directory/fortress/rest/AuditMgrImpl.java   |  127 ++-
 .../directory/fortress/rest/ConfigMgrImpl.java  |  102 +-
 .../fortress/rest/DelegatedAccessMgrImpl.java   |  218 ++--
 5 files changed, 920 insertions(+), 849 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/blob/04e93834/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
index f651408..9763f56 100644
--- a/src/main/java/org/apache/directory/fortress/rest/AccessMgrImpl.java
+++ b/src/main/java/org/apache/directory/fortress/rest/AccessMgrImpl.java
@@ -21,6 +21,7 @@ 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.GlobalErrIds;
 import org.apache.directory.fortress.core.SecurityException;
 import org.apache.directory.fortress.core.rbac.Permission;
 import org.apache.directory.fortress.core.rbac.Session;
@@ -38,245 +39,267 @@ import java.util.Set;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-class AccessMgrImpl
+class AccessMgrImpl extends AbstractImpl
 {
-    private static final String CLS_NM = AccessMgrImpl.class.getName();
-    private static final Logger log = Logger.getLogger(CLS_NM);
+    /** A logger for this class */
+    private static final Logger LOG = Logger.getLogger( AccessMgrImpl.class.getName() );
+    
+    /** A flag for trusted sessions */
+    private static final boolean TRUSTED = true;
+    
+    /** A flag for untrusted sessions */
+    private static final boolean UNTRUSTED = false;
 
     /**
      * ************************************************************************************************************************************
      * BEGIN ACCESSMGR
      * **************************************************************************************************************************************
      */
-
-    FortResponse authenticate(FortRequest request)
+    /* No qualifier */ FortResponse authenticate( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+        
         try
         {
-            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            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);
+            Session outSession = accessMgr.authenticate( inUser.getUserId(), inUser.getPassword() );
+            response.setSession( outSession );
+            response.setErrorCode( GlobalErrIds.NO_ERROR );
         }
-        catch (org.apache.directory.fortress.core.SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, LOG, se );
         }
+        
         return response;
     }
 
-    FortResponse createSession(FortRequest request)
+    
+    /**
+     * Creates an untrusted session
+     * 
+     * @param request The request We want to create a session for
+     * @return The created response
+     */
+    /* no qualifier*/ 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;
+        return createSession( request, UNTRUSTED );
     }
 
-    FortResponse createSessionTrusted(FortRequest request)
+    
+    /**
+     * Creates a trusted session
+     * 
+     * @param request The request We want to create a session for
+     * @return The created response
+     */
+    /* no qualifier*/ FortResponse createSessionTrusted( FortRequest request )
+    {
+        return createSession( request, TRUSTED );
+    }
+
+    
+    /**
+     * Creates a session, trusted or untrested
+     * 
+     * @param request The request We want to create a session for
+     * @param trusted Is the session trusted or not
+     * @return The created response
+     */
+    private FortResponse createSession( FortRequest request, boolean trusted )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+        
         try
         {
-            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            AccessMgr accessMgr = AccessMgrFactory.createInstance( request.getContextId() );
             User inUser = (User) request.getEntity();
-            Session outSession = accessMgr.createSession(inUser, true);
-            response.setSession(outSession);
-            response.setErrorCode(0);
+            Session outSession = accessMgr.createSession( inUser, trusted );
+            response.setSession( outSession );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, LOG, se );
         }
+        
         return response;
     }
-
-    FortResponse checkAccess(FortRequest request)
+    
+    
+    /**
+     * Perform user RBAC authorization.
+     *
+     * @param request The {@link FortressRequest} we have to check
+     * @return a {@link FortressResponse} containing the response
+     */
+    /* no qualifier*/ FortResponse checkAccess( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+        
         try
         {
-            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            AccessMgr accessMgr = AccessMgrFactory.createInstance( request.getContextId() );
             Permission perm = (Permission)request.getEntity();
-            perm.setAdmin(false);
+            perm.setAdmin( false );
             Session session = request.getSession();
-            boolean result = accessMgr.checkAccess(session, perm);
-            response.setSession(session);
-            response.setAuthorized(result);
-            response.setErrorCode(0);
+            boolean result = accessMgr.checkAccess( session, perm );
+            response.setSession( session );
+            response.setAuthorized( result );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, LOG, se );
         }
+        
         return response;
     }
 
-    FortResponse sessionPermissions(FortRequest request)
+    
+    /* No qualifier */ FortResponse sessionPermissions( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+        
         try
         {
-            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            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);
+            List<Permission> perms = accessMgr.sessionPermissions( session );
+            response.setSession( session );
+            response.setEntities( perms );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, LOG, se );
         }
+        
         return response;
     }
 
-    FortResponse sessionRoles(FortRequest request)
+    
+    /* No qualifier */ FortResponse sessionRoles( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+        
         try
         {
-            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            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);
+            List<UserRole> roles = accessMgr.sessionRoles( session );
+            response.setEntities( roles );
+            response.setSession( session );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, LOG, se );
         }
+        
         return response;
     }
 
-    FortResponse authorizedSessionRoles(FortRequest request)
+    
+    /* No qualifier */ FortResponse authorizedSessionRoles( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+        
         try
         {
-            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            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);
+            Set<String> roles = accessMgr.authorizedRoles( session );
+            response.setValueSet( roles );
+            response.setSession( session );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, LOG, se );
         }
+        
         return response;
     }
+    
 
-    FortResponse addActiveRole(FortRequest request)
+    /* No qualifier */ FortResponse addActiveRole( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+        
         try
         {
-            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            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);
+            accessMgr.addActiveRole( session, uRole );
+            response.setSession( session );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, LOG, se );
         }
+        
         return response;
     }
 
-    FortResponse dropActiveRole(FortRequest request)
+    
+    /* No qualifier */ FortResponse dropActiveRole( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+        
         try
         {
-            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            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);
+            accessMgr.dropActiveRole( session, uRole );
+            response.setSession( session );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, LOG, se );
         }
+        
         return response;
     }
+    
 
-    FortResponse getUserId(FortRequest request)
+    /* No qualifier */ FortResponse getUserId( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+        
         try
         {
-            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            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);
+            String userId = accessMgr.getUserId( session );
+            User outUser = new User( userId );
+            response.setSession( session );
+            response.setEntity( outUser );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, LOG, se );
         }
+        
         return response;
     }
 
-    FortResponse getUser(FortRequest request)
+    
+    /* No qualifier */ FortResponse getUser( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+        
         try
         {
-            AccessMgr accessMgr = AccessMgrFactory.createInstance(request.getContextId());
+            AccessMgr accessMgr = AccessMgrFactory.createInstance( request.getContextId() );
             Session session = request.getSession();
-            User outUser = accessMgr.getUser(session);
-            response.setSession(session);
-            response.setEntity(outUser);
-            response.setErrorCode(0);
+            User outUser = accessMgr.getUser( session );
+            response.setSession( session );
+            response.setEntity( outUser );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, LOG, se );
         }
+        
         return response;
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/blob/04e93834/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
index 112e60a..a4c27bb 100644
--- a/src/main/java/org/apache/directory/fortress/rest/AdminMgrImpl.java
+++ b/src/main/java/org/apache/directory/fortress/rest/AdminMgrImpl.java
@@ -44,948 +44,997 @@ import org.apache.log4j.Logger;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-class AdminMgrImpl
+class AdminMgrImpl extends AbstractImpl
 {
-    private static final String CLS_NM = AdminMgrImpl.class.getName();
-    private static final Logger log = Logger.getLogger(CLS_NM);
+    /** A logger for this class */
+    private static final Logger log = Logger.getLogger( AdminMgrImpl.class.getName() );
 
-    FortResponse addUser(FortRequest request)
+    
+    /* No qualifier */ FortResponse addUser( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+        
         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);
+            AdminMgr adminMgr = AdminMgrFactory.createInstance( request.getContextId() );
+            adminMgr.setAdmin( request.getSession() );
+            User inUser = (User)request.getEntity();
+            User outUser = adminMgr.addUser( inUser );
+            response.setEntity( outUser );
         }
-        catch (org.apache.directory.fortress.core.SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse deleteUser(FortRequest request)
+    
+    /* No qualifier */ FortResponse deleteUser( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
         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);
+            AdminMgr adminMgr = AdminMgrFactory.createInstance( request.getContextId() );
+            adminMgr.setAdmin( request.getSession() );
+            User inUser = (User)request.getEntity();
+            adminMgr.deleteUser( inUser );
+            response.setEntity( inUser );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse disableUser(FortRequest request)
+    
+    /* No qualifier */ FortResponse disableUser( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
         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);
+            AdminMgr adminMgr = AdminMgrFactory.createInstance( request.getContextId() );
+            adminMgr.setAdmin( request.getSession() );
+            User inUser = (User)request.getEntity();
+            adminMgr.disableUser( inUser );
+            response.setEntity( inUser );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse updateUser(FortRequest request)
+    
+    /* No qualifier */ FortResponse updateUser( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            User outUser = adminMgr.updateUser( inUser );
+            response.setEntity( outUser );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse changePassword(FortRequest request)
+    
+    /* No qualifier */ FortResponse changePassword( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            ReviewMgr reviewMgr = ReviewMgrFactory.createInstance( request.getContextId() );
+            User outUser = reviewMgr.readUser( inUser );
+            response.setEntity( outUser );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse lockUserAccount(FortRequest request)
+    
+    /* No qualifier */ FortResponse lockUserAccount( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            adminMgr.lockUserAccount( inUser );
+            ReviewMgr reviewMgr = ReviewMgrFactory.createInstance( request.getContextId() );
+            User outUser = reviewMgr.readUser( inUser );
+            response.setEntity( outUser );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse unlockUserAccount(FortRequest request)
+    
+    /* No qualifier */ FortResponse unlockUserAccount( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            adminMgr.unlockUserAccount( inUser );
+            ReviewMgr reviewMgr = ReviewMgrFactory.createInstance( request.getContextId() );
+            User outUser = reviewMgr.readUser( inUser );
+            response.setEntity( outUser );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse resetPassword(FortRequest request)
+    
+    /* No qualifier */ FortResponse resetPassword( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            ReviewMgr reviewMgr = ReviewMgrFactory.createInstance( request.getContextId() );
+            User outUser = reviewMgr.readUser( inUser );
+            response.setEntity( outUser );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse addRole(FortRequest request)
+    
+    /* No qualifier */ FortResponse addRole( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            Role outRole = adminMgr.addRole( inRole );
+            response.setEntity( outRole );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
-
-    FortResponse deleteRole(FortRequest request)
+    
+    
+    /* No qualifier */ FortResponse deleteRole( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            AdminMgr adminMgr = AdminMgrFactory.createInstance( request.getContextId() );
+            adminMgr.setAdmin( request.getSession() );
             Role inRole = (Role) request.getEntity();
-            adminMgr.deleteRole(inRole);
-            response.setEntity(inRole);
-            response.setErrorCode(0);
+            adminMgr.deleteRole( inRole );
+            response.setEntity( inRole );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse updateRole(FortRequest request)
+    
+    /* No qualifier */ FortResponse updateRole( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            Role outRole = adminMgr.updateRole( inRole );
+            response.setEntity( outRole );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
-
-    FortResponse assignUser(FortRequest request)
+    
+    
+    /* No qualifier */ FortResponse assignUser( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            AdminMgr adminMgr = AdminMgrFactory.createInstance( request.getContextId() );
+            adminMgr.setAdmin( request.getSession() );
             UserRole inRole = (UserRole) request.getEntity();
-            adminMgr.assignUser(inRole);
-            response.setEntity(inRole);
-            response.setErrorCode(0);
+            adminMgr.assignUser( inRole );
+            response.setEntity( inRole );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse deassignUser(FortRequest request)
+    
+    /* No qualifier */ FortResponse deassignUser( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            AdminMgr adminMgr = AdminMgrFactory.createInstance( request.getContextId() );
+            adminMgr.setAdmin( request.getSession() );
             UserRole inRole = (UserRole) request.getEntity();
-            adminMgr.deassignUser(inRole);
-            response.setEntity(inRole);
-            response.setErrorCode(0);
+            adminMgr.deassignUser( inRole );
+            response.setEntity( inRole );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse addPermission(FortRequest request)
+    
+    /* No qualifier */ FortResponse addPermission( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            Permission outPerm = adminMgr.addPermission( inPerm );
+            response.setEntity( outPerm );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse updatePermission(FortRequest request)
+    
+    /* No qualifier */ FortResponse updatePermission( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            Permission outPerm = adminMgr.updatePermission( inPerm );
+            response.setEntity( outPerm );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse deletePermission(FortRequest request)
+    
+    /* No qualifier */ FortResponse deletePermission( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            AdminMgr adminMgr = AdminMgrFactory.createInstance( request.getContextId() );
+            adminMgr.setAdmin( request.getSession() );
             Permission inPerm = (Permission) request.getEntity();
-            adminMgr.deletePermission(inPerm);
-            response.setEntity(inPerm);
-            response.setErrorCode(0);
+            adminMgr.deletePermission( inPerm );
+            response.setEntity( inPerm );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse addPermObj(FortRequest request)
+    
+    /* No qualifier */ FortResponse addPermObj( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            PermObj outObj = adminMgr.addPermObj( inObj );
+            response.setEntity( outObj );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse updatePermObj(FortRequest request)
+    
+    /* No qualifier */ FortResponse updatePermObj( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            PermObj outObj = adminMgr.updatePermObj( inObj );
+            response.setEntity( outObj );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse deletePermObj(FortRequest request)
+    
+    /* No qualifier */ FortResponse deletePermObj( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            AdminMgr adminMgr = AdminMgrFactory.createInstance( request.getContextId() );
+            adminMgr.setAdmin( request.getSession() );
             PermObj inObj = (PermObj) request.getEntity();
-            adminMgr.deletePermObj(inObj);
-            response.setEntity(inObj);
-            response.setErrorCode(0);
+            adminMgr.deletePermObj( inObj );
+            response.setEntity( inObj );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    private void grantPerm(FortRequest request) throws SecurityException
+    
+    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);
+        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
+    
+    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);
+        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
+    
+    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);
+        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
+    
+    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);
+        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
+    
+    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);
+        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
+    
+    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);
+        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
+    
+    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);
+        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
+    
+    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);
+        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)
+    
+    /* No qualifier */ FortResponse grant(FortRequest request, FortressServiceImpl fortressService)
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
             PermGrant permGrant = (PermGrant) request.getEntity();
-            if (permGrant.isAdmin())
+        
+            if ( permGrant.isAdmin() )
             {
-                grantAdminPerm(request);
+                grantAdminPerm( request );
             }
             else
             {
-                grantPerm(request);
+                grantPerm( request );
             }
+            
             response.setEntity(permGrant);
-            response.setErrorCode(0);
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse revoke(FortRequest request, FortressServiceImpl fortressService)
+    
+    /* No qualifier */ FortResponse revoke(FortRequest request, FortressServiceImpl fortressService)
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
             PermGrant permGrant = (PermGrant) request.getEntity();
+            
             if (permGrant.isAdmin())
             {
-                revokeAdminPerm(request);
+                revokeAdminPerm( request );
             }
             else
             {
-                revokePerm(request);
+                revokePerm( request );
             }
-            response.setEntity(permGrant);
-            response.setErrorCode(0);
+            response.setEntity( permGrant );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse grantUser(FortRequest request, FortressServiceImpl fortressService)
+    
+    /* No qualifier */ FortResponse grantUser(FortRequest request, FortressServiceImpl fortressService)
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
             PermGrant permGrant = (PermGrant) request.getEntity();
-            if (permGrant.isAdmin())
+            
+            if ( permGrant.isAdmin() )
             {
-                grantAdminUserPerm(request);
+                grantAdminUserPerm( request );
             }
             else
             {
-                grantUserPerm(request);
+                grantUserPerm( request );
             }
-            response.setEntity(permGrant);
-            response.setErrorCode(0);
+            
+            response.setEntity( permGrant );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+
         return response;
     }
 
-    FortResponse revokeUser(FortRequest request, FortressServiceImpl fortressService)
+    
+    /* No qualifier */ FortResponse revokeUser(FortRequest request, FortressServiceImpl fortressService)
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
             PermGrant permGrant = (PermGrant) request.getEntity();
-            if (permGrant.isAdmin())
+            
+            if ( permGrant.isAdmin() )
             {
-                revokeAdminUserPerm(request);
+                revokeAdminUserPerm( request );
             }
             else
             {
-                revokeUserPerm(request);
+                revokeUserPerm( request );
             }
-            response.setEntity(permGrant);
-            response.setErrorCode(0);
+            
+            response.setEntity( permGrant );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse addDescendant(FortRequest request)
+    
+    /* No qualifier */ FortResponse addDescendant( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            response.setEntity( relationship );
 
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse addAscendant(FortRequest request)
+    
+    /* No qualifier */ FortResponse addAscendant( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            response.setEntity( relationship );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+
         return response;
     }
 
-    FortResponse addInheritance(FortRequest request)
+    
+    /* No qualifier */ FortResponse addInheritance( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            response.setEntity( relationship );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+
         return response;
     }
 
-    FortResponse deleteInheritance(FortRequest request)
+    
+    /* No qualifier */ FortResponse deleteInheritance( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            adminMgr.deleteInheritance( relationship.getParent(), relationship.getChild() );
+            response.setEntity( relationship );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+
         return response;
     }
 
-    FortResponse createSsdSet(FortRequest request)
+    
+    /* No qualifier */ FortResponse createSsdSet( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            SDSet outSet = adminMgr.createSsdSet( inSet );
+            response.setEntity( outSet );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+
         return response;
     }
 
-    FortResponse updateSsdSet(FortRequest request)
+    
+    /* No qualifier */ FortResponse updateSsdSet( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            SDSet outSet = adminMgr.updateSsdSet( inSet );
+            response.setEntity( outSet );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse addSsdRoleMember(FortRequest request)
+    
+    /* No qualifier */ FortResponse addSsdRoleMember( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            Role role = new Role( request.getValue() );
+            SDSet outSet = adminMgr.addSsdRoleMember( inSet, role );
+            response.setEntity( outSet );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+
         return response;
     }
 
-    FortResponse deleteSsdRoleMember(FortRequest request)
+    
+    /* No qualifier */ FortResponse deleteSsdRoleMember( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            Role role = new Role( request.getValue() );
+            SDSet outSet = adminMgr.deleteSsdRoleMember( inSet, role );
             response.setEntity(outSet);
-            response.setErrorCode(0);
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+
         return response;
     }
 
-    FortResponse deleteSsdSet(FortRequest request)
+    
+    /* No qualifier */ FortResponse deleteSsdSet( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            SDSet outSet = adminMgr.deleteSsdSet( inSet );
+            response.setEntity( outSet );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+
         return response;
     }
 
-    FortResponse setSsdSetCardinality(FortRequest request)
+    
+    /* No qualifier */ FortResponse setSsdSetCardinality( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            SDSet outSet = adminMgr.setSsdSetCardinality( inSet, inSet.getCardinality() );
+            response.setEntity( outSet );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse createDsdSet(FortRequest request)
+    
+    /* No qualifier */ FortResponse createDsdSet( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            SDSet outSet = adminMgr.createDsdSet( inSet );
+            response.setEntity( outSet );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse updateDsdSet(FortRequest request)
+    
+    /* No qualifier */ FortResponse updateDsdSet( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            SDSet outSet = adminMgr.updateDsdSet( inSet );
+            response.setEntity( outSet );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+
         return response;
     }
 
-    FortResponse addDsdRoleMember(FortRequest request)
+    
+    /* No qualifier */ FortResponse addDsdRoleMember( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            SDSet outSet = adminMgr.addDsdRoleMember( inSet, role );
+            response.setEntity( outSet );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+
         return response;
     }
 
-    FortResponse deleteDsdRoleMember(FortRequest request)
+    
+    /* No qualifier */ FortResponse deleteDsdRoleMember( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            SDSet outSet = adminMgr.deleteDsdRoleMember( inSet, role );
+            response.setEntity( outSet );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+
         return response;
     }
 
-    FortResponse deleteDsdSet(FortRequest request)
+    
+    /* No qualifier */ FortResponse deleteDsdSet( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            SDSet outSet = adminMgr.deleteDsdSet( inSet );
+            response.setEntity( outSet );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse setDsdSetCardinality(FortRequest request)
+    
+    /* No qualifier */ FortResponse setDsdSetCardinality( FortRequest request )
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
+        
         try
         {
-            AdminMgr adminMgr = AdminMgrFactory.createInstance(request.getContextId());
-            adminMgr.setAdmin(request.getSession());
+            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);
+            SDSet outSet = adminMgr.setDsdSetCardinality( inSet, inSet.getCardinality() );
+            response.setEntity( outSet );
         }
-        catch (SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/blob/04e93834/src/main/java/org/apache/directory/fortress/rest/AuditMgrImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/rest/AuditMgrImpl.java b/src/main/java/org/apache/directory/fortress/rest/AuditMgrImpl.java
index 9a70c2a..2f49506 100644
--- a/src/main/java/org/apache/directory/fortress/rest/AuditMgrImpl.java
+++ b/src/main/java/org/apache/directory/fortress/rest/AuditMgrImpl.java
@@ -37,10 +37,10 @@ import java.util.List;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-class AuditMgrImpl
+class AuditMgrImpl extends AbstractImpl
 {
-    private static final String CLS_NM = AuditMgrImpl.class.getName();
-    private static final Logger log = Logger.getLogger(CLS_NM);
+    /** A logger for this class */
+    private static final Logger log = Logger.getLogger( AuditMgrImpl.class.getName() );
 
     /**
      * ************************************************************************************************************************************
@@ -48,129 +48,128 @@ class AuditMgrImpl
      * **************************************************************************************************************************************
      */
 
-    FortResponse searchBinds(FortRequest request)
+    /* No qualifier */ FortResponse searchBinds(FortRequest request)
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+        
         try
         {
             UserAudit inAudit = (UserAudit) request.getEntity();
-            AuditMgr auditMgr = AuditMgrFactory.createInstance(request.getContextId());
-            auditMgr.setAdmin(request.getSession());
-            List<Bind> outAudit = auditMgr.searchBinds(inAudit);
-            response.setEntities(outAudit);
-            response.setErrorCode(0);
+            AuditMgr auditMgr = AuditMgrFactory.createInstance( request.getContextId() );
+            auditMgr.setAdmin( request.getSession() );
+            List<Bind> outAudit = auditMgr.searchBinds( inAudit );
+            response.setEntities( outAudit );
         }
-        catch (org.apache.directory.fortress.core.SecurityException se)
+        catch ( SecurityException se )
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse getUserAuthZs(FortRequest request)
+    
+    /* No qualifier */ FortResponse getUserAuthZs(FortRequest request)
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+        
         try
         {
             UserAudit inAudit = (UserAudit)request.getEntity();
-            AuditMgr auditMgr = AuditMgrFactory.createInstance(request.getContextId());
-            auditMgr.setAdmin(request.getSession());
-            List<AuthZ> outAudit = auditMgr.getUserAuthZs(inAudit);
-            response.setEntities(outAudit);
-            response.setErrorCode(0);
+            AuditMgr auditMgr = AuditMgrFactory.createInstance( request.getContextId() );
+            auditMgr.setAdmin( request.getSession() );
+            List<AuthZ> outAudit = auditMgr.getUserAuthZs( inAudit );
+            response.setEntities( outAudit );
         }
         catch (SecurityException se)
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse searchAuthZs(FortRequest request)
+    
+    /* No qualifier */ FortResponse searchAuthZs(FortRequest request)
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+        
         try
         {
             UserAudit inAudit = (UserAudit)request.getEntity();
-            AuditMgr auditMgr = AuditMgrFactory.createInstance(request.getContextId());
-            auditMgr.setAdmin(request.getSession());
-            List<AuthZ> outAudit = auditMgr.searchAuthZs(inAudit);
-            response.setEntities(outAudit);
-            response.setErrorCode(0);
+            AuditMgr auditMgr = AuditMgrFactory.createInstance( request.getContextId() );
+            auditMgr.setAdmin( request.getSession() );
+            List<AuthZ> outAudit = auditMgr.searchAuthZs( inAudit );
+            response.setEntities( outAudit );
         }
         catch (SecurityException se)
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+
         return response;
     }
 
-    FortResponse searchUserSessions(FortRequest request)
+    
+    /* No qualifier */ FortResponse searchUserSessions(FortRequest request)
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+        
         try
         {
             UserAudit inAudit = (UserAudit)request.getEntity();
-            AuditMgr auditMgr = AuditMgrFactory.createInstance(request.getContextId());
-            auditMgr.setAdmin(request.getSession());
-            List<Mod> outAudit = auditMgr.searchUserSessions(inAudit);
-            response.setEntities(outAudit);
-            response.setErrorCode(0);
+            AuditMgr auditMgr = AuditMgrFactory.createInstance( request.getContextId() );
+            auditMgr.setAdmin( request.getSession() );
+            List<Mod> outAudit = auditMgr.searchUserSessions( inAudit );
+            response.setEntities( outAudit );
         }
         catch (SecurityException se)
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+
         return response;
     }
 
-    FortResponse searchAdminMods(FortRequest request)
+    
+    /* No qualifier */ FortResponse searchAdminMods(FortRequest request)
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+        
         try
         {
             UserAudit inAudit = (UserAudit)request.getEntity();
-            AuditMgr auditMgr = AuditMgrFactory.createInstance(request.getContextId());
-            auditMgr.setAdmin(request.getSession());
-            List<Mod> outAudit = auditMgr.searchAdminMods(inAudit);
-            response.setEntities(outAudit);
-            response.setErrorCode(0);
+            AuditMgr auditMgr = AuditMgrFactory.createInstance( request.getContextId() );
+            auditMgr.setAdmin( request.getSession() );
+            List<Mod> outAudit = auditMgr.searchAdminMods( inAudit );
+            response.setEntities( outAudit );
         }
         catch (SecurityException se)
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 
-    FortResponse searchInvalidUsers(FortRequest request)
+    
+    /* No qualifier */ FortResponse searchInvalidUsers(FortRequest request)
     {
-        FortResponse response = new FortResponse();
+        FortResponse response = createResponse();
+
         try
         {
             UserAudit inAudit = (UserAudit)request.getEntity();
-            AuditMgr auditMgr = AuditMgrFactory.createInstance(request.getContextId());
-            auditMgr.setAdmin(request.getSession());
-            List<AuthZ> outAudit = auditMgr.searchInvalidUsers(inAudit);
-            response.setEntities(outAudit);
-            response.setErrorCode(0);
+            AuditMgr auditMgr = AuditMgrFactory.createInstance( request.getContextId() );
+            auditMgr.setAdmin( request.getSession() );
+            List<AuthZ> outAudit = auditMgr.searchInvalidUsers( inAudit );
+            response.setEntities( outAudit );
         }
         catch (SecurityException se)
         {
-            log.info(CLS_NM + " caught " + se);
-            response.setErrorCode(se.getErrorId());
-            response.setErrorMessage(se.getMessage());
+            createError( response, log, se );
         }
+        
         return response;
     }
 }
\ No newline at end of file


Mime
View raw message