toolbox.services.ldap
Class LDAPService

Package class diagram package LDAPService
java.lang.Object
  extended by toolbox.services.BaseService
      extended by toolbox.services.ldap.LDAPService
All Implemented Interfaces:
Service
Direct Known Subclasses:
LDAPUserInfoService, SimpleGroupServiceImpl, SimpleUserServiceImpl

public class LDAPService
extends BaseService

Convenience service implementation that can be used to develop services that require interaction with a LDAP Directory using the toolbox.ldap package.


Constructor Summary
protected LDAPService()
          Default constructor.
 
Method Summary
 void create(java.lang.String name, java.lang.String confHome, ServiceEnvironment env, XMLProperties xmlProps)
          Create the service by obtaining a reference to the LDAPWorker using the provided environment.
 void destroy()
          Destroy this service by nulling the worker.
protected  LDAPWorker getLDAPWorker()
          Returns the LDAPWorker for this service.
protected  java.util.List search(java.lang.String entry, java.lang.String filter, java.lang.String context, java.lang.String[] attrs, java.lang.String[] params)
          Perform a subtree directory search using the given parameters.
protected  java.util.List search(java.lang.String entry, java.lang.String filter, java.lang.String context, java.lang.String[] attrs, java.lang.String[] params, java.lang.String sortAttr, java.lang.String sortOrder)
          Perform a subtree directory search using the given parameters and sort the results as specified.
 
Methods inherited from class toolbox.services.BaseService
getConfigHome, getName, getProperties, getProperty, getXMLProperties, logConfig, logFine, logFiner, logFinest, logInfo, logSevere, logWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LDAPService

protected LDAPService()
Default constructor.

Method Detail

create

public void create(java.lang.String name,
                   java.lang.String confHome,
                   ServiceEnvironment env,
                   XMLProperties xmlProps)
            throws ServiceException
Create the service by obtaining a reference to the LDAPWorker using the provided environment.

Specified by:
create in interface Service
Overrides:
create in class BaseService
Parameters:
name - The name of this service.
confHome - The path to the configuration home directory.
env - The service environment for this service.
xmlProps - XML configuration properties.
Throws:
ServiceException - if this service cannot be created.

getLDAPWorker

protected LDAPWorker getLDAPWorker()
Returns the LDAPWorker for this service.

Returns:
LDAPWorker instance.

search

protected java.util.List search(java.lang.String entry,
                                java.lang.String filter,
                                java.lang.String context,
                                java.lang.String[] attrs,
                                java.lang.String[] params)
                         throws ServiceException
Perform a subtree directory search using the given parameters.

Parameters:
entry - String containing the entry type to search for.
filter - String containing a filter template.
context - String containing the name of a configured context to search in.
attrs - String array containing the names of the entries to return.
params - The filter parameters.
Returns:
List containing search results.
Throws:
ServiceException - if the search cannot be performed.

search

protected java.util.List search(java.lang.String entry,
                                java.lang.String filter,
                                java.lang.String context,
                                java.lang.String[] attrs,
                                java.lang.String[] params,
                                java.lang.String sortAttr,
                                java.lang.String sortOrder)
                         throws ServiceException
Perform a subtree directory search using the given parameters and sort the results as specified.

Parameters:
entry - String containing the entry type to search for.
filter - String containing a filter template.
context - String containing the name of a configured context to search in.
attrs - String array containing the names of the entries to return.
params - The filter parameters.
sortAttr - String containing the name of the attribute to sort on. Must be one of the attributes in the attrs param.
sortOrder - String indicating the sort order, asc or desc.
Returns:
List containing search results sorted as specified.
Throws:
ServiceException - if the search cannot be performed.

destroy

public void destroy()
Destroy this service by nulling the worker.

Specified by:
destroy in interface Service
Overrides:
destroy in class BaseService