|
||||||||||
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.schema.SchemaPartition
public final class SchemaPartition
A special partition designed to contain the portion of the DIT where schema information for the server is stored. In an effort to make sure that all Partition implementations are equal citizens to ApacheDS we want to be able to swap in and out any kind of Partition to store schema. This also has the added advantage of making sure the core, and hence the server is not dependent on any specific partition, which reduces coupling in the server's modules. The SchemaPartition achieves this by not really being a backing store itself for the schema entries. It instead delegates to another Partition via containment. It delegates all calls to this contained Partition. While doing so it also manages certain things:
Field Summary |
---|
Fields inherited from class org.apache.directory.server.core.partition.AbstractPartition |
---|
initialized |
Constructor Summary | |
---|---|
SchemaPartition()
|
Method Summary | |
---|---|
void |
add(AddOperationContext opContext)
Adds an entry to this ContextPartition. |
void |
bind(BindOperationContext opContext)
Represents a bind operation issued to authenticate a client. |
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. |
protected void |
doDestroy()
Override this method to put your initialization code. |
protected void |
doInit()
Override this method to put your initialization code. |
java.lang.String |
getId()
Get's the ID which is fixed: 'schema'. |
org.apache.directory.shared.ldap.schema.SchemaManager |
getSchemaManager()
Gets the schema manager assigned to this Partition. |
java.lang.String |
getSuffix()
Always returns ServerDNConstants#OU_SCHEMA_DN : 'ou=schema'. |
org.apache.directory.shared.ldap.name.DN |
getSuffixDn()
Always returns ServerDNConstants#OU_SCHEMA_DN_NORMALIZED : '2.5.4.11=schema'. |
Partition |
getWrappedPartition()
Gets the Partition being wrapped. |
boolean |
hasEntry(EntryOperationContext entryContext)
This method calls Partition.lookup(LookupOperationContext) and return true
if it returns an entry by default. |
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. |
ClonedServerEntry |
lookup(LookupOperationContext lookupContext)
This method calls Partition.lookup(LookupOperationContext)
with null attributeIds by default. |
void |
modify(ModifyOperationContext opContext)
Modifies an entry by adding, removing or replacing a set of attributes. |
void |
move(MoveOperationContext opContext)
Transplants a child entry, to a position in the namespace under a new parent entry. |
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. |
void |
rename(RenameOperationContext opContext)
Modifies an entry by changing its relative name. |
EntryFilteringCursor |
search(SearchOperationContext opContext)
Conducts a search against this ContextPartition. |
void |
setId(java.lang.String id)
Has no affect: the id is fixed at ID : 'schema'. |
void |
setSchemaManager(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
Sets the schema manager assigned to this Partition. |
void |
setSuffix(java.lang.String suffix)
Has no affect: just logs a warning. |
void |
setWrappedPartition(Partition wrapped)
Sets the wrapped Partition which must be supplied or
Partition.initialize() will fail with a NullPointerException. |
void |
sync()
This method does nothing by default. |
java.lang.String |
toString()
|
void |
unbind(UnbindOperationContext opContext)
Represents an unbind operation issued by an authenticated client. |
Methods inherited from class org.apache.directory.server.core.partition.AbstractPartition |
---|
destroy, initialize, isInitialized |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SchemaPartition()
Method Detail |
---|
public void setWrappedPartition(Partition wrapped)
Partition
which must be supplied or
Partition.initialize()
will fail with a NullPointerException.
wrapped
- the Partition being wrappedpublic Partition getWrappedPartition()
Partition
being wrapped.
public final java.lang.String getId()
public final void setId(java.lang.String id)
ID
: 'schema'.
A warning is logged.
id
- the unique identifier for this partitionpublic final org.apache.directory.shared.ldap.name.DN getSuffixDn()
ServerDNConstants#OU_SCHEMA_DN_NORMALIZED
: '2.5.4.11=schema'.
public final java.lang.String getSuffix()
ServerDNConstants#OU_SCHEMA_DN
: 'ou=schema'.
public final void setSuffix(java.lang.String suffix)
suffix
- the suffix String for this Partition.public void sync() throws java.lang.Exception
AbstractPartition
sync
in interface Partition
sync
in class AbstractPartition
java.lang.Exception
- if buffers cannot be flushed to diskprotected void doInit() throws java.lang.Exception
AbstractPartition
doInit
in class AbstractPartition
java.lang.Exception
protected void doDestroy()
AbstractPartition
doDestroy
in class AbstractPartition
public void add(AddOperationContext opContext) throws java.lang.Exception
opContext
- the context used to add and entry to this ContextPartition
java.lang.Exception
- if there are any problemspublic void bind(BindOperationContext opContext) throws java.lang.Exception
Partition
opContext
- the bind context, containing all the needed informations to bind
java.lang.Exception
- if something goes wrongpublic void delete(DeleteOperationContext opContext) throws java.lang.Exception
Partition
opContext
- the context of the entry to
delete from this ContextPartition.
java.lang.Exception
- if there are any problemspublic 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 boolean hasEntry(EntryOperationContext entryContext) throws java.lang.Exception
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
entryContext
- The context used to pass informations
java.lang.Exception
- if there are any problemspublic void modify(ModifyOperationContext opContext) throws java.lang.Exception
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 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 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 void rename(RenameOperationContext opContext) throws java.lang.Exception
opContext
- the modify DN context
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 void unbind(UnbindOperationContext opContext) throws java.lang.Exception
Partition
opContext
- the context used to unbind
java.lang.Exception
- if something goes wrongpublic ClonedServerEntry lookup(LookupOperationContext lookupContext) 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
lookupContext
- The context containing the parameters
java.lang.Exception
- if there are any problemspublic void setSchemaManager(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
Partition
schemaManager
- the SchemaManager to setpublic org.apache.directory.shared.ldap.schema.SchemaManager getSchemaManager()
Partition
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |