directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r379013 [12/45] - in /directory/trunks/apacheds: ./ core-plugin/ core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/ core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/ core-shared/ core-shared/src/...
Date Mon, 20 Feb 2006 03:58:21 GMT
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java Sun Feb 19 19:57:02 2006
@@ -56,7 +56,7 @@
      * @param env the JNDI environment parameters
      * @throws NamingException the context cannot be created
      */
-    public ServerLdapContext( DirectoryService service, Hashtable env ) throws NamingException
+    public ServerLdapContext(DirectoryService service, Hashtable env) throws NamingException
     {
         super( service, env );
     }
@@ -71,7 +71,7 @@
      * @param env the environment properties used by this context
      * @param dn the distinguished name of this context
      */
-    ServerLdapContext( DirectoryService service, LdapPrincipal principal, Name dn ) throws NamingException
+    ServerLdapContext(DirectoryService service, LdapPrincipal principal, Name dn) throws NamingException
     {
         super( service, principal, dn );
     }
@@ -91,8 +91,7 @@
      * @see javax.naming.ldap.LdapContext#newInstance(
      * javax.naming.ldap.Control[])
      */
-    public LdapContext newInstance( Control[] requestControls )
-        throws NamingException
+    public LdapContext newInstance( Control[] requestControls ) throws NamingException
     {
         ServerLdapContext ctx = new ServerLdapContext( getService(), getPrincipal(), getDn() );
         ctx.setRequestControls( requestControls );
@@ -150,7 +149,6 @@
     // Additional ApacheDS Specific JNDI Functionality
     // ------------------------------------------------------------------------
 
-
     /**
      * Explicitly exposes an LDAP compare operation which JNDI does not
      * directly provide.  All normalization and schema checking etcetera
@@ -166,10 +164,10 @@
      */
     public boolean compare( Name name, String oid, Object value ) throws NamingException
     {
-       return super.getNexusProxy().compare( name, oid, value );
+        return super.getNexusProxy().compare( name, oid, value );
     }
-    
-    
+
+
     /**
      * Calling this method tunnels an unbind call down into the partition holding 
      * the bindDn.  The bind() counter part is not exposed because it is automatically
@@ -183,17 +181,17 @@
         String bindDn = ( String ) getEnvironment().get( Context.SECURITY_PRINCIPAL );
         super.getNexusProxy().unbind( new LdapName( bindDn ) );
     }
-    
-    
+
+
     private transient ReferralService refService;
     public boolean isReferral( String name ) throws NamingException
     {
         if ( refService == null )
         {
-            refService = ( ReferralService ) getService().getConfiguration().getInterceptorChain().
-                get( ReferralService.NAME );
+            refService = ( ReferralService ) getService().getConfiguration().getInterceptorChain().get(
+                ReferralService.NAME );
         }
-        
+
         return refService.isReferral( name );
     }
 }

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java Sun Feb 19 19:57:02 2006
@@ -73,15 +73,17 @@
     }
 
 
-    public void destroy() {}
+    public void destroy()
+    {
+    }
 
 
     // ------------------------------------------------------------------------
     // Normalize all Name based arguments for ContextPartition interface operations
     // ------------------------------------------------------------------------
 
-
-    public void add( NextInterceptor nextInterceptor, String upName, Name normName, Attributes attrs ) throws NamingException
+    public void add( NextInterceptor nextInterceptor, String upName, Name normName, Attributes attrs )
+        throws NamingException
     {
         normName = parser.parse( normName.toString() );
         nextInterceptor.add( upName, normName, attrs );
@@ -95,7 +97,8 @@
     }
 
 
-    public void modify( NextInterceptor nextInterceptor, Name name, int modOp, Attributes attrs ) throws NamingException
+    public void modify( NextInterceptor nextInterceptor, Name name, int modOp, Attributes attrs )
+        throws NamingException
     {
         name = parser.parse( name.toString() );
         nextInterceptor.modify( name, modOp, attrs );
@@ -109,7 +112,8 @@
     }
 
 
-    public void modifyRn( NextInterceptor nextInterceptor, Name name, String newRn, boolean deleteOldRn ) throws NamingException
+    public void modifyRn( NextInterceptor nextInterceptor, Name name, String newRn, boolean deleteOldRn )
+        throws NamingException
     {
         name = parser.parse( name.toString() );
         nextInterceptor.modifyRn( name, newRn, deleteOldRn );
@@ -124,7 +128,8 @@
     }
 
 
-    public void move( NextInterceptor nextInterceptor, Name name, Name newParentName, String newRn, boolean deleteOldRn ) throws NamingException
+    public void move( NextInterceptor nextInterceptor, Name name, Name newParentName, String newRn, boolean deleteOldRn )
+        throws NamingException
     {
         name = parser.parse( name.toString() );
         newParentName = parser.parse( newParentName.toString() );
@@ -132,16 +137,15 @@
     }
 
 
-    public NamingEnumeration search( NextInterceptor nextInterceptor,
-                                     Name base, Map env, ExprNode filter,
-                                     SearchControls searchCtls ) throws NamingException
+    public NamingEnumeration search( NextInterceptor nextInterceptor, Name base, Map env, ExprNode filter,
+        SearchControls searchCtls ) throws NamingException
     {
         base = parser.parse( base.toString() );
 
         if ( filter.isLeaf() )
         {
             LeafNode ln = ( LeafNode ) filter;
-            if ( ! registry.hasAttributeType( ln.getAttribute() ) )
+            if ( !registry.hasAttributeType( ln.getAttribute() ) )
             {
                 StringBuffer buf = new StringBuffer();
                 buf.append( "undefined filter based on undefined attributeType '" );
@@ -155,14 +159,15 @@
         filter.accept( visitor );
 
         // check that after pruning we have valid branch node at the top
-        if ( ! filter.isLeaf() )
+        if ( !filter.isLeaf() )
         {
             BranchNode child = ( BranchNode ) filter;
 
             // if the remaining filter branch node has no children return an empty enumeration
             if ( child.getChildren().size() == 0 )
             {
-                log.warn( "Undefined branchnode filter without child nodes not evaluted at all.  Returning empty enumeration." );
+                log
+                    .warn( "Undefined branchnode filter without child nodes not evaluted at all.  Returning empty enumeration." );
                 return new EmptyEnumeration();
             }
 
@@ -215,7 +220,6 @@
     // Normalize all Name based arguments for other interface operations
     // ------------------------------------------------------------------------
 
-
     public Name getMatchedName( NextInterceptor nextInterceptor, Name name, boolean normalized ) throws NamingException
     {
         name = parser.parse( name.toString() );
@@ -236,7 +240,6 @@
         return next.compare( name, oid, value );
     }
 
-
     /**
      * A normalizer that normalizes each name component specifically according to
      * the attribute type of the name component.
@@ -249,6 +252,7 @@
             return ( String ) type.getEquality().getNormalizer().normalize( value );
         }
 
+
         public String normalizeByName( String name, byte[] value ) throws NamingException
         {
             AttributeType type = registry.lookup( name );
@@ -262,6 +266,7 @@
             AttributeType type = registry.lookup( oid );
             return ( String ) type.getEquality().getNormalizer().normalize( value );
         }
+
 
         public boolean isDefined( String id )
         {

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/ValueNormalizingVisitor.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/ValueNormalizingVisitor.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/ValueNormalizingVisitor.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/ValueNormalizingVisitor.java Sun Feb 19 19:57:02 2006
@@ -55,7 +55,7 @@
     private final NameComponentNormalizer ncn;
 
 
-    public ValueNormalizingVisitor( NameComponentNormalizer ncn )
+    public ValueNormalizingVisitor(NameComponentNormalizer ncn)
     {
         this.ncn = ncn;
     }
@@ -72,7 +72,7 @@
             {
                 // still need this check here in case the top level is a leaf node
                 // with an undefined attributeType for its attribute
-                if ( ! ncn.isDefined( snode.getAttribute() ) )
+                if ( !ncn.isDefined( snode.getAttribute() ) )
                 {
                     normalized = snode.getValue();
                 }
@@ -99,7 +99,7 @@
         {
             BranchNode bnode = ( BranchNode ) node;
             StringBuffer buf = null;
-            for ( int ii = 0; ii < bnode.getChildren().size() ; ii++ )
+            for ( int ii = 0; ii < bnode.getChildren().size(); ii++ )
             {
                 // before visiting each node let's check to make sure non-branch children use
                 // attributes that are defined in the system, if undefined nodes are removed
@@ -107,7 +107,7 @@
                 if ( child.isLeaf() )
                 {
                     LeafNode ln = ( LeafNode ) child;
-                    if ( ! ncn.isDefined( ln.getAttribute() ) )
+                    if ( !ncn.isDefined( ln.getAttribute() ) )
                     {
                         if ( buf == null )
                         {
@@ -136,7 +136,7 @@
             // AND/OR with one or less children) and repair them by removing branch
             // nodes without children and replacing branch nodes like AND/OR with
             // their single child if other branch nodes do not remain.
-            for ( int ii = 0; ii < bnode.getChildren().size() ; ii++ )
+            for ( int ii = 0; ii < bnode.getChildren().size(); ii++ )
             {
                 ExprNode unknown = ( ExprNode ) bnode.getChildren().get( ii );
                 if ( !unknown.isLeaf() )

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/ValueNormalizingVisitor.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java Sun Feb 19 19:57:02 2006
@@ -65,7 +65,7 @@
     private final SearchResultFilter SEARCH_FILTER = new SearchResultFilter()
     {
         public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
-                throws NamingException
+            throws NamingException
         {
             if ( controls.getReturningAttributes() == null )
             {
@@ -107,7 +107,8 @@
     /**
      * Adds extra operational attributes to the entry before it is added.
      */
-    public void add( NextInterceptor nextInterceptor, String upName, Name normName, Attributes entry ) throws NamingException
+    public void add( NextInterceptor nextInterceptor, String upName, Name normName, Attributes entry )
+        throws NamingException
     {
         String principal = getPrincipal().getName();
 
@@ -123,10 +124,11 @@
     }
 
 
-    public void modify( NextInterceptor nextInterceptor, Name name, int modOp, Attributes attrs) throws NamingException
+    public void modify( NextInterceptor nextInterceptor, Name name, int modOp, Attributes attrs )
+        throws NamingException
     {
         nextInterceptor.modify( name, modOp, attrs );
-        
+
         // add operational attributes after call in case the operation fails
         Attributes attributes = new BasicAttributes( true );
         BasicAttribute attribute = new BasicAttribute( "modifiersName" );
@@ -159,10 +161,11 @@
     }
 
 
-    public void modifyRn( NextInterceptor nextInterceptor, Name name, String newRn, boolean deleteOldRn ) throws NamingException
+    public void modifyRn( NextInterceptor nextInterceptor, Name name, String newRn, boolean deleteOldRn )
+        throws NamingException
     {
         nextInterceptor.modifyRn( name, newRn, deleteOldRn );
-        
+
         // add operational attributes after call in case the operation fails
         Attributes attributes = new BasicAttributes( true );
         BasicAttribute attribute = new BasicAttribute( "modifiersName" );
@@ -196,7 +199,8 @@
     }
 
 
-    public void move( NextInterceptor nextInterceptor, Name name, Name newParentName, String newRn, boolean deleteOldRn ) throws NamingException
+    public void move( NextInterceptor nextInterceptor, Name name, Name newParentName, String newRn, boolean deleteOldRn )
+        throws NamingException
     {
         nextInterceptor.move( name, newParentName, newRn, deleteOldRn );
 
@@ -247,9 +251,8 @@
     }
 
 
-    public NamingEnumeration search( NextInterceptor nextInterceptor, 
-            Name base, Map env, ExprNode filter,
-            SearchControls searchCtls ) throws NamingException
+    public NamingEnumeration search( NextInterceptor nextInterceptor, Name base, Map env, ExprNode filter,
+        SearchControls searchCtls ) throws NamingException
     {
         Invocation invocation = InvocationStack.getInstance().peek();
         NamingEnumeration e = nextInterceptor.search( base, env, filter, searchCtls );
@@ -293,8 +296,7 @@
     }
 
 
-    private void filter( Name dn, Attributes entry, String[] ids )
-            throws NamingException
+    private void filter( Name dn, Attributes entry, String[] ids ) throws NamingException
     {
         // still need to protect against returning op attrs when ids is null
         if ( ids == null )
@@ -324,7 +326,7 @@
                 }
             }
         }
-        
+
         // do nothing past here since this explicity specifies which
         // attributes to include - backends will automatically populate
         // with right set of attributes using ids array

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/AbstractDirectoryPartition.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/AbstractDirectoryPartition.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/AbstractDirectoryPartition.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/AbstractDirectoryPartition.java Sun Feb 19 19:57:02 2006
@@ -16,6 +16,7 @@
  */
 package org.apache.directory.server.core.partition;
 
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -32,6 +33,7 @@
 import org.apache.directory.server.core.configuration.DirectoryPartitionConfiguration;
 import org.apache.directory.shared.ldap.name.LdapName;
 
+
 /**
  * A {@link DirectoryPartition} that helps users to implement their own partition.
  * Most methods are implemented by default.  Please look at the description of
@@ -48,11 +50,13 @@
     private DirectoryPartitionConfiguration cfg;
     /** <tt>true</tt> if and only if this partition is initialized. */
     private boolean initialized;
-    
+
+
     protected AbstractDirectoryPartition()
     {
     }
 
+
     /**
      * Sets up default properties(<tt>factoryConfiguration</tt> and <tt>configuration</tt>) and
      * calls {@link #doInit()} where you have to put your initialization code in.
@@ -60,9 +64,10 @@
      * without any errors.  {@link #destroy()} is called automatically as a clean-up process
      * if {@link #doInit()} throws an exception.
      */
-    public final void init( DirectoryServiceConfiguration factoryCfg, DirectoryPartitionConfiguration cfg ) throws NamingException
+    public final void init( DirectoryServiceConfiguration factoryCfg, DirectoryPartitionConfiguration cfg )
+        throws NamingException
     {
-        if( initialized )
+        if ( initialized )
         {
             // Already initialized.
             return;
@@ -70,26 +75,29 @@
 
         this.factoryCfg = factoryCfg;
         this.cfg = cfg;
-        try{
+        try
+        {
             doInit();
             initialized = true;
         }
         finally
         {
-            if( !initialized )
+            if ( !initialized )
             {
                 destroy();
             }
         }
     }
 
+
     /**
      * Override this method to put your initialization code.
      */
     protected void doInit() throws NamingException
     {
     }
-    
+
+
     /**
      * Calls {@link #doDestroy()} where you have to put your destroy code in,
      * and clears default properties.  Once this method is invoked, {@link #isInitialized()}
@@ -97,7 +105,7 @@
      */
     public final void destroy()
     {
-        if( cfg == null )
+        if ( cfg == null )
         {
             // Already destroyed.
             return;
@@ -115,6 +123,7 @@
         }
     }
 
+
     /**
      * Override this method to put your initialization code.
      */
@@ -122,6 +131,7 @@
     {
     }
 
+
     /**
      * Returns <tt>true</tt> if this context partition is initialized successfully.
      */
@@ -130,6 +140,7 @@
         return initialized;
     }
 
+
     /**
      * Returns {@link DirectoryServiceConfiguration} that is provided from
      * {@link #init(DirectoryServiceConfiguration, DirectoryPartitionConfiguration)}.
@@ -138,7 +149,8 @@
     {
         return factoryCfg;
     }
-    
+
+
     /**
      * Returns {@link DirectoryPartitionConfiguration} that is provided from
      * {@link #init(DirectoryServiceConfiguration, DirectoryPartitionConfiguration)}.
@@ -148,12 +160,13 @@
         return cfg;
     }
 
+
     public final Name getSuffix( boolean normalized ) throws NamingException
     {
-        if( normalized )
+        if ( normalized )
         {
             return getConfiguration().getNormalizedSuffix(
-                    getFactoryConfiguration().getGlobalRegistries().getMatchingRuleRegistry() );
+                getFactoryConfiguration().getGlobalRegistries().getMatchingRuleRegistry() );
         }
         else
         {
@@ -161,18 +174,21 @@
         }
     }
 
+
     public final boolean isSuffix( Name name ) throws NamingException
     {
         return getSuffix( true ).equals( name ) || getSuffix( false ).equals( name );
     }
 
+
     /**
      * This method does nothing by default.
      */
     public void sync() throws NamingException
     {
     }
-    
+
+
     /**
      * This method calls {@link #lookup(Name)} and return <tt>true</tt>
      * if it returns an entry by default.  Please override this method if
@@ -184,12 +200,13 @@
         {
             return lookup( name ) != null;
         }
-        catch( NameNotFoundException e )
+        catch ( NameNotFoundException e )
         {
             return false;
         }
     }
 
+
     /**
      * This method calls {@link DirectoryPartition#lookup(Name, String[])}
      * with null <tt>attributeIds</tt> by default.  Please override
@@ -200,6 +217,7 @@
         return lookup( name, null );
     }
 
+
     /**
      * This method forwards the request to
      * {@link DirectoryPartition#modify(Name, ModificationItem[])} after
@@ -211,16 +229,17 @@
     {
         List items = new ArrayList( mods.size() );
         NamingEnumeration e = mods.getAll();
-        while( e.hasMore() )
+        while ( e.hasMore() )
         {
             items.add( new ModificationItem( modOp, ( Attribute ) e.next() ) );
         }
-        
-        ModificationItem[] itemsArray = new ModificationItem[ items.size() ];
+
+        ModificationItem[] itemsArray = new ModificationItem[items.size()];
         itemsArray = ( ModificationItem[] ) items.toArray( itemsArray );
         modify( name, itemsArray );
     }
 
+
     /**
      * This method calls {@link DirectoryPartition#move(Name, Name)} and
      * {@link DirectoryPartition#modifyRn(Name, String, boolean)} subsequently
@@ -234,6 +253,7 @@
         move( oldName, newParentName );
         modifyRn( newName, newRn, deleteOldRn );
     }
+
 
     /**
      * This method throws {@link OperationNotSupportedException} by default.

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/AbstractDirectoryPartition.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/AbstractDirectoryPartition.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java Sun Feb 19 19:57:02 2006
@@ -71,7 +71,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-                                
+
 /**
  * A nexus for partitions dedicated for storing entries specific to a naming
  * context.
@@ -118,7 +118,7 @@
      *
      * @see <a href="http://www.faqs.org/rfcs/rfc3045.html">Vendor Information</a>
      */
-    public DefaultDirectoryPartitionNexus( Attributes rootDSE )
+    public DefaultDirectoryPartitionNexus(Attributes rootDSE)
     {
         // setup that root DSE
         this.rootDSE = rootDSE;
@@ -166,30 +166,31 @@
         {
             log.error( "failed to log version properties" );
         }
-        
+
         attr = new LockableAttributeImpl( VENDORVERSION_ATTR );
         attr.add( props.getProperty( "apacheds.version", "UNKNOWN" ) );
         rootDSE.put( attr );
     }
 
 
-    public void init( DirectoryServiceConfiguration factoryCfg, DirectoryPartitionConfiguration cfg ) throws NamingException
+    public void init( DirectoryServiceConfiguration factoryCfg, DirectoryPartitionConfiguration cfg )
+        throws NamingException
     {
         // NOTE: We ignore ContextPartitionConfiguration parameter here.
-        if( initialized )
+        if ( initialized )
         {
             return;
         }
-        
+
         this.factoryCfg = factoryCfg;
-        
+
         List initializedPartitionCfgs = new ArrayList();
         initializedPartitionCfgs.add( initializeSystemPartition() );
-        
+
         Iterator i = factoryCfg.getStartupConfiguration().getContextPartitionConfigurations().iterator();
         try
         {
-            while( i.hasNext() )
+            while ( i.hasNext() )
             {
                 DirectoryPartitionConfiguration c = ( DirectoryPartitionConfiguration ) i.next();
                 addContextPartition( c );
@@ -199,24 +200,21 @@
         }
         finally
         {
-            if( !initialized )
+            if ( !initialized )
             {
                 i = initializedPartitionCfgs.iterator();
-                while( i.hasNext() )
+                while ( i.hasNext() )
                 {
-                    DirectoryPartitionConfiguration partitionCfg = 
-                        ( DirectoryPartitionConfiguration ) i.next();
+                    DirectoryPartitionConfiguration partitionCfg = ( DirectoryPartitionConfiguration ) i.next();
                     DirectoryPartition partition = partitionCfg.getContextPartition();
                     i.remove();
                     try
                     {
                         partition.destroy();
                     }
-                    catch( Exception e )
+                    catch ( Exception e )
                     {
-                        log.warn(
-                                "Failed to destroy a partition: " +
-                                partitionCfg.getSuffix(), e );
+                        log.warn( "Failed to destroy a partition: " + partitionCfg.getSuffix(), e );
                     }
                     finally
                     {
@@ -236,7 +234,7 @@
         systemCfg.setName( "system" );
         systemCfg.setSuffix( DirectoryPartitionNexus.SYSTEM_PARTITION_SUFFIX );
         systemCfg.setContextPartition( system );
-        
+
         // Add indexed attributes for system partition
         Set indexedSystemAttrs = new HashSet();
         indexedSystemAttrs.add( Oid.ALIAS );
@@ -247,31 +245,30 @@
         indexedSystemAttrs.add( Oid.SUBALIAS );
         indexedSystemAttrs.add( Oid.UPDN );
         systemCfg.setIndexedAttributes( indexedSystemAttrs );
-        
+
         // Add context entry for system partition
         Attributes systemEntry = new LockableAttributesImpl();
         Attribute objectClassAttr = new LockableAttributeImpl( "objectClass" );
         objectClassAttr.add( "top" );
         objectClassAttr.add( "organizationalUnit" );
         systemEntry.put( objectClassAttr );
-        systemEntry.put( "creatorsName", DirectoryPartitionNexus.ADMIN_PRINCIPAL ) ;
-        systemEntry.put( "createTimestamp", DateUtils.getGeneralizedTime() ) ;
-        systemEntry.put(
-                NamespaceTools.getRdnAttribute( DirectoryPartitionNexus.SYSTEM_PARTITION_SUFFIX ),
-                NamespaceTools.getRdnValue( DirectoryPartitionNexus.SYSTEM_PARTITION_SUFFIX ) ) ;
+        systemEntry.put( "creatorsName", DirectoryPartitionNexus.ADMIN_PRINCIPAL );
+        systemEntry.put( "createTimestamp", DateUtils.getGeneralizedTime() );
+        systemEntry.put( NamespaceTools.getRdnAttribute( DirectoryPartitionNexus.SYSTEM_PARTITION_SUFFIX ),
+            NamespaceTools.getRdnValue( DirectoryPartitionNexus.SYSTEM_PARTITION_SUFFIX ) );
         systemCfg.setContextEntry( systemEntry );
 
         system.init( factoryCfg, systemCfg );
         String key = system.getSuffix( true ).toString();
-        if( partitions.containsKey( key ) )
+        if ( partitions.containsKey( key ) )
         {
             throw new ConfigurationException( "Duplicate partition suffix: " + key );
         }
         partitions.put( key, system );
-        
+
         Attribute namingContexts = rootDSE.get( NAMINGCTXS_ATTR );
         namingContexts.add( system.getSuffix( false ).toString() );
-        
+
         return systemCfg;
     }
 
@@ -295,7 +292,7 @@
         // have an attempt at closing down and synching their cached entries
         while ( suffixes.hasNext() )
         {
-            String suffix = (String) suffixes.next();
+            String suffix = ( String ) suffixes.next();
             try
             {
                 removeContextPartition( new LdapName( suffix ) );
@@ -351,14 +348,13 @@
     // ContextPartitionNexus Method Implementations
     // ------------------------------------------------------------------------
 
-
     public boolean compare( Name name, String oid, Object value ) throws NamingException
     {
         DirectoryPartition partition = getBackend( name );
         AttributeTypeRegistry registry = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
 
         // complain if we do not recognize the attribute being compared
-        if ( ! registry.hasAttributeType( oid ) )
+        if ( !registry.hasAttributeType( oid ) )
         {
             throw new LdapInvalidAttributeIdentifierException( oid + " not found within the attributeType registry" );
         }
@@ -387,30 +383,30 @@
          */
         Normalizer normalizer = attrType.getEquality().getNormalizer();
         Object reqVal = normalizer.normalize( value );
-        
+
         for ( int ii = 0; ii < attr.size(); ii++ )
         {
-        	Object attrValObj = normalizer.normalize( attr.get( ii ) );
-        	if ( attrValObj instanceof String )
-        	{
-        		String attrVal = ( String ) attrValObj;
-	            if ( ( reqVal instanceof String) && attrVal.equals( reqVal ) )
-	            {
-	                return true;
-	            }
-        	}
-        	else
-        	{
-        		byte[] attrVal = (byte[])attrValObj;
-        		if ( reqVal instanceof byte[] ) 
-        		{
-        			return Arrays.equals( attrVal, (byte[])reqVal );
-        		}
-        		else if ( reqVal instanceof String )
-        		{
-        			return Arrays.equals( attrVal, StringTools.getBytesUtf8( (String)reqVal ) );
-        		}
-        	}
+            Object attrValObj = normalizer.normalize( attr.get( ii ) );
+            if ( attrValObj instanceof String )
+            {
+                String attrVal = ( String ) attrValObj;
+                if ( ( reqVal instanceof String ) && attrVal.equals( reqVal ) )
+                {
+                    return true;
+                }
+            }
+            else
+            {
+                byte[] attrVal = ( byte[] ) attrValObj;
+                if ( reqVal instanceof byte[] )
+                {
+                    return Arrays.equals( attrVal, ( byte[] ) reqVal );
+                }
+                else if ( reqVal instanceof String )
+                {
+                    return Arrays.equals( attrVal, StringTools.getBytesUtf8( ( String ) reqVal ) );
+                }
+            }
         }
 
         return false;
@@ -423,14 +419,14 @@
 
         // Turn on default indices
         String key = config.getSuffix();
-        if( partitions.containsKey( key ) )
+        if ( partitions.containsKey( key ) )
         {
             throw new ConfigurationException( "Duplicate partition suffix: " + key );
         }
 
         partition.init( factoryCfg, config );
         partitions.put( partition.getSuffix( true ).toString(), partition );
-        
+
         Attribute namingContexts = rootDSE.get( NAMINGCTXS_ATTR );
         namingContexts.add( partition.getSuffix( false ).toString() );
     }
@@ -439,12 +435,12 @@
     public synchronized void removeContextPartition( Name suffix ) throws NamingException
     {
         String key = suffix.toString();
-        DirectoryPartition partition = (DirectoryPartition) partitions.get( key );
-        if( partition == null )
+        DirectoryPartition partition = ( DirectoryPartition ) partitions.get( key );
+        if ( partition == null )
         {
             throw new NameNotFoundException( "No partition with suffix: " + key );
         }
-        
+
         Attribute namingContexts = rootDSE.get( NAMINGCTXS_ATTR );
         namingContexts.remove( partition.getSuffix( false ).toString() );
         partitions.remove( key );
@@ -452,16 +448,18 @@
         partition.sync();
         partition.destroy();
     }
-    
+
+
     public DirectoryPartition getSystemPartition()
     {
         return system;
     }
 
+
     /**
      * @see DirectoryPartitionNexus#getLdapContext()
      */
-    public LdapContext getLdapContext() 
+    public LdapContext getLdapContext()
     {
         throw new NotImplementedException();
     }
@@ -512,7 +510,7 @@
     }
 
 
-    public Attributes getRootDSE() 
+    public Attributes getRootDSE()
     {
         return rootDSE;
     }
@@ -541,8 +539,7 @@
     // ------------------------------------------------------------------------
     // DirectoryPartition Interface Method Implementations
     // ------------------------------------------------------------------------
-    
-    
+
     public void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException
     {
         DirectoryPartition partition = getBackend( bindDn );
@@ -556,7 +553,7 @@
         partition.unbind( bindDn );
     }
 
-    
+
     /**
      * @see DirectoryPartition#delete(javax.naming.Name)
      */
@@ -603,7 +600,7 @@
         backend.modify( dn, mods );
     }
 
-    
+
     /**
      * @see DirectoryPartition#list(javax.naming.Name)
      */
@@ -612,13 +609,13 @@
         DirectoryPartition backend = getBackend( base );
         return backend.list( base );
     }
-    
+
 
     /**
      * @see DirectoryPartition#search(Name, Map, ExprNode, SearchControls)
      */
     public NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls )
-            throws NamingException
+        throws NamingException
     {
 
         if ( base.size() == 0 )
@@ -675,7 +672,7 @@
     /**
      * @see DirectoryPartition#lookup(javax.naming.Name)
      */
-    public Attributes lookup( Name dn )  throws NamingException
+    public Attributes lookup( Name dn ) throws NamingException
     {
         if ( dn.size() == 0 )
         {
@@ -690,7 +687,7 @@
     /**
      * @see org.apache.directory.server.core.partition.DirectoryPartition#lookup(javax.naming.Name, String[])
      */
-    public Attributes lookup( Name dn, String[] attrIds )  throws NamingException
+    public Attributes lookup( Name dn, String[] attrIds ) throws NamingException
     {
         if ( dn.size() == 0 )
         {
@@ -719,7 +716,7 @@
         {
             log.debug( "Check if DN '" + dn + "' exists." );
         }
-        
+
         if ( dn.size() == 0 )
         {
             return true;
@@ -729,7 +726,7 @@
         return backend.hasEntry( dn );
     }
 
-    
+
     /**
      * @see DirectoryPartition#isSuffix(javax.naming.Name)
      */
@@ -738,7 +735,7 @@
         return partitions.containsKey( dn.toString() );
     }
 
-    
+
     /**
      * @see DirectoryPartition#modifyRn(Name, String, boolean)
      */
@@ -747,8 +744,8 @@
         DirectoryPartition backend = getBackend( dn );
         backend.modifyRn( dn, newRdn, deleteOldRdn );
     }
-    
-    
+
+
     /**
      * @see DirectoryPartition#move(Name, Name)
      */
@@ -757,25 +754,23 @@
         DirectoryPartition backend = getBackend( oriChildName );
         backend.move( oriChildName, newParentName );
     }
-    
-    
+
+
     /**
      * @see DirectoryPartition#move(javax.naming.Name,
      * javax.naming.Name, java.lang.String, boolean)
      */
-    public void move( Name oldChildDn, Name newParentDn, String newRdn,
-        boolean deleteOldRdn ) throws NamingException
+    public void move( Name oldChildDn, Name newParentDn, String newRdn, boolean deleteOldRdn ) throws NamingException
     {
         DirectoryPartition backend = getBackend( oldChildDn );
         backend.move( oldChildDn, newParentDn, newRdn, deleteOldRdn );
     }
 
-    
+
     // ------------------------------------------------------------------------
     // Private Methods
     // ------------------------------------------------------------------------
 
-
     /**
      * Gets the backend partition associated with a normalized dn.
      *
@@ -792,7 +787,7 @@
             {
                 return ( DirectoryPartition ) partitions.get( clonedDn.toString() );
             }
-            
+
             clonedDn.remove( clonedDn.size() - 1 );
         }
         throw new NameNotFoundException( dn.toString() );

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartition.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartition.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartition.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartition.java Sun Feb 19 19:57:02 2006
@@ -1,289 +1,304 @@
-/*
- *   Copyright 2004 The Apache Software Foundation
- *
- *   Licensed 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.partition;
-
-
-import java.util.List;
-import java.util.Map;
-
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.ModificationItem;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-
-import org.apache.directory.server.core.DirectoryServiceConfiguration;
-import org.apache.directory.server.core.configuration.DirectoryPartitionConfiguration;
-import org.apache.directory.shared.ldap.filter.ExprNode;
-
-
-/**
- * An interfaces that bridges between underlying JNDI entries and JNDI
- * {@link Context} API.  DIT (Directory Information Tree) consists one or
- * above {@link DirectoryPartition}s whose parent is {@link DirectoryPartitionNexus},
- * and all of them are mapped to different
- * base suffix.  Each partition contains entries whose name ends with that
- * base suffix.
- *
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Rev$
- */
-public interface DirectoryPartition
-{
-    /** The objectClass name for aliases: 'alias' */
-    String ALIAS_OBJECT = "alias";
-
-    /** 
-     * The aliased Dn attribute name: aliasedObjectName for LDAP and
-     * aliasedEntryName or X.500.
-     */ 
-    String ALIAS_ATTRIBUTE = "aliasedObjectName";
-
-    /**
-     * Initializes this partition.
-     */
-    void init( DirectoryServiceConfiguration factoryCfg, DirectoryPartitionConfiguration cfg ) throws NamingException;
-    
-    
-    /**
-     * Deinitialized this partition.
-     */
-    void destroy();
-
-    /**
-     * Checks to see if this partition is initialized or not.
-     */
-    boolean isInitialized();
-
-    /**
-     * Flushes any changes made to this partition now.
-     */
-    void sync() throws NamingException;
-
-    
-    /**
-     * Gets the distinguished/absolute name of the suffix for all entries
-     * stored within this ContextPartition.
-     *
-     * @param normalized boolean value used to control the normalization of the
-     * returned Name.  If true the normalized Name is returned, otherwise the 
-     * original user provided Name without normalization is returned.
-     * @return Name representing the distinguished/absolute name of this
-     * ContextPartitions root context.
-     */
-    Name getSuffix( boolean normalized ) throws NamingException;
-
-    
-    /**
-     * Deletes a leaf entry from this ContextPartition: non-leaf entries cannot be 
-     * deleted until this operation has been applied to their children.
-     *
-     * @param name the normalized distinguished/absolute name of the entry to
-     * delete from this ContextPartition.
-     * @throws NamingException if there are any problems
-     */ 
-    void delete( Name name ) throws NamingException;
-
-    /**
-     * Adds an entry to this ContextPartition.
-     *
-     * @param userProvidedName the user provided distinguished/absolute name of the entry
-     * @param normalizedName the normalized distinguished/absolute name of the entry
-     * @param entry the entry to add to this ContextPartition
-     * @throws NamingException if there are any problems
-     */
-    void add( String userProvidedName, Name normalizedName, Attributes entry ) throws NamingException;
-
-    /**
-     * Modifies an entry by adding, removing or replacing a set of attributes.
-     *
-     * @param name the normalized distinguished/absolute name of the entry to
-     * modify
-     * @param modOp the modification operation to perform on the entry which
-     * is one of constants specified by the DirContext interface:
-     * <code>ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE</code>.
-     * @param attributes the attributes and their values used to affect the
-     * modification with.
-     * @throws NamingException if there are any problems
-     * @see javax.naming.directory.DirContext
-     * @see javax.naming.directory.DirContext#ADD_ATTRIBUTE
-     * @see javax.naming.directory.DirContext#REMOVE_ATTRIBUTE
-     * @see javax.naming.directory.DirContext#REPLACE_ATTRIBUTE
-     */
-    void modify( Name name, int modOp, Attributes attributes ) throws NamingException;
-
-    /**
-     * Modifies an entry by using a combination of adds, removes or replace 
-     * operations using a set of ModificationItems.
-     *
-     * @param name the normalized distinguished/absolute name of the entry to modify
-     * @param items the ModificationItems used to affect the modification with
-     * @throws NamingException if there are any problems
-     * @see ModificationItem
-     */
-    void modify( Name name, ModificationItem [] items ) throws NamingException;
-
-    /**
-     * A specialized form of one level search used to return a minimal set of 
-     * information regarding child entries under a base.  Convenience method
-     * used to optimize operations rather than conducting a full search with 
-     * retrieval.
-     *
-     * @param baseName the base distinguished/absolute name for the search/listing
-     * @return a NamingEnumeration containing objects of type {@link SearchResult}
-     * @throws NamingException if there are any problems
-     */
-    NamingEnumeration list( Name baseName ) throws NamingException;
-    
-    /**
-     * Conducts a search against this ContextPartition.  Namespace specific
-     * parameters for search are contained within the environment using
-     * namespace specific keys into the hash.  For example in the LDAP namespace
-     * a ContextPartition implementation may look for search Controls using a
-     * namespace specific or implementation specific key for the set of LDAP
-     * Controls.
-     *
-     * @param baseName the normalized distinguished/absolute name of the search base
-     * @param environment the environment under which operation occurs
-     * @param filter the root node of the filter expression tree
-     * @param searchControls the search controls
-     * @throws NamingException if there are any problems
-     * @return a NamingEnumeration containing objects of type 
-     * <a href="http://java.sun.com/j2se/1.4.2/docs/api/
-     * javax/naming/directory/SearchResult.html">SearchResult</a>.
-     */
-    NamingEnumeration search( Name baseName, Map environment, ExprNode filter,
-        SearchControls searchControls ) throws NamingException;
-
-    /**
-     * Looks up an entry by distinguished/absolute name.  This is a simplified
-     * version of the search operation used to point read an entry used for
-     * convenience.
-     *
-     * @param name the normalized distinguished name of the object to lookup
-     * @return an Attributes object representing the entry
-     * @throws NamingException if there are any problems
-     */
-    Attributes lookup( Name name ) throws NamingException;
-
-    /**
-     * Looks up an entry by distinguished/absolute name.  This is a simplified
-     * version of the search operation used to point read an entry used for
-     * convenience with a set of attributes to return.  If the attributes is
-     * null or empty, the returned entry will contain all attributes.
-     *
-     * @param name the normalized distinguished name of the object to lookup
-     * @param attrIds the set of attributes to return
-     * @return an Attributes object representing the entry
-     * @throws NamingException if there are any problems
-     */
-    Attributes lookup( Name name, String [] attrIds ) throws NamingException;
-
-    /**
-     * Fast operation to check and see if a particular entry exists.
-     *
-     * @param name the normalized distinguished/absolute name of the object to
-     * check for existance
-     * @return true if the entry exists, false if it does not
-     * @throws NamingException if there are any problems
-     */
-    boolean hasEntry( Name name ) throws NamingException;
-
-    /**
-     * Checks to see if name is a context suffix.
-     *
-     * @param name the normalized distinguished/absolute name of the context
-     * @return true if the name is a context suffix, false if it is not.
-     * @throws NamingException if there are any problems
-     */
-    boolean isSuffix( Name name ) throws NamingException;
-
-    /**
-     * Modifies an entry by changing its relative name. Optionally attributes
-     * associated with the old relative name can be removed from the entry.
-     * This makes sense only in certain namespaces like LDAP and will be ignored
-     * if it is irrelavent.
-     *
-     * @param name the normalized distinguished/absolute name of the entry to
-     * modify the RN of.
-     * @param newRn the new RN of the entry specified by name
-     * @param deleteOldRn boolean flag which removes the old RN attribute
-     * from the entry if set to true, and has no affect if set to false
-     * @throws NamingException if there are any problems
-     */
-    void modifyRn( Name name, String newRn, boolean deleteOldRn )
-        throws NamingException;
-
-    /**
-     * Transplants a child entry, to a position in the namespace under a new
-     * parent entry.
-     *
-     * @param newParentName the normalized distinguished/absolute name of the
-     * new parent to move the target entry to
-     * @param oldName the normalized distinguished/absolute name of the
-     * original child name representing the child entry to move
-     * @throws NamingException if there are any problems
-     */
-    void move( Name oldName, Name newParentName ) throws NamingException;
-
-    /**
-     * Transplants a child entry, to a position in the namespace under a new
-     * parent entry and changes the RN of the child entry which can optionally
-     * have its old RN attributes removed.  The removal of old RN attributes
-     * may not make sense in all namespaces.  If the concept is undefined in a
-     * namespace this parameters is ignored.  An example of a namespace where
-     * this parameter is significant is the LDAP namespace.
-     *
-     * @param oldName the normalized distinguished/absolute name of the
-     * original child name representing the child entry to move
-     * @param newParentName the normalized distinguished/absolute name of the
-     * new parent to move the targeted entry to
-     * @param newRn the new RN of the entry
-     * @param deleteOldRn boolean flag which removes the old RN attribute
-     * from the entry if set to true, and has no affect if set to false
-     * @throws NamingException if there are any problems
-     */
-    void move( Name oldName, Name newParentName, String newRn,
-               boolean deleteOldRn ) throws NamingException;
-    
-    /**
-     * Represents a bind operation issued to authenticate a client.  Partitions
-     * need not support this operation.  This operation is here to enable those
-     * interested in implementing virtual directories with ApacheDS.
-     * 
-     * @param bindDn the normalized dn of the principal 
-     * @param credentials the credentials of the principal
-     * @param mechanisms the mechanisms requested by the JNDI caller or a single
-     * mechanism representing the SASL bind mechanism used by a networked client (Strings)
-     * @param saslAuthId the SASL authentication (may be null)
-     * @throws NamingException if something goes wrong
-     */
-    void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException;
-
-    /**
-     * Represents an unbind operation issued by an authenticated client.  Partitions
-     * need not support this operation.  This operation is here to enable those
-     * interested in implementing virtual directories with ApacheDS.
-     * 
-     * @param bindDn the normalized dn of the principal attempting to unbind
-     * @throws NamingException if something goes wrong
-     */
-    void unbind( Name bindDn ) throws NamingException;
-}
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed 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.partition;
+
+
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.ModificationItem;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+
+import org.apache.directory.server.core.DirectoryServiceConfiguration;
+import org.apache.directory.server.core.configuration.DirectoryPartitionConfiguration;
+import org.apache.directory.shared.ldap.filter.ExprNode;
+
+
+/**
+ * An interfaces that bridges between underlying JNDI entries and JNDI
+ * {@link Context} API.  DIT (Directory Information Tree) consists one or
+ * above {@link DirectoryPartition}s whose parent is {@link DirectoryPartitionNexus},
+ * and all of them are mapped to different
+ * base suffix.  Each partition contains entries whose name ends with that
+ * base suffix.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface DirectoryPartition
+{
+    /** The objectClass name for aliases: 'alias' */
+    String ALIAS_OBJECT = "alias";
+
+    /** 
+     * The aliased Dn attribute name: aliasedObjectName for LDAP and
+     * aliasedEntryName or X.500.
+     */
+    String ALIAS_ATTRIBUTE = "aliasedObjectName";
+
+
+    /**
+     * Initializes this partition.
+     */
+    void init( DirectoryServiceConfiguration factoryCfg, DirectoryPartitionConfiguration cfg ) throws NamingException;
+
+
+    /**
+     * Deinitialized this partition.
+     */
+    void destroy();
+
+
+    /**
+     * Checks to see if this partition is initialized or not.
+     */
+    boolean isInitialized();
+
+
+    /**
+     * Flushes any changes made to this partition now.
+     */
+    void sync() throws NamingException;
+
+
+    /**
+     * Gets the distinguished/absolute name of the suffix for all entries
+     * stored within this ContextPartition.
+     *
+     * @param normalized boolean value used to control the normalization of the
+     * returned Name.  If true the normalized Name is returned, otherwise the 
+     * original user provided Name without normalization is returned.
+     * @return Name representing the distinguished/absolute name of this
+     * ContextPartitions root context.
+     */
+    Name getSuffix( boolean normalized ) throws NamingException;
+
+
+    /**
+     * Deletes a leaf entry from this ContextPartition: non-leaf entries cannot be 
+     * deleted until this operation has been applied to their children.
+     *
+     * @param name the normalized distinguished/absolute name of the entry to
+     * delete from this ContextPartition.
+     * @throws NamingException if there are any problems
+     */
+    void delete( Name name ) throws NamingException;
+
+
+    /**
+     * Adds an entry to this ContextPartition.
+     *
+     * @param userProvidedName the user provided distinguished/absolute name of the entry
+     * @param normalizedName the normalized distinguished/absolute name of the entry
+     * @param entry the entry to add to this ContextPartition
+     * @throws NamingException if there are any problems
+     */
+    void add( String userProvidedName, Name normalizedName, Attributes entry ) throws NamingException;
+
+
+    /**
+     * Modifies an entry by adding, removing or replacing a set of attributes.
+     *
+     * @param name the normalized distinguished/absolute name of the entry to
+     * modify
+     * @param modOp the modification operation to perform on the entry which
+     * is one of constants specified by the DirContext interface:
+     * <code>ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE</code>.
+     * @param attributes the attributes and their values used to affect the
+     * modification with.
+     * @throws NamingException if there are any problems
+     * @see javax.naming.directory.DirContext
+     * @see javax.naming.directory.DirContext#ADD_ATTRIBUTE
+     * @see javax.naming.directory.DirContext#REMOVE_ATTRIBUTE
+     * @see javax.naming.directory.DirContext#REPLACE_ATTRIBUTE
+     */
+    void modify( Name name, int modOp, Attributes attributes ) throws NamingException;
+
+
+    /**
+     * Modifies an entry by using a combination of adds, removes or replace 
+     * operations using a set of ModificationItems.
+     *
+     * @param name the normalized distinguished/absolute name of the entry to modify
+     * @param items the ModificationItems used to affect the modification with
+     * @throws NamingException if there are any problems
+     * @see ModificationItem
+     */
+    void modify( Name name, ModificationItem[] items ) throws NamingException;
+
+
+    /**
+     * A specialized form of one level search used to return a minimal set of 
+     * information regarding child entries under a base.  Convenience method
+     * used to optimize operations rather than conducting a full search with 
+     * retrieval.
+     *
+     * @param baseName the base distinguished/absolute name for the search/listing
+     * @return a NamingEnumeration containing objects of type {@link SearchResult}
+     * @throws NamingException if there are any problems
+     */
+    NamingEnumeration list( Name baseName ) throws NamingException;
+
+
+    /**
+     * Conducts a search against this ContextPartition.  Namespace specific
+     * parameters for search are contained within the environment using
+     * namespace specific keys into the hash.  For example in the LDAP namespace
+     * a ContextPartition implementation may look for search Controls using a
+     * namespace specific or implementation specific key for the set of LDAP
+     * Controls.
+     *
+     * @param baseName the normalized distinguished/absolute name of the search base
+     * @param environment the environment under which operation occurs
+     * @param filter the root node of the filter expression tree
+     * @param searchControls the search controls
+     * @throws NamingException if there are any problems
+     * @return a NamingEnumeration containing objects of type 
+     * <a href="http://java.sun.com/j2se/1.4.2/docs/api/
+     * javax/naming/directory/SearchResult.html">SearchResult</a>.
+     */
+    NamingEnumeration search( Name baseName, Map environment, ExprNode filter, SearchControls searchControls )
+        throws NamingException;
+
+
+    /**
+     * Looks up an entry by distinguished/absolute name.  This is a simplified
+     * version of the search operation used to point read an entry used for
+     * convenience.
+     *
+     * @param name the normalized distinguished name of the object to lookup
+     * @return an Attributes object representing the entry
+     * @throws NamingException if there are any problems
+     */
+    Attributes lookup( Name name ) throws NamingException;
+
+
+    /**
+     * Looks up an entry by distinguished/absolute name.  This is a simplified
+     * version of the search operation used to point read an entry used for
+     * convenience with a set of attributes to return.  If the attributes is
+     * null or empty, the returned entry will contain all attributes.
+     *
+     * @param name the normalized distinguished name of the object to lookup
+     * @param attrIds the set of attributes to return
+     * @return an Attributes object representing the entry
+     * @throws NamingException if there are any problems
+     */
+    Attributes lookup( Name name, String[] attrIds ) throws NamingException;
+
+
+    /**
+     * Fast operation to check and see if a particular entry exists.
+     *
+     * @param name the normalized distinguished/absolute name of the object to
+     * check for existance
+     * @return true if the entry exists, false if it does not
+     * @throws NamingException if there are any problems
+     */
+    boolean hasEntry( Name name ) throws NamingException;
+
+
+    /**
+     * Checks to see if name is a context suffix.
+     *
+     * @param name the normalized distinguished/absolute name of the context
+     * @return true if the name is a context suffix, false if it is not.
+     * @throws NamingException if there are any problems
+     */
+    boolean isSuffix( Name name ) throws NamingException;
+
+
+    /**
+     * Modifies an entry by changing its relative name. Optionally attributes
+     * associated with the old relative name can be removed from the entry.
+     * This makes sense only in certain namespaces like LDAP and will be ignored
+     * if it is irrelavent.
+     *
+     * @param name the normalized distinguished/absolute name of the entry to
+     * modify the RN of.
+     * @param newRn the new RN of the entry specified by name
+     * @param deleteOldRn boolean flag which removes the old RN attribute
+     * from the entry if set to true, and has no affect if set to false
+     * @throws NamingException if there are any problems
+     */
+    void modifyRn( Name name, String newRn, boolean deleteOldRn ) throws NamingException;
+
+
+    /**
+     * Transplants a child entry, to a position in the namespace under a new
+     * parent entry.
+     *
+     * @param newParentName the normalized distinguished/absolute name of the
+     * new parent to move the target entry to
+     * @param oldName the normalized distinguished/absolute name of the
+     * original child name representing the child entry to move
+     * @throws NamingException if there are any problems
+     */
+    void move( Name oldName, Name newParentName ) throws NamingException;
+
+
+    /**
+     * Transplants a child entry, to a position in the namespace under a new
+     * parent entry and changes the RN of the child entry which can optionally
+     * have its old RN attributes removed.  The removal of old RN attributes
+     * may not make sense in all namespaces.  If the concept is undefined in a
+     * namespace this parameters is ignored.  An example of a namespace where
+     * this parameter is significant is the LDAP namespace.
+     *
+     * @param oldName the normalized distinguished/absolute name of the
+     * original child name representing the child entry to move
+     * @param newParentName the normalized distinguished/absolute name of the
+     * new parent to move the targeted entry to
+     * @param newRn the new RN of the entry
+     * @param deleteOldRn boolean flag which removes the old RN attribute
+     * from the entry if set to true, and has no affect if set to false
+     * @throws NamingException if there are any problems
+     */
+    void move( Name oldName, Name newParentName, String newRn, boolean deleteOldRn ) throws NamingException;
+
+
+    /**
+     * Represents a bind operation issued to authenticate a client.  Partitions
+     * need not support this operation.  This operation is here to enable those
+     * interested in implementing virtual directories with ApacheDS.
+     * 
+     * @param bindDn the normalized dn of the principal 
+     * @param credentials the credentials of the principal
+     * @param mechanisms the mechanisms requested by the JNDI caller or a single
+     * mechanism representing the SASL bind mechanism used by a networked client (Strings)
+     * @param saslAuthId the SASL authentication (may be null)
+     * @throws NamingException if something goes wrong
+     */
+    void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException;
+
+
+    /**
+     * Represents an unbind operation issued by an authenticated client.  Partitions
+     * need not support this operation.  This operation is here to enable those
+     * interested in implementing virtual directories with ApacheDS.
+     * 
+     * @param bindDn the normalized dn of the principal attempting to unbind
+     * @throws NamingException if something goes wrong
+     */
+    void unbind( Name bindDn ) throws NamingException;
+}

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartition.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartition.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java Sun Feb 19 19:57:02 2006
@@ -57,7 +57,8 @@
      * building the name.  Note that what ever the SUFFIX equals it should be 
      * both the normalized and the user provided form.
      */
-    public static final String SYSTEM_PARTITION_SUFFIX = "ou=system" ;
+    public static final String SYSTEM_PARTITION_SUFFIX = "ou=system";
+
 
     /**
      * Gets the DN for the admin user.
@@ -66,7 +67,7 @@
     public static final Name getAdminName()
     {
         Name adminDn = null;
-    
+
         try
         {
             adminDn = new LdapName( ADMIN_PRINCIPAL );
@@ -75,10 +76,11 @@
         {
             throw new InternalError();
         }
-    
+
         return adminDn;
     }
 
+
     /**
      * Gets the DN for the base entry under which all groups reside.
      * A new Name instance is created and returned every time.
@@ -87,7 +89,7 @@
     public static final Name getGroupsBaseName()
     {
         Name groupsBaseDn = null;
-    
+
         try
         {
             groupsBaseDn = new LdapName( GROUPS_BASE_NAME );
@@ -96,10 +98,11 @@
         {
             throw new InternalError();
         }
-    
+
         return groupsBaseDn;
     }
 
+
     /**
      * Gets the DN for the base entry under which all non-admin users reside.
      * A new Name instance is created and returned every time.
@@ -108,7 +111,7 @@
     public static final Name getUsersBaseName()
     {
         Name usersBaseDn = null;
-    
+
         try
         {
             usersBaseDn = new LdapName( USERS_BASE_NAME );
@@ -117,10 +120,11 @@
         {
             throw new InternalError();
         }
-    
+
         return usersBaseDn;
     }
 
+
     /**
      * Gets the LdapContext associated with the calling thread.
      * 
@@ -129,6 +133,7 @@
      */
     public abstract LdapContext getLdapContext();
 
+
     /**
      * Get's the RootDSE entry for the DSA.
      *
@@ -136,6 +141,7 @@
      */
     public abstract Attributes getRootDSE() throws NamingException;
 
+
     /**
      * Performs a comparison check to see if an attribute of an entry has
      * a specified value.
@@ -148,12 +154,16 @@
      */
     public abstract boolean compare( Name name, String oid, Object value ) throws NamingException;
 
+
     public abstract void addContextPartition( DirectoryPartitionConfiguration config ) throws NamingException;
-    
+
+
     public abstract void removeContextPartition( Name suffix ) throws NamingException;
 
+
     public abstract DirectoryPartition getSystemPartition();
-    
+
+
     /**
      * Get's the partition corresponding to a distinguished name.  This 
      * name need not be the name of the partition suffix.  When used in 
@@ -166,6 +176,7 @@
      */
     public abstract DirectoryPartition getPartition( Name dn ) throws NamingException;
 
+
     /**
      * Gets the most significant Dn that exists within the server for any Dn.
      *
@@ -180,6 +191,7 @@
      */
     public abstract Name getMatchedName( Name name, boolean normalized ) throws NamingException;
 
+
     /**
      * Gets the distinguished name of the suffix that would hold an entry with
      * the supplied distinguished name parameter.  If the DN argument does not
@@ -195,6 +207,7 @@
      */
     public abstract Name getSuffix( Name name, boolean normalized ) throws NamingException;
 
+
     /**
      * Gets an iteration over the Name suffixes of the partitions managed by this
      * {@link DirectoryPartitionNexus}.
@@ -206,6 +219,7 @@
      * @throws NamingException if there are any problems
      */
     public abstract Iterator listSuffixes( boolean normalized ) throws NamingException;
+
 
     /**
      * Adds a set of supportedExtension (OID Strings) to the RootDSE.

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java Sun Feb 19 19:57:02 2006
@@ -80,7 +80,6 @@
     private final DirectoryService service;
     private final DirectoryServiceConfiguration configuration;
 
-
     static
     {
         Collection c = new HashSet();
@@ -114,61 +113,61 @@
      * @param caller a JNDI {@link Context} object that will call this proxy
      * @param service a JNDI service
      */
-    public DirectoryPartitionNexusProxy( Context caller, DirectoryService service )
+    public DirectoryPartitionNexusProxy(Context caller, DirectoryService service)
     {
         this.caller = caller;
         this.service = service;
         this.configuration = service.getConfiguration();
     }
-    
-    
-    public LdapContext getLdapContext() 
+
+
+    public LdapContext getLdapContext()
     {
         return this.configuration.getPartitionNexus().getLdapContext();
     }
 
-    
+
     public void init( DirectoryServiceConfiguration factoryCfg, DirectoryPartitionConfiguration cfg )
     {
     }
 
-    
+
     public void destroy()
     {
     }
 
-    
+
     public DirectoryPartition getSystemPartition()
     {
         return this.configuration.getPartitionNexus().getSystemPartition();
     }
 
-    
+
     public DirectoryPartition getPartition( Name dn ) throws NamingException
     {
         return this.configuration.getPartitionNexus().getPartition( dn );
     }
 
-    
+
     public Name getSuffix( boolean normalized ) throws NamingException
     {
         return this.configuration.getPartitionNexus().getSuffix( normalized );
     }
 
-    
-    public void sync() throws NamingException 
+
+    public void sync() throws NamingException
     {
         this.service.sync();
     }
 
-    
-    public void close() throws NamingException 
+
+    public void close() throws NamingException
     {
         this.service.shutdown();
     }
 
-    
-    public boolean isInitialized() 
+
+    public boolean isInitialized()
     {
         return this.service.isStarted();
     }
@@ -184,7 +183,8 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        Object[] args = new Object[] { dn, normalized? Boolean.TRUE : Boolean.FALSE };
+        Object[] args = new Object[]
+            { dn, normalized ? Boolean.TRUE : Boolean.FALSE };
         stack.push( new Invocation( this, caller, "getMatchedDn", args, bypass ) );
         try
         {
@@ -197,7 +197,7 @@
     }
 
 
-    public Name getSuffix( Name dn, boolean normalized) throws NamingException
+    public Name getSuffix( Name dn, boolean normalized ) throws NamingException
     {
         return getSuffix( dn, normalized, null );
     }
@@ -207,7 +207,8 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        Object[] args = new Object[] { dn, normalized? Boolean.TRUE : Boolean.FALSE };
+        Object[] args = new Object[]
+            { dn, normalized ? Boolean.TRUE : Boolean.FALSE };
         stack.push( new Invocation( this, caller, "getSuffix", args, bypass ) );
         try
         {
@@ -230,7 +231,8 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        Object[] args = new Object[] { normalized? Boolean.TRUE : Boolean.FALSE };
+        Object[] args = new Object[]
+            { normalized ? Boolean.TRUE : Boolean.FALSE };
         stack.push( new Invocation( this, caller, "listSuffixes", args, bypass ) );
         try
         {
@@ -253,7 +255,8 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        stack.push( new Invocation( this, caller, "compare", new Object[] { name, oid, value }, bypass ) );
+        stack.push( new Invocation( this, caller, "compare", new Object[]
+            { name, oid, value }, bypass ) );
         try
         {
             return this.configuration.getInterceptorChain().compare( name, oid, value );
@@ -275,7 +278,8 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        stack.push( new Invocation( this, caller, "delete", new Object[] { name }, bypass ) );
+        stack.push( new Invocation( this, caller, "delete", new Object[]
+            { name }, bypass ) );
         try
         {
             this.configuration.getInterceptorChain().delete( name );
@@ -297,7 +301,8 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        stack.push( new Invocation( this, caller, "add", new Object[] { upName, normName, entry }, bypass ) );
+        stack.push( new Invocation( this, caller, "add", new Object[]
+            { upName, normName, entry }, bypass ) );
         try
         {
             this.configuration.getInterceptorChain().add( upName, normName, entry );
@@ -321,22 +326,23 @@
         InvocationStack stack = InvocationStack.getInstance();
         Integer modOpObj;
 
-        switch( modOp )
+        switch ( modOp )
         {
-            case( DirContext.ADD_ATTRIBUTE ):
+            case ( DirContext.ADD_ATTRIBUTE  ):
                 modOpObj = ADD_MODOP;
                 break;
-            case( DirContext.REMOVE_ATTRIBUTE ):
+            case ( DirContext.REMOVE_ATTRIBUTE  ):
                 modOpObj = REMOVE_MODOP;
                 break;
-            case( DirContext.REPLACE_ATTRIBUTE ):
+            case ( DirContext.REPLACE_ATTRIBUTE  ):
                 modOpObj = REPLACE_MODOP;
                 break;
             default:
                 throw new IllegalArgumentException( "bad modification operation value: " + modOp );
         }
 
-        stack.push( new Invocation( this, caller, "modify", new Object[] { name, modOpObj, mods }, bypass ) );
+        stack.push( new Invocation( this, caller, "modify", new Object[]
+            { name, modOpObj, mods }, bypass ) );
         try
         {
             this.configuration.getInterceptorChain().modify( name, modOp, mods );
@@ -358,7 +364,8 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        stack.push( new Invocation( this, caller, "modify", new Object[] { name, mods }, bypass ) );
+        stack.push( new Invocation( this, caller, "modify", new Object[]
+            { name, mods }, bypass ) );
         try
         {
             this.configuration.getInterceptorChain().modify( name, mods );
@@ -380,7 +387,8 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        stack.push( new Invocation( this, caller, "list", new Object[] { base }, bypass ) );
+        stack.push( new Invocation( this, caller, "list", new Object[]
+            { base }, bypass ) );
         try
         {
             return this.configuration.getInterceptorChain().list( base );
@@ -393,10 +401,10 @@
 
 
     public NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls )
-            throws NamingException
+        throws NamingException
     {
         NamingEnumeration ne = search( base, env, filter, searchCtls, null );
-        
+
         if ( ne instanceof SearchResultFilteringEnumeration )
         {
             SearchResultFilteringEnumeration results = ( SearchResultFilteringEnumeration ) ne;
@@ -405,10 +413,14 @@
                 // this will be he last filter added so other filters before it must 
                 // have passed/approved of the entry to be returned back to the client
                 // so the candidate we have is going to be returned for sure
-                results.addResultFilter( new SearchResultFilter(){
+                results.addResultFilter( new SearchResultFilter()
+                {
                     final long startTime = System.currentTimeMillis();
-                    int count = 1;  // with prefetch we've missed one which is ok since 1 is the minimum
-                    public boolean accept( Invocation invocation, SearchResult result, SearchControls controls ) throws NamingException
+                    int count = 1; // with prefetch we've missed one which is ok since 1 is the minimum
+
+
+                    public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
+                        throws NamingException
                     {
                         if ( controls.getTimeLimit() > 0 )
                         {
@@ -418,19 +430,19 @@
                                 throw new LdapTimeLimitExceededException();
                             }
                         }
-                        
+
                         if ( controls.getCountLimit() > 0 )
                         {
-                           if ( count > controls.getCountLimit() )
-                           {
-                               throw new LdapSizeLimitExceededException();
-                           }
+                            if ( count > controls.getCountLimit() )
+                            {
+                                throw new LdapSizeLimitExceededException();
+                            }
                         }
-                        
+
                         count++;
                         return true;
                     }
-                });
+                } );
             }
         }
         return ne;
@@ -438,11 +450,12 @@
 
 
     public NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls, Collection bypass )
-            throws NamingException
+        throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        stack.push( new Invocation( this, caller, "search", new Object[] { base, env, filter, searchCtls }, bypass ) );
+        stack.push( new Invocation( this, caller, "search", new Object[]
+            { base, env, filter, searchCtls }, bypass ) );
         try
         {
             return this.configuration.getInterceptorChain().search( base, env, filter, searchCtls );
@@ -464,12 +477,14 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        stack.push( new Invocation( this, caller, "lookup", new Object[] { name }, bypass ) );
+        stack.push( new Invocation( this, caller, "lookup", new Object[]
+            { name }, bypass ) );
         try
         {
-        	OidRegistry registry = (OidRegistry)this.service.getConfiguration().getGlobalRegistries().getOidRegistry();
-        	
-        	LdapDN.normalize( name, registry.getNameByOid() );
+            OidRegistry registry = ( OidRegistry ) this.service.getConfiguration().getGlobalRegistries()
+                .getOidRegistry();
+
+            LdapDN.normalize( name, registry.getNameByOid() );
 
             return this.configuration.getInterceptorChain().lookup( name );
         }
@@ -490,7 +505,8 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        stack.push( new Invocation( this, caller, "lookup", new Object[] { dn, attrIds }, bypass ) );
+        stack.push( new Invocation( this, caller, "lookup", new Object[]
+            { dn, attrIds }, bypass ) );
         try
         {
             return this.configuration.getInterceptorChain().lookup( dn, attrIds );
@@ -512,7 +528,8 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        stack.push( new Invocation( this, caller, "hasEntry", new Object[] { name }, bypass ) );
+        stack.push( new Invocation( this, caller, "hasEntry", new Object[]
+            { name }, bypass ) );
         try
         {
             return this.configuration.getInterceptorChain().hasEntry( name );
@@ -534,7 +551,8 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        stack.push( new Invocation( this, caller, "isSuffix", new Object[] { name }, bypass ) );
+        stack.push( new Invocation( this, caller, "isSuffix", new Object[]
+            { name }, bypass ) );
         try
         {
             return this.configuration.getInterceptorChain().isSuffix( name );
@@ -556,7 +574,8 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        Object[] args = new Object[] { name, newRn, deleteOldRn? Boolean.TRUE : Boolean.FALSE };
+        Object[] args = new Object[]
+            { name, newRn, deleteOldRn ? Boolean.TRUE : Boolean.FALSE };
         stack.push( new Invocation( this, caller, "modifyRn", args, bypass ) );
         try
         {
@@ -579,7 +598,8 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        stack.push( new Invocation( this, caller, "move", new Object[] { oriChildName, newParentName }, bypass ) );
+        stack.push( new Invocation( this, caller, "move", new Object[]
+            { oriChildName, newParentName }, bypass ) );
         try
         {
             this.configuration.getInterceptorChain().move( oriChildName, newParentName );
@@ -598,11 +618,12 @@
 
 
     public void move( Name oriChildName, Name newParentName, String newRn, boolean deleteOldRn, Collection bypass )
-            throws NamingException
+        throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        Object[] args = new Object[] { oriChildName, newParentName, newRn, deleteOldRn? Boolean.TRUE : Boolean.FALSE };
+        Object[] args = new Object[]
+            { oriChildName, newParentName, newRn, deleteOldRn ? Boolean.TRUE : Boolean.FALSE };
         stack.push( new Invocation( this, caller, "move", args, bypass ) );
         try
         {
@@ -615,12 +636,13 @@
     }
 
 
-    public void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId, Collection bypass ) 
+    public void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId, Collection bypass )
         throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        Object[] args = new Object[] { bindDn, credentials, mechanisms, saslAuthId };
+        Object[] args = new Object[]
+            { bindDn, credentials, mechanisms, saslAuthId };
         stack.push( new Invocation( this, caller, "bind", args, bypass ) );
         try
         {
@@ -637,7 +659,8 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        Object[] args = new Object[] { bindDn };
+        Object[] args = new Object[]
+            { bindDn };
         stack.push( new Invocation( this, caller, "unbind", args, bypass ) );
         try
         {
@@ -649,7 +672,7 @@
         }
     }
 
-    
+
     public void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException
     {
         bind( bindDn, credentials, mechanisms, saslAuthId, null );
@@ -661,7 +684,7 @@
         unbind( bindDn, null );
     }
 
-    
+
     public Attributes getRootDSE() throws NamingException
     {
         return getRootDSE( null );
@@ -694,7 +717,8 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        stack.push( new Invocation( this, caller, "addContextPartition", new Object[] { config }, bypass ) );
+        stack.push( new Invocation( this, caller, "addContextPartition", new Object[]
+            { config }, bypass ) );
         try
         {
             this.configuration.getInterceptorChain().addContextPartition( config );
@@ -716,7 +740,8 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        stack.push( new Invocation( this, caller, "removeContextPartition", new Object[] { suffix }, bypass ) );
+        stack.push( new Invocation( this, caller, "removeContextPartition", new Object[]
+            { suffix }, bypass ) );
         try
         {
             this.configuration.getInterceptorChain().removeContextPartition( suffix );
@@ -730,7 +755,7 @@
 
     private void ensureStarted() throws ServiceUnavailableException
     {
-        if( !service.isStarted() )
+        if ( !service.isStarted() )
         {
             throw new ServiceUnavailableException( "Directory service is not started." );
         }
@@ -742,7 +767,7 @@
         configuration.getPartitionNexus().registerSupportedExtensions( extensionOids );
     }
 
-    
+
     // -----------------------------------------------------------------------
     // EventContext and EventDirContext notification methods
     // -----------------------------------------------------------------------
@@ -755,7 +780,7 @@
      */
 
     public void addNamingListener( EventContext ctx, Name name, ExprNode filter, SearchControls searchControls,
-                                   NamingListener namingListener ) throws NamingException
+        NamingListener namingListener ) throws NamingException
     {
         InterceptorChain chain = this.configuration.getInterceptorChain();
         EventService interceptor = ( EventService ) chain.get( "eventService" );



Mime
View raw message