You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/07/08 11:27:48 UTC
svn commit: r961658 - in /directory:
apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/
apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/
apacheds/trunk/server-integ/src/test/java/org/apache/direct...
Author: elecharny
Date: Thu Jul 8 09:27:47 2010
New Revision: 961658
URL: http://svn.apache.org/viewvc?rev=961658&view=rev
Log:
o Added some constants
o Added some Javadoc
Modified:
directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java
directory/shared/trunk/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java?rev=961658&r1=961657&r2=961658&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java Thu Jul 8 09:27:47 2010
@@ -36,7 +36,6 @@ import org.apache.directory.ldap.client.
import org.apache.directory.server.constants.ServerDNConstants;
import org.apache.directory.server.core.DirectoryService;
import org.apache.directory.server.core.integ.IntegrationUtils;
-import org.apache.directory.server.core.subtree.SubentryInterceptor;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.entry.DefaultEntry;
import org.apache.directory.shared.ldap.entry.Entry;
@@ -322,10 +321,10 @@ public class AutzIntegUtils
// modify ou=system to be an AP for an A/C AA if it is not already
EntryAttribute administrativeRole = systemEntry.get( "administrativeRole" );
- if ( administrativeRole == null || !administrativeRole.contains( SubentryInterceptor.AC_AREA ) )
+ if ( administrativeRole == null || !administrativeRole.contains( "accessControlSpecificArea" ) )
{
ModifyRequest modReq = new ModifyRequest( systemEntry.getDn() );
- modReq.add( "administrativeRole", SubentryInterceptor.AC_AREA );
+ modReq.add( "administrativeRole", "accessControlSpecificArea" );
connection.modify( modReq );
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=961658&r1=961657&r2=961658&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Thu Jul 8 09:27:47 2010
@@ -94,48 +94,54 @@ import org.slf4j.LoggerFactory;
*/
public class SubentryInterceptor extends BaseInterceptor
{
+ /** The logger for this class */
+ private static final Logger LOG = LoggerFactory.getLogger( SubentryInterceptor.class );
+
/** the subentry control OID */
private static final String SUBENTRY_CONTROL = SubentriesControl.CONTROL_OID;
- public static final String AC_AREA = "accessControlSpecificArea";
- public static final String AC_INNERAREA = "accessControlInnerArea";
-
- public static final String SCHEMA_AREA = "subschemaAdminSpecificArea";
-
- public static final String COLLECTIVE_AREA = "collectiveAttributeSpecificArea";
- public static final String COLLECTIVE_INNERAREA = "collectiveAttributeInnerArea";
-
- public static final String TRIGGER_AREA = "triggerExecutionSpecificArea";
- public static final String TRIGGER_INNERAREA = "triggerExecutionInnerArea";
-
+ /** The set of Subentry operational attributes */
public static final String[] SUBENTRY_OPATTRS =
- { SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT, SchemaConstants.SUBSCHEMA_SUBENTRY_AT,
- SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT, SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT };
-
- private static final Logger LOG = LoggerFactory.getLogger( SubentryInterceptor.class );
+ {
+ SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT,
+ SchemaConstants.SUBSCHEMA_SUBENTRY_AT,
+ SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT,
+ SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT
+ };
/** the hash mapping the DN of a subentry to its SubtreeSpecification/types */
private final SubentryCache subentryCache = new SubentryCache();
+ /** The SubTree specification parser instance */
private SubtreeSpecificationParser ssParser;
+
+ /** The Subtree evaluator instance */
private SubtreeEvaluator evaluator;
+
+ /** A reference to the nexus for direct backend operations */
private PartitionNexus nexus;
- /** The global registries */
+ /** The SchemManager instance */
private SchemaManager schemaManager;
- private AttributeType objectClassType;
+ /** A reference to the ObjectClass AT */
+ private static AttributeType OBJECT_CLASS_AT;
+ /**
+ * Initialize the Subentry Interceptor
+ *
+ * @param directoryService The DirectoryService instance
+ */
public void init( DirectoryService directoryService ) throws LdapException
{
super.init( directoryService );
+
nexus = directoryService.getPartitionNexus();
schemaManager = directoryService.getSchemaManager();
// setup various attribute type values
- objectClassType = schemaManager.lookupAttributeTypeRegistry( schemaManager.getAttributeTypeRegistry()
- .getOidByName( SchemaConstants.OBJECT_CLASS_AT ) );
+ OBJECT_CLASS_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASS_AT );
ssParser = new SubtreeSpecificationParser( schemaManager );
evaluator = new SubtreeEvaluator( schemaManager );
@@ -155,8 +161,9 @@ public class SubentryInterceptor extends
DN suffixDn = new DN( suffix );
suffixDn.normalize( schemaManager.getNormalizerMapping() );
- DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
+ DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN );
adminDn.normalize( schemaManager.getNormalizerMapping() );
+
CoreSession adminSession = new DefaultCoreSession(
new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), directoryService );
@@ -166,6 +173,8 @@ public class SubentryInterceptor extends
EntryFilteringCursor subentries = nexus.search( searchOperationContext );
+ // Loop on all the found Subentries, parse the SubtreeSpecification
+ // and store the subentry in the subrentry cache
try
{
while ( subentries.next() )
@@ -596,7 +605,7 @@ public class SubentryInterceptor extends
{
DN name = deleteContext.getDn();
Entry entry = deleteContext.getEntry();
- EntryAttribute objectClasses = entry.get( objectClassType );
+ EntryAttribute objectClasses = entry.get( OBJECT_CLASS_AT );
if ( objectClasses.contains( SchemaConstants.SUBENTRY_OC ) )
{
@@ -780,7 +789,7 @@ public class SubentryInterceptor extends
Entry entry = renameContext.getEntry().getClonedEntry();
- EntryAttribute objectClasses = entry.get( objectClassType );
+ EntryAttribute objectClasses = entry.get( OBJECT_CLASS_AT );
if ( objectClasses.contains( SchemaConstants.SUBENTRY_OC ) )
{
@@ -866,7 +875,7 @@ public class SubentryInterceptor extends
Entry entry = moveAndRenameContext.getOriginalEntry();
- EntryAttribute objectClasses = entry.get( objectClassType );
+ EntryAttribute objectClasses = entry.get( OBJECT_CLASS_AT );
if ( objectClasses.contains( SchemaConstants.SUBENTRY_OC ) )
{
@@ -1083,7 +1092,7 @@ public class SubentryInterceptor extends
Entry entry = modifyContext.getEntry();
- EntryAttribute objectClasses = entry.get( objectClassType );
+ EntryAttribute objectClasses = entry.get( OBJECT_CLASS_AT );
boolean isSubtreeSpecificationModification = false;
Modification subtreeMod = null;
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java?rev=961658&r1=961657&r2=961658&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java Thu Jul 8 09:27:47 2010
@@ -55,7 +55,6 @@ import org.apache.directory.server.annot
import org.apache.directory.server.core.annotations.ApplyLdifs;
import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
import org.apache.directory.server.core.integ.FrameworkRunner;
-import org.apache.directory.server.core.subtree.SubentryInterceptor;
import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.shared.ldap.codec.search.controls.subentries.SubentriesControl;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -617,9 +616,9 @@ public class SearchIT extends AbstractLd
Attributes ap = adminCtx.getAttributes( "", new String[]
{ "administrativeRole" } );
Attribute administrativeRole = ap.get( "administrativeRole" );
- if ( administrativeRole == null || !administrativeRole.contains( SubentryInterceptor.AC_AREA ) )
+ if ( administrativeRole == null || !administrativeRole.contains( "accessControlSpecificArea" ) )
{
- Attributes changes = new BasicAttributes( "administrativeRole", SubentryInterceptor.AC_AREA, true );
+ Attributes changes = new BasicAttributes( "administrativeRole", "accessControlSpecificArea", true );
adminCtx.modifyAttributes( "", DirContext.ADD_ATTRIBUTE, changes );
}
Modified: directory/shared/trunk/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java?rev=961658&r1=961657&r2=961658&view=diff
==============================================================================
--- directory/shared/trunk/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java (original)
+++ directory/shared/trunk/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java Thu Jul 8 09:27:47 2010
@@ -343,6 +343,30 @@ public interface SchemaConstants
String STRUCTURAL_OBJECT_CLASS_AT = "structuralObjectClass";
String STRUCTURAL_OBJECT_CLASS_AT_OID = "2.5.21.9";
+ // AutonomousArea
+ String AUTONOMOUS_AREA_AT = "autonomousArea";
+ String UTONOMOUS_AREA_AT_OID = "2.5.23.1";
+
+ // AccessControlSpecificArea
+ String ACCESS_CONTROL_SPECIFIC_AREA_AT = "accessControlSpecificArea";
+ String ACCESS_CONTROL_SPECIFIC_AREA_AT_OID = "2.5.23.2";
+
+ // AccessControlInnerArea
+ String ACCESS_CONTROL_INNER_AREA_AT = "accessControlInnerArea";
+ String ACCESS_CONTROL_INNER_AREA_AT_OID = "2.5.23.3";
+
+ // SubSchemaAdminSpecificArea
+ String SUB_SCHEMA_ADMIN_SPECIFIC_AREA_AT = "subSchemaSpecificSpecificArea";
+ String SUB_SCHEMA_ADMIN_SPECIFIC_AREA_AT_OID = "2.5.23.4";
+
+ // CollectiveAttributeSpecificArea
+ String COLLECTIVE_ATTRIBUTE_SPECIFIC_AREA_AT = "collectiveAttributeSpecificArea";
+ String COLLECTIVE_ATTRIBUTE_SPECIFIC_AREA_AT_OID= "2.5.23.5";
+
+ // CollectiveAttributeInnerArea
+ String COLLECTIVE_ATTRIBUTE_INNER_AREA_AT = "collectiveAttributeInnerArea";
+ String COLLECTIVE_ATTRIBUTE_INNER_AREA_AT_OID = "2.5.23.6";
+
// AccessControlScheme
String ACCESS_CONTROL_SCHEME_AT = "accessControlScheme";
String ACCESS_CONTROL_SCHEME_OID = "2.5.24.1";