org.constretto.internal.store.ldap
Class LdapConfigurationStoreBuilder

java.lang.Object
  extended by org.constretto.internal.store.ldap.LdapConfigurationStoreBuilder

public class LdapConfigurationStoreBuilder
extends Object

Builder used to build an LdapConfigurationStore by reading LDAP entries from an DirContext

Author:
Sondre Eikanger Kvalø
See Also:
LdapConfigurationStore

Field Summary
static String NULL_ARGUMENT
           
 
Method Summary
 LdapConfigurationStoreBuilder addDsn(String distinguishedName, String... tags)
          Add the given LDAP entry identified the DSN (distinguishedName).
 LdapConfigurationStoreBuilder addDsnWithKey(String key, String distinguishedName, String... tags)
          Add the given LDAP entry identified the DSN (distinguishedName).
 LdapConfigurationStoreBuilder addUsingSearch(String searchBase, String filter, String keyAttribute, String... tags)
          Used to do an search in the Ldap and may thus return multiple entries that will be made available as configuration entries
 LdapConfigurationStore done()
           
static LdapConfigurationStoreBuilder usingDirContext(DirContext dirContext)
          Creates the LdapConfigurationStoreBuilder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_ARGUMENT

public static final String NULL_ARGUMENT
See Also:
Constant Field Values
Method Detail

usingDirContext

public static LdapConfigurationStoreBuilder usingDirContext(DirContext dirContext)
Creates the LdapConfigurationStoreBuilder

Parameters:
dirContext - the Ldap context to be used for reading configuration entries. This class will never ever close or change the DirContext instance provided to it
Returns:
a LdapConfigurationStoreBuilder to be used for fluently defining the LDAP entries to read

addDsnWithKey

public LdapConfigurationStoreBuilder addDsnWithKey(String key,
                                                   String distinguishedName,
                                                   String... tags)
Add the given LDAP entry identified the DSN (distinguishedName).

Parameters:
key - an prefix that will be applied as an prefix for all settings from the LDAP entry
distinguishedName - the DSN of the LDAP entry
tags - the Constretto tags the entry should be valid for
Returns:

addDsn

public LdapConfigurationStoreBuilder addDsn(String distinguishedName,
                                            String... tags)
Add the given LDAP entry identified the DSN (distinguishedName).

Parameters:
distinguishedName - the DSN of the LDAP entry
tags - the Constretto tags the entry should be valid for
Returns:

addUsingSearch

public LdapConfigurationStoreBuilder addUsingSearch(String searchBase,
                                                    String filter,
                                                    String keyAttribute,
                                                    String... tags)
Used to do an search in the Ldap and may thus return multiple entries that will be made available as configuration entries

Parameters:
searchBase - a valid LDAP id to search from (ex.: "dc=constretto,dc=org")
filter - a LDAP filter to be applied to the matching entries (ex.: "(&(cn=John*)(objectClass=inetOrgPerson))")
keyAttribute - name of an attribute that will be used to prefix the configuration settings (ex.: "uid")
tags - the tags the returned settings will be made available for in the ConstrettoConfiguration
Returns:

done

public LdapConfigurationStore done()


Copyright © 2008-2013. All Rights Reserved.