|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.server.core.partition.avl.AvlStore<E>
public class AvlStore<E>
A Store implementation backed by in memory AVL trees. TODO - this class is extremely like the JdbmStore implementation of the Store interface which tells us that it's best for us to have some kind of abstract class.
Constructor Summary | |
---|---|
AvlStore()
|
Method Summary | |
---|---|
void |
add(org.apache.directory.shared.ldap.entry.ServerEntry entry)
Add an entry into the store. |
void |
addIndex(Index<? extends java.lang.Object,E,java.lang.Long> 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,java.lang.Long> |
getAliasIndex()
|
int |
getCacheSize()
always returns 0 (zero), cause this is a inmemory store |
int |
getChildCount(java.lang.Long id)
|
java.lang.Long |
getDefaultId()
Gets the default ID. |
Index<java.lang.String,E,java.lang.Long> |
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<java.lang.String,E,java.lang.Long> |
getEntryUuidIndex()
|
Index<?,E,java.lang.Long> |
getIndex(java.lang.String id)
Get the user or system index associated with the given name |
java.lang.String |
getName()
|
Index<java.lang.String,E,java.lang.Long> |
getNdnIndex()
|
Index<java.lang.String,E,java.lang.Long> |
getObjectClassIndex()
|
Index<java.lang.Long,E,java.lang.Long> |
getOneAliasIndex()
|
Index<java.lang.Long,E,java.lang.Long> |
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,java.lang.Long> |
getPresenceIndex()
|
java.lang.String |
getProperty(java.lang.String propertyName)
|
Index<java.lang.Long,E,java.lang.Long> |
getSubAliasIndex()
|
Index<java.lang.Long,E,java.lang.Long> |
getSubLevelIndex()
|
org.apache.directory.shared.ldap.name.DN |
getSuffix()
|
java.lang.String |
getSuffixDn()
|
Index<?,E,java.lang.Long> |
getSystemIndex(java.lang.String id)
Get the system index associated with the given name |
Index<java.lang.String,E,java.lang.Long> |
getUpdnIndex()
|
org.apache.directory.shared.ldap.name.DN |
getUpSuffix()
|
Index<? extends java.lang.Object,E,java.lang.Long> |
getUserIndex(java.lang.String id)
Get the user index associated with the given name |
java.util.Set<Index<? extends java.lang.Object,E,java.lang.Long>> |
getUserIndices()
|
java.io.File |
getWorkingDirectory()
|
boolean |
hasIndexOn(java.lang.String id)
Tells if an index is already present in the User's or System's index list |
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(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
Initialize the JDBM storage system. |
boolean |
isInitialized()
Gets whether the store is initialized. |
boolean |
isSyncOnWrite()
|
IndexCursor<java.lang.Long,E,java.lang.Long> |
list(java.lang.Long id)
Gets an IndexEntry Cursor over the child nodes of an entry. |
org.apache.directory.shared.ldap.entry.ServerEntry |
lookup(java.lang.Long id)
|
void |
modify(org.apache.directory.shared.ldap.name.DN dn,
java.util.List<org.apache.directory.shared.ldap.entry.Modification> mods)
|
void |
modify(org.apache.directory.shared.ldap.name.DN dn,
org.apache.directory.shared.ldap.entry.ModificationOperation modOp,
org.apache.directory.shared.ldap.entry.ServerEntry mods)
|
void |
modify(long entryId,
java.util.List<org.apache.directory.shared.ldap.entry.Modification> mods)
|
void |
move(org.apache.directory.shared.ldap.name.DN oldChildDn,
org.apache.directory.shared.ldap.name.DN newParentDn)
|
void |
move(org.apache.directory.shared.ldap.name.DN oldChildDn,
org.apache.directory.shared.ldap.name.DN newParentDn,
org.apache.directory.shared.ldap.name.RDN newRdn,
boolean deleteOldRdn)
|
void |
rename(org.apache.directory.shared.ldap.name.DN 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,java.lang.Long> index)
Set the Alias index |
void |
setCacheSize(int size)
Sets the cache size for this store |
void |
setEntryCsnIndex(Index<java.lang.String,E,java.lang.Long> index)
Set the EntryCSN index |
void |
setEntryUuidIndex(Index<java.lang.String,E,java.lang.Long> index)
Set the EntryUUID index |
void |
setName(java.lang.String name)
Sets the store's name |
void |
setNdnIndex(Index<java.lang.String,E,java.lang.Long> index)
Set the NDN index |
void |
setObjectClassIndex(Index<java.lang.String,E,java.lang.Long> index)
Set the ObjectClass index |
void |
setOneAliasIndex(Index<java.lang.Long,E,java.lang.Long> index)
Set the OneAlias index |
void |
setOneLevelIndex(Index<java.lang.Long,E,java.lang.Long> index)
Set the OneLevel index |
void |
setPresenceIndex(Index<java.lang.String,E,java.lang.Long> index)
Set the Presence index |
void |
setProperty(java.lang.String propertyName,
java.lang.String propertyValue)
|
void |
setSubAliasIndex(Index<java.lang.Long,E,java.lang.Long> index)
Set the SubAlias index |
void |
setSubLevelIndex(Index<java.lang.Long,E,java.lang.Long> index)
Set the SubLevel index |
void |
setSuffixDn(java.lang.String suffixDn)
|
void |
setSyncOnWrite(boolean sync)
Sets the flag telling the server to flush on disk when some modification has been done. |
void |
setUpdnIndex(Index<java.lang.String,E,java.lang.Long> index)
Set the UpDn index |
void |
setUserIndices(java.util.Set<Index<? extends java.lang.Object,E,java.lang.Long>> userIndices)
Stores the list of user index |
void |
setWorkingDirectory(java.io.File wkDir)
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AvlStore()
Method Detail |
---|
public void add(org.apache.directory.shared.ldap.entry.ServerEntry entry) throws java.lang.Exception
add
in interface Store<E,java.lang.Long>
entry
- The entry to add
java.lang.Exception
- If the addition failed.public void addIndex(Index<? extends java.lang.Object,E,java.lang.Long> index) throws java.lang.Exception
addIndex
in interface Store<E,java.lang.Long>
index
- The index to add
java.lang.Exception
- If the addition failedpublic int count() throws java.lang.Exception
count
in interface Store<E,java.lang.Long>
java.lang.Exception
public void delete(java.lang.Long id) throws java.lang.Exception
delete
in interface Store<E,java.lang.Long>
id
- The id of the entry to delete
java.lang.Exception
- If the deletion failedpublic void destroy() throws java.lang.Exception
destroy
in interface Store<E,java.lang.Long>
java.lang.Exception
- lazily thrown on any closer failures to avoid leaving
open filespublic Index<java.lang.String,E,java.lang.Long> getAliasIndex()
getAliasIndex
in interface Store<E,java.lang.Long>
public int getChildCount(java.lang.Long id) throws java.lang.Exception
getChildCount
in interface Store<E,java.lang.Long>
java.lang.Exception
public java.lang.String getEntryDn(java.lang.Long id) throws java.lang.Exception
getEntryDn
in interface Store<E,java.lang.Long>
java.lang.Exception
public java.lang.Long getEntryId(java.lang.String dn) throws java.lang.Exception
getEntryId
in interface Store<E,java.lang.Long>
java.lang.Exception
public java.lang.String getEntryUpdn(java.lang.Long id) throws java.lang.Exception
getEntryUpdn
in interface Store<E,java.lang.Long>
java.lang.Exception
public java.lang.String getEntryUpdn(java.lang.String dn) throws java.lang.Exception
getEntryUpdn
in interface Store<E,java.lang.Long>
java.lang.Exception
public java.lang.String getName()
getName
in interface Store<E,java.lang.Long>
public Index<java.lang.String,E,java.lang.Long> getNdnIndex()
getNdnIndex
in interface Store<E,java.lang.Long>
public Index<java.lang.Long,E,java.lang.Long> getOneAliasIndex()
getOneAliasIndex
in interface Store<E,java.lang.Long>
public Index<java.lang.Long,E,java.lang.Long> getOneLevelIndex()
getOneLevelIndex
in interface Store<E,java.lang.Long>
public java.lang.Long getParentId(java.lang.String dn) throws java.lang.Exception
getParentId
in interface Store<E,java.lang.Long>
dn
- the normalized distinguished name of the child
java.lang.Exception
- on failures to access the underlying storepublic java.lang.Long getParentId(java.lang.Long childId) throws java.lang.Exception
getParentId
in interface Store<E,java.lang.Long>
java.lang.Exception
public Index<java.lang.String,E,java.lang.Long> getPresenceIndex()
getPresenceIndex
in interface Store<E,java.lang.Long>
public java.lang.String getProperty(java.lang.String propertyName) throws java.lang.Exception
getProperty
in interface Store<E,java.lang.Long>
java.lang.Exception
public Index<java.lang.Long,E,java.lang.Long> getSubAliasIndex()
getSubAliasIndex
in interface Store<E,java.lang.Long>
public Index<java.lang.Long,E,java.lang.Long> getSubLevelIndex()
getSubLevelIndex
in interface Store<E,java.lang.Long>
public org.apache.directory.shared.ldap.name.DN getSuffix()
getSuffix
in interface Store<E,java.lang.Long>
public org.apache.directory.shared.ldap.name.DN getUpSuffix()
getUpSuffix
in interface Store<E,java.lang.Long>
public java.lang.String getSuffixDn()
getSuffixDn
in interface Store<E,java.lang.Long>
public Index<?,E,java.lang.Long> getSystemIndex(java.lang.String id) throws IndexNotFoundException
getSystemIndex
in interface Store<E,java.lang.Long>
id
- The index name we are looking for
IndexNotFoundException
- If the index does not existpublic Index<?,E,java.lang.Long> getIndex(java.lang.String id) throws IndexNotFoundException
getIndex
in interface Store<E,java.lang.Long>
id
- The index name we are looking for
IndexNotFoundException
- If the index does not existpublic Index<java.lang.String,E,java.lang.Long> getUpdnIndex()
getUpdnIndex
in interface Store<E,java.lang.Long>
public Index<? extends java.lang.Object,E,java.lang.Long> getUserIndex(java.lang.String id) throws IndexNotFoundException
getUserIndex
in interface Store<E,java.lang.Long>
id
- The index name we are looking for
IndexNotFoundException
- If the index does not existpublic java.util.Set<Index<? extends java.lang.Object,E,java.lang.Long>> getUserIndices()
getUserIndices
in interface Store<E,java.lang.Long>
public boolean hasIndexOn(java.lang.String id) throws java.lang.Exception
hasIndexOn
in interface Store<E,java.lang.Long>
id
- The index we are looking for
true
if the index is already present in the
User's or System's index list
java.lang.Exception
- If something went wrongpublic boolean hasSystemIndexOn(java.lang.String id) throws java.lang.Exception
hasSystemIndexOn
in interface Store<E,java.lang.Long>
id
- The index we are looking for
true
if the index is already present in the
System's index list
java.lang.Exception
- If something went wrongpublic boolean hasUserIndexOn(java.lang.String id) throws java.lang.Exception
hasUserIndexOn
in interface Store<E,java.lang.Long>
id
- The index we are looking for
true
if the index is already present in the
User's index list
java.lang.Exception
- If something went wrongpublic void init(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager) throws java.lang.Exception
init
in interface Store<E,java.lang.Long>
schemaManager
- the schema schemaManager
java.lang.Exception
- on failure to lookup elements in schemaManagerpublic boolean isInitialized()
isInitialized
in interface Store<E,java.lang.Long>
public IndexCursor<java.lang.Long,E,java.lang.Long> list(java.lang.Long id) throws java.lang.Exception
list
in interface Store<E,java.lang.Long>
id
- the id of the parent entry
java.lang.Exception
- on failures to access the underlying storepublic org.apache.directory.shared.ldap.entry.ServerEntry lookup(java.lang.Long id) throws java.lang.Exception
lookup
in interface Store<E,java.lang.Long>
java.lang.Exception
public void modify(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.entry.ModificationOperation modOp, org.apache.directory.shared.ldap.entry.ServerEntry mods) throws java.lang.Exception
modify
in interface Store<E,java.lang.Long>
java.lang.Exception
public void modify(org.apache.directory.shared.ldap.name.DN dn, java.util.List<org.apache.directory.shared.ldap.entry.Modification> mods) throws java.lang.Exception
modify
in interface Store<E,java.lang.Long>
java.lang.Exception
public void modify(long entryId, java.util.List<org.apache.directory.shared.ldap.entry.Modification> mods) throws java.lang.Exception
java.lang.Exception
public void move(org.apache.directory.shared.ldap.name.DN oldChildDn, org.apache.directory.shared.ldap.name.DN newParentDn, org.apache.directory.shared.ldap.name.RDN newRdn, boolean deleteOldRdn) throws java.lang.Exception
move
in interface Store<E,java.lang.Long>
java.lang.Exception
public void move(org.apache.directory.shared.ldap.name.DN oldChildDn, org.apache.directory.shared.ldap.name.DN newParentDn) throws java.lang.Exception
move
in interface Store<E,java.lang.Long>
java.lang.Exception
public void rename(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.name.RDN newRdn, boolean deleteOldRdn) throws java.lang.Exception
rename
in interface Store<E,java.lang.Long>
dn
- the normalized distinguished name of the entry to alternewRdn
- the new RDN to setdeleteOldRdn
- whether or not to remove the old RDN attr/val
java.lang.Exception
- if there are any errors propagating the name changespublic void setAliasIndex(Index<java.lang.String,E,java.lang.Long> index) throws java.lang.Exception
setAliasIndex
in interface Store<E,java.lang.Long>
index
- The Alias index
java.lang.Exception
- If the addition failedpublic void setName(java.lang.String name)
setName
in interface Store<E,java.lang.Long>
name
- The store's namepublic void setNdnIndex(Index<java.lang.String,E,java.lang.Long> index) throws java.lang.Exception
setNdnIndex
in interface Store<E,java.lang.Long>
index
- The NDN index
java.lang.Exception
- If the addition failedpublic void setOneAliasIndex(Index<java.lang.Long,E,java.lang.Long> index) throws java.lang.Exception
setOneAliasIndex
in interface Store<E,java.lang.Long>
index
- The OneAlias index
java.lang.Exception
- If the addition failedpublic void setOneLevelIndex(Index<java.lang.Long,E,java.lang.Long> index) throws java.lang.Exception
setOneLevelIndex
in interface Store<E,java.lang.Long>
index
- The OneLevel index
java.lang.Exception
- If the addition failedpublic void setPresenceIndex(Index<java.lang.String,E,java.lang.Long> index) throws java.lang.Exception
setPresenceIndex
in interface Store<E,java.lang.Long>
index
- The Presence index
java.lang.Exception
- If the addition failedpublic void setProperty(java.lang.String propertyName, java.lang.String propertyValue) throws java.lang.Exception
setProperty
in interface Store<E,java.lang.Long>
java.lang.Exception
public void setSubAliasIndex(Index<java.lang.Long,E,java.lang.Long> index) throws java.lang.Exception
setSubAliasIndex
in interface Store<E,java.lang.Long>
index
- The SubAlias index
java.lang.Exception
- If the addition failedpublic void setSubLevelIndex(Index<java.lang.Long,E,java.lang.Long> index) throws java.lang.Exception
setSubLevelIndex
in interface Store<E,java.lang.Long>
index
- The SubLevel index
java.lang.Exception
- If the addition failedpublic void setSuffixDn(java.lang.String suffixDn)
setSuffixDn
in interface Store<E,java.lang.Long>
public void setUpdnIndex(Index<java.lang.String,E,java.lang.Long> index) throws java.lang.Exception
setUpdnIndex
in interface Store<E,java.lang.Long>
index
- The UpDn index
java.lang.Exception
- If the addition failedpublic void setUserIndices(java.util.Set<Index<? extends java.lang.Object,E,java.lang.Long>> userIndices)
setUserIndices
in interface Store<E,java.lang.Long>
userIndices
- The list of user indexpublic java.util.Iterator<java.lang.String> systemIndices()
systemIndices
in interface Store<E,java.lang.Long>
public java.util.Iterator<java.lang.String> userIndices()
userIndices
in interface Store<E,java.lang.Long>
public int getCacheSize()
getCacheSize
in interface Store<E,java.lang.Long>
public Index<java.lang.String,E,java.lang.Long> getEntryCsnIndex()
getEntryCsnIndex
in interface Store<E,java.lang.Long>
public Index<java.lang.String,E,java.lang.Long> getEntryUuidIndex()
getEntryUuidIndex
in interface Store<E,java.lang.Long>
public Index<java.lang.String,E,java.lang.Long> getObjectClassIndex()
getObjectClassIndex
in interface Store<E,java.lang.Long>
public void setEntryCsnIndex(Index<java.lang.String,E,java.lang.Long> index) throws java.lang.Exception
Store
setEntryCsnIndex
in interface Store<E,java.lang.Long>
index
- The EntryCSN index
java.lang.Exception
- If the addition failedpublic void setSyncOnWrite(boolean sync)
Store
setSyncOnWrite
in interface Store<E,java.lang.Long>
sync
- A boolean set to true if we have to flush on disk
when a modification occurspublic void setWorkingDirectory(java.io.File wkDir)
Store
setWorkingDirectory
in interface Store<E,java.lang.Long>
public java.io.File getWorkingDirectory()
getWorkingDirectory
in interface Store<E,java.lang.Long>
public boolean isSyncOnWrite()
isSyncOnWrite
in interface Store<E,java.lang.Long>
true
if we write to disk for every modificationpublic void setCacheSize(int size)
Store
setCacheSize
in interface Store<E,java.lang.Long>
size
- The cache sizepublic void setObjectClassIndex(Index<java.lang.String,E,java.lang.Long> index)
Store
setObjectClassIndex
in interface Store<E,java.lang.Long>
index
- The ObjectClass indexpublic void setEntryUuidIndex(Index<java.lang.String,E,java.lang.Long> index)
Store
setEntryUuidIndex
in interface Store<E,java.lang.Long>
index
- The EntryUUID indexpublic void sync() throws java.lang.Exception
Store
sync
in interface Store<E,java.lang.Long>
java.lang.Exception
- on failures to sync database files to diskpublic java.lang.Long getDefaultId()
Store
getDefaultId
in interface Store<E,java.lang.Long>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |