|
|||||||||||
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
A Partition
that helps users to implement their own partition.
Most methods are implemented by default. Please look at the description of
each methods for the detail of implementations.
Field Summary |
Fields inherited from interface org.apache.directory.server.core.partition.Partition |
ALIAS_ATTRIBUTE, ALIAS_OBJECT |
Constructor Summary | |
protected |
AbstractPartition()
|
Method Summary | |
void |
destroy()
Calls doDestroy() where you have to put your destroy code in,
and clears default properties. |
protected void |
doDestroy()
Override this method to put your initialization code. |
protected void |
doInit()
Override this method to put your initialization code. |
PartitionConfiguration |
getConfiguration()
Returns PartitionConfiguration that is provided from
init(DirectoryServiceConfiguration, PartitionConfiguration) . |
DirectoryServiceConfiguration |
getFactoryConfiguration()
Returns DirectoryServiceConfiguration that is provided from
init(DirectoryServiceConfiguration, PartitionConfiguration) . |
LdapDN |
getSuffix()
Gets the distinguished/absolute name of the suffix for all entries stored within this ContextPartition. |
boolean |
hasEntry(LdapDN name)
This method calls Partition#lookup(org.apache.directory.shared.ldap.name.LdapDN) and return true
if it returns an entry by default. |
void |
init(DirectoryServiceConfiguration factoryCfg,
PartitionConfiguration cfg)
Sets up default properties(factoryConfiguration and configuration) and calls doInit() where you have to put your initialization code in. |
boolean |
isInitialized()
Returns true if this context partition is initialized successfully. |
boolean |
isSuffix(LdapDN name)
Checks to see if name is a context suffix. |
javax.naming.directory.Attributes |
lookup(LdapDN name)
This method calls Partition#lookup(org.apache.directory.shared.ldap.name.LdapDN,String[])
with null attributeIds by default. |
void |
modify(LdapDN name,
int modOp,
javax.naming.directory.Attributes mods)
This method forwards the request to Partition#modify(org.apache.directory.shared.ldap.name.LdapDN,javax.naming.directory.ModificationItem[]) after
translating parameters to ModificationItem [] by default. |
void |
move(LdapDN oldName,
LdapDN newParentName)
This method throws OperationNotSupportedException by default. |
void |
move(LdapDN oldName,
LdapDN newParentName,
java.lang.String newRn,
boolean deleteOldRn)
This method calls Partition#move(org.apache.directory.shared.ldap.name.LdapDN,org.apache.directory.shared.ldap.name.LdapDN) and
Partition#modifyRn(org.apache.directory.shared.ldap.name.LdapDN,String,boolean) subsequently
by default. |
void |
sync()
This method does nothing by default. |
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 |
add, bind, delete, getUpSuffix, list, lookup, modify, modifyRn, search, unbind |
Constructor Detail |
protected AbstractPartition()
Method Detail |
public final void init(DirectoryServiceConfiguration factoryCfg, PartitionConfiguration cfg) throws javax.naming.NamingException
doInit()
where you have to put your initialization code in.
isInitialized()
will return true if doInit()
returns
without any errors. destroy()
is called automatically as a clean-up process
if doInit()
throws an exception.
init
in interface Partition
javax.naming.NamingException
protected void doInit() throws javax.naming.NamingException
javax.naming.NamingException
public final void destroy()
doDestroy()
where you have to put your destroy code in,
and clears default properties. Once this method is invoked, isInitialized()
will return false.
destroy
in interface Partition
protected void doDestroy()
public final boolean isInitialized()
isInitialized
in interface Partition
public final DirectoryServiceConfiguration getFactoryConfiguration()
DirectoryServiceConfiguration
that is provided from
init(DirectoryServiceConfiguration, PartitionConfiguration)
.
public final PartitionConfiguration getConfiguration()
PartitionConfiguration
that is provided from
init(DirectoryServiceConfiguration, PartitionConfiguration)
.
public final LdapDN getSuffix() throws javax.naming.NamingException
Partition
getSuffix
in interface Partition
javax.naming.NamingException
public final boolean isSuffix(LdapDN name) throws javax.naming.NamingException
Partition
isSuffix
in interface Partition
name
- the normalized distinguished/absolute name of the context
javax.naming.NamingException
- if there are any problemspublic void sync() throws javax.naming.NamingException
sync
in interface Partition
javax.naming.NamingException
public boolean hasEntry(LdapDN name) throws javax.naming.NamingException
Partition#lookup(org.apache.directory.shared.ldap.name.LdapDN)
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
name
- the normalized distinguished/absolute name of the object to
check for existance
javax.naming.NamingException
- if there are any problemspublic javax.naming.directory.Attributes lookup(LdapDN name) throws javax.naming.NamingException
Partition#lookup(org.apache.directory.shared.ldap.name.LdapDN,String[])
with null attributeIds by default. Please override
this method if there is more effective way for your implementation.
lookup
in interface Partition
name
- the normalized distinguished name of the object to lookup
javax.naming.NamingException
- if there are any problemspublic void modify(LdapDN name, int modOp, javax.naming.directory.Attributes mods) throws javax.naming.NamingException
Partition#modify(org.apache.directory.shared.ldap.name.LdapDN,javax.naming.directory.ModificationItem[])
after
translating parameters to ModificationItem
[] by default.
Please override this method if there is more effactive way for your
implementation.
modify
in interface Partition
name
- the normalized distinguished/absolute name of the entry to
modifymodOp
- the modification operation to perform on the entry which
is one of constants specified by the DirContext interface:
ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE
.mods
- the attributes and their values used to affect the
modification with.
javax.naming.NamingException
- if there are any problemsDirContext
,
DirContext.ADD_ATTRIBUTE
,
DirContext.REMOVE_ATTRIBUTE
,
DirContext.REPLACE_ATTRIBUTE
public void move(LdapDN oldName, LdapDN newParentName, java.lang.String newRn, boolean deleteOldRn) throws javax.naming.NamingException
Partition#move(org.apache.directory.shared.ldap.name.LdapDN,org.apache.directory.shared.ldap.name.LdapDN)
and
Partition#modifyRn(org.apache.directory.shared.ldap.name.LdapDN,String,boolean)
subsequently
by default. Please override this method if there is more effactive
way for your implementation.
move
in interface Partition
oldName
- the normalized distinguished/absolute name of the
original child name representing the child entry to movenewParentName
- the normalized distinguished/absolute name of the
new parent to move the targeted entry tonewRn
- the new RN of the entrydeleteOldRn
- boolean flag which removes the old RN attribute
from the entry if set to true, and has no affect if set to false
javax.naming.NamingException
- if there are any problemspublic void move(LdapDN oldName, LdapDN newParentName) throws javax.naming.NamingException
OperationNotSupportedException
by default.
Please override this method to implement move operation.
move
in interface Partition
oldName
- the normalized distinguished/absolute name of the
original child name representing the child entry to movenewParentName
- the normalized distinguished/absolute name of the
new parent to move the target entry to
javax.naming.NamingException
- if there are any problems
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |