org.apache.directory.server.xdbm.tools
Class StoreUtils

java.lang.Object
  extended by org.apache.directory.server.xdbm.tools.StoreUtils

public class StoreUtils
extends java.lang.Object

A utility class for loading example LDIF data.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Constructor Summary
StoreUtils()
           
 
Method Summary
 org.apache.directory.shared.ldap.entry.Entry getAttributes(Store<java.lang.Object,java.lang.Long> store, java.lang.Long id)
          This is primarily a convenience method used to extract all the attributes associated with an entry.
static void injectEntryInStore(Store<org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> store, org.apache.directory.shared.ldap.entry.ServerEntry entry)
          adds a given ServerEntry to the store after injecting entryCSN and entryUUID operational attributes
static void loadExampleData(Store<org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> store, org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
          Initializes and loads a store with the example data shown in Structure and Organization TODO might want to make this load an LDIF instead in the future TODO correct size of spaces in user provided DN
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoreUtils

public StoreUtils()
Method Detail

loadExampleData

public static void loadExampleData(Store<org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> store,
                                   org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
                            throws java.lang.Exception
Initializes and loads a store with the example data shown in Structure and Organization TODO might want to make this load an LDIF instead in the future TODO correct size of spaces in user provided DN

Parameters:
store - the store object to be initialized
registries - oid registries
Throws:
java.lang.Exception - on access exceptions

getAttributes

public org.apache.directory.shared.ldap.entry.Entry getAttributes(Store<java.lang.Object,java.lang.Long> store,
                                                                  java.lang.Long id)
                                                           throws java.lang.Exception
This is primarily a convenience method used to extract all the attributes associated with an entry.

Parameters:
store - the store to get the attributes from
id - the id of the entry to get index information for
Returns:
the index names and values as an Attributes object
Throws:
java.lang.Exception - if there are failures accessing the underlying store

injectEntryInStore

public static void injectEntryInStore(Store<org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> store,
                                      org.apache.directory.shared.ldap.entry.ServerEntry entry)
                               throws java.lang.Exception
adds a given ServerEntry to the store after injecting entryCSN and entryUUID operational attributes

Parameters:
store - the store
dn - the normalized DN
entry - the server entry
Throws:
java.lang.Exception - in case of any problems in adding the entry to the store


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.