directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r609459 [3/4] - in /directory: apacheds/branches/bigbang/bootstrap-plugin/ apacheds/branches/bigbang/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/ apacheds/branches/bigbang/core-entry/src/main/java/org/ap...
Date Sun, 06 Jan 2008 22:58:16 GMT
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java Sun Jan  6 14:58:12 2008
@@ -22,6 +22,10 @@
 
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.BindOperationContext;
@@ -59,7 +63,6 @@
 import org.apache.directory.shared.ldap.exception.LdapNoSuchAttributeException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
-import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.CascadeControl;
 import org.apache.directory.shared.ldap.message.EntryChangeControl;
@@ -119,15 +122,6 @@
     /** the vendorName string proudly set to: Apache Software Foundation*/
     private static final String ASF = "Apache Software Foundation";
 
-    /** the vendorName DSE operational attribute */
-    private static final String VENDORNAME_ATTR = "vendorName";
-
-    /** the vendorVersion DSE operational attribute */
-    private static final String VENDORVERSION_ATTR = "vendorVersion";
-
-    /** the namingContexts DSE operational attribute */
-    private static final String NAMINGCTXS_ATTR = "namingContexts";
-
     /** the closed state of this partition */
     private boolean initialized;
 
@@ -143,7 +137,7 @@
     private BranchNode partitionLookupTree = new BranchNode();
     
     /** the read only rootDSE attributes */
-    private final Attributes rootDSE;
+    private final ServerEntry rootDSE;
 
     /** The global registries */
     private Registries registries;
@@ -165,54 +159,43 @@
      * @see <a href="http://www.faqs.org/rfcs/rfc3045.html">Vendor Information</a>
      * @param rootDSE the root entry for the DSA
      */
-    public DefaultPartitionNexus( Attributes rootDSE )
+    public DefaultPartitionNexus( ServerEntry rootDSE ) throws NamingException
     {
         // setup that root DSE
         this.rootDSE = rootDSE;
-        Attribute attr = new AttributeImpl( SchemaConstants.SUBSCHEMA_SUBENTRY_AT );
-        attr.add( ServerDNConstants.CN_SCHEMA_DN );
-        rootDSE.put( attr );
-
-        attr = new AttributeImpl( "supportedLDAPVersion" );
-        rootDSE.put( attr );
-        attr.add( "3" );
-
-        attr = new AttributeImpl( "supportedFeatures" );
-        rootDSE.put( attr );
-        attr.add( "1.3.6.1.4.1.4203.1.5.1" );
-
-        attr = new AttributeImpl( "supportedExtension" );
-        rootDSE.put( attr );
-        attr.add( NoticeOfDisconnect.EXTENSION_OID );
+        
+        // Add the basic informations
+        rootDSE.put( SchemaConstants.SUBSCHEMA_SUBENTRY_AT, ServerDNConstants.CN_SCHEMA_DN );
+        rootDSE.put( SchemaConstants.SUPPORTED_LDAP_VERSION_AT, "3" );
+        rootDSE.put( SchemaConstants.SUPPORTED_FEATURES_AT, SchemaConstants.FEATURE_ALL_OPERATIONAL_ATTRIBUTES );
+        rootDSE.put( SchemaConstants.SUPPORTED_EXTENSION_AT, NoticeOfDisconnect.EXTENSION_OID );
 
         // Add the supportedSASLMechanisms attribute to rootDSE
-        attr = new AttributeImpl( SupportedSASLMechanisms.ATTRIBUTE );
-        rootDSE.put( attr );
-        attr.add( SupportedSASLMechanisms.GSSAPI );
-        attr.add( SupportedSASLMechanisms.DIGEST_MD5 );
-        attr.add( SupportedSASLMechanisms.CRAM_MD5 );
-
-        attr = new AttributeImpl( "supportedControl" );
-        rootDSE.put( attr );
-        attr.add( PersistentSearchControl.CONTROL_OID );
-        attr.add( EntryChangeControl.CONTROL_OID );
-        attr.add( SubentriesControl.CONTROL_OID );
-        attr.add( ManageDsaITControl.CONTROL_OID );
-        attr.add( CascadeControl.CONTROL_OID );
-
-        attr = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
-        rootDSE.put( attr );
-        attr.add( SchemaConstants.TOP_OC );
-        attr.add( SchemaConstants.EXTENSIBLE_OBJECT_OC );
-
-        attr = new AttributeImpl( NAMINGCTXS_ATTR );
-        rootDSE.put( attr );
-
-        attr = new AttributeImpl( VENDORNAME_ATTR );
-        attr.add( ASF );
-        rootDSE.put( attr );
+        rootDSE.put( SupportedSASLMechanisms.ATTRIBUTE, 
+            SupportedSASLMechanisms.GSSAPI, 
+            SupportedSASLMechanisms.DIGEST_MD5, 
+            SupportedSASLMechanisms.CRAM_MD5 );
+
+        // Add the supported controls
+        rootDSE.put( SchemaConstants.SUPPORTED_CONTROL_AT, 
+            PersistentSearchControl.CONTROL_OID,
+            EntryChangeControl.CONTROL_OID,
+            SubentriesControl.CONTROL_OID,
+            ManageDsaITControl.CONTROL_OID,
+            CascadeControl.CONTROL_OID );
+
+        // Add the objectClasses
+        rootDSE.put( SchemaConstants.OBJECT_CLASS_AT,
+            SchemaConstants.TOP_OC,
+            SchemaConstants.EXTENSIBLE_OBJECT_OC );
+
+        rootDSE.set( SchemaConstants.NAMING_CONTEXTS_AT );
+        
+        // Add the 'vendor' name and version infos
+        rootDSE.put( SchemaConstants.VENDOR_NAME_AT, ASF );
 
         Properties props = new Properties();
+        
         try
         {
             props.load( getClass().getResourceAsStream( "version.properties" ) );
@@ -222,9 +205,7 @@
             LOG.error( "failed to LOG version properties" );
         }
 
-        attr = new AttributeImpl( VENDORVERSION_ATTR );
-        attr.add( props.getProperty( "apacheds.version", "UNKNOWN" ) );
-        rootDSE.put( attr );
+        rootDSE.put( SchemaConstants.VENDOR_VERSION_AT, props.getProperty( "apacheds.version", "UNKNOWN" ) );
     }
 
     
@@ -260,22 +241,42 @@
      *
      * @return the root entry for the DSA
      */
-    public Attributes getContextEntry()
+    public ServerEntry getContextEntry()
     {
         return rootDSE;
     }
 
 
     /**
+     * Returns root the rootDSE.
+     *
+     * @return the root entry for the DSA
+     */
+    public Attributes getContextEntryAttr()
+    {
+        return null;
+    }
+
+
+    /**
      * Sets root entry for this BTreePartition.
      *
      * @throws UnsupportedOperationException everytime
      */
+    public void setContextEntry( ServerEntry rootEntry )
+    {
+        throw new UnsupportedOperationException( "Setting the RootDSE is not allowed." );
+    }
+
     public void setContextEntry( Attributes rootEntry )
     {
         throw new UnsupportedOperationException( "Setting the RootDSE is not allowed." );
     }
 
+    public void setContextEntry( String rootEntry )
+    {
+        throw new UnsupportedOperationException( "Setting the RootDSE is not allowed." );
+    }
 
     /**
      * Always returns the empty String "".
@@ -381,22 +382,32 @@
     {
         // initialize system partition first
         Partition override = directoryService.getSystemPartition();
+        
         if ( override != null )
         {
-            Attributes systemEntry = override.getContextEntry();
-            Attribute objectClassAttr = systemEntry.get( SchemaConstants.OBJECT_CLASS_AT );
+            ServerEntry systemEntry = ServerEntryUtils.toServerEntry( override.getContextEntryAttr(), new LdapDN( override.getSuffix() ), registries );
+            ServerAttribute objectClassAttr = systemEntry.get( SchemaConstants.OBJECT_CLASS_AT );
+            
             if ( objectClassAttr == null )
             {
-                objectClassAttr = new AttributeImpl(  SchemaConstants.OBJECT_CLASS_AT );
-                systemEntry.put( objectClassAttr );
+                systemEntry.put( SchemaConstants.OBJECT_CLASS_AT, 
+                    SchemaConstants.TOP_OC,
+                    SchemaConstants.ORGANIZATIONAL_UNIT_OC,
+                    SchemaConstants.EXTENSIBLE_OBJECT_OC );
+            }
+            else
+            {
+                objectClassAttr.add( 
+                    SchemaConstants.TOP_OC,
+                    SchemaConstants.ORGANIZATIONAL_UNIT_OC,
+                    SchemaConstants.EXTENSIBLE_OBJECT_OC );
             }
-            objectClassAttr.add( SchemaConstants.TOP_OC );
-            objectClassAttr.add( SchemaConstants.ORGANIZATIONAL_UNIT_OC );
-            objectClassAttr.add( SchemaConstants.EXTENSIBLE_OBJECT_OC );
+            
             systemEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN );
             systemEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
             systemEntry.put( NamespaceTools.getRdnAttribute( ServerDNConstants.SYSTEM_DN ),
                 NamespaceTools.getRdnValue( ServerDNConstants.SYSTEM_DN ) );
+            
             override.setContextEntry( systemEntry );
             
             // ---------------------------------------------------------------
@@ -449,16 +460,21 @@
             ( ( JdbmPartition ) system ).setIndexedAttributes( indexedAttrs );
     
             // Add context entry for system partition
-            Attributes systemEntry = new AttributesImpl();
-            Attribute objectClassAttr = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
-            objectClassAttr.add( SchemaConstants.TOP_OC );
-            objectClassAttr.add( SchemaConstants.ORGANIZATIONAL_UNIT_OC );
-            objectClassAttr.add( SchemaConstants.EXTENSIBLE_OBJECT_OC );
-            systemEntry.put( objectClassAttr );
+            ServerEntry systemEntry = new DefaultServerEntry( registries, new LdapDN( ServerDNConstants.SYSTEM_DN ) );
+
+            // Add the ObjectClasses
+            systemEntry.put( SchemaConstants.OBJECT_CLASS_AT,
+                SchemaConstants.TOP_OC,
+                SchemaConstants.ORGANIZATIONAL_UNIT_OC,
+                SchemaConstants.EXTENSIBLE_OBJECT_OC
+                );
+            
+            // Add some operational attributes
             systemEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN );
             systemEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
             systemEntry.put( NamespaceTools.getRdnAttribute( ServerDNConstants.SYSTEM_DN ),
                 NamespaceTools.getRdnValue( ServerDNConstants.SYSTEM_DN ) );
+
             system.setContextEntry( systemEntry );
         }
 
@@ -474,7 +490,7 @@
         {
             partitions.put( key, system );
             partitionLookupTree.recursivelyAddPartition( partitionLookupTree, system.getSuffixDn(), 0, system );
-            Attribute namingContexts = rootDSE.get( NAMINGCTXS_ATTR );
+            ServerAttribute namingContexts = rootDSE.get( SchemaConstants.NAMING_CONTEXTS_AT );
             namingContexts.add( system.getUpSuffixDn().getUpName() );
         }
 
@@ -636,6 +652,15 @@
 
         if ( ! partition.isInitialized() )
         {
+            if ( partition.getContextEntry() != null )
+            {
+                partition.setContextEntry( partition.getContextEntry() );
+            }
+            else
+            {
+                partition.setContextEntry( ServerEntryUtils.toServerEntry( partition.getContextEntryAttr(), new LdapDN( partition.getSuffix() ) , registries ) );
+            }
+            
             partition.init( directoryService );
         }
         
@@ -651,9 +676,10 @@
             partitions.put( partitionSuffix.toString(), partition );
             partitionLookupTree.recursivelyAddPartition( partitionLookupTree, partition.getSuffixDn(), 0, partition );
 
-            Attribute namingContexts = rootDSE.get( NAMINGCTXS_ATTR );
+            ServerAttribute namingContexts = rootDSE.get( SchemaConstants.NAMING_CONTEXTS_AT );
 
         	LdapDN partitionUpSuffix = partition.getUpSuffixDn();
+        	
         	if ( partitionUpSuffix == null )
         	{
         		throw new ConfigurationException( "The current partition does not have any user provided suffix: " + partition.getId() );
@@ -674,12 +700,12 @@
             throw new NameNotFoundException( "No partition with suffix: " + key );
         }
 
-        Attribute namingContexts = rootDSE.get( NAMINGCTXS_ATTR );
+        ServerAttribute namingContexts = rootDSE.get( SchemaConstants.NAMING_CONTEXTS_AT );
         namingContexts.remove( partition.getUpSuffixDn().getUpName() );
 
         // Create a new partition list. 
         // This is easier to create a new structure from scratch than to reorganize
-        // the current structure. As this strcuture is not modified often
+        // the current structure. As this structure is not modified often
         // this is an acceptable solution.
         synchronized ( partitionLookupTree )
         {
@@ -763,7 +789,7 @@
     }
 
 
-    public Attributes getRootDSE( GetRootDSEOperationContext getRootDSEContext )
+    public ServerEntry getRootDSE( GetRootDSEOperationContext getRootDSEContext )
     {
         return rootDSE;
     }
@@ -784,7 +810,7 @@
      */
     private void unregister( Partition partition ) throws NamingException
     {
-        Attribute namingContexts = rootDSE.get( NAMINGCTXS_ATTR );
+        ServerAttribute namingContexts = rootDSE.get( SchemaConstants.NAMING_CONTEXTS_AT );
         namingContexts.remove( partition.getSuffixDn().getUpName() );
         partitions.remove( partition.getSuffixDn().toString() );
     }
@@ -934,57 +960,31 @@
                     return new SingletonEnumeration<SearchResult>( result );
                 }
                 
-                Attributes attrs = new AttributesImpl();
-                if ( containsAsterisk )
+                ServerEntry serverEntry = new DefaultServerEntry( registries, opContext.getDn() );
+                
+                Iterator<ServerAttribute> attributes = getRootDSE( new GetRootDSEOperationContext( registries ) ).iterator();
+                
+                while ( attributes.hasNext() )
                 {
-                    for ( NamingEnumeration<? extends Attribute> ii = getRootDSE( null ).getAll(); ii.hasMore(); /**/ )
+                    ServerAttribute attribute = attributes.next();
+                    
+                    AttributeType type = atRegistry.lookup( attribute.getUpId() );
+                    
+                    if ( realIds.contains( type.getOid() ) )
                     {
-                        // add all user attribute
-                        Attribute attr = ii.next();
-                        AttributeType type = atRegistry.lookup( attr.getID() );
-                        if ( type.getUsage() == UsageEnum.USER_APPLICATIONS )
-                        {
-                            attrs.put( attr );
-                        }
-                        // add attributes specifically asked for
-                        else if ( realIds.contains( type.getOid() ) )
-                        {
-                            attrs.put( attr );
-                        }
+                        serverEntry.put( attribute );
                     }
-                }
-                else if ( containsPlus )
-                {
-                    for ( NamingEnumeration<? extends Attribute> ii = getRootDSE( null ).getAll(); ii.hasMore(); /**/ )
+                    else if ( containsAsterisk && ( type.getUsage() == UsageEnum.USER_APPLICATIONS ) )
                     {
-                        // add all operational attributes
-                        Attribute attr = ii.next();
-                        AttributeType type = atRegistry.lookup( attr.getID() );
-                        if ( type.getUsage() != UsageEnum.USER_APPLICATIONS )
-                        {
-                            attrs.put( attr );
-                        }
-                        // add user attributes specifically asked for
-                        else if ( realIds.contains( type.getOid() ) )
-                        {
-                            attrs.put( attr );
-                        }
+                        serverEntry.put( attribute );
                     }
-                }
-                else
-                {
-                    for ( NamingEnumeration<? extends Attribute> ii = getRootDSE( null ).getAll(); ii.hasMore(); /**/ )
+                    else if ( containsPlus && ( type.getUsage() == UsageEnum.USER_APPLICATIONS ) )
                     {
-                      // add user attributes specifically asked for
-                        Attribute attr = ii.next();
-                        AttributeType type = atRegistry.lookup( attr.getID() );
-                        if ( realIds.contains( type.getOid() ) )
-                        {
-                            attrs.put( attr );
-                        }
+                        serverEntry.put( attribute );
                     }
                 }
 
+                Attributes attrs = ServerEntryUtils.toAttributesImpl( serverEntry );
                 SearchResult result = new ServerSearchResult( "", null, attrs, false );
                 return new SingletonEnumeration<SearchResult>( result );
             }
@@ -1003,33 +1003,35 @@
         
         if ( dn.size() == 0 )
         {
-            Attributes retval = new AttributesImpl();
-            NamingEnumeration<String> list = rootDSE.getIDs();
+            ServerEntry retval = new DefaultServerEntry( registries, opContext.getDn() );
+            Set<AttributeType> attributeTypes = rootDSE.getAttributeTypes();
      
             if ( opContext.getAttrsId() != null )
             {
-                while ( list.hasMore() )
+                for ( AttributeType attributeType:attributeTypes )
                 {
-                    String id = list.next();
+                    String id = attributeType.getName();
                     
                     if ( opContext.getAttrsId().contains( id ) )
                     {
-                        Attribute attr = rootDSE.get( id );
-                        retval.put( ( Attribute ) attr.clone() );
+                        ServerAttribute attr = rootDSE.get( id );
+                        retval.put( (ServerAttribute)attr.clone() );
                     }
+                    
                 }
             }
             else
             {
-                while ( list.hasMore() )
+                for ( AttributeType attributeType:attributeTypes )
                 {
-                    String id = list.next();
-                    Attribute attr = rootDSE.get( id );
-                    retval.put( ( Attribute ) attr.clone() );
+                    String id = attributeType.getName();
+                    
+                    ServerAttribute attr = rootDSE.get( id );
+                    retval.put( (ServerAttribute)attr.clone() );
                 }
             }
             
-            return retval;
+            return ServerEntryUtils.toAttributesImpl( retval );
         }
 
         Partition backend = getPartition( dn );
@@ -1139,13 +1141,13 @@
     // ------------------------------------------------------------------------
 
 
-    public void registerSupportedExtensions( Set<String> extensionOids )
+    public void registerSupportedExtensions( Set<String> extensionOids ) throws NamingException
     {
-        Attribute supportedExtension = rootDSE.get( "supportedExtension" );
+        ServerAttribute supportedExtension = rootDSE.get( SchemaConstants.SUPPORTED_EXTENSION_AT );
+        
         if ( supportedExtension == null )
         {
-            supportedExtension = new AttributeImpl( "supportedExtension" );
-            rootDSE.put( supportedExtension );
+            rootDSE.set( SchemaConstants.SUPPORTED_EXTENSION_AT );
         }
         
         for ( String extensionOid : extensionOids )

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/Partition.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/Partition.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/Partition.java Sun Jan  6 14:58:12 2008
@@ -21,6 +21,7 @@
 
 
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.BindOperationContext;
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
@@ -90,16 +91,27 @@
      *
      * @return the entry for the suffix of this Partition.
      */
-    Attributes getContextEntry();
+    ServerEntry getContextEntry();
 
 
     /**
+     * Gets the root entry of the partition, the entry for the suffix.
+     *
+     * @return the entry for the suffix of this Partition.
+     */
+    Attributes getContextEntryAttr();
+
+    
+    /**
      * Sets the root entry of the partition, the entry for the suffix.
      *
      * @param contextEntry the entry for the suffix of this Partition.
      */
     void setContextEntry( Attributes contextEntry );
 
+    void setContextEntry( ServerEntry contextEntry );
+
+    void setContextEntry( String contextEntry );
 
     /**
      * Gets the non-normalized suffix for this Partition as a string.

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java Sun Jan  6 14:58:12 2008
@@ -27,10 +27,10 @@
 
 import javax.naming.InvalidNameException;
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.constants.ServerDNConstants;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.CompareOperationContext;
 import org.apache.directory.server.core.interceptor.context.GetMatchedNameOperationContext;
@@ -165,7 +165,7 @@
      *
      * @return the attributes of the RootDSE
      */
-    public abstract Attributes getRootDSE( GetRootDSEOperationContext opContext ) throws NamingException;
+    public abstract ServerEntry getRootDSE( GetRootDSEOperationContext opContext ) throws NamingException;
 
 
     /**
@@ -244,5 +244,5 @@
      * @param extensionOids a set of OID strings to add to the supportedExtension 
      * attribute in the RootDSE
      */
-    public abstract void registerSupportedExtensions( Set<String> extensionOids );
+    public abstract void registerSupportedExtensions( Set<String> extensionOids ) throws NamingException;
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java Sun Jan  6 14:58:12 2008
@@ -43,6 +43,8 @@
 import org.apache.directory.server.core.authn.AuthenticationInterceptor;
 import org.apache.directory.server.core.authz.AciAuthorizationInterceptor;
 import org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
 import org.apache.directory.server.core.event.EventInterceptor;
@@ -121,12 +123,12 @@
     /**
      * A static object to store the rootDSE entry with all the attributes
      */
-    private static Attributes ROOT_DSE_ALL;
+    private static ServerEntry ROOT_DSE_ALL;
 
     /**
      * A static object to store the rootDSE entry without operationnal attributes
      */
-    private static Attributes ROOT_DSE_NO_OPERATIONNAL;
+    private static ServerEntry ROOT_DSE_NO_OPERATIONNAL;
 
     /**
      * A mutex to protect the rootDSE construction
@@ -221,7 +223,19 @@
     }
 
 
-    public Attributes getContextEntry()
+    public ServerEntry getContextEntry()
+    {
+        throw new UnsupportedOperationException( "Not supported by PartitionNexusProxy" );
+    }
+
+
+    public Attributes getContextEntryAttr()
+    {
+        throw new UnsupportedOperationException( "Not supported by PartitionNexusProxy" );
+    }
+
+
+    public void setContextEntry( ServerEntry contextEntry )
     {
         throw new UnsupportedOperationException( "Not supported by PartitionNexusProxy" );
     }
@@ -233,6 +247,12 @@
     }
 
 
+    public void setContextEntry( String contextEntry )
+    {
+        throw new UnsupportedOperationException( "Not supported by PartitionNexusProxy" );
+    }
+
+
     public String getSuffix()
     {
         throw new UnsupportedOperationException( "Not supported by PartitionNexusProxy" );
@@ -577,22 +597,23 @@
                 {
                     if ( ROOT_DSE_NO_OPERATIONNAL == null )
                     {
-                        ROOT_DSE_NO_OPERATIONNAL = lookup( opContext, null );
+                        ROOT_DSE_NO_OPERATIONNAL = ServerEntryUtils.toServerEntry( lookup( opContext, null ), opContext.getDn(), opContext.getRegistries() );
                     }
                 }
 
-                return ROOT_DSE_NO_OPERATIONNAL;
-            } else if ( ( attrs.size() == 1 ) && ( attrs.contains( SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES ) ) )
+                return ServerEntryUtils.toAttributesImpl( ROOT_DSE_NO_OPERATIONNAL );
+            } 
+            else if ( ( attrs.size() == 1 ) && ( attrs.contains( SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES ) ) )
             {
                 synchronized ( ROOT_DSE_ALL_MUTEX )
                 {
                     if ( ROOT_DSE_ALL == null )
                     {
-                        ROOT_DSE_ALL = lookup( opContext, null );
+                        ROOT_DSE_ALL = ServerEntryUtils.toServerEntry( lookup( opContext, null ), opContext.getDn(), opContext.getRegistries() );
                     }
                 }
 
-                return ROOT_DSE_ALL;
+                return ServerEntryUtils.toAttributesImpl( ROOT_DSE_ALL );
             }
 
         }
@@ -768,7 +789,7 @@
     }
 
 
-    public Attributes getRootDSE( GetRootDSEOperationContext opContext ) throws NamingException
+    public ServerEntry getRootDSE( GetRootDSEOperationContext opContext ) throws NamingException
     {
         if ( opContext.getDn().size() == 0 )
         {
@@ -787,7 +808,7 @@
     }
 
 
-    public Attributes getRootDSE( GetRootDSEOperationContext opContext, Collection<String> bypass )
+    public ServerEntry getRootDSE( GetRootDSEOperationContext opContext, Collection<String> bypass )
             throws NamingException
     {
         ensureStarted();
@@ -861,7 +882,7 @@
     }
 
 
-    public void registerSupportedExtensions( Set<String> extensionOids )
+    public void registerSupportedExtensions( Set<String> extensionOids ) throws NamingException
     {
         service.getPartitionNexus().registerSupportedExtensions( extensionOids );
     }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java Sun Jan  6 14:58:12 2008
@@ -20,6 +20,7 @@
 package org.apache.directory.server.core.partition.impl.btree;
 
 
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.enumeration.SearchResultEnumeration;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
@@ -89,7 +90,12 @@
     protected int cacheSize = -1;
     protected LdapDN suffixDn;
     protected String suffix;
-    protected Attributes contextEntry = new AttributesImpl( true );
+    
+    /** The rootDSE context */
+    protected ServerEntry contextEntry;
+
+    /** The rootDSE context */
+    protected Attributes contextEntryAttr;
 
 
     // ------------------------------------------------------------------------
@@ -139,9 +145,34 @@
      *
      * @return the root suffix entry for this BTreePartition
      */
-    public Attributes getContextEntry()
+    public ServerEntry getContextEntry()
     {
-        return ( Attributes ) contextEntry.clone();
+        if ( contextEntry != null )
+        {
+            return ( ServerEntry ) contextEntry.clone();
+        }
+        else
+        {
+            return null;
+        }
+    }
+
+
+    /**
+     * Returns root entry for this BTreePartition.
+     *
+     * @return the root suffix entry for this BTreePartition
+     */
+    public Attributes getContextEntryAttr()
+    {
+        if ( contextEntryAttr != null )
+        {
+            return ( Attributes ) contextEntryAttr.clone();
+        }
+        else
+        {
+            return null;
+        }
     }
 
 
@@ -150,12 +181,34 @@
      *
      * @param rootEntry the root suffix entry of this BTreePartition
      */
-    public void setContextEntry( Attributes rootEntry )
+    public void setContextEntry( ServerEntry rootEntry )
     {
-        this.contextEntry = ( Attributes ) rootEntry.clone();
+        this.contextEntry = ( ServerEntry ) rootEntry.clone();
     }
 
+    
+    /**
+     * Sets root entry for this BTreePartition.
+     *
+     * @param rootEntry the root suffix entry of this BTreePartition
+     */
+    public void setContextEntry( String rootEntry )
+    {
+        System.out.println( rootEntry );
+    }
+
+    
+    /**
+     * Sets root entry for this BTreePartition.
+     *
+     * @param rootEntry the root suffix entry of this BTreePartition
+     */
+    public void setContextEntry( Attributes rootEntryAttr )
+    {
+        this.contextEntryAttr = ( AttributesImpl ) rootEntryAttr.clone();
+    }
 
+    
     /**
      * Gets the unique identifier for this partition.
      *

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Sun Jan  6 14:58:12 2008
@@ -23,6 +23,8 @@
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.entry.ServerStringValue;
+import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
@@ -207,8 +209,8 @@
         schemaManager = directoryService.getSchemaService().getSchemaControl();
 
         // stuff for dealing with subentries (garbage for now)
-        String subschemaSubentry = ( String ) nexus.getRootDSE( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
-        LdapDN subschemaSubentryDn = new LdapDN( subschemaSubentry );
+        ServerValue<?> subschemaSubentry = nexus.getRootDSE( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
+        LdapDN subschemaSubentryDn = new LdapDN( (String)(subschemaSubentry.get()) );
         subschemaSubentryDn.normalize( attributeTypeRegistry.getNormalizerMapping() );
         subschemaSubentryDnNorm = subschemaSubentryDn.getNormName();
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java Sun Jan  6 14:58:12 2008
@@ -85,6 +85,12 @@
             while( searchContexts.hasMore() )
             {
                 currentSearchContextName = ( String ) searchContexts.next();
+                
+                if ( currentSearchContextName == null )
+                {
+                    continue;
+                }
+                
                 currentSearchContext = ( ServerLdapContext ) RootDSE.lookup( currentSearchContextName );
                 
                 javaClassEntries = currentSearchContext.search( LdapDN.EMPTY_LDAPDN, filter, controls );

Modified: directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java (original)
+++ directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java Sun Jan  6 14:58:12 2008
@@ -501,6 +501,11 @@
         {
             return null;
         }
+        
+        public ServerEntry newEntry( String dn, String ldif )
+        {
+            return null;
+        }
     }
 
     class BogusEnumeration implements NamingEnumeration

Modified: directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java (original)
+++ directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java Sun Jan  6 14:58:12 2008
@@ -550,5 +550,11 @@
         {
             return null;
         }
+
+        
+        public ServerEntry newEntry( String dn, String ldif )
+        {
+            return null;
+        }
     }
 }

Modified: directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/interceptor/MockInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/interceptor/MockInterceptor.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/interceptor/MockInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/interceptor/MockInterceptor.java Sun Jan  6 14:58:12 2008
@@ -21,6 +21,7 @@
 
 
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.BindOperationContext;
@@ -84,7 +85,7 @@
     }
 
 
-    public Attributes getRootDSE( NextInterceptor next, GetRootDSEOperationContext opContext ) throws NamingException
+    public ServerEntry getRootDSE( NextInterceptor next, GetRootDSEOperationContext opContext ) throws NamingException
     {
         test.interceptors.add( this );
         return next.getRootDSE( opContext );

Modified: directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java (original)
+++ directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java Sun Jan  6 14:58:12 2008
@@ -23,6 +23,8 @@
 import junit.framework.TestCase;
 import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.impl.btree.Index;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
@@ -38,12 +40,14 @@
 import org.apache.directory.server.schema.registries.DefaultRegistries;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
 import java.io.File;
 import java.io.IOException;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -92,11 +96,12 @@
         loader.loadWithDependencies( bootstrapSchemas, registries );
         
         // run referential integrity tests
-        java.util.List errors = registries.checkRefInteg();
+        List<Throwable> errors = registries.checkRefInteg();
+        
         if ( !errors.isEmpty() )
         {
             NamingException e = new NamingException();
-            e.setRootCause( ( Throwable ) errors.get( 0 ) );
+            e.setRootCause( errors.get( 0 ) );
             throw e;
         }
 
@@ -136,9 +141,8 @@
         schemaPartition.setIndexedAttributes( indexedAttributes );
         schemaPartition.setSuffix( "ou=schema" );
         
-        Attributes entry = new AttributesImpl();
-        entry.put( "objectClass", "top" );
-        entry.get( "objectClass" ).add( "organizationalUnit" );
+        ServerEntry entry = new DefaultServerEntry( registries, new LdapDN( "ou=schema" ) );
+        entry.put( "objectClass", "top", "organizationalUnit" );
         entry.put( "ou", "schema" );
         schemaPartition.setContextEntry( entry );
         schemaPartition.init( directoryService );

Modified: directory/apacheds/branches/bigbang/jdbm-store/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/jdbm-store/pom.xml?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/jdbm-store/pom.xml (original)
+++ directory/apacheds/branches/bigbang/jdbm-store/pom.xml Sun Jan  6 14:58:12 2008
@@ -57,6 +57,12 @@
 
     <dependency>
       <groupId>${pom.groupId}</groupId>
+      <artifactId>apacheds-core-entry</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
       <artifactId>apacheds-btree-base</artifactId>
       <version>${pom.version}</version>
     </dependency>

Modified: directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java (original)
+++ directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java Sun Jan  6 14:58:12 2008
@@ -24,6 +24,9 @@
 import jdbm.helper.MRU;
 import jdbm.recman.BaseRecordManager;
 import jdbm.recman.CacheRecordManager;
+
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.partition.Oid;
 import org.apache.directory.server.core.partition.impl.btree.Index;
 import org.apache.directory.server.core.partition.impl.btree.IndexAssertion;
@@ -136,7 +139,7 @@
     // -----------------------------------------------------------------------
 
 
-    private Attributes contextEntry;
+    private ServerEntry contextEntry;
     private String suffixDn;
     private boolean enableOptimizer;
     private int cacheSize = DEFAULT_CACHE_SIZE;
@@ -181,14 +184,14 @@
     }
 
 
-    public void setContextEntry( Attributes contextEntry )
+    public void setContextEntry( ServerEntry contextEntry )
     {
         protect( "contextEntry" );
         this.contextEntry = contextEntry;
     }
 
 
-    public Attributes getContextEntry()
+    public ServerEntry getContextEntry()
     {
         return contextEntry;
     }
@@ -435,7 +438,7 @@
      * @param entry the root entry of the store
      * @throws NamingException on failre to add the root entry
      */
-    protected void initSuffixEntry3( String suffix, Attributes entry ) throws NamingException
+    protected void initSuffixEntry3( String suffix, ServerEntry entry ) throws NamingException
     {
         // add entry for context, if it does not exist
         Attributes suffixOnDisk = getSuffixEntry();
@@ -444,7 +447,9 @@
         {
             LdapDN dn = new LdapDN( suffix );
             LdapDN normalizedSuffix = LdapDN.normalize( dn, attributeTypeRegistry.getNormalizerMapping() );
-            add( normalizedSuffix, entry );
+            
+            //add( normalizedSuffix, entry );
+            add( normalizedSuffix, ServerEntryUtils.toAttributesImpl( entry ) );
         }
     }
 

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java Sun Jan  6 14:58:12 2008
@@ -33,7 +33,10 @@
 import org.apache.directory.mitosis.service.protocol.handler.ReplicationServerProtocolHandler;
 import org.apache.directory.mitosis.store.ReplicationStore;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.Interceptor;
@@ -80,6 +83,7 @@
 import java.net.InetSocketAddress;
 import java.text.ParseException;
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
 
@@ -303,9 +307,10 @@
      */
     public void purgeAgedData() throws NamingException
     {
-        Attributes rootDSE = nexus.getRootDSE( null );
-        Attribute namingContextsAttr = rootDSE.get( "namingContexts" );
-        if ( namingContextsAttr == null || namingContextsAttr.size() == 0 )
+        ServerEntry rootDSE = nexus.getRootDSE( null );
+        ServerAttribute namingContextsAttr = rootDSE.get( SchemaConstants.NAMING_CONTEXTS_AT );
+        
+        if ( ( namingContextsAttr == null ) || ( namingContextsAttr.size() == 0 ) )
         {
             throw new NamingException( "No namingContexts attributes in rootDSE." );
         }
@@ -326,21 +331,15 @@
         }
 
         // Iterate all context partitions to send all entries of them.
-        NamingEnumeration<?> e = namingContextsAttr.getAll();
+        Iterator<ServerValue<?>> namingContexts = namingContextsAttr.getAll();
         
-        while ( e.hasMore() )
+        while ( namingContexts.hasNext() )
         {
-            Object value = e.next();
+            ServerValue<?> namingContext = namingContexts.next();
             // Convert attribute value to JNDI name.
             LdapDN contextName;
-            if ( value instanceof LdapDN )
-            {
-                contextName = ( LdapDN ) value;
-            }
-            else
-            {
-                contextName = new LdapDN( String.valueOf( value ) );
-            }
+            
+            contextName = new LdapDN( (String)namingContext.get() );
 
             contextName.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
             LOG.info( "[Replica-{}] Purging aged data under '{}'", configuration.getReplicaId(), contextName );

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java (original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java Sun Jan  6 14:58:12 2008
@@ -42,6 +42,9 @@
 import org.apache.directory.mitosis.service.protocol.message.LoginMessage;
 import org.apache.directory.mitosis.store.ReplicationLogIterator;
 import org.apache.directory.mitosis.store.ReplicationStore;
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
@@ -60,6 +63,7 @@
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import java.net.InetSocketAddress;
+import java.util.Iterator;
 import java.util.Map;
 
 
@@ -347,9 +351,10 @@
 
     private void sendAllEntries( ReplicationContext ctx ) throws NamingException
     {
-        Attributes rootDSE = ctx.getDirectoryService().getPartitionNexus().getRootDSE( null );
+        ServerEntry rootDSE = ctx.getDirectoryService().getPartitionNexus().getRootDSE( null );
 
-        Attribute namingContextsAttr = rootDSE.get( "namingContexts" );
+        ServerAttribute namingContextsAttr = rootDSE.get( SchemaConstants.NAMING_CONTEXTS_AT );
+        
         if ( namingContextsAttr == null || namingContextsAttr.size() == 0 )
         {
             SessionLog.warn( ctx.getSession(), "[Replica-"+ ctx.getConfiguration().getReplicaId() +
@@ -358,22 +363,16 @@
         }
 
         // Iterate all context partitions to send all entries of them.
-        NamingEnumeration<?> e = namingContextsAttr.getAll();
+        Iterator<ServerValue<?>> namingContexts = namingContextsAttr.getAll();
         
-        while ( e.hasMore() )
+        while ( namingContexts.hasNext() )
         {
-            Object value = e.next();
+            ServerValue<?> namingContext = namingContexts.next();
 
             // Convert attribute value to JNDI name.
             LdapDN contextName;
-            if ( value instanceof LdapDN )
-            {
-                contextName = ( LdapDN ) value;
-            }
-            else
-            {
-                contextName = new LdapDN( String.valueOf( value ) );
-            }
+
+            contextName = new LdapDN( (String)namingContext.get() );
 
             SessionLog.info( ctx.getSession(), "[Replica-"+ ctx.getConfiguration().getReplicaId() +
                     "] Sending entries under '" + contextName + '\'' );

Modified: directory/apacheds/branches/bigbang/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java (original)
+++ directory/apacheds/branches/bigbang/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java Sun Jan  6 14:58:12 2008
@@ -21,6 +21,8 @@
 
 
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.Interceptor;
 import org.apache.directory.server.core.kerberos.KeyDerivationInterceptor;
 import org.apache.directory.server.core.partition.Partition;
@@ -33,8 +35,10 @@
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 import javax.naming.Context;
+import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
@@ -144,9 +148,8 @@
         users.createSubcontext( "uid=ldap", attrs );
     }
 
-    protected void configureDirectoryService()
+    protected void configureDirectoryService() throws NamingException
     {
-        Attributes attrs;
         Set<Partition> partitions = new HashSet<Partition>();
 
         // Add partition 'example'
@@ -160,15 +163,10 @@
         indexedAttrs.add( new JdbmIndex( "objectClass" ) );
         partition.setIndexedAttributes( indexedAttrs );
 
-        attrs = new AttributesImpl( true );
-        Attribute attr = new AttributeImpl( "objectClass" );
-        attr.add( "top" );
-        attr.add( "domain" );
-        attrs.put( attr );
-        attr = new AttributeImpl( "dc" );
-        attr.add( "example" );
-        attrs.put( attr );
-        partition.setContextEntry( attrs );
+        ServerEntry serverEntry = new DefaultServerEntry( directoryService.getRegistries(), new LdapDN( "dc=example, dc=com" ) );
+        serverEntry.put( "objectClass", "top", "domain" );
+        serverEntry.put( "dc", "example" );
+        partition.setContextEntry( serverEntry );
 
         partitions.add( partition );
         directoryService.setPartitions( partitions );

Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java (original)
+++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java Sun Jan  6 14:58:12 2008
@@ -402,7 +402,7 @@
 
 
     private void startLDAP0( int port, IoFilterChainBuilder chainBuilder )
-        throws LdapNamingException, LdapConfigurationException
+        throws LdapNamingException, LdapConfigurationException, NamingException
     {
         for ( ExtendedOperationHandler h : getExtendedOperationHandlers() )
         {

Modified: directory/apacheds/branches/bigbang/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java (original)
+++ directory/apacheds/branches/bigbang/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java Sun Jan  6 14:58:12 2008
@@ -29,6 +29,7 @@
 import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.server.protocol.shared.store.LdifFileLoader;
 import org.apache.directory.server.protocol.shared.store.LdifLoadFilter;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
@@ -76,6 +77,7 @@
 
     public ApacheDS( DirectoryService directoryService, LdapServer ldapServer, LdapServer ldapsServer )
     {
+        LOG.info(  "Starting the Apache Directory Server" );
         this.directoryService = directoryService;
         
         if ( this.directoryService == null )
@@ -166,6 +168,7 @@
 
     public void setSynchPeriodMillis( long synchPeriodMillis )
     {
+        LOG.info( "Set the synchPeriodMillis to {}", synchPeriodMillis );
         this.synchPeriodMillis = synchPeriodMillis;
     }
 
@@ -189,20 +192,25 @@
 
     public void setAllowAnonymousAccess( boolean allowAnonymousAccess )
     {
-        this.directoryService.setAllowAnonymousAccess( allowAnonymousAccess );
+        LOG.info( "Set the allowAnonymousAccess flag to {}", allowAnonymousAccess );
+        
+        directoryService.setAllowAnonymousAccess( allowAnonymousAccess );
+        
         if ( ldapServer != null )
         {
-            this.ldapServer.setAllowAnonymousAccess( allowAnonymousAccess );
+            ldapServer.setAllowAnonymousAccess( allowAnonymousAccess );
         }
+        
         if ( ldapsServer != null )
         {
-            this.ldapsServer.setAllowAnonymousAccess( allowAnonymousAccess );
+            ldapsServer.setAllowAnonymousAccess( allowAnonymousAccess );
         }
     }
 
 
     public void setLdifDirectory( File ldifDirectory )
     {
+        LOG.info( "The LDIF directory file is {}", ldifDirectory.getAbsolutePath() );
         this.ldifDirectory = ldifDirectory;
     }
 
@@ -213,10 +221,20 @@
     }
 
 
-    protected void setLdifFilters( List<LdifLoadFilter> filters )
+    public void setLdifFilters( List<LdifLoadFilter> filters )
     {
-        this.ldifFilters.clear();
-        this.ldifFilters.addAll( filters );
+        if ( LOG.isInfoEnabled() )
+        {
+            LOG.info( "Set the ldif filters :" );
+            
+            for ( LdifLoadFilter filter:filters )
+            {
+                LOG.info( "    Ldif Filter {}", filter );
+            }
+        }
+        
+        ldifFilters.clear();
+        ldifFilters.addAll( filters );
     }
 
 
@@ -324,8 +342,15 @@
         }
 
 
-        LdapPrincipal admin = new LdapPrincipal( new LdapDN( ServerDNConstants.ADMIN_SYSTEM_DN ),
-                AuthenticationLevel.STRONG );
+        LdapDN dn = new LdapDN( ServerDNConstants.ADMIN_SYSTEM_DN );
+        
+        // Must normailize the dn or - IllegalStateException!
+        AttributeTypeRegistry reg = directoryService.getRegistries().getAttributeTypeRegistry();
+            dn.normalize( reg.getNormalizerMapping() );
+        
+        LdapPrincipal admin = new LdapPrincipal( dn, AuthenticationLevel.STRONG );
+        
+        
         DirContext root = directoryService.getJndiContext( admin );
         ensureLdifFileBase( root );
 

Modified: directory/apacheds/branches/bigbang/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java (original)
+++ directory/apacheds/branches/bigbang/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java Sun Jan  6 14:58:12 2008
@@ -27,6 +27,8 @@
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.impl.btree.Index;
 import org.apache.directory.server.core.partition.impl.btree.Tuple;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
@@ -55,8 +57,8 @@
 import org.apache.directory.shared.ldap.exception.LdapConfigurationException;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.ldif.LdifUtils;
-import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 import org.apache.directory.shared.ldap.util.Base64;
@@ -215,18 +217,21 @@
         }
 
         Set<Index> indexedAttributes = new HashSet<Index>();
+        
         for ( String attributeId : listing.getIndexedAttributes() )
         {
             indexedAttributes.add( new JdbmIndex( attributeId ) );
         }
+        
         schemaPartition.setIndexedAttributes( indexedAttributes );
         schemaPartition.setSuffix( ServerDNConstants.OU_SCHEMA_DN );
         
-        Attributes entry = new AttributesImpl();
-        entry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC );
-        entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( SchemaConstants.ORGANIZATIONAL_UNIT_OC );
-        entry.put( SchemaConstants.OU_AT, "schema" );
-        schemaPartition.setContextEntry( entry );
+        ServerEntry systemEntry = new DefaultServerEntry( registries, new LdapDN( "ou=schema" ) );
+        systemEntry.put( SchemaConstants.OBJECT_CLASS_AT, 
+            SchemaConstants.TOP_OC,
+            SchemaConstants.ORGANIZATIONAL_UNIT_OC );
+        systemEntry.put( SchemaConstants.OU_AT, "schema" );
+        schemaPartition.setContextEntry( systemEntry );
 
         DirectoryService directoryService = new DefaultDirectoryService();
         schemaPartition.init( directoryService );

Modified: directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java Sun Jan  6 14:58:12 2008
@@ -239,7 +239,7 @@
         setContexts( ServerDNConstants.ADMIN_SYSTEM_DN, "secret" );
     }
 
-    protected void configureDirectoryService()
+    protected void configureDirectoryService() throws NamingException
     {
     }
 

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java Sun Jan  6 14:58:12 2008
@@ -79,7 +79,7 @@
 
 
     @Override
-    protected void configureDirectoryService()
+    protected void configureDirectoryService() throws NamingException
     {
 
         Set<Partition> partitions = new HashSet<Partition>();
@@ -103,6 +103,7 @@
         attrs.put( attr );
         partition.setContextEntry( attrs );
 
+
         partitions.add( partition );
         directoryService.setPartitions( partitions );
     }
@@ -173,11 +174,11 @@
             Attributes attrs = ctx.getAttributes( "ldap://localhost:" + port, new String[]
                 { "supportedSASLMechanisms" } );
 
-            NamingEnumeration answer = attrs.getAll();
+            NamingEnumeration<? extends Attribute> answer = attrs.getAll();
 
             if ( answer.hasMore() )
             {
-                Attribute result = ( Attribute ) answer.next();
+                Attribute result = answer.next();
                 assertTrue( result.size() == 3 );
                 assertTrue( result.contains( "GSSAPI" ) );
                 assertTrue( result.contains( "DIGEST-MD5" ) );

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java Sun Jan  6 14:58:12 2008
@@ -21,13 +21,15 @@
 
 
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.impl.btree.Index;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
 import org.apache.directory.server.core.unit.AbstractAdminTestCase;
-import org.apache.directory.shared.ldap.message.AttributeImpl;
-import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 import javax.naming.Context;
 import javax.naming.InitialContext;
@@ -35,6 +37,8 @@
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
+import javax.naming.directory.InitialDirContext;
+
 import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.Set;
@@ -46,16 +50,18 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ServerContextFactoryTest extends AbstractAdminTestCase
+public class ServerContextFactoryTest extends AbstractServerTest
 {
     public ServerContextFactoryTest() throws NamingException
     {
     }
 
+    private DirContext ctx = null;
+
 
     public void setUp() throws Exception
     {
-        Attributes attrs;
+        super.setUp();
         Set<Index> indexedAttrs;
         Set<Partition> partitions = new HashSet<Partition>();
 
@@ -69,16 +75,10 @@
         indexedAttrs.add( new JdbmIndex( "objectClass" ) );
         partition.setIndexedAttributes( indexedAttrs );
 
-        attrs = new AttributesImpl( true );
-        Attribute attr = new AttributeImpl( "objectClass" );
-        attr.add( "top" );
-        attr.add( "organizationalUnit" );
-        attr.add( "extensibleObject" );
-        attrs.put( attr );
-        attr = new AttributeImpl( "ou" );
-        attr.add( "testing" );
-        attrs.put( attr );
-        partition.setContextEntry( attrs );
+        ServerEntry serverEntry = new DefaultServerEntry( directoryService.getRegistries(), new LdapDN( "ou=testing" ) );
+        serverEntry.put( "objectClass", "top", "organizationalUnit", "extensibleObject" );
+        serverEntry.put( "ou", "testing" );
+        partition.setContextEntry( serverEntry );
 
         partitions.add( partition );
 
@@ -93,16 +93,10 @@
         indexedAttrs.add( new JdbmIndex( "objectClass" ) );
         partition.setIndexedAttributes( indexedAttrs );
 
-        attrs = new AttributesImpl( true );
-        attr = new AttributeImpl( "objectClass" );
-        attr.add( "top" );
-        attr.add( "domain" );
-        attr.add( "extensibleObject" );
-        attrs.put( attr );
-        attr = new AttributeImpl( "dc" );
-        attr.add( "example" );
-        attrs.put( attr );
-        partition.setContextEntry( attrs );
+        serverEntry = new DefaultServerEntry( directoryService.getRegistries(), new LdapDN( "dc=example" ) );
+        serverEntry.put( "objectClass", "top", "organizationalUnit", "extensibleObject" );
+        serverEntry.put( "dc", "example" );
+        partition.setContextEntry( serverEntry );
 
         partitions.add( partition );
 
@@ -116,20 +110,14 @@
         indexedAttrs.add( new JdbmIndex( "objectClass" ) );
         partition.setIndexedAttributes( indexedAttrs );
 
-        attrs = new AttributesImpl( true );
-        attr = new AttributeImpl( "objectClass" );
-        attr.add( "top" );
-        attr.add( "domain" );
-        attr.add( "extensibleObject" );
-        attrs.put( attr );
-        attr = new AttributeImpl( "dc" );
-        attr.add( "MixedCase" );
-        attrs.put( attr );
-        partition.setContextEntry( attrs );
+        serverEntry = new DefaultServerEntry( directoryService.getRegistries(), new LdapDN( "dc=MixedCase" ) );
+        serverEntry.put( "objectClass", "top", "organizationalUnit", "extensibleObject" );
+        serverEntry.put( "dc", "MixedCase" );
+        partition.setContextEntry( serverEntry );
 
         partitions.add( partition );
 
-        service.setPartitions( partitions );
+        directoryService.setPartitions( partitions );
 
         super.setUp();
     }
@@ -178,12 +166,13 @@
     }
 
 
+    /*
     public void testAppPartitionExample() throws NamingException
     {
         Hashtable<String,Object> env = new Hashtable<String,Object>();
 
         env.put( Context.PROVIDER_URL, "dc=example" );
-        env.put( DirectoryService.JNDI_KEY, service );
+        env.put( DirectoryService.JNDI_KEY, directoryService );
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
         env.put( Context.SECURITY_AUTHENTICATION, "simple" );
@@ -207,7 +196,7 @@
         Hashtable<String,Object> env = new Hashtable<String,Object>();
 
         env.put( Context.PROVIDER_URL, "ou=testing" );
-        env.put( DirectoryService.JNDI_KEY, service );
+        env.put( DirectoryService.JNDI_KEY, directoryService );
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
         env.put( Context.SECURITY_AUTHENTICATION, "simple" );
@@ -231,7 +220,7 @@
         Hashtable<String,Object> env = new Hashtable<String,Object>();
 
         env.put( Context.PROVIDER_URL, "dc=MixedCase" );
-        env.put( DirectoryService.JNDI_KEY, service );
+        env.put( DirectoryService.JNDI_KEY, directoryService );
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
         env.put( Context.SECURITY_AUTHENTICATION, "simple" );
@@ -248,4 +237,5 @@
         assertTrue( attribute.contains( "top" ) );
         assertTrue( attribute.contains( "domain" ) );
     }
+    */
 }

Modified: directory/shared/branches/bigbang/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java (original)
+++ directory/shared/branches/bigbang/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java Sun Jan  6 14:58:12 2008
@@ -160,8 +160,7 @@
     String EXCLUDE_ALL_COLLECTIVE_ATTRIBUTES_AT = "excludeAllCollectiveAttributes";
     String EXCLUDE_ALL_COLLECTIVE_ATTRIBUTES_AT_OID = "2.5.18.0";
     
-    
-    // CreateTimestamp
+        // CreateTimestamp
     String CREATE_TIMESTAMP_AT = "createTimestamp";
     String CREATE_TIMESTAMP_AT_OID = "2.5.18.1";
     
@@ -249,11 +248,39 @@
     // UidObject
     String UID_OBJECT_AT = "uidObject";
     String UID_OBJECT_AT_OID = "1.3.6.1.1.3.1";
+    
+    // VendorName
+    String VENDOR_NAME_AT = "vendorName";
+    String VENDOR_NAME_AT_OID = "1.3.6.1.1.4";
+    
+    // VendorVersion
+    String VENDOR_VERSION_AT = "vendorVersion";
+    String VENDOR_VERSION_AT_OID = "1.3.6.1.1.5";
+    
+    // NamingContexts
+    String NAMING_CONTEXTS_AT = "namingContexts";
+    String NAMING_CONTEXTS_AT_OID = "1.3.6.1.4.1.1466.101.120.5";
+    
+    // SupportedExtension
+    String SUPPORTED_EXTENSION_AT = "supportedExtension";
+    String SUPPORTED_EXTENSION_AT_OID = "1.3.6.1.4.1.1466.101.120.7";
+    
+    // supportedControl
+    String SUPPORTED_CONTROL_AT = "supportedControl";
+    String SUPPORTED_CONTROL_AT_OID = "1.3.6.1.4.1.1466.101.120.13";
+    
+    // SupportedLdapVersion
+    String SUPPORTED_LDAP_VERSION_AT = "supportedLDAPVersion";
+    String SUPPORTED_LDAP_VERSION_AT_OID = "1.3.6.1.4.1.1466.101.120.15";
 
     // LdapSyntaxes
     String LDAP_SYNTAXES_AT = "ldapSyntaxes";
     String LDAP_SYNTAXES_AT_OID = "1.3.6.1.4.1.1466.101.120.16";
-
+    
+    // SupportedFeatures
+    String SUPPORTED_FEATURES_AT = "supportedFeatures";
+    String SUPPORTED_FEATURES_AT_OID = "1.3.6.1.4.1.4203.1.3.5";
+    
     // AccessControlSubentries
     String ACCESS_CONTROL_SUBENTRIES_AT = "accessControlSubentries";
     String ACCESS_CONTROL_SUBENTRIES_AT_OID = "1.3.6.1.4.1.18060.0.4.1.2.11";
@@ -310,4 +337,7 @@
     String BIT_STRING_MR = "bitStringMatch";
     String GENERALIZED_TIME_MR = "generalizedTimeMatch";
     String GENERALIZED_TIME_ORDERING_MR = "generalizedTimeOrderingMatch";
+    
+    // ---- Features ----------------------------------------------------------
+    String FEATURE_ALL_OPERATIONAL_ATTRIBUTES = "1.3.6.1.4.1.4203.1.5.1";
 }

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractBinaryValue.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractBinaryValue.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractBinaryValue.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractBinaryValue.java Sun Jan  6 14:58:12 2008
@@ -37,7 +37,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public abstract class AbstractBinaryValue implements Value<byte[]>
+public abstract class AbstractBinaryValue implements Value<byte[]>, Cloneable
 {
     /** logger for reporting errors that might not be handled properly upstream */
     private static final Logger LOG = LoggerFactory.getLogger( AbstractBinaryValue.class );
@@ -201,21 +201,6 @@
 
 
     /**
-     * Makes a deep copy of the BinaryValue.
-     *
-     * @return a deep copy of the Value.
-     */
-    public AbstractBinaryValue clone() throws CloneNotSupportedException
-    {
-        AbstractBinaryValue cloned = (AbstractBinaryValue)super.clone();
-        
-        cloned.wrapped = getCopy();
-        
-        return cloned;
-    }
-
-
-    /**
      * @see Object#equals(Object)
      */
     @Override
@@ -276,6 +261,28 @@
         }
 
         return ByteArrayComparator.INSTANCE.compare( wrapped, value.getReference() );
+    }
+
+    
+    /**
+     * Makes a deep copy of the BinaryValue.
+     *
+     * @return a deep copy of the Value.
+     */
+    public AbstractBinaryValue clone()
+    {
+        try
+        {
+            AbstractBinaryValue clone = (AbstractBinaryValue)super.clone();
+            
+            clone.wrapped = getCopy();
+            
+            return clone;
+        }
+        catch ( CloneNotSupportedException cnse )
+        {
+            return null;
+        }
     }
 
     

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStreamedValue.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStreamedValue.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStreamedValue.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStreamedValue.java Sun Jan  6 14:58:12 2008
@@ -33,7 +33,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public abstract class AbstractStreamedValue implements Value<URI>
+public abstract class AbstractStreamedValue implements Value<URI>, Cloneable
 {
     /** The URI pointing to the stored data */
     private URI wrapped;

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStringValue.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStringValue.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStringValue.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStringValue.java Sun Jan  6 14:58:12 2008
@@ -32,7 +32,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public abstract class AbstractStringValue implements Value<String>
+public abstract class AbstractStringValue implements Value<String>, Cloneable
 {
     /** logger for reporting errors that might not be handled properly upstream */
     private static final Logger LOG = LoggerFactory.getLogger( AbstractStringValue.class );

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java?rev=609459&r1=609458&r2=609459&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java Sun Jan  6 14:58:12 2008
@@ -50,6 +50,24 @@
 
 
     /**
+     * Puts some values to this attribute.
+     * <p>
+     * The new values are replace the previous values.
+     * </p>
+     * <p>
+     * This method returns the number of values that were put.
+     * </p>
+     *
+     * @param val some values to be put which may be null
+     * @return the number of added values, or 0 if none has been added
+     * @throws InvalidAttributeValueException If we try to add some values
+     * which conflicts with the AttributeType for this attribute
+     * @throws NamingException If the attributeType does not have a syntax
+     */
+    int put( String... vals ) throws InvalidAttributeValueException, NamingException;
+
+
+    /**
      * Adds some values to this attribute. If the new values are already present in
      * the attribute values, the method has no effect.
      * <p>
@@ -66,6 +84,21 @@
 
 
     /**
+     * Puts some values to this attribute.
+     * <p>
+     * The new values are replace the previous values.
+     * </p>
+     * <p>
+     * This method returns the number of values that were put.
+     * </p>
+     *
+     * @param val some values to be put which may be null
+     * @return the number of added values, or 0 if none has been added
+     */
+    int put( byte[]... vals ) throws InvalidAttributeValueException, NamingException;
+
+
+    /**
      * Removes all values of this attribute.
      */
     void clear();
@@ -202,4 +235,27 @@
      * @return the number of added values, or 0 if none has been added
      */
     int add( T... val ) throws InvalidAttributeValueException, NamingException;
+    
+    
+    /**
+     * Puts some values to this attribute.
+     * <p>
+     * The new values are replace the previous values.
+     * </p>
+     * <p>
+     * This method returns the number of values that were put.
+     * </p>
+     *
+     * @param val some values to be put which may be null
+     * @return the number of added values, or 0 if none has been added
+     */
+    int put( T... vals ) throws InvalidAttributeValueException, NamingException;
+
+
+    /**
+     * Returns a cloned version of the current attribute.
+     *
+     * @return A copy of the current attribute
+     */
+    EntryAttribute<T> clone();
 }



Mime
View raw message