directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1393998 - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/subtree/ apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/ shared/trunk/ldap/model/src/main/java/...
Date Thu, 04 Oct 2012 11:45:39 GMT
Author: elecharny
Date: Thu Oct  4 11:45:39 2012
New Revision: 1393998

URL: http://svn.apache.org/viewvc?rev=1393998&view=rev
Log:
Moved the Subentry class to shared, along the other subtree classes already there.

Added:
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/subtree/Subentry.java
Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/subtree/SubentryCache.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/subtree/SubentryUtils.java
    directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/subtree/SubentryCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/subtree/SubentryCache.java?rev=1393998&r1=1393997&r2=1393998&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/subtree/SubentryCache.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/subtree/SubentryCache.java
Thu Oct  4 11:45:39 2012
@@ -26,6 +26,7 @@ import java.util.concurrent.ConcurrentHa
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.directory.shared.ldap.model.name.Dn;
+import org.apache.directory.shared.ldap.model.subtree.Subentry;
 
 
 /**

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/subtree/SubentryUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/subtree/SubentryUtils.java?rev=1393998&r1=1393997&r2=1393998&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/subtree/SubentryUtils.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/subtree/SubentryUtils.java
Thu Oct  4 11:45:39 2012
@@ -21,9 +21,6 @@ package org.apache.directory.server.core
 
 
 import org.apache.directory.server.core.api.DirectoryService;
-import org.apache.directory.server.core.api.subtree.Subentry;
-import org.apache.directory.server.core.api.subtree.SubentryCache;
-import org.apache.directory.server.core.api.subtree.SubtreeEvaluator;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.entry.Attribute;
 import org.apache.directory.shared.ldap.model.entry.DefaultAttribute;
@@ -33,6 +30,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
+import org.apache.directory.shared.ldap.model.subtree.Subentry;
 import org.apache.directory.shared.ldap.model.subtree.SubtreeSpecification;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=1393998&r1=1393997&r2=1393998&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
(original)
+++ directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
Thu Oct  4 11:45:39 2012
@@ -49,7 +49,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.SearchingOperationContext;
 import org.apache.directory.server.core.api.partition.PartitionNexus;
-import org.apache.directory.server.core.api.subtree.Subentry;
 import org.apache.directory.server.core.api.subtree.SubentryCache;
 import org.apache.directory.server.core.api.subtree.SubtreeEvaluator;
 import org.apache.directory.server.core.shared.DefaultCoreSession;
@@ -83,6 +82,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.subtree.AdministrativeRole;
+import org.apache.directory.shared.ldap.model.subtree.Subentry;
 import org.apache.directory.shared.ldap.model.subtree.SubtreeSpecification;
 import org.apache.directory.shared.ldap.model.subtree.SubtreeSpecificationParser;
 import org.slf4j.Logger;
@@ -386,7 +386,7 @@ public class SubentryInterceptor extends
                     nexus.modify( new ModifyOperationContext( session, candidateDn, modifications
) );
                 }
             }
-            
+
             subentries.close();
         }
         catch ( Exception e )

Added: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/subtree/Subentry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/subtree/Subentry.java?rev=1393998&view=auto
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/subtree/Subentry.java
(added)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/subtree/Subentry.java
Thu Oct  4 11:45:39 2012
@@ -0,0 +1,127 @@
+/*
+ *  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.shared.ldap.model.subtree;
+
+
+import java.util.Set;
+
+
+
+/**
+ * An operational view of a subentry within the system. A Subentry can have
+ * many types (Collective, Schema, AccessControl or Trigger) but only one
+ * Subtree Specification.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class Subentry
+{
+    /** The Subtree Specification associated with this subentry */
+    private SubtreeSpecification ss;
+
+    /** The administratives roles */
+    private Set<AdministrativeRole> administrativeRoles;
+
+
+    /**
+     * Stores the subtree
+     *
+     * @param ss The subtree specification
+     */
+    public final void setSubtreeSpecification( SubtreeSpecification ss )
+    {
+        this.ss = ss;
+    }
+
+
+    /**
+     * @return The subtree specification
+     */
+    public final SubtreeSpecification getSubtreeSpecification()
+    {
+        return ss;
+    }
+
+
+    /**
+     *
+     * TODO setAdministrativeRoles.
+     *
+     * @param administrativeRoles
+     */
+    public final void setAdministrativeRoles( Set<AdministrativeRole> administrativeRoles
)
+    {
+        this.administrativeRoles = administrativeRoles;
+    }
+
+
+    public final Set<AdministrativeRole> getAdministrativeRoles()
+    {
+        return administrativeRoles;
+    }
+
+
+    /**
+     * Tells if the type contains the Collective attribute Administrative Role
+     */
+    public final boolean isCollectiveAdminRole()
+    {
+        return administrativeRoles.contains( AdministrativeRole.CollectiveAttributeInnerArea
) ||
+            administrativeRoles.contains( AdministrativeRole.CollectiveAttributeSpecificArea
);
+    }
+
+
+    /**
+     * Tells if the type contains the SubSchema Administrative Role
+     */
+    public final boolean isSchemaAdminRole()
+    {
+        return administrativeRoles.contains( AdministrativeRole.SubSchemaSpecificArea );
+    }
+
+
+    /**
+     * Tells if the type contains the Access Control Administrative Role
+     */
+    public final boolean isAccessControlAdminRole()
+    {
+        return administrativeRoles.contains( AdministrativeRole.AccessControlSpecificArea
) ||
+            administrativeRoles.contains( AdministrativeRole.AccessControlInnerArea );
+    }
+
+
+    /**
+     * Tells if the type contains the Triggers Administrative Role
+     */
+    public final boolean isTriggersAdminRole()
+    {
+        return administrativeRoles.contains( AdministrativeRole.TriggerExecutionSpecificArea
) ||
+            administrativeRoles.contains( AdministrativeRole.TriggerExecutionInnerArea );
+    }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        return "Subentry[" + administrativeRoles + ", " + ss + "]";
+    }
+}



Mime
View raw message