|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object toolbox.ldap.LDAPWorkerImpl
public class LDAPWorkerImpl
Default LDAPWorker implementation.
Constructor Summary | |
---|---|
LDAPWorkerImpl()
Default constructor |
Method Summary | |
---|---|
java.lang.String |
add(java.lang.String entry,
java.lang.String context,
java.util.Map attrs)
Add an entry to the LDAP directory. |
java.lang.String |
getContextValue(java.lang.String mapping)
Return context value for the given context mapping. |
EntryDefinition |
getEntryDefinition(java.lang.String mapping)
Return EntryDefinition for the given entry mapping. |
java.lang.String |
getRootContext()
Return the root context of this worker. |
void |
init(java.util.Map entries,
java.util.Map contexts,
LDAPManager mngr)
Initialise this worker with the supported Map of LDAP entry definitions and contexts. |
java.util.Map |
lookup(java.lang.String entry,
java.lang.String context,
java.lang.String bindName,
java.lang.String[] attrs)
Return a single entry from the LDAP directory. |
void |
modify(java.lang.String entry,
java.lang.String context,
java.lang.String bindName,
int modType,
java.util.Map attrs)
Modify the attributes of the entry with given bind attribute value. |
void |
remove(java.lang.String entry,
java.lang.String context,
java.lang.String bindName)
Remove an entry from the LDAP directory. |
java.util.List |
search(java.lang.String entry,
java.lang.String filter,
java.lang.String context,
int scope,
java.lang.String[] attrs)
Search for entries in the LDAP directory. |
java.util.List |
search(java.lang.String entry,
java.lang.String filter,
java.lang.String context,
int scope,
java.lang.String[] attrs,
java.lang.String sortAttr,
java.lang.String sortOrder)
Search for entries in the LDAP directory and sort the results as specified. |
void |
update(java.lang.String entry,
java.lang.String context,
java.util.Map attrs)
Update an existing entry in the LDAP directory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LDAPWorkerImpl()
Method Detail |
---|
public void init(java.util.Map entries, java.util.Map contexts, LDAPManager mngr)
init
in interface LDAPWorker
entries
- Map instance containing the supported LDAP entry
definitions.contexts
- Map containing the supported context's.mngr
- LDAPManager instance that created this worker.public java.lang.String add(java.lang.String entry, java.lang.String context, java.util.Map attrs) throws LDAPException
add
in interface LDAPWorker
entry
- String indicating the configured entry type.context
- String indicating the configured context where the
the attributes should be added to the directory.attrs
- Map containing attributes. The keys will be used as
attributes names. Multi-valued attributes must contain
a Set instance with the attribute values.
LDAPException
- if the attributes cannot be added to the directory.public void update(java.lang.String entry, java.lang.String context, java.util.Map attrs) throws LDAPException
update
in interface LDAPWorker
entry
- String indicating the configured entry type.context
- String indicating the configured context where the
the attributes should be added to the directory.attrs
- Map containing attributes. The keys will be used as
attributes names. Multi-valued attributes must contain
a Set instance with the attribute values.
LDAPException
- if the attributes cannot be updated in the directory.public void remove(java.lang.String entry, java.lang.String context, java.lang.String bindName) throws LDAPException
remove
in interface LDAPWorker
entry
- String indicating the entry type to remove.context
- String containing the name of a configured context where
the entry is located.bindName
- String containing the value of the bind attribute.
LDAPException
- if the entry cannot be removed from the given
context.public void modify(java.lang.String entry, java.lang.String context, java.lang.String bindName, int modType, java.util.Map attrs) throws LDAPException
modify
in interface LDAPWorker
entry
- String indicating the entry type.context
- String containing the name of configured context where
the entry is located.bindName
- String containing the value of the bind attribute.modType
- Primitive int indication the modification operation type.attrs
- Map containing the attributes that must be modified.
LDAPException
- if the attributes cannot be modified.public java.util.Map lookup(java.lang.String entry, java.lang.String context, java.lang.String bindName, java.lang.String[] attrs) throws LDAPException
lookup
in interface LDAPWorker
entry
- String indicating the entry type.context
- String indicating the name of the configured context
to look in.bindName
- String containing the value of the bind attribute.attrs
- String array containing the names of the attributes
that must be returned.
LDAPException
- if the attributes cannot be returned.public java.util.List search(java.lang.String entry, java.lang.String filter, java.lang.String context, int scope, java.lang.String[] attrs) throws LDAPException
search
in interface LDAPWorker
entry
- String containing entry type that we are searching for.filter
- String containing a valid LDAP filter.context
- String containing the name of one of the configured
contexts. May be null.scope
- Primitive int indicating the search scope.attrs
- String array containing the names of the attributes
that must be returned by the search.
LDAPException
- if the search cannot be performed.public java.util.List search(java.lang.String entry, java.lang.String filter, java.lang.String context, int scope, java.lang.String[] attrs, java.lang.String sortAttr, java.lang.String sortOrder) throws LDAPException
search
in interface LDAPWorker
entry
- String containing entry type that we are searching for.filter
- String containing a valid LDAP filter.context
- String containing the name of one of the configured
contexts. May be null.scope
- Primitive int indicating the search scope.attrs
- String array containing the names of the attributes
that must be returned by the search.sortAttr
- String containing the name of the attribute that must
be sorted on.sortOrder
- String indicating the sort order. Specify "asc" for
ascending order and "desc" for descending order.
LDAPException
- if the search cannot be performed.public java.lang.String getContextValue(java.lang.String mapping)
getContextValue
in interface LDAPWorker
mapping
- String containing the context mapping.
public EntryDefinition getEntryDefinition(java.lang.String mapping)
getEntryDefinition
in interface LDAPWorker
mapping
- String containing the entry mapping.
public java.lang.String getRootContext() throws LDAPException
getRootContext
in interface LDAPWorker
LDAPException
- if the context cannot be returned.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |