directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1054334 - /directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/
Date Sun, 02 Jan 2011 00:49:31 GMT
Author: elecharny
Date: Sun Jan  2 00:49:30 2011
New Revision: 1054334

URL: http://svn.apache.org/viewvc?rev=1054334&view=rev
Log:
o Used the AdministrativeRoleEnum instead of AdministrativeRole
o Created the 4 Subentry sub classes, one for each role
o Modified the SubentryCache to manage an UUID -> Subentry relation instead of a DN ->
subentry

Added:
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlSubentry.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeSubentry.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubSchemaSubentry.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubentryCache.java
      - copied, changed from r1051326, directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/subtree/SubentryCache.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionSubentry.java
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/AdministrativePoint.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/Subentry.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=1054334&r1=1054333&r2=1054334&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
Sun Jan  2 00:49:30 2011
@@ -174,7 +174,7 @@ public abstract class AbstractAdministra
     /**
      * {@inheritDoc}
      */
-    public Set<Subentry> getSubentries( AdministrativeRole role )
+    public Set<Subentry> getSubentries( AdministrativeRoleEnum role )
     {
         synchronized( subentries )
         {
@@ -182,7 +182,7 @@ public abstract class AbstractAdministra
             
             for ( Subentry subentry : this.subentries )
             {
-                if ( subentry.getAdministrativeRoles().contains( role ) )
+                if ( subentry.getAdministrativeRole() == role )
                 {
                     subentries.add( subentry );
                 }

Added: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlSubentry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlSubentry.java?rev=1054334&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlSubentry.java
(added)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlSubentry.java
Sun Jan  2 00:49:30 2011
@@ -0,0 +1,103 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.directory.server.core.administrative;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.directory.shared.ldap.aci.ACIItem;
+import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
+
+
+/**
+ * A subentry class to manage the AccessControl aspect.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class AccessControlSubentry extends Subentry
+{
+    /** The list of ACIItems */
+    private List<ACIItem> aciItems;
+    
+    /**
+     * Create an instance of the AccessControlSubentry class
+     */
+    public AccessControlSubentry( String cn, SubtreeSpecification ss, String uuid )
+    {
+        super( cn, ss, uuid );
+        aciItems = new ArrayList<ACIItem>();
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isAccessControlAdminRole()
+    {
+        return true;
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public AdministrativeRoleEnum getAdministrativeRole()
+    {
+        return AdministrativeRoleEnum.AccessControl;
+    }
+
+
+    /**
+     * @return the aciItems
+     */
+    public List<ACIItem> getAciItems()
+    {
+        return aciItems;
+    }
+
+
+    /**
+     * @param aciItem the aciItems to add
+     */
+    public void addAciItem( ACIItem aciItem )
+    {
+        aciItems.add( aciItem );
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "AccessControlSubentry\n" );
+        
+        sb.append( super.toString() );
+        
+        for ( ACIItem aciItem : aciItems )
+        {
+            sb.append( aciItem );
+        }
+        
+        return sb.toString();
+    }
+}

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AdministrativePoint.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AdministrativePoint.java?rev=1054334&r1=1054333&r2=1054334&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AdministrativePoint.java
(original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AdministrativePoint.java
Sun Jan  2 00:49:30 2011
@@ -118,7 +118,7 @@ public interface AdministrativePoint
      * @param role The role we are looking the subentries for
      * @return The Set of subentries found
      */
-    Set<Subentry> getSubentries( AdministrativeRole role );
+    Set<Subentry> getSubentries( AdministrativeRoleEnum role );
     
     
     /**

Added: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeSubentry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeSubentry.java?rev=1054334&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeSubentry.java
(added)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeSubentry.java
Sun Jan  2 00:49:30 2011
@@ -0,0 +1,101 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.directory.server.core.administrative;
+
+import java.util.List;
+
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
+
+/**
+ * A subentry class to manage the CollectiveAttribute aspect.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class CollectiveAttributeSubentry extends Subentry
+{
+    private List<EntryAttribute> collectiveAttributes;
+    
+    /**
+     * Create an instance of the CollectiveAttributeSubentry class
+     */
+    public CollectiveAttributeSubentry( List<EntryAttribute> collectiveAttributes )
+    {
+        super();
+        this.collectiveAttributes = collectiveAttributes;
+    }
+
+    
+    /**
+     * Create an instance of the CollectiveAttributeSubentry class
+     */
+    public CollectiveAttributeSubentry( String cn, SubtreeSpecification ss, String uuid,
List<EntryAttribute> collectiveAttributes )
+    {
+        super( cn, ss, uuid );
+        this.collectiveAttributes = collectiveAttributes;
+    }
+
+    
+    /**
+     * @return the collective Attributes
+     */
+    public List<EntryAttribute> getCollectiveAttributes()
+    {
+        return collectiveAttributes;
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isCollectiveAdminRole()
+    {
+        return true;
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public AdministrativeRoleEnum getAdministrativeRole()
+    {
+        return AdministrativeRoleEnum.CollectiveAttribute;
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "CollectiveAttributeSubentry\n" );
+        
+        sb.append( super.toString() );
+        
+        for ( EntryAttribute attribute : collectiveAttributes )
+        {
+            sb.append( attribute );
+        }
+        
+        return sb.toString();
+    }
+}

Added: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubSchemaSubentry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubSchemaSubentry.java?rev=1054334&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubSchemaSubentry.java
(added)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubSchemaSubentry.java
Sun Jan  2 00:49:30 2011
@@ -0,0 +1,72 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.directory.server.core.administrative;
+
+import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
+
+
+/**
+ * A subentry class to manage the SubSchema aspect.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class SubSchemaSubentry extends Subentry
+{
+    /**
+     * Create an instance of the SubSchemaSubentry class
+     */
+    public SubSchemaSubentry( String cn, SubtreeSpecification ss, String uuid )
+    {
+        super( cn, ss, uuid );
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isSubSchemaAdminRole()
+    {
+        return true;
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public AdministrativeRoleEnum getAdministrativeRole()
+    {
+        return AdministrativeRoleEnum.SubSchema;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "SubSchemaSubentry\n" );
+        
+        sb.append( super.toString() );
+        
+        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=1054334&r1=1054333&r2=1054334&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
Sun Jan  2 00:49:30 2011
@@ -20,8 +20,6 @@
 package org.apache.directory.server.core.administrative;
 
 
-import java.util.Set;
-
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
 
 
@@ -33,14 +31,11 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class Subentry
+public abstract class Subentry
 {
     /** The Subtree Specification associated with this subentry */
     private SubtreeSpecification ss;
 
-    /** The administratives roles */
-    private Set<AdministrativeRoleEnum> administrativeRoles;
-    
     /** The subentry UUID */
     private String uuid;
     
@@ -48,42 +43,41 @@ public class Subentry
     private String cn;
     
     /**
-     * Stores the subtreeSpecification
-     *
-     * @param ss The subtree specification
+     * Creates a new instance of a Subentry
      */
-    public void setSubtreeSpecification( SubtreeSpecification ss )
+    protected Subentry()
     {
-        this.ss = ss;
     }
-
-
+    
+    
     /**
-     * @return The subtree specification
+     * Creates a new instance of a Subentry
      */
-    public SubtreeSpecification getSubtreeSpecification()
+    protected Subentry( String cn, SubtreeSpecification ss, String uuid )
     {
-        return ss;
+        this.cn = cn;
+        this.ss = ss;
+        this.uuid = uuid;
     }
-
-
+    
+    
     /**
-     * Stores the set of roles for this subentry
+     * Stores the subtreeSpecification
      *
-     * @param administrativeRoles The roles to be added
+     * @param ss The subtree specification
      */
-    public void setAdministrativeRoles( Set<AdministrativeRoleEnum> administrativeRoles
)
+    public void setSubtreeSpecification( SubtreeSpecification ss )
     {
-        this.administrativeRoles = administrativeRoles;
+        this.ss = ss;
     }
 
 
     /**
-     * @return The list of roles for this subentry
+     * @return The subtree specification
      */
-    public Set<AdministrativeRoleEnum> getAdministrativeRoles()
+    public SubtreeSpecification getSubtreeSpecification()
     {
-        return administrativeRoles;
+        return ss;
     }
 
 
@@ -92,7 +86,7 @@ public class Subentry
      */
     public boolean isCollectiveAdminRole()
     {
-        return administrativeRoles.contains( AdministrativeRoleEnum.CollectiveAttribute );
+        return false;
     }
 
 
@@ -101,7 +95,7 @@ public class Subentry
      */
     public boolean isSchemaAdminRole()
     {
-        return administrativeRoles.contains( AdministrativeRoleEnum.SubSchema );
+        return false;
     }
 
 
@@ -110,7 +104,7 @@ public class Subentry
      */
     public boolean isAccessControlAdminRole()
     {
-        return administrativeRoles.contains( AdministrativeRoleEnum.AccessControl );
+        return false;
     }
 
 
@@ -119,8 +113,14 @@ public class Subentry
      */
     public boolean isTriggersAdminRole()
     {
-        return administrativeRoles.contains( AdministrativeRoleEnum.TriggerExecution );
+        return false;
     }
+    
+    
+    /**
+     * @return the subentry administrativeRole
+     */
+    public abstract AdministrativeRoleEnum getAdministrativeRole();
 
 
     /**
@@ -165,24 +165,8 @@ public class Subentry
     public String toString()
     {
         StringBuilder sb = new StringBuilder();
-        sb.append( "Subentry: " ).append( cn).append( '-').append( uuid ).append( "[" );
-        
-        boolean isFirst = true;
-        
-        for ( AdministrativeRoleEnum role : administrativeRoles )
-        {
-            if ( isFirst )
-            {
-                isFirst = false;
-            }
-            else
-            {
-                sb.append( ", " );
-            }
-            
-            sb.append( role );
-        }
-        sb.append( "]" );
+        sb.append( "Subentry name : " ).append( cn ).append( '\n' );
+        sb.append( "UUID          : " ).append( uuid ).append( '\n' );
         
         return sb.toString();
     }

Copied: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubentryCache.java
(from r1051326, directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/subtree/SubentryCache.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubentryCache.java?p2=directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubentryCache.java&p1=directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/subtree/SubentryCache.java&r1=1051326&r2=1054334&rev=1054334&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/subtree/SubentryCache.java
(original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubentryCache.java
Sun Jan  2 00:49:30 2011
@@ -17,47 +17,30 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.server.core.subtree;
+package org.apache.directory.server.core.administrative;
 
 
 import java.util.Iterator;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.directory.server.core.administrative.Subentry;
-import org.apache.directory.shared.ldap.name.DN;
 
 
 /**
- * A cache for subtree specifications. It associates a Subentry with a DN,
- * representing its position in the DIT.<br>
- * This cache has a size limit set to 1000 at the moment. We should add a configuration
- * parameter to manage its size.
+ * A cache for subtree specifications. It associates a Subentry with its entryUUID<br>
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SubentryCache implements Iterable<DN>
+public class SubentryCache implements Iterable<String>
 {
-    /** The default cache size limit */
-    private static final int DEFAULT_CACHE_MAX_SIZE = 1000;
-    
-    /** The cache size limit */
-    private int cacheMaxSize = DEFAULT_CACHE_MAX_SIZE;
-    
-    /** The current cache size */
-    private AtomicInteger cacheSize;
-    
     /** The Subentry cache */
-    private final Map<DN, Subentry> cache;
+    private final Map<String, Subentry> cache;
     
     /**
      * Creates a new instance of SubentryCache with a default maximum size.
      */
     public SubentryCache()
     {
-        cache = new ConcurrentHashMap<DN, Subentry>();
-        cacheSize = new AtomicInteger( 0 );
+        cache = new ConcurrentHashMap<String, Subentry>();
     }
     
     
@@ -66,39 +49,32 @@ public class SubentryCache implements It
      */
     public SubentryCache( int maxSize )
     {
-        cache = new ConcurrentHashMap<DN, Subentry>();
-        cacheSize = new AtomicInteger( 0 );
-        cacheMaxSize = maxSize;
+        cache = new ConcurrentHashMap<String, Subentry>();
     }
     
     
     /**
-     * Retrieve a Subentry given a DN. If there is none, null will be returned.
+     * Retrieve a Subentry given an UUID. If there is none, null will be returned.
      *
-     * @param dn The DN we want to get the Subentry for 
+     * @param uuid The UUID we want to get the Subentry for 
      * @return The found Subentry, or null
      */
-    final Subentry getSubentry( DN dn )
+    public final Subentry getSubentry( String uuid )
     {
-        return cache.get( dn );
+        return cache.get( uuid );
     }
     
     
     /**
-     * Remove a Subentry for a given DN 
+     * Remove a Subentry for a given UUID 
      *
-     * @param dn The DN for which we want to remove the 
+     * @param uuid The UUID for which we want to remove the 
      * associated Subentry
      * @return The removed Subentry, if any
      */
-    final Subentry removeSubentry( DN dn )
+    public final Subentry removeSubentry( String uuid )
     {
-        Subentry oldSubentry = cache.remove( dn );
-        
-        if ( oldSubentry != null )
-        {
-            cacheSize.decrementAndGet();
-        }
+        Subentry oldSubentry = cache.remove( uuid );
         
         return oldSubentry;
     }
@@ -107,54 +83,33 @@ public class SubentryCache implements It
     /**
      * Stores a new Subentry into the cache, associated with a DN
      *
-     * @param dn The Subentry DN
-     * @param ss The SubtreeSpecification
-     * @param adminRoles The administrative roles for this Subentry
+     * @param subentry The Subentry
      * @return The old Subentry, if any
      */
-    /* No qualifier */ Subentry addSubentry( DN dn, Subentry subentry )
+    public Subentry addSubentry( Subentry subentry )
     {
-        if ( cacheSize.get() > cacheMaxSize )
-        {
-            // TODO : Throw an exception here
-        }
-        
-        Subentry oldSubentry = cache.put( dn, subentry );
-        
-        if ( oldSubentry == null )
-        {
-            cacheSize.getAndIncrement();
-        }
+        Subentry oldSubentry = cache.put( subentry.getUuid(), subentry );
         
         return oldSubentry;
     }
     
     
     /**
-     * Tells if there is a Subentry associated with a DN
-     * @param dn The DN
+     * Tells if there is a Subentry associated with an UUID
+     * @param uuid The UUID
      * @return True if a Subentry is found
      */
-    /* No qualifier */ boolean hasSubentry( DN dn )
+    public boolean hasSubentry( String uuid )
     {
-        return cache.containsKey( dn );
+        return cache.containsKey( uuid );
     }
     
     
     /**
-     * @return An Iterator over the Subentry's DNs 
+     * @return An Iterator over the Subentry's UUIDs 
      */
-    public Iterator<DN> iterator()
+    public Iterator<String> iterator()
     {
         return cache.keySet().iterator();
     }
-    
-    
-    /**
-     * @return The number of elements in the cache
-     */
-    public int getCacheSize()
-    {
-        return cacheSize.get();
-    }
 }

Added: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionSubentry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionSubentry.java?rev=1054334&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionSubentry.java
(added)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionSubentry.java
Sun Jan  2 00:49:30 2011
@@ -0,0 +1,103 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.directory.server.core.administrative;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
+import org.apache.directory.shared.ldap.trigger.TriggerSpecification;
+
+
+/**
+ * A subentry class to manage the TriggerExecutionSubentry aspect.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TriggerExecutionSubentry extends Subentry
+{
+    /** The list of TriggerSpecifications */
+    private List<TriggerSpecification> triggerSpecifications;
+    
+    /**
+     * Create an instance of the TriggerExecutionSubentry class
+     */
+    public TriggerExecutionSubentry( String cn, SubtreeSpecification ss, String uuid )
+    {
+        super( cn, ss, uuid );
+        triggerSpecifications = new ArrayList<TriggerSpecification>();
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isTriggerExecutionAdminRole()
+    {
+        return true;
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public AdministrativeRoleEnum getAdministrativeRole()
+    {
+        return AdministrativeRoleEnum.TriggerExecution;
+    }
+
+
+    /**
+     * @return the triggerSpecifications
+     */
+    public List<TriggerSpecification> getTriggerSpecification()
+    {
+        return triggerSpecifications;
+    }
+
+
+    /**
+     * @param triggerSpecification the TriggerSpecification to add
+     */
+    public void addTriggerSpecification( TriggerSpecification triggerSpecification )
+    {
+        triggerSpecifications.add( triggerSpecification );
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "AccessControlSubentry\n" );
+        
+        sb.append( super.toString() );
+        
+        for ( TriggerSpecification triggerSpecification : triggerSpecifications )
+        {
+            sb.append( triggerSpecification );
+        }
+        
+        return sb.toString();
+    }
+}



Mime
View raw message