|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ldap.server.partition.AbstractContextPartition
A ContextPartition
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.ldap.server.partition.ContextPartition |
ALIAS_ATTRIBUTE, ALIAS_OBJECT |
Constructor Summary | |
protected |
AbstractContextPartition()
|
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. |
ContextPartitionConfiguration |
getConfiguration()
Returns ContextPartitionConfiguration that is provided from
init(ContextFactoryConfiguration, ContextPartitionConfiguration) . |
ContextFactoryConfiguration |
getFactoryConfiguration()
Returns ContextFactoryConfiguration that is provided from
init(ContextFactoryConfiguration, ContextPartitionConfiguration) . |
javax.naming.Name |
getSuffix(boolean normalized)
Gets the distinguished/absolute name of the suffix for all entries stored within this ContextPartition. |
boolean |
hasEntry(javax.naming.Name name)
This method calls lookup(Name) and return true
if it returns an entry by default. |
void |
init(ContextFactoryConfiguration factoryCfg,
ContextPartitionConfiguration 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(javax.naming.Name name)
Checks to see if name is a context suffix. |
javax.naming.directory.Attributes |
lookup(javax.naming.Name name)
This method calls ContextPartition.lookup(Name, String[])
with null attributeIds by default. |
void |
modify(javax.naming.Name name,
int modOp,
javax.naming.directory.Attributes mods)
This method forwards the request to ContextPartition.modify(Name, ModificationItem[]) after
translating parameters to ModificationItem [] by default. |
void |
move(javax.naming.Name oldName,
javax.naming.Name newParentName)
This method throws OperationNotSupportedException by default. |
void |
move(javax.naming.Name oldName,
javax.naming.Name newParentName,
java.lang.String newRn,
boolean deleteOldRn)
This method calls ContextPartition.move(Name, Name) and
ContextPartition.modifyRn(Name, 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.ldap.server.partition.ContextPartition |
add, delete, list, lookup, modify, modifyRn, search |
Constructor Detail |
protected AbstractContextPartition()
Method Detail |
public final void init(ContextFactoryConfiguration factoryCfg, ContextPartitionConfiguration 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 ContextPartition
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 ContextPartition
protected void doDestroy()
public final boolean isInitialized()
isInitialized
in interface ContextPartition
public final ContextFactoryConfiguration getFactoryConfiguration()
ContextFactoryConfiguration
that is provided from
init(ContextFactoryConfiguration, ContextPartitionConfiguration)
.
public final ContextPartitionConfiguration getConfiguration()
ContextPartitionConfiguration
that is provided from
init(ContextFactoryConfiguration, ContextPartitionConfiguration)
.
public final javax.naming.Name getSuffix(boolean normalized) throws javax.naming.NamingException
ContextPartition
getSuffix
in interface ContextPartition
normalized
- boolean value used to control the normalization of the
returned Name. If true the normalized Name is returned, otherwise the
original user provided Name without normalization is returned.
javax.naming.NamingException
public final boolean isSuffix(javax.naming.Name name) throws javax.naming.NamingException
ContextPartition
isSuffix
in interface ContextPartition
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 ContextPartition
javax.naming.NamingException
public boolean hasEntry(javax.naming.Name name) throws javax.naming.NamingException
lookup(Name)
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 ContextPartition
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(javax.naming.Name name) throws javax.naming.NamingException
ContextPartition.lookup(Name, String[])
with null attributeIds by default. Please override
this method if there is more effective way for your implementation.
lookup
in interface ContextPartition
name
- the normalized distinguished name of the object to lookup
javax.naming.NamingException
- if there are any problemspublic void modify(javax.naming.Name name, int modOp, javax.naming.directory.Attributes mods) throws javax.naming.NamingException
ContextPartition.modify(Name, ModificationItem[])
after
translating parameters to ModificationItem
[] by default.
Please override this method if there is more effactive way for your
implementation.
modify
in interface ContextPartition
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(javax.naming.Name oldName, javax.naming.Name newParentName, java.lang.String newRn, boolean deleteOldRn) throws javax.naming.NamingException
ContextPartition.move(Name, Name)
and
ContextPartition.modifyRn(Name, String, boolean)
subsequently
by default. Please override this method if there is more effactive
way for your implementation.
move
in interface ContextPartition
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(javax.naming.Name oldName, javax.naming.Name newParentName) throws javax.naming.NamingException
OperationNotSupportedException
by default.
Please override this method to implement move operation.
move
in interface ContextPartition
newParentName
- the normalized distinguished/absolute name of the
new parent to move the target entry tooldName
- the normalized distinguished/absolute name of the
original child name representing the child entry to move
javax.naming.NamingException
- if there are any problems
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |