directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cp...@apache.org
Subject [10/10] directory-fortress-core git commit: fixed methods to match coding standards, added documentation
Date Mon, 28 Nov 2016 21:13:37 GMT
fixed methods to match coding standards, added documentation


Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/commit/4178bd6e
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/4178bd6e
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/4178bd6e

Branch: refs/heads/master
Commit: 4178bd6e2ea3dedb50546ad90f0885ec89557867
Parents: 32e480b
Author: clp207 <clp207@psu.edu>
Authored: Mon Nov 28 14:20:40 2016 -0500
Committer: clp207 <clp207@psu.edu>
Committed: Mon Nov 28 14:20:40 2016 -0500

----------------------------------------------------------------------
 .../fortress/core/impl/PropertyDAO.java         | 49 ++++++++++++++++++--
 .../fortress/core/impl/PropertyMgrImpl.java     |  6 ++-
 .../directory/fortress/core/impl/PropertyP.java | 48 +++++++++++++++++--
 3 files changed, 92 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/4178bd6e/src/main/java/org/apache/directory/fortress/core/impl/PropertyDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/PropertyDAO.java b/src/main/java/org/apache/directory/fortress/core/impl/PropertyDAO.java
index 99da04d..614a35c 100644
--- a/src/main/java/org/apache/directory/fortress/core/impl/PropertyDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/PropertyDAO.java
@@ -47,7 +47,18 @@ import org.apache.directory.ldap.client.api.LdapConnection;
 public class PropertyDAO extends LdapDataProvider
 {
 
-    public FortEntity addProperties( FortEntity entity, Properties properties, PropertyProvider
propProvider ) throws UpdateException, FinderException{ 
+    /**
+     * Add properties to the provided entity using the provided property provider
+     *
+     * @param entity A FortressEntity that supports properties (Role, AdminRole, Group, Permission,
PermObj)
+     * @param properties
+     * @param propProvider DAO for entity type that implements property provider interface
+     * @return Entity with current property value
+     * @throws UpdateException
+     * @throws FinderException
+     */
+    public FortEntity addProperties( FortEntity entity, Properties properties, PropertyProvider
propProvider ) throws UpdateException, FinderException
+    { 
         LdapConnection ld = null;
         String entityDn = propProvider.getDn( entity );
 
@@ -72,7 +83,18 @@ public class PropertyDAO extends LdapDataProvider
         return propProvider.getEntity( entity );
     }
     
-    public FortEntity updateProperties( FortEntity entity, Properties properties, PropertyProvider
propProvider ) throws UpdateException, FinderException{ 
+    /**
+     * Update properties on the provided entity using the provided property provider    

+     *
+     * @param entity A FortressEntity that supports properties (Role, AdminRole, Group, Permission,
PermObj)
+     * @param properties
+     * @param propProvider DAO for entity type that implements property provider interface
+     * @return Entity with current property value
+     * @throws UpdateException
+     * @throws FinderException
+     */
+    public FortEntity updateProperties( FortEntity entity, Properties properties, PropertyProvider
propProvider ) throws UpdateException, FinderException
+    { 
         //ftProps all have same name, so will need to delete proprs first, then readd ones
that are approprirate
         
         //get current properties
@@ -94,7 +116,17 @@ public class PropertyDAO extends LdapDataProvider
         return propProvider.getEntity( entity );
     }
     
-    public void deleteProperties( FortEntity entity, Properties properties, PropertyProvider
propProvider ) throws UpdateException, FinderException{
+    /**
+     * Delete properties to the provided entity using the provided property provider    
+     *
+     * @param entity A FortressEntity that supports properties (Role, AdminRole, Group, Permission,
PermObj)
+     * @param properties
+     * @param propProvider DAO for entity type that implements property provider interface
+     * @throws UpdateException
+     * @throws FinderException
+     */
+    public void deleteProperties( FortEntity entity, Properties properties, PropertyProvider
propProvider ) throws UpdateException, FinderException
+    {
         LdapConnection ld = null;
         String entityDn = propProvider.getDn( entity );
 
@@ -117,7 +149,16 @@ public class PropertyDAO extends LdapDataProvider
         }
     }
     
-    public Properties getProperties( FortEntity entity, PropertyProvider propProvider ) throws
FinderException{ 
+    /**
+     * Get properties on the provided entity using the provided property provider     
+     *
+     * @param entity A FortressEntity that supports properties (Role, AdminRole, Group, Permission,
PermObj)
+     * @param propProvider DAO for entity type that implements property provider interface
+     * @return Current properties of entity
+     * @throws FinderException
+     */
+    public Properties getProperties( FortEntity entity, PropertyProvider propProvider ) throws
FinderException
+    { 
         Properties props = null;
         LdapConnection ld = null;
         String entityDn = propProvider.getDn( entity );

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/4178bd6e/src/main/java/org/apache/directory/fortress/core/impl/PropertyMgrImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/PropertyMgrImpl.java b/src/main/java/org/apache/directory/fortress/core/impl/PropertyMgrImpl.java
index badeed2..9e096ea 100644
--- a/src/main/java/org/apache/directory/fortress/core/impl/PropertyMgrImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/PropertyMgrImpl.java
@@ -82,7 +82,8 @@ public class PropertyMgrImpl extends Manageable implements PropertyMgr,
Serializ
         return propP.getProperties( entity );
     }
     
-    private void checkPropertyUpdateAccess( FortEntity entity ) throws SecurityException{
+    private void checkPropertyUpdateAccess( FortEntity entity ) throws SecurityException
   
+    {
         if( entity instanceof Role ){
             checkAccess( AdminMgrImpl.class.getName(), "updateRole" );
         }
@@ -115,7 +116,8 @@ public class PropertyMgrImpl extends Manageable implements PropertyMgr,
Serializ
         }
     }
     
-    private void checkPropertyGetAccess( FortEntity entity ) throws SecurityException{
+    private void checkPropertyGetAccess( FortEntity entity ) throws SecurityException
+    {
         if( entity instanceof Role ){
             checkAccess( ReviewMgrImpl.class.getName(), "readRole" );
         }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/4178bd6e/src/main/java/org/apache/directory/fortress/core/impl/PropertyP.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/PropertyP.java b/src/main/java/org/apache/directory/fortress/core/impl/PropertyP.java
index fddce56..ac6797e 100644
--- a/src/main/java/org/apache/directory/fortress/core/impl/PropertyP.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/PropertyP.java
@@ -39,23 +39,61 @@ public class PropertyP
     private PermOpDAO popDAO = new PermOpDAO();
     private PermObjDAO pobjDAO = new PermObjDAO();
     
-    public FortEntity addProperties( FortEntity entity, Properties props ) throws UpdateException,
FinderException {        
+    /**
+     * Adds the provided properties to the provided entity 
+     *
+     * @param entity A FortressEntity that supports properties (Role, AdminRole, Group, Permission,
PermObj)
+     * @param props Properties to add
+     * @return Updated entity with current properties
+     * @throws UpdateException
+     * @throws FinderException
+     */
+    public FortEntity addProperties( FortEntity entity, Properties props ) throws UpdateException,
FinderException 
+    {        
         return propDAO.addProperties( entity, props, this.getPropertyProvider( entity ) );
     }
     
-    public FortEntity updateProperties( FortEntity entity, Properties props ) throws UpdateException,
FinderException {        
+    /**
+     * Updates the provided properties on the provided entity
+     *
+     * @param entity A FortressEntity that supports properties (Role, AdminRole, Group, Permission,
PermObj)
+     * @param props Properties to update
+     * @return Updated entity with current properties
+     * @throws UpdateException
+     * @throws FinderException
+     */
+    public FortEntity updateProperties( FortEntity entity, Properties props ) throws UpdateException,
FinderException 
+    {        
         return propDAO.updateProperties( entity, props, this.getPropertyProvider( entity
) );
     }
     
-    public void deleteProperties( FortEntity entity, Properties props ) throws UpdateException,
FinderException {        
+    /**
+     * Deletes the provided properties on the provided entity
+     *
+     * @param entity A FortressEntity that supports properties (Role, AdminRole, Group, Permission,
PermObj)
+     * @param props Properties to delete
+     * @throws UpdateException
+     * @throws FinderException
+     */
+    public void deleteProperties( FortEntity entity, Properties props ) throws UpdateException,
FinderException 
+    {        
         propDAO.deleteProperties( entity, props, this.getPropertyProvider( entity ) );
     }
     
-    public Properties getProperties( FortEntity entity ) throws FinderException {       

+    /**
+     * Gets the properties that are present on the provided entity     
+     *
+     * @param entity A FortressEntity that supports properties (Role, AdminRole, Group, Permission,
PermObj)
+     * @return Properties for the given entity
+     * @throws FinderException
+     */
+    public Properties getProperties( FortEntity entity ) throws FinderException 
+    {        
         return propDAO.getProperties( entity, this.getPropertyProvider( entity ) );
     }
     
-    private PropertyProvider getPropertyProvider( FortEntity entity ){
+    private PropertyProvider getPropertyProvider( FortEntity entity )
+    {
         if( entity instanceof AdminRole ){
             return arDAO;
         }


Mime
View raw message