public abstract class AbstractBTreePartition extends AbstractPartition implements Store
Partition
that uses general BTree operations.Modifier and Type | Field and Description |
---|---|
protected static boolean |
ADD_CHILD |
protected org.apache.directory.api.ldap.model.schema.AttributeType |
administrativeRoleAT |
protected Index<String,String> |
adminRoleIdx
a system index on administrativeRole attribute
|
protected com.github.benmanes.caffeine.cache.Cache<String,org.apache.directory.api.ldap.model.name.Dn> |
aliasCache
The alias cache
|
protected org.apache.directory.api.ldap.model.schema.AttributeType |
aliasedObjectNameAT |
protected Index<org.apache.directory.api.ldap.model.name.Dn,String> |
aliasIdx
a system index on aliasedObjectName attribute
|
protected int |
cacheSize
The Entry cache size for this partition
|
protected org.apache.directory.api.ldap.model.schema.AttributeType |
contextCsnAT |
static int |
DEFAULT_CACHE_SIZE
The default cache size is set to 10 000 objects
|
protected org.apache.directory.api.ldap.model.schema.AttributeType |
entryCsnAT |
protected Index<String,String> |
entryCsnIdx
a system index on entryCSN attribute
|
protected org.apache.directory.api.ldap.model.schema.AttributeType |
entryDnAT |
protected org.apache.directory.api.ldap.model.schema.AttributeType |
entryUuidAT |
protected AtomicBoolean |
isSyncOnWrite
true if we sync disks on every write operation
|
protected MasterTable |
master
the master table storing entries by primary key
|
protected org.apache.directory.api.ldap.model.schema.AttributeType |
objectClassAT
Cached attributes types to avoid lookup all over the code
|
protected Index<String,String> |
objectClassIdx
a system index on objectClass attribute
|
protected Index<String,String> |
oneAliasIdx
the one level scope alias index
|
protected boolean |
optimizerEnabled
Tells if the Optimizer is enabled
|
protected URI |
partitionPath
The path in which this Partition stores files
|
protected com.github.benmanes.caffeine.cache.Cache<String,ParentIdAndRdn> |
piarCache
The ParentIdAndRdn cache
|
protected org.apache.directory.api.ldap.model.schema.AttributeType |
presenceAT |
protected Index<String,String> |
presenceIdx
the attribute presence index
|
protected Index<ParentIdAndRdn,String> |
rdnIdx
the relative distinguished name index
|
protected static boolean |
REMOVE_CHILD |
protected Index<String,String> |
subAliasIdx
the subtree scope alias index
|
protected Map<String,Index<?,String>> |
systemIndices
a map of attributeType numeric UUID to system userIndices
|
protected Map<String,Index<?,String>> |
userIndices
a map of attributeType numeric UUID to user userIndices
|
contextEntry, ctxCsnChanged, dnFactory, id, initialized, schemaManager, suffixDn
SYS_INDEX_OID_ARRAY, SYS_INDEX_OIDS
DEFAULT_ID, ROOT_ID
Modifier | Constructor and Description |
---|---|
protected |
AbstractBTreePartition(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager)
Creates a B-tree based context partition.
|
protected |
AbstractBTreePartition(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
DnFactory dnFactory)
Creates a B-tree based context partition.
|
Modifier and Type | Method and Description |
---|---|
void |
add(AddOperationContext addContext)
Adds an entry to this ContextPartition.
|
protected void |
addAliasIndices(PartitionTxn partitionTxn,
String aliasId,
org.apache.directory.api.ldap.model.name.Dn aliasDn,
org.apache.directory.api.ldap.model.name.Dn aliasTarget)
Adds userIndices for an aliasEntry to be added to the database while checking
for constrained alias constructs like alias cycles and chaining.
|
void |
addIndex(Index<?,String> index)
Adds a (system or user) index to the list of index for this store.
|
void |
addIndexedAttributes(Index<?,String>... indexes)
Add some new indexes
|
void |
addToCache(String id,
org.apache.directory.api.ldap.model.entry.Entry entry)
adds the given entry to cache
Note: this method is not called during add operation to avoid filling the cache
with all the added entries
|
protected org.apache.directory.api.ldap.model.name.Dn |
buildEntryDn(PartitionTxn partitionTxn,
String id)
builds the Dn of the entry identified by the given id
|
protected abstract Index<?,String> |
convertAndInit(Index<?,String> index)
Convert and initialize an index for a specific store implementation.
|
long |
count(PartitionTxn partitionTxn)
Gets the total count of entries within this store.
|
protected abstract Index |
createSystemIndex(String indexOid,
URI path,
boolean withReverse)
Create a new Index for a given OID
|
org.apache.directory.api.ldap.model.entry.Entry |
delete(DeleteOperationContext deleteContext)
Deletes a leaf entry from this ContextPartition: non-leaf entries cannot be
deleted until this operation has been applied to their children.
|
org.apache.directory.api.ldap.model.entry.Entry |
delete(PartitionTxn partitionTxn,
String id)
Delete the entry associated with a given Id
|
protected void |
doDestroy(PartitionTxn partitionTxn)
Override this method to put your initialization code.
|
protected void |
doInit()
Override this method to put your initialization code.
|
protected void |
dropAliasIndices(PartitionTxn partitionTxn,
String aliasId)
Removes the index entries for an alias before the entry is deleted from
the master table.
|
protected void |
dropMovedAliasIndices(PartitionTxn partitionTxn,
org.apache.directory.api.ldap.model.name.Dn movedBase)
For all aliases including and under the moved base, this method removes
one and subtree alias index tuples for old ancestors above the moved base
that will no longer be ancestors after the move.
|
void |
dumpIndex(PartitionTxn partitionTxn,
OutputStream stream,
String name)
Dump the requested index to a given stream
|
void |
dumpRdnIdx(PartitionTxn partitionTxn,
String id,
String tabs)
Dump the RDN index content
|
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
|
Index<String,String> |
getAdministrativeRoleIndex() |
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 entry cache size for this BTreePartition.
|
long |
getChildCount(PartitionTxn partitionTxn,
String id)
Gets the count of immediate children of the given entry UUID.
|
String |
getContextCsn(PartitionTxn partitionTxn)
Get the contextCSN
|
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
|
Set<Index<?,String>> |
getIndexedAttributes() |
MasterTable |
getMasterTable()
Expose the Master table
|
Index<String,String> |
getObjectClassIndex() |
Index<String,String> |
getOneAliasIndex() |
Optimizer |
getOptimizer() |
String |
getParentId(PartitionTxn partitionTxn,
String childId)
Gets the UUID of an entry's parent using the child entry's UUID.
|
URI |
getPartitionPath()
Gets the path in which this Partition stores data.
|
Index<String,String> |
getPresenceIndex() |
Index<ParentIdAndRdn,String> |
getRdnIndex() |
ReadWriteLock |
getReadWriteLock() |
SearchEngine |
getSearchEngine()
Gets the DefaultSearchEngine used by this ContextPartition to search the
Database.
|
Index<String,String> |
getSubAliasIndex() |
Subordinates |
getSubordinates(PartitionTxn partitionTxn,
org.apache.directory.api.ldap.model.entry.Entry entry)
Return the number of children and subordinates for a given entry
|
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 |
hasEntry(HasEntryOperationContext entryContext)
This method calls
Partition.lookup(LookupOperationContext) and return true
if it returns an entry by default. |
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 |
isOptimizerEnabled()
Tells if the Optimizer is enabled or not
|
boolean |
isSyncOnWrite() |
protected void |
loadContextCsn(PartitionTxn partitionTxn)
Loads the current context CSN present in the context entry of the partition
|
org.apache.directory.api.ldap.model.entry.Entry |
lookup(LookupOperationContext lookupContext)
Looks up an entry by distinguished/absolute name.
|
org.apache.directory.api.ldap.model.entry.Entry |
lookupCache(String id)
looks up for the entry with the given ID in the cache
|
void |
modify(ModifyOperationContext modifyContext)
Modifies an entry by adding, removing or replacing a set of attributes.
|
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(MoveOperationContext moveContext)
Transplants a child entry, to a position in the namespace under a new
parent entry.
|
void |
move(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.Dn newDn,
org.apache.directory.api.ldap.model.entry.Entry modifiedEntry)
Move an entry from one place to the other.
|
void |
moveAndRename(MoveAndRenameOperationContext moveAndRenameContext)
Transplants a child entry, to a position in the namespace under a new
parent entry and changes the RN of the child entry which can optionally
have its old RN attributes removed.
|
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)
Moves an entry under a new parent.
|
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 |
rename(RenameOperationContext renameContext)
Modifies an entry by changing its relative name.
|
void |
repair()
Repair this partition.
|
void |
saveContextCsn(PartitionTxn partitionTxn)
Saves the context CSN value in the context entry of the partition
|
EntryFilteringCursor |
search(SearchOperationContext searchContext)
Conducts a search against this ContextPartition.
|
void |
setCacheSize(int cacheSize)
Used to specify the entry cache size for a Partition.
|
void |
setIndexedAttributes(Set<Index<?,String>> indexedAttributes)
Set the list of indexes for this partition
|
void |
setOptimizer(Optimizer optimizer) |
void |
setOptimizerEnabled(boolean optimizerEnabled)
Set the optimizer flag
|
void |
setPartitionPath(URI partitionPath)
Sets the path in which this Partition stores data.
|
void |
setSearchEngine(SearchEngine searchEngine) |
void |
setSyncOnWrite(boolean isSyncOnWrite)
Sets the flag telling the server to flush on disk when some
modification has been done.
|
protected void |
setupSystemIndices()
Sets up the system indices.
|
protected void |
setupUserIndices()
Sets up the user indices.
|
String |
toString() |
void |
unbind(UnbindOperationContext unbindContext)
Represents an unbind operation issued by an authenticated client.
|
void |
updateCache(OperationContext opCtx)
updates the cache based on the type of OperationContext
|
protected void |
updateRdnIdx(PartitionTxn partitionTxn,
String parentId,
boolean addRemove,
int nbDescendant) |
checkInitialized, destroy, doRepair, getContextEntry, getId, getSchemaManager, getSuffixDn, initialize, isInitialized, setContextCsn, setContextEntry, setId, setSchemaManager, setSuffixDn, sync
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
beginReadTransaction, beginWriteTransaction
protected boolean optimizerEnabled
public static final int DEFAULT_CACHE_SIZE
protected int cacheSize
protected com.github.benmanes.caffeine.cache.Cache<String,org.apache.directory.api.ldap.model.name.Dn> aliasCache
protected com.github.benmanes.caffeine.cache.Cache<String,ParentIdAndRdn> piarCache
protected AtomicBoolean isSyncOnWrite
protected URI partitionPath
protected MasterTable master
protected Map<String,Index<?,String>> userIndices
protected Map<String,Index<?,String>> systemIndices
protected Index<ParentIdAndRdn,String> rdnIdx
protected Index<String,String> objectClassIdx
protected Index<String,String> presenceIdx
protected Index<String,String> entryCsnIdx
protected Index<org.apache.directory.api.ldap.model.name.Dn,String> aliasIdx
protected Index<String,String> subAliasIdx
protected Index<String,String> oneAliasIdx
protected Index<String,String> adminRoleIdx
protected org.apache.directory.api.ldap.model.schema.AttributeType objectClassAT
protected org.apache.directory.api.ldap.model.schema.AttributeType presenceAT
protected org.apache.directory.api.ldap.model.schema.AttributeType entryCsnAT
protected org.apache.directory.api.ldap.model.schema.AttributeType entryDnAT
protected org.apache.directory.api.ldap.model.schema.AttributeType entryUuidAT
protected org.apache.directory.api.ldap.model.schema.AttributeType aliasedObjectNameAT
protected org.apache.directory.api.ldap.model.schema.AttributeType administrativeRoleAT
protected org.apache.directory.api.ldap.model.schema.AttributeType contextCsnAT
protected static final boolean ADD_CHILD
protected static final boolean REMOVE_CHILD
protected AbstractBTreePartition(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager)
schemaManager
- the schema managerprotected AbstractBTreePartition(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager, DnFactory dnFactory)
schemaManager
- the schema managerdnFactory
- the DN factorypublic int getCacheSize()
getCacheSize
in interface Store
public void setCacheSize(int cacheSize)
setCacheSize
in interface Store
cacheSize
- the maximum size of the cache in the number of entriespublic boolean isOptimizerEnabled()
public void setOptimizerEnabled(boolean optimizerEnabled)
optimizerEnabled
- The flagpublic void setPartitionPath(URI partitionPath)
setPartitionPath
in interface Store
partitionPath
- the path in which this Partition stores data.public boolean isSyncOnWrite()
isSyncOnWrite
in interface Store
true
if we write to disk for every modificationpublic void setSyncOnWrite(boolean isSyncOnWrite)
setSyncOnWrite
in interface Store
isSyncOnWrite
- A boolean set to true if we have to flush on disk
when a modification occursprotected void setupSystemIndices() throws org.apache.directory.api.ldap.model.exception.LdapException
org.apache.directory.api.ldap.model.exception.LdapException
- If the setup failedprotected void setupUserIndices() throws org.apache.directory.api.ldap.model.exception.LdapException
org.apache.directory.api.ldap.model.exception.LdapException
- If the setup failedpublic SearchEngine getSearchEngine()
protected abstract Index<?,String> convertAndInit(Index<?,String> index) throws org.apache.directory.api.ldap.model.exception.LdapException
index
- the indexorg.apache.directory.api.ldap.model.exception.LdapException
- If teh conversion failedpublic URI getPartitionPath()
getPartitionPath
in interface Store
protected void doDestroy(PartitionTxn partitionTxn) throws org.apache.directory.api.ldap.model.exception.LdapException
doDestroy
in class AbstractPartition
partitionTxn
- The transaction to useorg.apache.directory.api.ldap.model.exception.LdapException
- If the destroy call failedpublic void repair() throws org.apache.directory.api.ldap.model.exception.LdapException
repair
in interface Partition
repair
in class AbstractPartition
org.apache.directory.api.ldap.model.exception.LdapException
protected void doInit() throws org.apache.directory.api.ldap.model.exception.LdapException
doInit
in class AbstractPartition
org.apache.directory.api.ldap.model.exception.LdapException
- If the initialization failedpublic void dumpRdnIdx(PartitionTxn partitionTxn, String id, String tabs) throws org.apache.directory.api.ldap.model.exception.LdapException, org.apache.directory.api.ldap.model.cursor.CursorException, IOException
partitionTxn
- The transaction to useid
- The root IDtabs
- The space prefixorg.apache.directory.api.ldap.model.exception.LdapException
- If we had an issue while dumping the Rdn indexorg.apache.directory.api.ldap.model.cursor.CursorException
- If the cursor failed to browse the Rdn IndexIOException
- If we weren't able to read teh Rdn Index filepublic void add(AddOperationContext addContext) throws org.apache.directory.api.ldap.model.exception.LdapException
public org.apache.directory.api.ldap.model.entry.Entry delete(DeleteOperationContext deleteContext) throws org.apache.directory.api.ldap.model.exception.LdapException
protected void updateRdnIdx(PartitionTxn partitionTxn, String parentId, boolean addRemove, int nbDescendant) throws org.apache.directory.api.ldap.model.exception.LdapException
org.apache.directory.api.ldap.model.exception.LdapException
public org.apache.directory.api.ldap.model.entry.Entry delete(PartitionTxn partitionTxn, String id) throws org.apache.directory.api.ldap.model.exception.LdapException
public EntryFilteringCursor search(SearchOperationContext searchContext) throws org.apache.directory.api.ldap.model.exception.LdapException
public org.apache.directory.api.ldap.model.entry.Entry lookup(LookupOperationContext lookupContext) throws org.apache.directory.api.ldap.model.exception.LdapException
public org.apache.directory.api.ldap.model.entry.Entry fetch(PartitionTxn partitionTxn, String id) throws org.apache.directory.api.ldap.model.exception.LdapException
fetch
in interface Store
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)public 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
fetch
in interface Store
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)public void modify(ModifyOperationContext modifyContext) throws org.apache.directory.api.ldap.model.exception.LdapException
modify
in interface Partition
modifyContext
- The context containing the modification operation
to perform on the entry which is one of constants specified by the
DirContext interface:
ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE
.org.apache.directory.api.ldap.model.exception.LdapException
- if there are any problemspublic final 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) throws org.apache.directory.api.ldap.model.exception.LdapException
public void move(MoveOperationContext moveContext) throws org.apache.directory.api.ldap.model.exception.LdapException
public final void move(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.Dn newDn, org.apache.directory.api.ldap.model.entry.Entry modifiedEntry) 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 :
public void moveAndRename(MoveAndRenameOperationContext moveAndRenameContext) throws org.apache.directory.api.ldap.model.exception.LdapException
moveAndRename
in interface Partition
moveAndRenameContext
- The context contain all the information about
the modifyDN operationorg.apache.directory.api.ldap.model.exception.LdapException
- if there are any problemspublic 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) throws org.apache.directory.api.ldap.model.exception.LdapException
moveAndRename
in interface Store
oldDn
- the normalized dn of the child to be movednewSuperiorDn
- the id of the child being movednewRdn
- the normalized dn of the new parent for the childmodAvas
- The modified AvasmodifiedEntry
- the modified entrypartitionTxn
- The transaction to useorg.apache.directory.api.ldap.model.exception.LdapException
- if something goes wrongpublic void rename(RenameOperationContext renameContext) throws org.apache.directory.api.ldap.model.exception.LdapException
public final 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) throws org.apache.directory.api.ldap.model.exception.LdapException
rename
in interface Store
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 changespublic final void unbind(UnbindOperationContext unbindContext) throws org.apache.directory.api.ldap.model.exception.LdapException
public boolean hasEntry(HasEntryOperationContext entryContext) throws org.apache.directory.api.ldap.model.exception.LdapException
Partition.lookup(LookupOperationContext)
and return true
if it returns an entry by default. Please override this method if
there is more effective way for your implementation.protected org.apache.directory.api.ldap.model.name.Dn buildEntryDn(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 build the entry Dnpublic long count(PartitionTxn partitionTxn) throws org.apache.directory.api.ldap.model.exception.LdapException
public final long getChildCount(PartitionTxn partitionTxn, String id) throws org.apache.directory.api.ldap.model.exception.LdapException
getChildCount
in interface Store
partitionTxn
- The transaction to useid
- the entry UUIDorg.apache.directory.api.ldap.model.exception.LdapException
- on failures to access the underlying storepublic final org.apache.directory.api.ldap.model.name.Dn getEntryDn(PartitionTxn partitionTxn, String id) throws org.apache.directory.api.ldap.model.exception.LdapException
getEntryDn
in interface Store
partitionTxn
- The transaction to useid
- the entry's idorg.apache.directory.api.ldap.model.exception.LdapException
- If we can't get the entry Dnpublic final String 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!getEntryId
in interface Store
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 IDpublic String getParentId(PartitionTxn partitionTxn, String childId) throws org.apache.directory.api.ldap.model.exception.LdapException
getParentId
in interface Store
partitionTxn
- The transaction to usechildId
- the UUID of the entryorg.apache.directory.api.ldap.model.exception.LdapException
- on failures to access the underlying storepublic String getSuffixId(PartitionTxn partitionTxn) throws org.apache.directory.api.ldap.model.exception.LdapException
getSuffixId
in interface Store
partitionTxn
- The transaction to useorg.apache.directory.api.ldap.model.exception.LdapException
- If we weren't able to retrieve the Suffix IDpublic void addIndex(Index<?,String> index) throws org.apache.directory.api.ldap.model.exception.LdapException
public void addIndexedAttributes(Index<?,String>... indexes)
indexes
- The added indexespublic void setIndexedAttributes(Set<Index<?,String>> indexedAttributes)
indexedAttributes
- The list of indexespublic Set<Index<?,String>> getIndexedAttributes()
public Iterator<String> getUserIndices()
getUserIndices
in interface Store
public Iterator<String> getSystemIndices()
getSystemIndices
in interface Store
public Index<?,String> getIndex(org.apache.directory.api.ldap.model.schema.AttributeType attributeType) throws IndexNotFoundException
getIndex
in interface Store
attributeType
- The index attributeType we are looking forIndexNotFoundException
- If the index does not existpublic Index<?,String> getUserIndex(org.apache.directory.api.ldap.model.schema.AttributeType attributeType) throws IndexNotFoundException
getUserIndex
in interface Store
attributeType
- The index name we are looking forIndexNotFoundException
- If the index does not existpublic Index<?,String> getSystemIndex(org.apache.directory.api.ldap.model.schema.AttributeType attributeType) throws IndexNotFoundException
getSystemIndex
in interface Store
attributeType
- The index name we are looking forIndexNotFoundException
- If the index does not existpublic Index<org.apache.directory.api.ldap.model.name.Dn,String> getAliasIndex()
getAliasIndex
in interface Store
public Index<String,String> getOneAliasIndex()
getOneAliasIndex
in interface Store
public Index<String,String> getSubAliasIndex()
getSubAliasIndex
in interface Store
public Index<String,String> getObjectClassIndex()
getObjectClassIndex
in interface Store
public Index<String,String> getEntryCsnIndex()
getEntryCsnIndex
in interface Store
public Index<String,String> getAdministrativeRoleIndex()
public Index<String,String> getPresenceIndex()
getPresenceIndex
in interface Store
public Index<ParentIdAndRdn,String> getRdnIndex()
getRdnIndex
in interface Store
public boolean hasUserIndexOn(org.apache.directory.api.ldap.model.schema.AttributeType attributeType) throws org.apache.directory.api.ldap.model.exception.LdapException
hasUserIndexOn
in interface Store
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 wrongpublic boolean hasSystemIndexOn(org.apache.directory.api.ldap.model.schema.AttributeType attributeType) throws org.apache.directory.api.ldap.model.exception.LdapException
hasSystemIndexOn
in interface Store
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 wrongpublic boolean hasIndexOn(org.apache.directory.api.ldap.model.schema.AttributeType attributeType) throws org.apache.directory.api.ldap.model.exception.LdapException
hasIndexOn
in interface Store
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 wrongprotected void addAliasIndices(PartitionTxn partitionTxn, String aliasId, org.apache.directory.api.ldap.model.name.Dn aliasDn, org.apache.directory.api.ldap.model.name.Dn aliasTarget) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn
- The transaction to usealiasDn
- normalized distinguished name for the alias entryaliasTarget
- the user provided aliased entry dn as a stringaliasId
- the id of alias entry to addorg.apache.directory.api.ldap.model.exception.LdapException
- if index addition fails, and if the alias is
not allowed due to chaining or cycle formation.org.apache.directory.api.ldap.model.exception.LdapException
- if the wrappedCursor btrees cannot be alteredprotected void dropAliasIndices(PartitionTxn partitionTxn, String aliasId) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn
- The transaction to usealiasId
- the id of the alias entry in the master tableorg.apache.directory.api.ldap.model.exception.LdapException
- if we cannot delete index values in the databaseprotected void dropMovedAliasIndices(PartitionTxn partitionTxn, org.apache.directory.api.ldap.model.name.Dn movedBase) throws org.apache.directory.api.ldap.model.exception.LdapException
partitionTxn
- The transaction to usemovedBase
- the base at which the move occurred - the moved nodeorg.apache.directory.api.ldap.model.exception.LdapException
- if system userIndices failpublic void dumpIndex(PartitionTxn partitionTxn, OutputStream stream, String name) throws IOException
dumpIndex
in interface Partition
dumpIndex
in class AbstractPartition
partitionTxn
- The transaction to usestream
- The Stream used to dump the indexname
- The index to dump to stdoutIOException
- if we can't write the dataprotected abstract Index createSystemIndex(String indexOid, URI path, boolean withReverse) throws org.apache.directory.api.ldap.model.exception.LdapException
indexOid
- The Attribute OIDpath
- The working directory where this index will be storedwithReverse
- If the Reverse index must be created or notorg.apache.directory.api.ldap.model.exception.LdapException
- If the index can't be createdpublic MasterTable getMasterTable()
getMasterTable
in interface Store
public void updateCache(OperationContext opCtx)
opCtx
- the operation's contextpublic org.apache.directory.api.ldap.model.entry.Entry lookupCache(String id)
id
- the ID of the entrypublic void addToCache(String id, org.apache.directory.api.ldap.model.entry.Entry entry)
id
- ID of the entryentry
- the Entrypublic Optimizer getOptimizer()
public void setOptimizer(Optimizer optimizer)
optimizer
- the optimizer to setpublic void setSearchEngine(SearchEngine searchEngine)
searchEngine
- the searchEngine to setpublic ReadWriteLock getReadWriteLock()
getReadWriteLock
in interface Store
public com.github.benmanes.caffeine.cache.Cache<String,org.apache.directory.api.ldap.model.name.Dn> getAliasCache()
getAliasCache
in interface Store
public String getContextCsn(PartitionTxn partitionTxn)
getContextCsn
in interface Partition
getContextCsn
in class AbstractPartition
partitionTxn
- The transaction to useprotected void loadContextCsn(PartitionTxn partitionTxn)
partitionTxn
- The transaction to usepublic void saveContextCsn(PartitionTxn partitionTxn) throws org.apache.directory.api.ldap.model.exception.LdapException
saveContextCsn
in interface Partition
partitionTxn
- The transaction to useorg.apache.directory.api.ldap.model.exception.LdapException
- If the context can't be savedpublic Subordinates getSubordinates(PartitionTxn partitionTxn, org.apache.directory.api.ldap.model.entry.Entry entry) throws org.apache.directory.api.ldap.model.exception.LdapException
getSubordinates
in interface Partition
partitionTxn
- The transaction to useentry
- The entryorg.apache.directory.api.ldap.model.exception.LdapException
- If we had an issue while processing the requestCopyright © 2003–2020 The Apache Software Foundation. All rights reserved.