org.apache.directory.server.xdbm
Interface Store<E>


public interface Store<E>

Represents an entry store based on the Table, Index, and MasterTable database structure.

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

Method Summary
 void add(ServerEntry entry)
          Add an entry into the store.
 void addIndex(Index<?,E> index)
          Adds a user index to the list of index for this store
 int count()
           
 void delete(java.lang.Long id)
          Delete the entry associated with a given Id
 void destroy()
          Close the parttion : we have to close all the userIndices and the master table.
 Index<java.lang.String,E> getAliasIndex()
           
 int getCacheSize()
           
 int getChildCount(java.lang.Long id)
           
 Index<java.lang.String,E> getEntryCsnIndex()
           
 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)
           
 Index<byte[],E> getEntryUuidIndex()
           
 java.lang.String getName()
           
 Index<java.lang.String,E> getNdnIndex()
           
 Index<java.lang.String,E> getObjectClassIndex()
           
 Index<java.lang.Long,E> getOneAliasIndex()
           
 Index<java.lang.Long,E> getOneLevelIndex()
           
 java.lang.Long getParentId(java.lang.Long childId)
           
 java.lang.Long getParentId(java.lang.String dn)
          Gets the Long id of an entry's parent using the child entry's normalized dn.
 Index<java.lang.String,E> getPresenceIndex()
           
 java.lang.String getProperty(java.lang.String propertyName)
           
 Index<java.lang.Long,E> getSubAliasIndex()
           
 Index<java.lang.Long,E> getSubLevelIndex()
           
 org.apache.directory.shared.ldap.name.LdapDN getSuffix()
           
 java.lang.String getSuffixDn()
           
 Index<?,E> getSystemIndex(java.lang.String id)
          Get the user index associated with the given name
 Index<java.lang.String,E> getUpdnIndex()
           
 org.apache.directory.shared.ldap.name.LdapDN getUpSuffix()
           
 Index<?,E> getUserIndex(java.lang.String id)
          Get the user index associated with the given name
 java.util.Set<Index<?,E>> getUserIndices()
           
 java.io.File getWorkingDirectory()
           
 boolean hasSystemIndexOn(java.lang.String id)
          Tells if an index is already present in the System's index list
 boolean hasUserIndexOn(java.lang.String id)
          Tells if an index is already present in the User's index list
 void init(Registries registries)
          Initialize the JDBM storage system.
 void initRegistries(Registries registries)
           
 boolean isInitialized()
          Gets whether the store is initialized.
 boolean isSyncOnWrite()
           
 IndexCursor<java.lang.Long,E> list(java.lang.Long id)
          Gets an IndexEntry Cursor over the child nodes of an entry.
 ServerEntry lookup(java.lang.Long id)
           
 void modify(org.apache.directory.shared.ldap.name.LdapDN dn, java.util.List<org.apache.directory.shared.ldap.entry.Modification> mods)
           
 void modify(org.apache.directory.shared.ldap.name.LdapDN dn, org.apache.directory.shared.ldap.entry.ModificationOperation modOp, ServerEntry mods)
           
 void move(org.apache.directory.shared.ldap.name.LdapDN oldChildDn, org.apache.directory.shared.ldap.name.LdapDN newParentDn)
           
 void move(org.apache.directory.shared.ldap.name.LdapDN oldChildDn, org.apache.directory.shared.ldap.name.LdapDN newParentDn, org.apache.directory.shared.ldap.name.Rdn newRdn, boolean deleteOldRdn)
           
 void rename(org.apache.directory.shared.ldap.name.LdapDN dn, org.apache.directory.shared.ldap.name.Rdn newRdn, boolean deleteOldRdn)
          Changes the relative distinguished name of an entry specified by a distinguished name with the optional removal of the old Rdn attribute value from the entry.
 void setAliasIndex(Index<java.lang.String,E> index)
          Set the Alias index
 void setCacheSize(int cacheSize)
          Sets the cache size for this store
 void setEntryCsnIndex(Index<java.lang.String,E> index)
          Set the EntryCSN index
 void setEntryUuidIndex(Index<byte[],E> index)
          Set the EntryUUID index
 void setName(java.lang.String name)
          Sets the store's name
 void setNdnIndex(Index<java.lang.String,E> index)
          Set the NDN index
 void setObjectClassIndex(Index<java.lang.String,E> index)
          Set the ObjectClass index
 void setOneAliasIndex(Index<java.lang.Long,E> index)
          Set the OneAlias index
 void setOneLevelIndex(Index<java.lang.Long,E> index)
          Set the OneLevel index
 void setPresenceIndex(Index<java.lang.String,E> index)
          Set the Presence index
 void setProperty(java.lang.String propertyName, java.lang.String propertyValue)
           
 void setSubAliasIndex(Index<java.lang.Long,E> index)
          Set the SubAlias index
 void setSubLevelIndex(Index<java.lang.Long,E> index)
          Set the SubLevel index
 void setSuffixDn(java.lang.String suffixDn)
           
 void setSyncOnWrite(boolean isSyncOnWrite)
          Sets the flag telling the server to flush on disk when some modification has been done.
 void setUpdnIndex(Index<java.lang.String,E> index)
          Set the UpDn index
 void setUserIndices(java.util.Set<Index<?,E>> userIndices)
          Stores the list of user index
 void setWorkingDirectory(java.io.File workingDirectory)
          Sets the working directory for the store
 void sync()
          This method is called when the synch thread is waking up, to write the modified data.
 java.util.Iterator<java.lang.String> systemIndices()
          An iterator build on top of the System's index
 java.util.Iterator<java.lang.String> userIndices()
          An iterator build on top of the User's index
 

Method Detail

setWorkingDirectory

void setWorkingDirectory(java.io.File workingDirectory)
Sets the working directory for the store


getWorkingDirectory

java.io.File getWorkingDirectory()
Returns:
The current working directory for the store

setUserIndices

void setUserIndices(java.util.Set<Index<?,E>> userIndices)
Stores the list of user index

Parameters:
userIndices - The list of user index

getUserIndices

java.util.Set<Index<?,E>> getUserIndices()
Returns:
The list of user index

setSuffixDn

void setSuffixDn(java.lang.String suffixDn)

getSuffixDn

java.lang.String getSuffixDn()

setSyncOnWrite

void setSyncOnWrite(boolean isSyncOnWrite)
Sets the flag telling the server to flush on disk when some modification has been done.

Parameters:
isSyncOnWrite - A boolean set to true if we have to flush on disk when a modification occurs

isSyncOnWrite

boolean isSyncOnWrite()
Returns:
true if we write to disk for every modification

setCacheSize

void setCacheSize(int cacheSize)
Sets the cache size for this store

Parameters:
cacheSize - The cache size

getCacheSize

int getCacheSize()
Returns:
The cache size

setName

void setName(java.lang.String name)
Sets the store's name

Parameters:
name - The store's name

getName

java.lang.String getName()
Returns:
The store's name

init

void init(Registries registries)
          throws java.lang.Exception
Initialize the JDBM storage system.

Parameters:
registries - the schema registries
Throws:
java.lang.Exception - on failure to lookup elements in registries
java.lang.Exception - on failure to create database files

destroy

void destroy()
             throws java.lang.Exception
Close the parttion : we have to close all the userIndices and the master table.

Throws:
java.lang.Exception - lazily thrown on any closer failures to avoid leaving open files

isInitialized

boolean isInitialized()
Gets whether the store is initialized.

Returns:
true if the partition store is initialized

sync

void sync()
          throws java.lang.Exception
This method is called when the synch thread is waking up, to write the modified data.

Throws:
java.lang.Exception - on failures to sync database files to disk

addIndex

void addIndex(Index<?,E> index)
              throws java.lang.Exception
Adds a user index to the list of index for this store

Parameters:
index - The index to add
Throws:
java.lang.Exception - If the addition failed

getPresenceIndex

Index<java.lang.String,E> getPresenceIndex()
Returns:
The Presence system index

setPresenceIndex

void setPresenceIndex(Index<java.lang.String,E> index)
                      throws java.lang.Exception
Set the Presence index

Parameters:
index - The Presence index
Throws:
java.lang.Exception - If the addition failed

getOneLevelIndex

Index<java.lang.Long,E> getOneLevelIndex()
Returns:
The OneLevel system index

setOneLevelIndex

void setOneLevelIndex(Index<java.lang.Long,E> index)
                      throws java.lang.Exception
Set the OneLevel index

Parameters:
index - The OneLevel index
Throws:
java.lang.Exception - If the addition failed

getSubLevelIndex

Index<java.lang.Long,E> getSubLevelIndex()
Returns:
The SubLevel system index

setSubLevelIndex

void setSubLevelIndex(Index<java.lang.Long,E> index)
                      throws java.lang.Exception
Set the SubLevel index

Parameters:
index - The SubLevel index
Throws:
java.lang.Exception - If the addition failed

getAliasIndex

Index<java.lang.String,E> getAliasIndex()
Returns:
The Alias system index

setAliasIndex

void setAliasIndex(Index<java.lang.String,E> index)
                   throws java.lang.Exception
Set the Alias index

Parameters:
index - The Alias index
Throws:
java.lang.Exception - If the addition failed

getOneAliasIndex

Index<java.lang.Long,E> getOneAliasIndex()
Returns:
The OneAlias system index

setOneAliasIndex

void setOneAliasIndex(Index<java.lang.Long,E> index)
                      throws java.lang.Exception
Set the OneAlias index

Parameters:
index - The OneAlias index
Throws:
java.lang.Exception - If the addition failed

getSubAliasIndex

Index<java.lang.Long,E> getSubAliasIndex()
Returns:
The SubAlias system index

setSubAliasIndex

void setSubAliasIndex(Index<java.lang.Long,E> index)
                      throws java.lang.Exception
Set the SubAlias index

Parameters:
index - The SubAlias index
Throws:
java.lang.Exception - If the addition failed

getUpdnIndex

Index<java.lang.String,E> getUpdnIndex()
Returns:
The UpDN system index

setUpdnIndex

void setUpdnIndex(Index<java.lang.String,E> index)
                  throws java.lang.Exception
Set the UpDn index

Parameters:
index - The UpDn index
Throws:
java.lang.Exception - If the addition failed

getNdnIndex

Index<java.lang.String,E> getNdnIndex()
Returns:
The Ndn system index

setNdnIndex

void setNdnIndex(Index<java.lang.String,E> index)
                 throws java.lang.Exception
Set the NDN index

Parameters:
index - The NDN index
Throws:
java.lang.Exception - If the addition failed

getObjectClassIndex

Index<java.lang.String,E> getObjectClassIndex()
Returns:
The ObjectClass system index

setObjectClassIndex

void setObjectClassIndex(Index<java.lang.String,E> index)
                         throws java.lang.Exception
Set the ObjectClass index

Parameters:
index - The ObjectClass index
Throws:
java.lang.Exception - If the addition failed

getEntryUuidIndex

Index<byte[],E> getEntryUuidIndex()
Returns:
The EntryUUID system index

setEntryUuidIndex

void setEntryUuidIndex(Index<byte[],E> index)
                       throws java.lang.Exception
Set the EntryUUID index

Parameters:
index - The EntryUUID index
Throws:
java.lang.Exception - If the addition failed

getEntryCsnIndex

Index<java.lang.String,E> getEntryCsnIndex()
Returns:
The EntryCSN system index

setEntryCsnIndex

void setEntryCsnIndex(Index<java.lang.String,E> index)
                      throws java.lang.Exception
Set the EntryCSN index

Parameters:
index - The EntryCSN index
Throws:
java.lang.Exception - If the addition failed

userIndices

java.util.Iterator<java.lang.String> userIndices()
An iterator build on top of the User's index


systemIndices

java.util.Iterator<java.lang.String> systemIndices()
An iterator build on top of the System's index


hasUserIndexOn

boolean hasUserIndexOn(java.lang.String id)
                       throws java.lang.Exception
Tells if an index is already present in the User's index list

Parameters:
id - The index we are looking for
Returns:
true if the index is already present in the User's index list
Throws:
java.lang.Exception - If something went wrong

hasSystemIndexOn

boolean hasSystemIndexOn(java.lang.String id)
                         throws java.lang.Exception
Tells if an index is already present in the System's index list

Parameters:
id - The index we are looking for
Returns:
true if the index is already present in the System's index list
Throws:
java.lang.Exception - If something went wrong

getUserIndex

Index<?,E> getUserIndex(java.lang.String id)
                        throws IndexNotFoundException
Get the user index associated with the given name

Parameters:
id - The index name we are looking for
Returns:
The associated user index
Throws:
IndexNotFoundException - If the index does not exist

getSystemIndex

Index<?,E> getSystemIndex(java.lang.String id)
                          throws IndexNotFoundException
Get the user index associated with the given name

Parameters:
id - The index name we are looking for
Returns:
The associated user index
Throws:
IndexNotFoundException - If the index does not exist

getEntryId

java.lang.Long getEntryId(java.lang.String dn)
                          throws java.lang.Exception
Throws:
java.lang.Exception

getEntryDn

java.lang.String getEntryDn(java.lang.Long id)
                            throws java.lang.Exception
Throws:
java.lang.Exception

getParentId

java.lang.Long getParentId(java.lang.String dn)
                           throws java.lang.Exception
Gets the Long id of an entry's parent using the child entry's normalized dn. Note that the suffix entry returns 0, which does not map to any entry.

Parameters:
dn - the normalized distinguished name of the child
Returns:
the id of the parent entry or zero if the suffix entry the normalized suffix dn string is used
Throws:
java.lang.Exception - on failures to access the underlying store

getParentId

java.lang.Long getParentId(java.lang.Long childId)
                           throws java.lang.Exception
Throws:
java.lang.Exception

getEntryUpdn

java.lang.String getEntryUpdn(java.lang.Long id)
                              throws java.lang.Exception
Throws:
java.lang.Exception

getEntryUpdn

java.lang.String getEntryUpdn(java.lang.String dn)
                              throws java.lang.Exception
Throws:
java.lang.Exception

count

int count()
          throws java.lang.Exception
Throws:
java.lang.Exception

add

void add(ServerEntry entry)
         throws java.lang.Exception
Add an entry into the store.

Parameters:
entry - The entry to add
Throws:
java.lang.Exception - If the addition failed.

lookup

ServerEntry lookup(java.lang.Long id)
                   throws java.lang.Exception
Throws:
java.lang.Exception

delete

void delete(java.lang.Long id)
            throws java.lang.Exception
Delete the entry associated with a given Id

Parameters:
id - The id of the entry to delete
Throws:
java.lang.Exception - If the deletion failed

list

IndexCursor<java.lang.Long,E> list(java.lang.Long id)
                                   throws java.lang.Exception
Gets an IndexEntry Cursor over the child nodes of an entry.

Parameters:
id - the id of the parent entry
Returns:
an IndexEntry Cursor over the child entries
Throws:
java.lang.Exception - on failures to access the underlying store

getChildCount

int getChildCount(java.lang.Long id)
                  throws java.lang.Exception
Throws:
java.lang.Exception

getSuffix

org.apache.directory.shared.ldap.name.LdapDN getSuffix()

getUpSuffix

org.apache.directory.shared.ldap.name.LdapDN getUpSuffix()

setProperty

void setProperty(java.lang.String propertyName,
                 java.lang.String propertyValue)
                 throws java.lang.Exception
Throws:
java.lang.Exception

getProperty

java.lang.String getProperty(java.lang.String propertyName)
                             throws java.lang.Exception
Throws:
java.lang.Exception

modify

void modify(org.apache.directory.shared.ldap.name.LdapDN dn,
            org.apache.directory.shared.ldap.entry.ModificationOperation modOp,
            ServerEntry mods)
            throws java.lang.Exception
Throws:
java.lang.Exception

modify

void modify(org.apache.directory.shared.ldap.name.LdapDN dn,
            java.util.List<org.apache.directory.shared.ldap.entry.Modification> mods)
            throws java.lang.Exception
Throws:
java.lang.Exception

rename

void rename(org.apache.directory.shared.ldap.name.LdapDN dn,
            org.apache.directory.shared.ldap.name.Rdn newRdn,
            boolean deleteOldRdn)
            throws java.lang.Exception
Changes the relative distinguished name of an entry specified by a distinguished name with the optional removal of the old Rdn attribute value from the entry. Name changes propagate down as dn changes to the descendants of the entry where the Rdn changed. An Rdn change operation does not change parent child relationships. It merely propagates a name change at a point in the DIT where the Rdn is changed. The change propagates down the subtree rooted at the distinguished name specified.

Parameters:
dn - the normalized distinguished name of the entry to alter
newRdn - the new Rdn to set
deleteOldRdn - whether or not to remove the old Rdn attr/val
Throws:
java.lang.Exception - if there are any errors propagating the name changes

move

void move(org.apache.directory.shared.ldap.name.LdapDN oldChildDn,
          org.apache.directory.shared.ldap.name.LdapDN newParentDn,
          org.apache.directory.shared.ldap.name.Rdn newRdn,
          boolean deleteOldRdn)
          throws java.lang.Exception
Throws:
java.lang.Exception

move

void move(org.apache.directory.shared.ldap.name.LdapDN oldChildDn,
          org.apache.directory.shared.ldap.name.LdapDN newParentDn)
          throws java.lang.Exception
Throws:
java.lang.Exception

initRegistries

void initRegistries(Registries registries)


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