|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.server.core.partition.AbstractPartition
org.apache.directory.server.core.partition.impl.btree.BTreePartition<ID>
public abstract class BTreePartition<ID>
An abstract Partition
that uses general BTree operations.
Field Summary | |
---|---|
protected int |
cacheSize
|
protected org.apache.directory.shared.ldap.entry.ServerEntry |
contextEntry
The rootDSE context |
protected java.lang.String |
id
|
protected Optimizer |
optimizer
|
protected org.apache.directory.shared.ldap.schema.SchemaManager |
schemaManager
|
protected SearchEngine<org.apache.directory.shared.ldap.entry.ServerEntry,ID> |
searchEngine
the search engine used to search the database |
protected org.apache.directory.shared.ldap.name.DN |
suffix
|
protected static java.util.Set<java.lang.String> |
SYS_INDEX_OIDS
|
Fields inherited from class org.apache.directory.server.core.partition.AbstractPartition |
---|
initialized |
Constructor Summary | |
---|---|
protected |
BTreePartition()
Creates a B-tree based context partition. |
Method Summary | |
---|---|
abstract void |
add(AddOperationContext opContext)
Adds an entry to this ContextPartition. |
void |
addIndexedAttributes(Index<? extends java.lang.Object,org.apache.directory.shared.ldap.entry.ServerEntry,ID>... indexes)
|
abstract void |
addIndexOn(Index<? extends java.lang.Object,org.apache.directory.shared.ldap.entry.ServerEntry,ID> index)
|
abstract int |
count()
Gets the count of the total number of entries in the database. |
void |
delete(DeleteOperationContext opContext)
Deletes a leaf entry from this ContextPartition: non-leaf entries cannot be deleted until this operation has been applied to their children. |
abstract void |
delete(ID id)
|
abstract Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,ID> |
getAliasIndex()
Gets the system index defined on the ALIAS_ATTRIBUTE which for LDAP would be the aliasedObjectName and for X.500 would be aliasedEntryName. |
int |
getCacheSize()
Gets the entry cache size for this BTreePartition. |
abstract int |
getChildCount(ID id)
|
abstract java.lang.String |
getEntryDn(ID id)
|
abstract ID |
getEntryId(java.lang.String dn)
|
abstract java.lang.String |
getEntryUpdn(ID id)
Gets the user provided distinguished name. |
abstract java.lang.String |
getEntryUpdn(java.lang.String dn)
Gets the user provided distinguished name. |
java.lang.String |
getId()
Gets the unique identifier for this partition. |
java.util.Set<Index<? extends java.lang.Object,org.apache.directory.shared.ldap.entry.ServerEntry,ID>> |
getIndexedAttributes()
|
abstract Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,ID> |
getNdnIndex()
Gets the Index mapping the normalized distinguished names of entries as Strings to the BigInteger primary keys of entries. |
abstract Index<ID,org.apache.directory.shared.ldap.entry.ServerEntry,ID> |
getOneAliasIndex()
Gets the alias index mapping parent entries with scope expanding aliases children one level below them; this system index is used to dereference aliases on one/single level scoped searches. |
abstract Index<ID,org.apache.directory.shared.ldap.entry.ServerEntry,ID> |
getOneLevelIndex()
Gets the Index mapping the primary keys of parents to the primary keys of their children. |
abstract ID |
getParentId(ID childId)
|
abstract ID |
getParentId(java.lang.String dn)
|
java.io.File |
getPartitionDir()
Gets the directory in which this Partition stores files. |
abstract Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,ID> |
getPresenceIndex()
|
abstract java.lang.String |
getProperty(java.lang.String key)
|
org.apache.directory.shared.ldap.schema.SchemaManager |
getSchemaManager()
Gets the schema manager assigned to this Partition. |
SearchEngine<org.apache.directory.shared.ldap.entry.ServerEntry,ID> |
getSearchEngine()
Gets the DefaultSearchEngine used by this ContextPartition to search the Database. |
abstract Index<ID,org.apache.directory.shared.ldap.entry.ServerEntry,ID> |
getSubAliasIndex()
Gets the alias index mapping relative entries with scope expanding alias descendents; this system index is used to dereference aliases on subtree scoped searches. |
abstract Index<ID,org.apache.directory.shared.ldap.entry.ServerEntry,ID> |
getSubLevelIndex()
Gets the Index mapping the primary keys of ancestors to the primary keys of their descendants. |
java.lang.String |
getSuffix()
Gets the user provided suffix for this Partition as a String. |
org.apache.directory.shared.ldap.name.DN |
getSuffixDn()
Gets the normalized suffix as an DN for this Partition after it has been initialized. |
abstract Index<? extends java.lang.Object,org.apache.directory.shared.ldap.entry.ServerEntry,ID> |
getSystemIndex(java.lang.String attribute)
|
abstract java.util.Iterator<java.lang.String> |
getSystemIndices()
|
abstract Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,ID> |
getUpdnIndex()
Gets the Index mapping user provided distinguished names of entries as Strings to the BigInteger primary keys of entries. |
abstract Index<? extends java.lang.Object,org.apache.directory.shared.ldap.entry.ServerEntry,ID> |
getUserIndex(java.lang.String attribute)
|
abstract java.util.Iterator<java.lang.String> |
getUserIndices()
|
boolean |
hasEntry(EntryOperationContext opContext)
This method calls Partition.lookup(LookupOperationContext) and return true
if it returns an entry by default. |
abstract boolean |
hasSystemIndexOn(java.lang.String attribute)
|
abstract boolean |
hasUserIndexOn(java.lang.String attribute)
|
abstract IndexCursor<ID,org.apache.directory.shared.ldap.entry.ServerEntry,ID> |
list(ID id)
|
EntryFilteringCursor |
list(ListOperationContext opContext)
A specialized form of one level search used to return a minimal set of information regarding child entries under a base. |
abstract ClonedServerEntry |
lookup(ID id)
|
ClonedServerEntry |
lookup(LookupOperationContext opContext)
This method calls Partition.lookup(LookupOperationContext)
with null attributeIds by default. |
abstract void |
modify(ModifyOperationContext opContext)
Modifies an entry by adding, removing or replacing a set of attributes. |
abstract void |
move(MoveOperationContext opContext)
Transplants a child entry, to a position in the namespace under a new parent entry. |
abstract void |
moveAndRename(MoveAndRenameOperationContext opContext)
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. |
abstract void |
rename(RenameOperationContext opContext)
Modifies an entry by changing its relative name. |
EntryFilteringCursor |
search(SearchOperationContext opContext)
Conducts a search against this ContextPartition. |
abstract void |
setAliasIndexOn(Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,ID> index)
Sets the system index defined on the ALIAS_ATTRIBUTE which for LDAP would be the aliasedObjectName and for X.500 would be aliasedEntryName. |
void |
setCacheSize(int cacheSize)
Used to specify the entry cache size for a Partition. |
void |
setId(java.lang.String id)
Sets the unique identifier for this partition. |
void |
setIndexedAttributes(java.util.Set<Index<? extends java.lang.Object,org.apache.directory.shared.ldap.entry.ServerEntry,ID>> indexedAttributes)
|
abstract void |
setNdnIndexOn(Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,ID> index)
Sets the normalized distinguished name Index. |
abstract void |
setOneAliasIndexOn(Index<ID,org.apache.directory.shared.ldap.entry.ServerEntry,ID> index)
Sets the alias index mapping parent entries with scope expanding aliases children one level below them; this system index is used to dereference aliases on one/single level scoped searches. |
abstract void |
setOneLevelIndexOn(Index<ID,org.apache.directory.shared.ldap.entry.ServerEntry,ID> index)
Sets the one level Index. |
void |
setPartitionDir(java.io.File partitionDir)
Sets the directory in which this Partition stores files. |
abstract void |
setPresenceIndexOn(Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,ID> index)
Sets the attribute existence Index. |
abstract void |
setProperty(java.lang.String key,
java.lang.String value)
|
void |
setSchemaManager(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
Sets the schema manager assigned to this Partition. |
abstract void |
setSubAliasIndexOn(Index<ID,org.apache.directory.shared.ldap.entry.ServerEntry,ID> index)
Sets the alias index mapping relative entries with scope expanding alias descendents; this system index is used to dereference aliases on subtree scoped searches. |
void |
setSuffix(java.lang.String suffix)
Sets the user provided suffix for this Partition as a String. |
abstract void |
setUpdnIndexOn(Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,ID> index)
Sets the user provided distinguished name Index. |
abstract void |
sync()
This method does nothing by default. |
Methods inherited from class org.apache.directory.server.core.partition.AbstractPartition |
---|
destroy, doDestroy, doInit, initialize, isInitialized |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.directory.server.core.partition.Partition |
---|
bind, unbind |
Field Detail |
---|
protected static final java.util.Set<java.lang.String> SYS_INDEX_OIDS
protected SearchEngine<org.apache.directory.shared.ldap.entry.ServerEntry,ID> searchEngine
protected Optimizer optimizer
protected org.apache.directory.shared.ldap.schema.SchemaManager schemaManager
protected java.lang.String id
protected int cacheSize
protected org.apache.directory.shared.ldap.name.DN suffix
protected org.apache.directory.shared.ldap.entry.ServerEntry contextEntry
Constructor Detail |
---|
protected BTreePartition()
Method Detail |
---|
public void setSchemaManager(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
public org.apache.directory.shared.ldap.schema.SchemaManager getSchemaManager()
public java.io.File getPartitionDir()
public void setPartitionDir(java.io.File partitionDir)
partitionDir
- the directory in which this Partition stores files.public void setIndexedAttributes(java.util.Set<Index<? extends java.lang.Object,org.apache.directory.shared.ldap.entry.ServerEntry,ID>> indexedAttributes)
public void addIndexedAttributes(Index<? extends java.lang.Object,org.apache.directory.shared.ldap.entry.ServerEntry,ID>... indexes)
public java.util.Set<Index<? extends java.lang.Object,org.apache.directory.shared.ldap.entry.ServerEntry,ID>> getIndexedAttributes()
public void setCacheSize(int cacheSize)
cacheSize
- the maximum size of the cache in the number of entriespublic int getCacheSize()
public java.lang.String getId()
public void setId(java.lang.String id)
id
- the unique identifier for this partitionpublic SearchEngine<org.apache.directory.shared.ldap.entry.ServerEntry,ID> getSearchEngine()
public void delete(DeleteOperationContext opContext) throws java.lang.Exception
opContext
- the context of the entry to
delete from this ContextPartition.
java.lang.Exception
- if there are any problemspublic abstract void add(AddOperationContext opContext) throws java.lang.Exception
Partition
opContext
- the context used to add and entry to this ContextPartition
java.lang.Exception
- if there are any problemspublic abstract void modify(ModifyOperationContext opContext) throws java.lang.Exception
Partition
opContext
- 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
.
java.lang.Exception
- if there are any problemsDirContext
,
DirContext.ADD_ATTRIBUTE
,
DirContext.REMOVE_ATTRIBUTE
,
DirContext.REPLACE_ATTRIBUTE
public EntryFilteringCursor list(ListOperationContext opContext) throws java.lang.Exception
Partition
opContext
- the context containing the distinguished/absolute name for the search/listing
ServerSearchResult
java.lang.Exception
- if there are any problemspublic EntryFilteringCursor search(SearchOperationContext opContext) throws java.lang.Exception
Partition
opContext
- The context containing the information used by the operation
java.lang.Exception
- if there are any problemspublic ClonedServerEntry lookup(LookupOperationContext opContext) throws java.lang.Exception
AbstractPartition
Partition.lookup(LookupOperationContext)
with null attributeIds by default. Please override
this method if there is more effective way for your implementation.
lookup
in interface Partition
lookup
in class AbstractPartition
opContext
- The context containing the parameters
java.lang.Exception
- if there are any problemspublic boolean hasEntry(EntryOperationContext opContext) throws java.lang.Exception
AbstractPartition
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.
hasEntry
in interface Partition
hasEntry
in class AbstractPartition
opContext
- The context used to pass informations
java.lang.Exception
- if there are any problemspublic abstract void rename(RenameOperationContext opContext) throws java.lang.Exception
Partition
opContext
- the modify DN context
java.lang.Exception
- if there are any problemspublic abstract void move(MoveOperationContext opContext) throws java.lang.Exception
Partition
opContext
- The context containing the DNs to move
java.lang.Exception
- if there are any problemspublic abstract void moveAndRename(MoveAndRenameOperationContext opContext) throws java.lang.Exception
Partition
opContext
- The context contain all the information about
the modifyDN operation
java.lang.Exception
- if there are any problemspublic abstract void sync() throws java.lang.Exception
AbstractPartition
sync
in interface Partition
sync
in class AbstractPartition
java.lang.Exception
- if buffers cannot be flushed to diskpublic abstract void addIndexOn(Index<? extends java.lang.Object,org.apache.directory.shared.ldap.entry.ServerEntry,ID> index) throws java.lang.Exception
java.lang.Exception
public abstract boolean hasUserIndexOn(java.lang.String attribute) throws java.lang.Exception
java.lang.Exception
public abstract boolean hasSystemIndexOn(java.lang.String attribute) throws java.lang.Exception
java.lang.Exception
public abstract Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,ID> getPresenceIndex()
public abstract Index<ID,org.apache.directory.shared.ldap.entry.ServerEntry,ID> getOneLevelIndex()
public abstract Index<ID,org.apache.directory.shared.ldap.entry.ServerEntry,ID> getSubLevelIndex()
public abstract Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,ID> getUpdnIndex()
public abstract Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,ID> getNdnIndex()
public abstract Index<ID,org.apache.directory.shared.ldap.entry.ServerEntry,ID> getOneAliasIndex()
public abstract Index<ID,org.apache.directory.shared.ldap.entry.ServerEntry,ID> getSubAliasIndex()
public abstract Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,ID> getAliasIndex()
public abstract void setAliasIndexOn(Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,ID> index) throws java.lang.Exception
index
- the index on the ALIAS_ATTRIBUTE
java.lang.Exception
- if there is a problem setting up the indexpublic abstract void setPresenceIndexOn(Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,ID> index) throws java.lang.Exception
index
- the attribute existence Index
java.lang.Exception
- if there is a problem setting up the indexpublic abstract void setOneLevelIndexOn(Index<ID,org.apache.directory.shared.ldap.entry.ServerEntry,ID> index) throws java.lang.Exception
index
- the one level Index
java.lang.Exception
- if there is a problem setting up the indexpublic abstract void setUpdnIndexOn(Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,ID> index) throws java.lang.Exception
index
- the updn Index
java.lang.Exception
- if there is a problem setting up the indexpublic abstract void setNdnIndexOn(Index<java.lang.String,org.apache.directory.shared.ldap.entry.ServerEntry,ID> index) throws java.lang.Exception
index
- the ndn Index
java.lang.Exception
- if there is a problem setting up the indexpublic abstract void setOneAliasIndexOn(Index<ID,org.apache.directory.shared.ldap.entry.ServerEntry,ID> index) throws java.lang.Exception
index
- a one level alias index
java.lang.Exception
- if there is a problem setting up the indexpublic abstract void setSubAliasIndexOn(Index<ID,org.apache.directory.shared.ldap.entry.ServerEntry,ID> index) throws java.lang.Exception
index
- a subtree alias index
java.lang.Exception
- if there is a problem setting up the indexpublic void setSuffix(java.lang.String suffix) throws org.apache.directory.shared.ldap.exception.LdapInvalidDnException
suffix
- the suffix String for this Partition.
org.apache.directory.shared.ldap.exception.LdapInvalidDnException
- if the suffix does not conform to LDAP DN syntaxpublic java.lang.String getSuffix()
public org.apache.directory.shared.ldap.name.DN getSuffixDn()
public abstract Index<? extends java.lang.Object,org.apache.directory.shared.ldap.entry.ServerEntry,ID> getUserIndex(java.lang.String attribute) throws java.lang.Exception
java.lang.Exception
public abstract Index<? extends java.lang.Object,org.apache.directory.shared.ldap.entry.ServerEntry,ID> getSystemIndex(java.lang.String attribute) throws java.lang.Exception
java.lang.Exception
public abstract ID getEntryId(java.lang.String dn) throws java.lang.Exception
java.lang.Exception
public abstract java.lang.String getEntryDn(ID id) throws java.lang.Exception
java.lang.Exception
public abstract ID getParentId(java.lang.String dn) throws java.lang.Exception
java.lang.Exception
public abstract ID getParentId(ID childId) throws java.lang.Exception
java.lang.Exception
public abstract java.lang.String getEntryUpdn(ID id) throws java.lang.Exception
id
- the entry id
java.lang.Exception
- if the updn index cannot be accessedpublic abstract java.lang.String getEntryUpdn(java.lang.String dn) throws java.lang.Exception
dn
- the normalized distinguished name
java.lang.Exception
- if the updn and ndn indices cannot be accessedpublic abstract ClonedServerEntry lookup(ID id) throws java.lang.Exception
java.lang.Exception
public abstract void delete(ID id) throws java.lang.Exception
java.lang.Exception
public abstract IndexCursor<ID,org.apache.directory.shared.ldap.entry.ServerEntry,ID> list(ID id) throws java.lang.Exception
java.lang.Exception
public abstract int getChildCount(ID id) throws java.lang.Exception
java.lang.Exception
public abstract void setProperty(java.lang.String key, java.lang.String value) throws java.lang.Exception
java.lang.Exception
public abstract java.lang.String getProperty(java.lang.String key) throws java.lang.Exception
java.lang.Exception
public abstract java.util.Iterator<java.lang.String> getUserIndices()
public abstract java.util.Iterator<java.lang.String> getSystemIndices()
public abstract int count() throws java.lang.Exception
java.lang.Exception
- if there is a failure to read the count
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |