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(PartitionTxn partitionTxn)
Gets the total count of entries within this store.
|
org.apache.directory.api.ldap.model.entry.Entry |
delete(PartitionTxn partitionTxn,
String id)
Delete an entry from the store
|
org.apache.directory.api.ldap.model.entry.Entry |
fetch(PartitionTxn partitionTxn,
String id)
Get back an entry knowing its UUID
|
org.apache.directory.api.ldap.model.entry.Entry |
fetch(PartitionTxn partitionTxn,
String id,
org.apache.directory.api.ldap.model.name.Dn dn)
Get back an entry knowing its UUID
|
com.github.benmanes.caffeine.cache.Cache<String,org.apache.directory.api.ldap.model.name.Dn> |
getAliasCache() |
Index<org.apache.directory.api.ldap.model.name.Dn,String> |
getAliasIndex() |
int |
getCacheSize()
Gets the cache size for this store.
|
long |
getChildCount(PartitionTxn partitionTxn,
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(PartitionTxn partitionTxn,
String id)
Gets the Entry's Dn identified by the given id.
|
String |
getEntryId(PartitionTxn partitionTxn,
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(PartitionTxn partitionTxn,
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() |
String |
getSuffixId(PartitionTxn partitionTxn)
Retrieve the SuffixID
|
Index<?,String> |
getSystemIndex(org.apache.directory.api.ldap.model.schema.AttributeType attributeType)
Get the system index associated with the given name
|
Iterator<String> |
getSystemIndices() |
Index<?,String> |
getUserIndex(org.apache.directory.api.ldap.model.schema.AttributeType attributeType)
Get the user index associated with the given name
|
Iterator<String> |
getUserIndices() |
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(PartitionTxn partitionTxn,
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(PartitionTxn partitionTxn,
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(PartitionTxn partitionTxn,
org.apache.directory.api.ldap.model.name.Dn oldDn,
org.apache.directory.api.ldap.model.name.Dn newSuperiorDn,
org.apache.directory.api.ldap.model.name.Rdn newRdn,
Map<String,List<ModDnAva>> modAvas,
org.apache.directory.api.ldap.model.entry.Entry modifiedEntry)
Move and Rename operation.
|
void |
rename(PartitionTxn partitionTxn,
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
static final Set<String> SYS_INDEX_OIDS
void setPartitionPath(URI partitionPath)
partitionPath
- 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<String,String> getPresenceIndex()
Index<org.apache.directory.api.ldap.model.name.Dn,String> getAliasIndex()
Index<String,String> getOneAliasIndex()
Index<String,String> getSubAliasIndex()
String getSuffixId(PartitionTxn partitionTxn) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn
- The transaction to useorg.apache.directory.api.ldap.model.exception.LdapException
- If we can't get the suffix IDIndex<ParentIdAndRdn,String> getRdnIndex()
Index<String,String> getObjectClassIndex()
Index<String,String> getEntryCsnIndex()
Iterator<String> getUserIndices()
Iterator<String> getSystemIndices()
boolean hasIndexOn(org.apache.directory.api.ldap.model.schema.AttributeType attributeType) throws org.apache.directory.api.ldap.model.exception.LdapException
attributeType
- The attributeType we are looking fortrue
if the index is already present in the
User's or System's index listorg.apache.directory.api.ldap.model.exception.LdapException
- If something went wrongboolean hasUserIndexOn(org.apache.directory.api.ldap.model.schema.AttributeType attributeType) throws org.apache.directory.api.ldap.model.exception.LdapException
attributeType
- The attributeType index we are looking fortrue
if the index is already present in the
User's index listorg.apache.directory.api.ldap.model.exception.LdapException
- 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 listorg.apache.directory.api.ldap.model.exception.LdapException
- If something went wrongIndex<?,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(PartitionTxn partitionTxn, org.apache.directory.api.ldap.model.name.Dn dn) throws org.apache.directory.api.ldap.model.exception.LdapException
null
if the Dn doesn't exist in this store.
Note that the Dn must be normalized!partitionTxn
- The transaction to usedn
- the normalized entry Dnnull
if the Dn doesn't existsorg.apache.directory.api.ldap.model.exception.LdapException
- If we can't get the entry IDorg.apache.directory.api.ldap.model.name.Dn getEntryDn(PartitionTxn partitionTxn, String id) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn
- The transaction to useid
- the entry's idorg.apache.directory.api.ldap.model.exception.LdapException
- If we can't get the entry DnString getParentId(PartitionTxn partitionTxn, String childId) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn
- The transaction to usechildId
- the UUID of the entryorg.apache.directory.api.ldap.model.exception.LdapException
- on failures to access the underlying storelong count(PartitionTxn partitionTxn) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn
- The transaction to useorg.apache.directory.api.ldap.model.exception.LdapException
- on failures to access the underlying storeorg.apache.directory.api.ldap.model.entry.Entry delete(PartitionTxn partitionTxn, String id) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn
- The transaction to useid
- The Entry UUID we want to deleteorg.apache.directory.api.ldap.model.exception.LdapException
- If the deletion failed for any reasonorg.apache.directory.api.ldap.model.entry.Entry fetch(PartitionTxn partitionTxn, String id) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn
- The transaction to useid
- The Entry UUID we want to get backorg.apache.directory.api.ldap.model.exception.LdapException
- If the lookup failed for any reason (except a not found entry)org.apache.directory.api.ldap.model.entry.Entry fetch(PartitionTxn partitionTxn, String id, org.apache.directory.api.ldap.model.name.Dn dn) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn
- The transaction to useid
- The Entry UUID we want to get backdn
- The entry DN when we have itorg.apache.directory.api.ldap.model.exception.LdapException
- If the lookup failed for any reason (except a not found entry)long getChildCount(PartitionTxn partitionTxn, String id) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn
- The transaction to useid
- the entry UUIDorg.apache.directory.api.ldap.model.exception.LdapException
- on failures to access the underlying storeorg.apache.directory.api.ldap.model.entry.Entry modify(PartitionTxn partitionTxn, org.apache.directory.api.ldap.model.name.Dn dn, org.apache.directory.api.ldap.model.entry.Modification... mods) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn
- The transaction to usedn
- The Entry's Dnmods
- The list of modificationsorg.apache.directory.api.ldap.model.exception.LdapException
- If the modification failedvoid rename(PartitionTxn partitionTxn, 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 org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn
- The transaction to usedn
- 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 entryorg.apache.directory.api.ldap.model.exception.LdapException
- if there are any errors propagating the name changesvoid moveAndRename(PartitionTxn partitionTxn, org.apache.directory.api.ldap.model.name.Dn oldDn, org.apache.directory.api.ldap.model.name.Dn newSuperiorDn, org.apache.directory.api.ldap.model.name.Rdn newRdn, Map<String,List<ModDnAva>> modAvas, org.apache.directory.api.ldap.model.entry.Entry modifiedEntry) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn
- The transaction to useoldDn
- The previous DNnewSuperiorDn
- The previous parent's DNnewRdn
- The new DNmodAvas
- The changed Attributes caused by the renaming (added and removed attributes)modifiedEntry
- the entry to moveorg.apache.directory.api.ldap.model.exception.LdapException
- If the modification failedvoid move(PartitionTxn partitionTxn, 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 org.apache.directory.api.ldap.model.exception.LdapException
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 :
partitionTxn
- The transaction to useoldDn
- The previous entry DnnewSuperior
- The new superior DnnewDn
- The new Dnentry
- The entry to moveorg.apache.directory.api.ldap.model.exception.LdapException
- If the move failedMasterTable getMasterTable()
ReadWriteLock getReadWriteLock()
com.github.benmanes.caffeine.cache.Cache<String,org.apache.directory.api.ldap.model.name.Dn> getAliasCache()
Copyright © 2003–2020 The Apache Software Foundation. All rights reserved.