public interface Store
Modifier and Type | Field and Description |
---|---|
static String[] |
SYS_INDEX_OID_ARRAY |
static Set<String> |
SYS_INDEX_OIDS |
Modifier and Type | Method and Description |
---|---|
void |
addIndex(Index<?,String> index)
Adds a (system or user) index to the list of index for this store.
|
long |
count()
Gets the total count of entries within this store.
|
org.apache.directory.api.ldap.model.entry.Entry |
delete(String id)
Delete an entry from the store
|
org.apache.directory.api.ldap.model.entry.Entry |
fetch(String id)
Get back an entry knowing its UUID
|
org.apache.directory.api.ldap.model.entry.Entry |
fetch(String id,
org.apache.directory.api.ldap.model.name.Dn dn)
Get back an entry knowing its UUID
|
net.sf.ehcache.Cache |
getAliasCache() |
Index<org.apache.directory.api.ldap.model.name.Dn,String> |
getAliasIndex() |
int |
getCacheSize()
Gets the cache size for this store.
|
long |
getChildCount(String id)
Gets the count of immediate children of the given entry UUID.
|
Index<String,String> |
getEntryCsnIndex() |
org.apache.directory.api.ldap.model.name.Dn |
getEntryDn(String id)
Gets the Entry's Dn identified by the given id.
|
String |
getEntryId(org.apache.directory.api.ldap.model.name.Dn dn)
Gets the entry's id.
|
Index<?,String> |
getIndex(org.apache.directory.api.ldap.model.schema.AttributeType attributeType)
Get the user or system index associated with the given attributeType
|
MasterTable |
getMasterTable()
Expose the Master table
|
Index<String,String> |
getObjectClassIndex() |
Index<String,String> |
getOneAliasIndex() |
String |
getParentId(String childId)
Gets the UUID of an entry's parent using the child entry's UUID.
|
URI |
getPartitionPath()
Gets the partition path (working directory) for the store.
|
Index<String,String> |
getPresenceIndex() |
Index<ParentIdAndRdn,String> |
getRdnIndex() |
ReadWriteLock |
getReadWriteLock() |
Index<String,String> |
getSubAliasIndex() |
Index<?,String> |
getSystemIndex(org.apache.directory.api.ldap.model.schema.AttributeType attributeType)
Get the system index associated with the given name
|
Iterator<String> |
getSystemIndices()
An iterator build on top of the System's index
|
Index<?,String> |
getUserIndex(org.apache.directory.api.ldap.model.schema.AttributeType attributeType)
Get the user index associated with the given name
|
Iterator<String> |
getUserIndices()
An iterator build on top of the User's index
|
boolean |
hasIndexOn(org.apache.directory.api.ldap.model.schema.AttributeType attributeType)
Tells if an index is already present in the User's or System's index list
|
boolean |
hasSystemIndexOn(org.apache.directory.api.ldap.model.schema.AttributeType attributeType)
Tells if an index is already present in the System's index list
|
boolean |
hasUserIndexOn(org.apache.directory.api.ldap.model.schema.AttributeType attributeType)
Tells if an index is already present in the User's index list
|
boolean |
isSyncOnWrite() |
org.apache.directory.api.ldap.model.entry.Entry |
modify(org.apache.directory.api.ldap.model.name.Dn dn,
org.apache.directory.api.ldap.model.entry.Modification... mods)
Modify an entry applying the given list of modifications.
|
void |
move(org.apache.directory.api.ldap.model.name.Dn oldDn,
org.apache.directory.api.ldap.model.name.Dn newSuperior,
org.apache.directory.api.ldap.model.name.Dn newDn,
org.apache.directory.api.ldap.model.entry.Entry entry)
Move an entry from one place to the other.
|
void |
moveAndRename(org.apache.directory.api.ldap.model.name.Dn oldChildDn,
org.apache.directory.api.ldap.model.name.Dn newParentDn,
org.apache.directory.api.ldap.model.name.Rdn newRdn,
org.apache.directory.api.ldap.model.entry.Entry entry,
boolean deleteOldRdn) |
void |
rename(org.apache.directory.api.ldap.model.name.Dn dn,
org.apache.directory.api.ldap.model.name.Rdn newRdn,
boolean deleteOldRdn,
org.apache.directory.api.ldap.model.entry.Entry entry)
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 |
setCacheSize(int cacheSize)
Sets the cache size for this store.
|
void |
setPartitionPath(URI partitionPath)
Sets the partition path (working directory) for the store.
|
void |
setSyncOnWrite(boolean isSyncOnWrite)
Sets the flag telling the server to flush on disk when some
modification has been done.
|
static final String[] SYS_INDEX_OID_ARRAY
void setPartitionPath(URI partitionPath)
partitionDir
- the new partition pathURI getPartitionPath()
void setSyncOnWrite(boolean isSyncOnWrite)
isSyncOnWrite
- A boolean set to true if we have to flush on disk
when a modification occursboolean isSyncOnWrite()
true
if we write to disk for every modificationvoid setCacheSize(int cacheSize)
cacheSize
- The cache sizeint getCacheSize()
void addIndex(Index<?,String> index) throws Exception
index
- The index to addException
- If the addition failedIndex<org.apache.directory.api.ldap.model.name.Dn,String> getAliasIndex()
Index<ParentIdAndRdn,String> getRdnIndex()
Index<String,String> getObjectClassIndex()
boolean hasIndexOn(org.apache.directory.api.ldap.model.schema.AttributeType attributeType) throws Exception
id
- The index we are looking fortrue
if the index is already present in the
User's or System's index listException
- If something went wrongboolean hasUserIndexOn(org.apache.directory.api.ldap.model.schema.AttributeType attributeType) throws Exception
attributeType
- The attributeType index we are looking fortrue
if the index is already present in the
User's index listException
- If something went wrongboolean hasSystemIndexOn(org.apache.directory.api.ldap.model.schema.AttributeType attributeType) throws org.apache.directory.api.ldap.model.exception.LdapException
attributeType
- The index we are looking fortrue
if the index is already present in the
System's index listException
- If something went wrongorg.apache.directory.api.ldap.model.exception.LdapException
Index<?,String> getIndex(org.apache.directory.api.ldap.model.schema.AttributeType attributeType) throws IndexNotFoundException
attributeType
- The index attributeType we are looking forIndexNotFoundException
- If the index does not existIndex<?,String> getUserIndex(org.apache.directory.api.ldap.model.schema.AttributeType attributeType) throws IndexNotFoundException
attributeType
- The index name we are looking forIndexNotFoundException
- If the index does not existIndex<?,String> getSystemIndex(org.apache.directory.api.ldap.model.schema.AttributeType attributeType) throws IndexNotFoundException
attributeType
- The index name we are looking forIndexNotFoundException
- If the index does not existString getEntryId(org.apache.directory.api.ldap.model.name.Dn dn) throws Exception
null
if the Dn doesn't exist in this store.
Note that the Dn must be normalized!dn
- the normalized entry Dnnull
if the Dn doesn't existsException
org.apache.directory.api.ldap.model.name.Dn getEntryDn(String id) throws Exception
id
- the entry's idException
String getParentId(String childId) throws Exception
childId
- the UUID of the entryException
- on failures to access the underlying storelong count() throws Exception
Exception
- on failures to access the underlying storeorg.apache.directory.api.ldap.model.entry.Entry delete(String id) throws org.apache.directory.api.ldap.model.exception.LdapException
id
- The Entry UUID we want to deleteException
- If the deletion failed for any reasonorg.apache.directory.api.ldap.model.exception.LdapException
org.apache.directory.api.ldap.model.entry.Entry fetch(String id) throws org.apache.directory.api.ldap.model.exception.LdapException
id
- The Entry UUID we want to get backException
- If the lookup failed for any reason (except a not found entry)org.apache.directory.api.ldap.model.exception.LdapException
org.apache.directory.api.ldap.model.entry.Entry fetch(String id, org.apache.directory.api.ldap.model.name.Dn dn) throws org.apache.directory.api.ldap.model.exception.LdapException
id
- The Entry UUID we want to get backdn
- The entry DN when we have itException
- If the lookup failed for any reason (except a not found entry)org.apache.directory.api.ldap.model.exception.LdapException
long getChildCount(String id) throws Exception
id
- the entry UUIDException
- on failures to access the underlying storeorg.apache.directory.api.ldap.model.entry.Entry modify(org.apache.directory.api.ldap.model.name.Dn dn, org.apache.directory.api.ldap.model.entry.Modification... mods) throws Exception
dn
- The Entry's Dnmods
- The list of modificationsException
- If the modification failedvoid rename(org.apache.directory.api.ldap.model.name.Dn dn, org.apache.directory.api.ldap.model.name.Rdn newRdn, boolean deleteOldRdn, org.apache.directory.api.ldap.model.entry.Entry entry) throws Exception
dn
- the normalized distinguished name of the entry to alternewRdn
- the new Rdn to setdeleteOldRdn
- whether or not to remove the old Rdn attr/valentry
- the modified entryException
- if there are any errors propagating the name changesvoid moveAndRename(org.apache.directory.api.ldap.model.name.Dn oldChildDn, org.apache.directory.api.ldap.model.name.Dn newParentDn, org.apache.directory.api.ldap.model.name.Rdn newRdn, org.apache.directory.api.ldap.model.entry.Entry entry, boolean deleteOldRdn) throws Exception
Exception
void move(org.apache.directory.api.ldap.model.name.Dn oldDn, org.apache.directory.api.ldap.model.name.Dn newSuperior, org.apache.directory.api.ldap.model.name.Dn newDn, org.apache.directory.api.ldap.model.entry.Entry entry) throws Exception
Move an entry from one place to the other. The Rdn remains unchanged, the parent Dn changes
We have to update some of the index when moving an entry. Assuming that the target destination does not exist, the following index must be updated :
If the moved entry is an alias, then we also have to update the following index :
The Alias index is not updated, as the entry UUID won't change.
We have a few check we must do before moving the entry :
oldDn
- The previous entry DnnewSuperior
- The new superior DnnewDn
- The new Dnentry
- The entry to moveException
- If the move failedMasterTable getMasterTable()
ReadWriteLock getReadWriteLock()
net.sf.ehcache.Cache getAliasCache()
Copyright © 2017. All rights reserved.