gldapo
Class GldapoDirectory

java.lang.Object
  extended by gldapo.GldapoDirectory
All Implemented Interfaces:
SearchProvider

public class GldapoDirectory
extends Object
implements SearchProvider


Constructor Summary
GldapoDirectory(String name, Map config)
          Creates a new instance via a config map.
 
Method Summary
 void createEntry(DistinguishedName dn, Attributes attributes)
           
 void deleteEntry(DistinguishedName dn)
           
 void deleteEntryRecursively(DistinguishedName dn)
           
 DistinguishedName getBase()
          Returns the base DN for operations for this directory
static Object getCONFIG_SEARCH_CONTROLS_KEY()
           
static Object getCONTEXT_SOURCE_PROPS()
           
 MetaClass getMetaClass()
           
 String getName()
           
 Object getProperty(String name)
           
 SearchControlProvider getSearchControls()
           
 Object getSubContextSource(DistinguishedName brdn)
           
 Object getTemplate()
           
 Object invokeMethod(String name, Object args)
           
 void moveEntry(DistinguishedName olddn, DistinguishedName newdn)
           
 void replaceEntry(DistinguishedName dn, Attributes attributes)
           
 List search(Object schemaRegistration, DistinguishedName base, String filter, SearchControlProvider controls)
          Performs a search operation on the directory.
 void setMetaClass(MetaClass metaClass)
           
 void setName(String value)
           
 void setProperty(String name, Object value)
           
 void setSearchControls(SearchControlProvider value)
           
 void setTemplate(Object value)
           
 void updateEntry(DistinguishedName dn, List modificationItems)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GldapoDirectory

public GldapoDirectory(String name,
                       Map config)
Creates a new instance via a config map.

The config map contains the attributes for the underlying LdapContextSource (see CONTEXT_SOURCE_PROPS). The only mandatory attribute is url (or urls). The rest are optional.

The config map can also contain a map under the key env which will be used as the environment properties for the connection (e.g java.naming.ldap.attributes.binary)

It can also contain a map under the key denoted by CONFIG_SEARCH_CONTROLS_KEY that is used to construct an instance of SearchControls using the SearchControls.SearchControls(Map) constructor. If it is omitted, a search controls object with default values is used.

Method Detail

getCONFIG_SEARCH_CONTROLS_KEY

public static final Object getCONFIG_SEARCH_CONTROLS_KEY()

getCONTEXT_SOURCE_PROPS

public static final Object getCONTEXT_SOURCE_PROPS()

getSearchControls

public SearchControlProvider getSearchControls()
Specified by:
getSearchControls in interface SearchProvider

setSearchControls

public void setSearchControls(SearchControlProvider value)

getName

public String getName()

setName

public void setName(String value)

getTemplate

public Object getTemplate()

setTemplate

public void setTemplate(Object value)

getBase

public DistinguishedName getBase()
Returns the base DN for operations for this directory

Specified by:
getBase in interface SearchProvider

search

public List search(Object schemaRegistration,
                   DistinguishedName base,
                   String filter,
                   SearchControlProvider controls)
            throws NamingException
Performs a search operation on the directory.

If the search control provider contains a pageSize that is greater than 1 pagedSearch() is used, otherwise nonPagedSearch() is used.

An instance of SearchControls is made out of the gldapo search controls (controls) to be used by the LdapTemplate instance which does the actual searching.

Specified by:
search in interface SearchProvider
Parameters:
schemaRegistration - Provides the metadata about the target class in order to make objects (must be instance of GldapoSchemaRegistration)
base - The base of the search operation, relative to the base of the directory
filter - The LDAP filter string to use to restrict the search
controls - Provides several settings that augment the search
Returns:
A list of objects of the class that the schemaRegistration is for
Throws:
NamingException - If any LDAP related error occurs

createEntry

public void createEntry(DistinguishedName dn,
                        Attributes attributes)

updateEntry

public void updateEntry(DistinguishedName dn,
                        List modificationItems)

moveEntry

public void moveEntry(DistinguishedName olddn,
                      DistinguishedName newdn)

replaceEntry

public void replaceEntry(DistinguishedName dn,
                         Attributes attributes)

deleteEntry

public void deleteEntry(DistinguishedName dn)

deleteEntryRecursively

public void deleteEntryRecursively(DistinguishedName dn)

getSubContextSource

public Object getSubContextSource(DistinguishedName brdn)

getMetaClass

public MetaClass getMetaClass()

setMetaClass

public void setMetaClass(MetaClass metaClass)

invokeMethod

public Object invokeMethod(String name,
                           Object args)

getProperty

public Object getProperty(String name)

setProperty

public void setProperty(String name,
                        Object value)


Copyright © 2007-2010 Codehaus. All Rights Reserved.