You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Si...@saaconsultants.com on 2007/09/25 11:33:53 UTC

Dumping The Partition in DS 1.5

For an embedded DS I provide a dump method which prints the content of the jdbm partition(s) as a form of data integrity check.

In order to implement this I think I need a reference to the bootstrapRegistries:

            <snip>

            JdbmMasterTable master = new JdbmMasterTable( recMan );
            AttributeType attributeType = bootstrapRegistries.getAttributeTypeRegistry(  )
                                                             .lookup( "apacheUpdn" );
            JdbmIndex idIndex = new JdbmIndex( attributeType,
                    partitionDirectory, 1000, 1000 );

            NamingEnumeration list = master.listTuples(  );
            StringBuffer buf = new StringBuffer(  );

            while ( list.hasMore(  ) )

            <snip>

This code is very similar to my old DS 1.0 code and is a match to the code in 1.5 server-tools:dumpcmd:DumpCommandExecutor.java

How do I get a reference to boostrapRegistries in an running, embedded directory?

Doing this throws an exception:

               Registries bootstrapRegistries = new DefaultRegistries( "bootstrap", 
                    new BootstrapSchemaLoader(), new DefaultOidRegistry() );

javax.naming.NamingException: OID for name 'apacheUpdn' was not found within the OID registry
 at org.apache.directory.server.schema.registries.DefaultOidRegistry.getOid(DefaultOidRegistry.java:113)
 at org.apache.directory.server.schema.registries.DefaultAttributeTypeRegistry.lookup(DefaultAttributeTypeRegistry.java:156)
<snip>


Many Thanks


Simon Temple

Re: Dumping The Partition in DS 1.5

Posted by Alex Karasulu <ak...@apache.org>.
Simon,

In 1.5 there is no longer a bootstrap registries.  Now the server bootstrap
process starts up the schema
partition and loads all the schema info from the schema partition with a
minimal set of schema data.

To help you out I need to know what your main objective is not how you're
trying to solve some part of
it.  You may just be doing it the wrong way and I might be able to suggest a
better option.

Alex

On 9/25/07, Simon.Temple@saaconsultants.com <Si...@saaconsultants.com>
wrote:
>
>  For an embedded DS I provide a dump method which prints the content of
> the jdbm partition(s) as a form of data integrity check.
>
> In order to implement this I think I need a reference to the
> bootstrapRegistries:
>
>             <snip>
>
>             JdbmMasterTable master = new JdbmMasterTable( recMan );
>             AttributeType attributeType =
> bootstrapRegistries.getAttributeTypeRegistry(  )
>                                                              .lookup(
> "apacheUpdn" );
>             JdbmIndex idIndex = new JdbmIndex( attributeType,
>                     partitionDirectory, 1000, 1000 );
>
>             NamingEnumeration list = master.listTuples(  );
>             StringBuffer buf = new StringBuffer(  );
>
>             while ( list.hasMore(  ) )
>
>             <snip>
>
> This code is very similar to my old DS 1.0 code and is a match to the code
> in 1.5 server-tools:dumpcmd:DumpCommandExecutor.java
>
> How do I get a reference to boostrapRegistries in an running, embedded
> directory?
>
> Doing this throws an exception:
>
>                Registries bootstrapRegistries = new DefaultRegistries(
> "bootstrap",
>                     new BootstrapSchemaLoader(), new DefaultOidRegistry()
> );
>
> javax.naming.NamingException: OID for name 'apacheUpdn' was not found
> within the OID registry
>  at
> org.apache.directory.server.schema.registries.DefaultOidRegistry.getOid(
> DefaultOidRegistry.java:113)
>  at
> org.apache.directory.server.schema.registries.DefaultAttributeTypeRegistry.lookup
> (DefaultAttributeTypeRegistry.java:156)
> <snip>
>
>
> Many Thanks
>
>
> Simon Temple
>

Re: Dumping The Partition in DS 1.5

Posted by Emmanuel Lecharny <el...@gmail.com>.
Hi Simon,

the method org.apache.directory.server.schema.registries.DefaultOidRegistry.getOid()
expect to receive an OID as a parameter, not a name. You might want to
use the  SchemaConstant  constants I just committed :

AttributeType attributeType =
bootstrapRegistries.getAttributeTypeRegistry(  )
              .lookup( SchemaConstants.APACHE_UP_DN_OID );

Not 100% sure it's enough though :)


On 9/25/07, Simon.Temple@saaconsultants.com
<Si...@saaconsultants.com> wrote:
>
>
> For an embedded DS I provide a dump method which prints the content of the
> jdbm partition(s) as a form of data integrity check.
>
> In order to implement this I think I need a reference to the
> bootstrapRegistries:
>
>             <snip>
>
>             JdbmMasterTable master = new JdbmMasterTable( recMan );
>             AttributeType attributeType =
> bootstrapRegistries.getAttributeTypeRegistry(  )
>
>  .lookup( "apacheUpdn" );
>             JdbmIndex idIndex = new JdbmIndex( attributeType,
>                     partitionDirectory, 1000, 1000 );
>
>             NamingEnumeration list = master.listTuples(  );
>             StringBuffer buf = new StringBuffer(  );
>
>             while ( list.hasMore(  ) )
>
>             <snip>
>
> This code is very similar to my old DS 1.0 code and is a match to the code
> in 1.5 server-tools:dumpcmd:DumpCommandExecutor.java
>
> How do I get a reference to boostrapRegistries in an running, embedded
> directory?
>
> Doing this throws an exception:
>
>                Registries bootstrapRegistries = new DefaultRegistries(
> "bootstrap",
>                     new BootstrapSchemaLoader(), new DefaultOidRegistry() );
>
> javax.naming.NamingException: OID for name 'apacheUpdn' was not found within
> the OID registry
>  at
> org.apache.directory.server.schema.registries.DefaultOidRegistry.getOid(DefaultOidRegistry.java:113)
>  at
> org.apache.directory.server.schema.registries.DefaultAttributeTypeRegistry.lookup(DefaultAttributeTypeRegistry.java:156)
> <snip>
>
>
> Many Thanks
>
>
> Simon Temple


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com