org.apache.directory.server.core.partition.ldif
Class LdifPartition

java.lang.Object
  extended by org.apache.directory.server.core.partition.AbstractPartition
      extended by org.apache.directory.server.core.partition.impl.btree.BTreePartition<java.lang.Long>
          extended by org.apache.directory.server.core.partition.ldif.LdifPartition
All Implemented Interfaces:
Partition

public class LdifPartition
extends BTreePartition<java.lang.Long>

A LDIF based partition. Data are stored on disk as LDIF, following this organisation :

  • each entry is associated with a file, postfixed with LDIF
  • each entry having at least one child will have a directory created using its name. The root is the partition's suffix.
    So for instance, we may have on disk :
     /ou=example,ou=system.ldif
     /ou=example,ou=system/
       |
       +--> cn=test.ldif
            cn=test/
               |
               +--> cn=another test.ldif
                    ...
     


    In this exemple, the partition's suffix is ou=example,ou=system.

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

    Field Summary
     
    Fields inherited from class org.apache.directory.server.core.partition.impl.btree.BTreePartition
    cacheSize, contextEntry, id, optimizer, schemaManager, searchEngine, suffix, SYS_INDEX_OIDS
     
    Fields inherited from class org.apache.directory.server.core.partition.AbstractPartition
    initialized
     
    Constructor Summary
    LdifPartition()
              Creates a new instance of LdifPartition.
     
    Method Summary
     void add(AddOperationContext addContext)
              
     void addIndexOn(Index<? extends java.lang.Object,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> index)
               
     void bind(BindOperationContext bindContext)
              
     int count()
               
     void delete(java.lang.Long id)
              
    protected  void doDestroy()
               
    protected  void doInit()
              
     Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getAliasIndex()
               
     int getChildCount(java.lang.Long id)
               
     org.apache.directory.shared.ldap.entry.Entry getContextEntry()
               
     java.lang.String getEntryDn(java.lang.Long id)
               
     java.lang.Long getEntryId(java.lang.String dn)
               
     java.lang.String getEntryUpdn(java.lang.Long id)
               
     java.lang.String getEntryUpdn(java.lang.String dn)
               
     java.lang.String getId()
               
     Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getNdnIndex()
               
     Index<java.lang.Long,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getOneAliasIndex()
               
     Index<java.lang.Long,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getOneLevelIndex()
               
     java.lang.Long getParentId(java.lang.Long childId)
               
     java.lang.Long getParentId(java.lang.String dn)
               
     Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getPresenceIndex()
               
     java.lang.String getProperty(java.lang.String propertyName)
               
     Index<java.lang.Long,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getSubAliasIndex()
               
     Index<java.lang.Long,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getSubLevelIndex()
               
     Index<?,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getSystemIndex(java.lang.String id)
               
     java.util.Iterator<java.lang.String> getSystemIndices()
               
     Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getUpdnIndex()
               
     Index<? extends java.lang.Object,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getUserIndex(java.lang.String id)
               
     java.util.Iterator<java.lang.String> getUserIndices()
               
     java.lang.String getWorkingDirectory()
               
     Partition getWrappedPartition()
               
     boolean hasSystemIndexOn(java.lang.String id)
               
     boolean hasUserIndexOn(java.lang.String id)
               
     boolean isInitialized()
               
     IndexCursor<java.lang.Long,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> list(java.lang.Long id)
               
     ClonedServerEntry lookup(java.lang.Long id)
               
     void modify(ModifyOperationContext modifyContext)
              
     void move(MoveOperationContext moveContext)
              
     void moveAndRename(MoveAndRenameOperationContext moveAndRenameContext)
              
     void rename(RenameOperationContext renameContext)
              
     void setAliasIndexOn(Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> index)
               
     void setContextEntry(java.lang.String contextEntry)
               
     void setId(java.lang.String id)
               
     void setLdifScanInterval(int ldifScanInterval)
              the interval at which the config directory containing LDIF files should be scanned, default value is 10 min
     void setNdnIndexOn(Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> index)
               
     void setOneAliasIndexOn(Index<java.lang.Long,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> index)
               
     void setOneLevelIndexOn(Index<java.lang.Long,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> index)
               
     void setPresenceIndexOn(Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> index)
               
     void setProperty(java.lang.String propertyName, java.lang.String propertyValue)
               
     void setSchemaManager(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
               
     void setSubAliasIndexOn(Index<java.lang.Long,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> index)
               
     void setSuffix(java.lang.String suffix)
               
     void setUpdnIndexOn(Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> index)
               
     void setWorkingDirectory(java.lang.String workingDirectory)
               
     void setWrappedPartition(AvlPartition wrappedPartition)
               
     void sync()
               
     void unbind(UnbindOperationContext unbindContext)
               
     
    Methods inherited from class org.apache.directory.server.core.partition.impl.btree.BTreePartition
    addIndexedAttributes, delete, getCacheSize, getIndexedAttributes, getPartitionDir, getSchemaManager, getSearchEngine, getSuffix, getSuffixDn, hasEntry, list, lookup, search, setCacheSize, setIndexedAttributes, setPartitionDir
     
    Methods inherited from class org.apache.directory.server.core.partition.AbstractPartition
    destroy, initialize
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    LdifPartition

    public LdifPartition()
    Creates a new instance of LdifPartition.

    Method Detail

    doInit

    protected void doInit()
                   throws java.lang.Exception

    Specified by:
    doInit in class AbstractPartition
    Throws:
    java.lang.Exception

    add

    public void add(AddOperationContext addContext)
             throws java.lang.Exception

    Specified by:
    add in interface Partition
    Specified by:
    add in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    bind

    public void bind(BindOperationContext bindContext)
              throws java.lang.Exception

    Throws:
    java.lang.Exception

    delete

    public void delete(java.lang.Long id)
                throws java.lang.Exception

    Specified by:
    delete in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    modify

    public void modify(ModifyOperationContext modifyContext)
                throws java.lang.Exception

    Specified by:
    modify in interface Partition
    Specified by:
    modify in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    move

    public void move(MoveOperationContext moveContext)
              throws java.lang.Exception

    Specified by:
    move in interface Partition
    Specified by:
    move in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    moveAndRename

    public void moveAndRename(MoveAndRenameOperationContext moveAndRenameContext)
                       throws java.lang.Exception

    Specified by:
    moveAndRename in interface Partition
    Specified by:
    moveAndRename in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    rename

    public void rename(RenameOperationContext renameContext)
                throws java.lang.Exception

    Specified by:
    rename in interface Partition
    Specified by:
    rename in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    addIndexOn

    public void addIndexOn(Index<? extends java.lang.Object,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> index)
                    throws java.lang.Exception
    Specified by:
    addIndexOn in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    count

    public int count()
              throws java.lang.Exception
    Specified by:
    count in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    doDestroy

    protected void doDestroy()
                      throws java.lang.Exception
    Specified by:
    doDestroy in class AbstractPartition
    Throws:
    java.lang.Exception

    getAliasIndex

    public Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getAliasIndex()
    Specified by:
    getAliasIndex in class BTreePartition<java.lang.Long>

    getChildCount

    public int getChildCount(java.lang.Long id)
                      throws java.lang.Exception
    Specified by:
    getChildCount in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    getEntryDn

    public java.lang.String getEntryDn(java.lang.Long id)
                                throws java.lang.Exception
    Specified by:
    getEntryDn in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    getEntryId

    public java.lang.Long getEntryId(java.lang.String dn)
                              throws java.lang.Exception
    Specified by:
    getEntryId in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    getEntryUpdn

    public java.lang.String getEntryUpdn(java.lang.Long id)
                                  throws java.lang.Exception
    Specified by:
    getEntryUpdn in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    getEntryUpdn

    public java.lang.String getEntryUpdn(java.lang.String dn)
                                  throws java.lang.Exception
    Specified by:
    getEntryUpdn in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    getNdnIndex

    public Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getNdnIndex()
    Specified by:
    getNdnIndex in class BTreePartition<java.lang.Long>

    getOneAliasIndex

    public Index<java.lang.Long,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getOneAliasIndex()
    Specified by:
    getOneAliasIndex in class BTreePartition<java.lang.Long>

    getOneLevelIndex

    public Index<java.lang.Long,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getOneLevelIndex()
    Specified by:
    getOneLevelIndex in class BTreePartition<java.lang.Long>

    getParentId

    public java.lang.Long getParentId(java.lang.Long childId)
                               throws java.lang.Exception
    Specified by:
    getParentId in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    getParentId

    public java.lang.Long getParentId(java.lang.String dn)
                               throws java.lang.Exception
    Specified by:
    getParentId in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    getPresenceIndex

    public Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getPresenceIndex()
    Specified by:
    getPresenceIndex in class BTreePartition<java.lang.Long>

    getProperty

    public java.lang.String getProperty(java.lang.String propertyName)
                                 throws java.lang.Exception
    Specified by:
    getProperty in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    getSubAliasIndex

    public Index<java.lang.Long,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getSubAliasIndex()
    Specified by:
    getSubAliasIndex in class BTreePartition<java.lang.Long>

    getSubLevelIndex

    public Index<java.lang.Long,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getSubLevelIndex()
    Specified by:
    getSubLevelIndex in class BTreePartition<java.lang.Long>

    getSystemIndex

    public Index<?,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getSystemIndex(java.lang.String id)
                                                                                              throws java.lang.Exception
    Specified by:
    getSystemIndex in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    getSystemIndices

    public java.util.Iterator<java.lang.String> getSystemIndices()
    Specified by:
    getSystemIndices in class BTreePartition<java.lang.Long>

    getUpdnIndex

    public Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getUpdnIndex()
    Specified by:
    getUpdnIndex in class BTreePartition<java.lang.Long>

    getUserIndex

    public Index<? extends java.lang.Object,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> getUserIndex(java.lang.String id)
                                                                                                                     throws java.lang.Exception
    Specified by:
    getUserIndex in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    getUserIndices

    public java.util.Iterator<java.lang.String> getUserIndices()
    Specified by:
    getUserIndices in class BTreePartition<java.lang.Long>

    hasSystemIndexOn

    public boolean hasSystemIndexOn(java.lang.String id)
                             throws java.lang.Exception
    Specified by:
    hasSystemIndexOn in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    hasUserIndexOn

    public boolean hasUserIndexOn(java.lang.String id)
                           throws java.lang.Exception
    Specified by:
    hasUserIndexOn in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    isInitialized

    public boolean isInitialized()
    Specified by:
    isInitialized in interface Partition
    Overrides:
    isInitialized in class AbstractPartition

    list

    public IndexCursor<java.lang.Long,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> list(java.lang.Long id)
                                                                                                       throws java.lang.Exception
    Specified by:
    list in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    lookup

    public ClonedServerEntry lookup(java.lang.Long id)
                             throws java.lang.Exception
    Specified by:
    lookup in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    setAliasIndexOn

    public void setAliasIndexOn(Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> index)
                         throws java.lang.Exception
    Specified by:
    setAliasIndexOn in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    setNdnIndexOn

    public void setNdnIndexOn(Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> index)
                       throws java.lang.Exception
    Specified by:
    setNdnIndexOn in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    setOneAliasIndexOn

    public void setOneAliasIndexOn(Index<java.lang.Long,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> index)
                            throws java.lang.Exception
    Specified by:
    setOneAliasIndexOn in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    setOneLevelIndexOn

    public void setOneLevelIndexOn(Index<java.lang.Long,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> index)
                            throws java.lang.Exception
    Specified by:
    setOneLevelIndexOn in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    setPresenceIndexOn

    public void setPresenceIndexOn(Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> index)
                            throws java.lang.Exception
    Specified by:
    setPresenceIndexOn in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    setProperty

    public void setProperty(java.lang.String propertyName,
                            java.lang.String propertyValue)
                     throws java.lang.Exception
    Specified by:
    setProperty in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    setSchemaManager

    public void setSchemaManager(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
    Specified by:
    setSchemaManager in interface Partition
    Overrides:
    setSchemaManager in class BTreePartition<java.lang.Long>

    setSubAliasIndexOn

    public void setSubAliasIndexOn(Index<java.lang.Long,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> index)
                            throws java.lang.Exception
    Specified by:
    setSubAliasIndexOn in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    setUpdnIndexOn

    public void setUpdnIndexOn(Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,java.lang.Long> index)
                        throws java.lang.Exception
    Specified by:
    setUpdnIndexOn in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    sync

    public void sync()
              throws java.lang.Exception
    Specified by:
    sync in interface Partition
    Specified by:
    sync in class BTreePartition<java.lang.Long>
    Throws:
    java.lang.Exception

    unbind

    public void unbind(UnbindOperationContext unbindContext)
                throws java.lang.Exception
    Throws:
    java.lang.Exception

    getId

    public java.lang.String getId()
    Specified by:
    getId in interface Partition
    Overrides:
    getId in class BTreePartition<java.lang.Long>

    setId

    public void setId(java.lang.String id)
    Specified by:
    setId in interface Partition
    Overrides:
    setId in class BTreePartition<java.lang.Long>

    setSuffix

    public void setSuffix(java.lang.String suffix)
                   throws org.apache.directory.shared.ldap.exception.LdapInvalidDnException
    Specified by:
    setSuffix in interface Partition
    Overrides:
    setSuffix in class BTreePartition<java.lang.Long>
    Throws:
    org.apache.directory.shared.ldap.exception.LdapInvalidDnException

    setLdifScanInterval

    public void setLdifScanInterval(int ldifScanInterval)
    the interval at which the config directory containing LDIF files should be scanned, default value is 10 min

    Parameters:
    ldifScanInterval - the scan interval time in minutes

    getWorkingDirectory

    public java.lang.String getWorkingDirectory()
    Returns:
    the workingDirectory

    setWorkingDirectory

    public void setWorkingDirectory(java.lang.String workingDirectory)
    Parameters:
    workingDirectory - the workingDirectory to set

    getContextEntry

    public org.apache.directory.shared.ldap.entry.Entry getContextEntry()
    Returns:
    the contextEntry

    setContextEntry

    public void setContextEntry(java.lang.String contextEntry)
                         throws org.apache.directory.shared.ldap.ldif.LdapLdifException
    Parameters:
    contextEntry - the contextEntry to set
    Throws:
    org.apache.directory.shared.ldap.ldif.LdapLdifException

    getWrappedPartition

    public Partition getWrappedPartition()
    Returns:
    the wrappedPartition

    setWrappedPartition

    public void setWrappedPartition(AvlPartition wrappedPartition)
    Parameters:
    wrappedPartition - the wrappedPartition to set


    Copyright © 2003-2010 The Apache Software Foundation. All Rights Reserved.