directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1060157 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/interceptor/ core/src/main/java/org/apache/directory/server/core/admin/ core/src/main/java/org/apache/directory/server/core/authn/ core/src/mai...
Date Tue, 18 Jan 2011 01:56:49 GMT
Author: elecharny
Date: Tue Jan 18 01:56:49 2011
New Revision: 1060157

URL: http://svn.apache.org/viewvc?rev=1060157&view=rev
Log:
moved the instance to DirectoryService and SharedManager to the BaseInterceptor class.

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java?rev=1060157&r1=1060156&r2=1060157&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
Tue Jan 18 01:56:49 2011
@@ -47,6 +47,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 
 
 /**
@@ -58,6 +59,11 @@ import org.apache.directory.shared.ldap.
  */
 public abstract class BaseInterceptor implements Interceptor
 {
+    /** A reference to the DirectoryService instance */
+    protected DirectoryService directoryService;
+
+    /** A reference to the SchemaManager instance */
+    protected SchemaManager schemaManager;
 
     /** set of operational attribute types used for representing the password policy state
of a user entry */
     protected static final Set<AttributeType> PWD_POLICY_STATE_ATTRIBUTE_TYPES = new
HashSet<AttributeType>();
@@ -110,6 +116,8 @@ public abstract class BaseInterceptor im
      */
     public void init( DirectoryService directoryService ) throws LdapException
     {
+        this.directoryService = directoryService;
+        this.schemaManager = directoryService.getSchemaManager();
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java?rev=1060157&r1=1060156&r2=1060157&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java
Tue Jan 18 01:56:49 2011
@@ -82,7 +82,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.ldap.util.tree.DnNode;
@@ -105,12 +104,6 @@ public class AdministrativePointIntercep
      */
     private static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
-    /** A reference to the DirectoryService instance */
-    private DirectoryService directoryService;
-
-    /** A reference to the SchemaManager instance */
-    private SchemaManager schemaManager;
-
     /** A reference to the nexus for direct backend operations */
     private PartitionNexus nexus;
 
@@ -1147,9 +1140,7 @@ public class AdministrativePointIntercep
     {
         LOG.debug( "Initializing the AdministrativeInterceptor" );
 
-        this.directoryService = directoryService;
-
-        schemaManager = directoryService.getSchemaManager();
+        super.init( directoryService );
         nexus = directoryService.getPartitionNexus();
 
         // Init the At we use locally

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=1060157&r1=1060156&r2=1060157&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
Tue Jan 18 01:56:49 2011
@@ -106,7 +106,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.util.DateUtils;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
@@ -133,12 +132,6 @@ public class AuthenticationInterceptor e
     /** A map of authenticators associated with the authentication level required */
     private final Map<AuthenticationLevel, Collection<Authenticator>> authenticatorsMapByType
= new HashMap<AuthenticationLevel, Collection<Authenticator>>();
 
-    /** A reference to the DirectoryService instance */
-    private DirectoryService directoryService;
-
-    /** A reference to the SchemaManager instance */
-    private SchemaManager schemaManager;
-
     private CoreSession adminSession;
 
     private Set<DN> pwdResetSet = new HashSet<DN>();
@@ -197,9 +190,7 @@ public class AuthenticationInterceptor e
      */
     public void init( DirectoryService directoryService ) throws LdapException
     {
-        this.directoryService = directoryService;
-
-        schemaManager = directoryService.getSchemaManager();
+        super.init( directoryService );
 
         adminSession = directoryService.getAdminSession();
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=1060157&r1=1060156&r2=1060157&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
Tue Jan 18 01:56:49 2011
@@ -83,7 +83,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.normalizers.ConcreteNameComponentNormalizer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -164,9 +163,6 @@ public class AciAuthorizationInterceptor
     /** interceptor chain */
     private InterceptorChain chain;
 
-    /** SchemaManager instance */
-    private SchemaManager schemaManager;
-
     /** the system wide subschemaSubentryDn */
     private String subschemaSubentryDn;
 
@@ -185,9 +181,6 @@ public class AciAuthorizationInterceptor
     /** A reference to the nexus for direct backend operations */
     private PartitionNexus nexus;
 
-    /** A reference to the DirectoryService instance */
-    private DirectoryService directoryService;
-
     public static final SearchControls DEFAULT_SEARCH_CONTROLS = new SearchControls();
 
 
@@ -292,13 +285,13 @@ public class AciAuthorizationInterceptor
     {
         LOG.debug( "Initializing the AciAuthorizationInterceptor" );
 
-        this.directoryService = directoryService;
+        super.init( directoryService );
+
         nexus = directoryService.getPartitionNexus();
 
         DN adminDn = directoryService.getDNFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN
);
         CoreSession adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG
),
             directoryService );
-        schemaManager = directoryService.getSchemaManager();
         chain = directoryService.getInterceptorChain();
 
         // Create the caches

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=1060157&r1=1060156&r2=1060157&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
Tue Jan 18 01:56:49 2011
@@ -58,7 +58,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -104,8 +103,9 @@ public class DefaultAuthorizationInterce
 
     public void init( DirectoryService directoryService ) throws LdapException
     {
+        super.init( directoryService );
+
         nexus = directoryService.getPartitionNexus();
-        SchemaManager schemaManager = directoryService.getSchemaManager();
 
         ADMIN_SYSTEM_DN = directoryService.getDNFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN
);
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java?rev=1060157&r1=1060156&r2=1060157&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
Tue Jan 18 01:56:49 2011
@@ -52,7 +52,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SchemaUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -72,9 +71,6 @@ public class CollectiveAttributeIntercep
     /** The LoggerFactory used by this Interceptor */
     private static Logger LOG = LoggerFactory.getLogger( CollectiveAttributeInterceptor.class
);
 
-    /** The SchemaManager instance */
-    private SchemaManager schemaManager;
-    
     /** The ObjectClass AttributeType */
     private static AttributeType OBJECT_CLASS_AT;
 
@@ -106,7 +102,6 @@ public class CollectiveAttributeIntercep
     public void init( DirectoryService directoryService ) throws LdapException
     {
         super.init( directoryService );
-        schemaManager = directoryService.getSchemaManager();
         
         // Load some AttributeType
         COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT = schemaManager.getAttributeType( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT
);

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java?rev=1060157&r1=1060156&r2=1060157&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
Tue Jan 18 01:56:49 2011
@@ -46,7 +46,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
-import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.normalizers.ConcreteNameComponentNormalizer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -63,26 +62,23 @@ public class EventInterceptor extends Ba
     private final static Logger LOG = LoggerFactory.getLogger( EventInterceptor.class );
 
     private List<RegistrationEntry> registrations = new CopyOnWriteArrayList<RegistrationEntry>();
-    private DirectoryService ds;
     private FilterNormalizingVisitor filterNormalizer;
     private Evaluator evaluator;
     private ExecutorService executor;
 
 
     @Override
-    public void init( DirectoryService ds ) throws LdapException
+    public void init( DirectoryService directpryService ) throws LdapException
     {
         LOG.info( "Initializing ..." );
-        super.init( ds );
+        super.init( directpryService );
 
-        this.ds = ds;
-        SchemaManager schemaManager = ds.getSchemaManager();
         NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( schemaManager
);
         filterNormalizer = new FilterNormalizingVisitor( ncn, schemaManager );
         evaluator = new ExpressionEvaluator( schemaManager );
         executor = new ThreadPoolExecutor( 1, 10, 1000, TimeUnit.MILLISECONDS, new ArrayBlockingQueue<Runnable>(
100 ) );
 
-        this.ds.setEventService( new DefaultEventService() );
+        this.directoryService.setEventService( new DefaultEventService() );
         LOG.info( "Initialization complete." );
     }
 
@@ -336,7 +332,7 @@ public class EventInterceptor extends Ba
          */
         public void addListener( DirectoryListener listener, NotificationCriteria criteria
) throws Exception
         {
-            criteria.getBase().normalize( ds.getSchemaManager() );
+            criteria.getBase().normalize( directoryService.getSchemaManager() );
             ExprNode result = ( ExprNode ) criteria.getFilter().accept( filterNormalizer
);
             criteria.setFilter( result );
             registrations.add( new RegistrationEntry( listener, criteria ) );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=1060157&r1=1060156&r2=1060157&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
Tue Jan 18 01:56:49 2011
@@ -54,7 +54,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.SchemaManager;
 
 
 /**
@@ -93,9 +92,6 @@ public class ExceptionInterceptor extend
     /** Declare a default for this cache. 100 entries seems to be enough */
     private static final int DEFAULT_CACHE_SIZE = 100;
 
-    /** SchemaManager instance */
-    private SchemaManager schemaManager;
-
     /** The ObjectClass AttributeType */
     private static AttributeType OBJECT_CLASS_AT;
 
@@ -110,10 +106,10 @@ public class ExceptionInterceptor extend
 
     public void init( DirectoryService directoryService ) throws LdapException
     {
+        super.init( directoryService );
         nexus = directoryService.getPartitionNexus();
         Value<?> attr = nexus.getRootDSE( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT
).get();
         subschemSubentryDn = directoryService.getDNFactory().create( attr.getString() );
-        schemaManager = directoryService.getSchemaManager();
 
         // look up some constant information
         OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT
);

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=1060157&r1=1060156&r2=1060157&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
Tue Jan 18 01:56:49 2011
@@ -53,7 +53,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.normalizers.ConcreteNameComponentNormalizer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -79,10 +78,6 @@ public class NormalizationInterceptor ex
     /** a filter node value normalizer and undefined node remover */
     private FilterNormalizingVisitor normVisitor;
 
-    /** The attributeType registry */
-    private SchemaManager schemaManager;
-
-
     /**
      * Initialize the registries, normalizers.
      */
@@ -90,7 +85,8 @@ public class NormalizationInterceptor ex
     {
         LOG.debug( "Initialiazing the NormalizationInterceptor" );
 
-        schemaManager = directoryService.getSchemaManager();
+        super.init( directoryService );
+
         NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( schemaManager
);
         normVisitor = new FilterNormalizingVisitor( ncn, schemaManager );
     }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=1060157&r1=1060156&r2=1060157&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
Tue Jan 18 01:56:49 2011
@@ -61,7 +61,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 import org.apache.directory.shared.ldap.util.DateUtils;
 import org.slf4j.Logger;
@@ -106,17 +105,12 @@ public class OperationalAttributeInterce
         }
     };
 
-    private DirectoryService service;
-
     /** The subschemasubentry DN */
     private DN subschemaSubentryDn;
 
     /** The admin DN */
     private DN adminDn;
 
-    /** The schemaManager */
-    private SchemaManager schemaManager;
-
     private static AttributeType MODIFIERS_NAME_ATTRIBUTE_TYPE;
     private static AttributeType MODIFY_TIMESTAMP_ATTRIBUTE_TYPE;
     private static AttributeType ENTRY_CSN_ATTRIBUTE_TYPE;
@@ -131,16 +125,15 @@ public class OperationalAttributeInterce
 
     public void init( DirectoryService directoryService ) throws LdapException
     {
-        service = directoryService;
-        schemaManager = directoryService.getSchemaManager();
+        super.init( directoryService );
 
         // stuff for dealing with subentries (garbage for now)
-        Value<?> subschemaSubentry = service.getPartitionNexus().getRootDSE( null ).get(
+        Value<?> subschemaSubentry = directoryService.getPartitionNexus().getRootDSE(
null ).get(
             SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
-        subschemaSubentryDn = service.getDNFactory().create( subschemaSubentry.getString()
);
+        subschemaSubentryDn = directoryService.getDNFactory().create( subschemaSubentry.getString()
);
 
         // Create the Admin DN 
-        adminDn = service.getDNFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN );
+        adminDn = directoryService.getDNFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN
);
 
         MODIFIERS_NAME_ATTRIBUTE_TYPE = schemaManager.getAttributeType( SchemaConstants.MODIFIERS_NAME_AT
);
         MODIFY_TIMESTAMP_ATTRIBUTE_TYPE = schemaManager.getAttributeType( SchemaConstants.MODIFY_TIMESTAMP_AT
);
@@ -208,7 +201,7 @@ public class OperationalAttributeInterce
         // The EntryCSN attribute
         if ( !checkAddOperationalAttribute( isAdmin, entry, SchemaConstants.ENTRY_CSN_AT
) )
         {
-            entry.put( SchemaConstants.ENTRY_CSN_AT, service.getCSN().toString() );
+            entry.put( SchemaConstants.ENTRY_CSN_AT, directoryService.getCSN().toString()
);
         }
 
         // The CreatorsName attribute
@@ -336,7 +329,7 @@ public class OperationalAttributeInterce
 
         if ( !entryCsnAtPresent )
         {
-            String csn = service.getCSN().toString();
+            String csn = directoryService.getCSN().toString();
             EntryAttribute attribute = new DefaultEntryAttribute( ENTRY_CSN_ATTRIBUTE_TYPE,
csn );
             Modification updatedCsn = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
attribute );
             mods.add( updatedCsn );
@@ -431,7 +424,7 @@ public class OperationalAttributeInterce
         if ( searchContext.isAllOperationalAttributes()
             || ( searchContext.getReturningAttributes() != null && !searchContext.getReturningAttributes().isEmpty()
) )
         {
-            if ( service.isDenormalizeOpAttrsEnabled() )
+            if ( directoryService.isDenormalizeOpAttrsEnabled() )
             {
                 cursor.addEntryFilter( DENORMALIZING_SEARCH_FILTER );
             }
@@ -510,13 +503,13 @@ public class OperationalAttributeInterce
 
     public void denormalizeEntryOpAttrs( Entry entry ) throws LdapException
     {
-        if ( service.isDenormalizeOpAttrsEnabled() )
+        if ( directoryService.isDenormalizeOpAttrsEnabled() )
         {
             EntryAttribute attr = entry.get( SchemaConstants.CREATORS_NAME_AT );
 
             if ( attr != null )
             {
-                DN creatorsName = service.getDNFactory().create( attr.getString() );
+                DN creatorsName = directoryService.getDNFactory().create( attr.getString()
);
 
                 attr.clear();
                 attr.add( denormalizeTypes( creatorsName ).getName() );
@@ -526,7 +519,7 @@ public class OperationalAttributeInterce
 
             if ( attr != null )
             {
-                DN modifiersName = service.getDNFactory().create( attr.getString() );
+                DN modifiersName = directoryService.getDNFactory().create( attr.getString()
);
 
                 attr.clear();
                 attr.add( denormalizeTypes( modifiersName ).getName() );
@@ -536,7 +529,7 @@ public class OperationalAttributeInterce
 
             if ( attr != null )
             {
-                DN modifiersName = service.getDNFactory().create( attr.getString() );
+                DN modifiersName = directoryService.getDNFactory().create( attr.getString()
);
 
                 attr.clear();
                 attr.add( denormalizeTypes( modifiersName ).getName() );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java?rev=1060157&r1=1060156&r2=1060157&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
Tue Jan 18 01:56:49 2011
@@ -46,7 +46,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
@@ -66,9 +65,6 @@ public class ReferralInterceptor extends
 
     private PartitionNexus nexus;
 
-    /** The global schemaManager */
-    private SchemaManager schemaManager;
-
     /** The referralManager */
     private ReferralManager referralManager;
 
@@ -203,8 +199,9 @@ public class ReferralInterceptor extends
 
     public void init( DirectoryService directoryService ) throws LdapException
     {
+        super.init( directoryService );
+
         nexus = directoryService.getPartitionNexus();
-        schemaManager = directoryService.getSchemaManager();
 
         // Initialize the referralManager
         referralManager = new ReferralManagerImpl( directoryService );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=1060157&r1=1060156&r2=1060157&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Tue Jan 18 01:56:49 2011
@@ -90,7 +90,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schema.AttributeTypeOptions;
 import org.apache.directory.shared.ldap.schema.ObjectClass;
 import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
-import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
@@ -129,9 +128,6 @@ public class SchemaInterceptor extends B
 
     private List<EntryFilter> filters = new ArrayList<EntryFilter>();
 
-    /** the global schema object SchemaManager */
-    private SchemaManager schemaManager;
-
     /** A global reference to the ObjectClass attributeType */
     private AttributeType OBJECT_CLASS_AT;
 
@@ -184,8 +180,9 @@ public class SchemaInterceptor extends B
             LOG.debug( "Initializing SchemaInterceptor..." );
         }
 
+        super.init( directoryService );
+
         nexus = directoryService.getPartitionNexus();
-        schemaManager = directoryService.getSchemaManager();
         OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT
);
         binaryAttributeFilter = new BinaryAttributeFilter();
         topFilter = new TopFilter();

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=1060157&r1=1060156&r2=1060157&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
Tue Jan 18 01:56:49 2011
@@ -78,7 +78,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecificationParser;
@@ -115,9 +114,6 @@ public class SubentryInterceptor extends
     /** A reference to the nexus for direct backend operations */
     private PartitionNexus nexus;
 
-    /** The SchemManager instance */
-    private SchemaManager schemaManager;
-
     /** A reference to the ObjectClass AT */
     private static AttributeType OBJECT_CLASS_AT;
 
@@ -203,7 +199,6 @@ public class SubentryInterceptor extends
         super.init( directoryService );
 
         nexus = directoryService.getPartitionNexus();
-        schemaManager = directoryService.getSchemaManager();
 
         // setup various attribute type values
         OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT
);

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java?rev=1060157&r1=1060156&r2=1060157&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
Tue Jan 18 01:56:49 2011
@@ -57,7 +57,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.NormalizerMappingResolver;
-import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
 import org.apache.directory.shared.ldap.trigger.ActionTime;
 import org.apache.directory.shared.ldap.trigger.LdapOperation;
@@ -98,9 +97,6 @@ public class TriggerInterceptor extends 
 
     private StoredProcExecutionManager manager;
     
-    /** The global schemaManager */
-    private SchemaManager schemaManager;
-
     /** The ObjectClass AttributeType */
     private static AttributeType OBJECT_CLASS_AT;
 
@@ -240,7 +236,6 @@ public class TriggerInterceptor extends 
         super.init( directoryService );
 
         triggerSpecCache = new TriggerSpecCache( directoryService );
-        schemaManager = directoryService.getSchemaManager();
 
         // look up some constant information
         OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT
);
@@ -252,6 +247,7 @@ public class TriggerInterceptor extends 
                 return schemaManager.getNormalizerMapping();
             }
         } );
+
         chain = directoryService.getInterceptorChain();
 
         //StoredProcEngineConfig javaxScriptSPEngineConfig = new JavaxStoredProcEngineConfig();



Mime
View raw message