directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1053095 - in /directory/apacheds/branches/apacheds-AP: core-api/src/main/java/org/apache/directory/server/core/administrative/ core/src/main/java/org/apache/directory/server/core/subtree/
Date Mon, 27 Dec 2010 16:10:21 GMT
Author: elecharny
Date: Mon Dec 27 16:10:21 2010
New Revision: 1053095

URL: http://svn.apache.org/viewvc?rev=1053095&view=rev
Log:
o Added a CN field in the Subentry
o Extended the AdministrativePoint toString() method to print the subentries' names
o Cleaned up the subentryInterceptor code

Modified:
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AbstractAdministrativePoint.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/Subentry.java
    directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AbstractAdministrativePoint.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AbstractAdministrativePoint.java?rev=1053095&r1=1053094&r2=1053095&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AbstractAdministrativePoint.java
(original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AbstractAdministrativePoint.java
Mon Dec 27 16:10:21 2010
@@ -215,6 +215,26 @@ public abstract class AbstractAdministra
         sb.append( "Role: '" ).append( role ).append( "', " );
         sb.append( "UUID: " ).append( uuid ).append( ", " );
         sb.append( "SeqNumber: " ).append( seqNumber ).append( '\n' );
+        
+        if ( subentries.size() > 0 )
+        {
+            sb.append( "Subentries: " );
+            boolean isFirst = true;
+            
+            for ( Subentry subentry : subentries )
+            {
+                if ( isFirst )
+                {
+                    isFirst = false;
+                }
+                else
+                {
+                    sb.append( ", " );
+                }
+                
+                sb.append( '\'' ).append( subentry.getCn() ).append( '\'' );
+            }
+        }
 
         return sb.toString();
     }

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/Subentry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/Subentry.java?rev=1053095&r1=1053094&r2=1053095&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/Subentry.java
(original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/Subentry.java
Mon Dec 27 16:10:21 2010
@@ -45,6 +45,9 @@ public class Subentry
     /** The subentry UUID */
     private String uuid;
     
+    /** The subentry CN */
+    private String cn;
+    
     /**
      * Stores the subtreeSpecification
      *
@@ -143,12 +146,30 @@ public class Subentry
 
 
     /**
+     * @return the cn
+     */
+    public String getCn()
+    {
+        return cn;
+    }
+
+
+    /**
+     * @param cn the cn to set
+     */
+    public void setCn( String cn )
+    {
+        this.cn = cn;
+    }
+
+
+    /**
      * @see Object#toString()
      */
     public String toString()
     {
         StringBuilder sb = new StringBuilder();
-        sb.append( "Subentry-" ).append( uuid ).append( "[" );
+        sb.append( "Subentry: " ).append( cn).append( '-').append( uuid ).append( "[" );
         
         boolean isFirst = true;
         

Modified: directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=1053095&r1=1053094&r2=1053095&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
(original)
+++ directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
Mon Dec 27 16:10:21 2010
@@ -424,6 +424,7 @@ public class SubentryInterceptor extends
 
                     newSubentry.setAdministrativeRoles( getSubentryAdminRoles( subentry )
);
                     newSubentry.setSubtreeSpecification( ss );
+                    newSubentry.setCn( subentry.get( SchemaConstants.CN_AT ).getString()
);
 
                     subentryCache.addSubentry( subentryDn, newSubentry );
                 }
@@ -2005,26 +2006,13 @@ public class SubentryInterceptor extends
                     throw new LdapUnwillingToPerformException( message );
                 }
                 
-                /* ----------------------------------------------------------------
-                 * Build the set of operational attributes to be injected into
-                 * entries that are contained within the subtree represented by this
-                 * new subentry.  In the process we make sure the proper roles are
-                 * supported by the administrative point to allow the addition of
-                 * this new subentry.
-                 * ----------------------------------------------------------------
-                 */
+                // Create the Subentry
                 Subentry subentry = new Subentry();
+
+                subentry.setCn( entry.get( SchemaConstants.CN_AT ).getString() );
                 subentry.setAdministrativeRoles( getSubentryAdminRoles( entry ) );
-                //List<EntryAttribute> operationalAttributes = getSubentryOperationalAttributes(
dn, subentry );
-    
-                /* ----------------------------------------------------------------
-                 * Parse the subtreeSpecification of the subentry and add it to the
-                 * SubtreeSpecification cache.  If the parse succeeds we continue
-                 * to add the entry to the DIT.  Thereafter we search out entries
-                 * to modify the subentry operational attributes of.
-                 * ----------------------------------------------------------------
-                 */
                 setSubtreeSpecification( subentry, entry );
+                
                 subentryCache.addSubentry( dn, subentry );
 
                 // Update the seqNumber and update the parent AP
@@ -2033,7 +2021,7 @@ public class SubentryInterceptor extends
                 // Now inject the subentry into the backend
                 next.add( addContext );
                 
-                // Get back the entryUUID and store it in the subentry
+                // Get back the subentry entryUUID and store it in the subentry
                 String subentryUuid = addContext.getEntry().get( SchemaConstants.ENTRY_UUID_AT
).getString();
                 subentry.setUuid( subentryUuid );
 



Mime
View raw message