edu.vt.middleware.ldap
Class LdapConfig

java.lang.Object
  extended by edu.vt.middleware.ldap.props.AbstractPropertyConfig
      extended by edu.vt.middleware.ldap.LdapConfig
All Implemented Interfaces:
PropertyConfig
Direct Known Subclasses:
AuthenticatorConfig

public class LdapConfig
extends AbstractPropertyConfig

LdapConfig contains all the configuration data that the Ldap needs to control connections and searching.

Version:
$Revision: 1786 $ $Date: 2011-01-05 09:45:07 -0500 (Wed, 05 Jan 2011) $
Author:
Middleware Services

Nested Class Summary
static class LdapConfig.SearchScope
          Enum to define the type of search scope.
 
Field Summary
static String PROPERTIES_DOMAIN
          Domain to look for ldap properties in, value is "edu.vt.middleware.ldap.".
 
Fields inherited from class edu.vt.middleware.ldap.props.AbstractPropertyConfig
logger
 
Constructor Summary
LdapConfig()
          Default constructor.
LdapConfig(String ldapUrl)
          This will create a new LdapConfig with the supplied ldap url.
LdapConfig(String ldapUrl, String baseDn)
          This will create a new LdapConfig with the supplied ldap url and base Strings.
 
Method Summary
static LdapConfig createFromProperties(InputStream is)
          Create an instance of this class initialized with properties from the input stream.
 boolean getAuthoritative()
          See isAuthoritative().
 String getAuthtype()
          This returns the security level for the LdapConfig.
 String getBase()
          Deprecated. use getBaseDn() instead
 String getBaseDn()
          This returns the base dn for the LdapConfig.
 int getBatchSize()
          This returns the batch size for the LdapConfig.
 String getBinaryAttributes()
          This returns additional binary attributes for the LdapConfig.
 Object getBindCredential()
          This returns the credential used with the bind DN.
 String getBindDn()
          This returns the bind DN.
static SearchControls getCompareSearchControls()
          This returns a SearchControls object configured to perform a LDAP compare operation.
 ConnectionHandler getConnectionHandler()
          This returns the connection handler of the LdapConfig.
 String getContextFactory()
          This returns the context factory of the LdapConfig.
 long getCountLimit()
          This returns the count limit for the LdapConfig.
 String getDerefAliases()
          This returns the alias setting for the LdapConfig.
 boolean getDerefLinkFlag()
          This returns the derefLinkFlag for the LdapConfig.
 String getDnsUrl()
          This returns the dns url for the LdapConfig.
 Hashtable<String,?> getEnvironment()
          This returns the Context environment properties that are used to make LDAP connections.
 Map<String,Object> getEnvironmentProperties()
          This returns any environment properties that may have been set for the LdapConfig using setEnvironmentProperties(String,String) that do not represent properties of this config.
 Class<?>[] getHandlerIgnoreExceptions()
          This returns the exception types to ignore when handling results.
 String getHost()
          Deprecated. use getLdapUrl() instead
 HostnameVerifier getHostnameVerifier()
          This returns the hostname verifier of the LdapConfig.
 String getLanguage()
          This returns the preferred language for the LdapConfig.
 String getLdapUrl()
          This returns the ldap url of the LdapConfig.
 boolean getLogCredentials()
          This returns whether authentication credentials will be logged.
 int getOperationRetry()
          This returns the number of times ldap operations will be retried if a communication exception occurs.
 int getOperationRetryBackoff()
          This returns the factor by which to multiply the operation retry wait time.
 Class<?>[] getOperationRetryExceptions()
          This returns the exception types to retry operations on.
 long getOperationRetryWait()
          This returns the operation retry wait time for the LdapConfig.
 int getPagedResultsSize()
          This returns the paged results size for the LdapConfig.
 String getPort()
          Deprecated. use getLdapUrl() instead
 String getPropertiesDomain()
          This returns the properties domain for this property config.
 String getReferral()
          This returns the referral setting for the LdapConfig.
 boolean getReturningObjFlag()
          This returns the returningObjFlag for the LdapConfig.
 String getSaslAuthorizationId()
          This returns ths SASL authorization id for the LdapConfig.
 String getSaslRealm()
          This returns ths SASL realm for the LdapConfig.
 SearchControls getSearchControls(String[] retAttrs)
          This returns a SearchControls object configured with this LdapConfig.
 SearchResultHandler[] getSearchResultHandlers()
          This returns the handlers to use for processing search results.
 LdapConfig.SearchScope getSearchScope()
          This returns the search scope for the LdapConfig.
 Object getServiceCredential()
          Deprecated. use getBindCredential() instead
 String getServiceUser()
          Deprecated. use getBindDn() instead
 boolean getSsl()
          See isSslEnabled().
 SSLSocketFactory getSslSocketFactory()
          This returns the SSL socket factory of the LdapConfig.
 int getTimeLimit()
          This returns the time limit for the LdapConfig.
 int getTimeout()
          This returns the timeout for the LdapConfig.
 boolean getTls()
          See isTlsEnabled().
 boolean getTypesOnly()
          See isTypesOnly().
 boolean hasEnvironmentProperty(String name)
          This returns whether the supplied property exists.
 boolean isAnonymousAuth()
          This returns whether the security authentication context is set to 'none'.
 boolean isAuthoritative()
          This returns whether the LdapConfig is set to require a authoritative source.
 boolean isCramMD5Auth()
          This returns whether the security authentication context is set to 'CRAM-MD5'.
 boolean isDigestMD5Auth()
          This returns whether the security authentication context is set to 'DIGEST-MD5'.
 boolean isExternalAuth()
          This returns whether the security authentication context is set to 'EXTERNAL'.
 boolean isGSSAPIAuth()
          This returns whether the security authentication context is set to 'GSSAPI'.
 boolean isObjectSearchScope()
          This returns whether the search scope is set to object.
 boolean isOneLevelSearchScope()
          This returns whether the search scope is set to one level.
 boolean isSaslAuth()
          This returns whether the security authentication context will perform a SASL bind as defined by the supported SASL mechanisms.
 boolean isSimpleAuth()
          This returns whether the security authentication context is set to 'simple'.
 boolean isSslEnabled()
          This returns whether the LdapConfig is using the SSL protocol for connections.
 boolean isStrongAuth()
          This returns whether the security authentication context is set to 'strong'.
 boolean isSubTreeSearchScope()
          This returns whether the search scope is set to sub tree.
 boolean isTlsEnabled()
          This returns whether the LdapConfig is using the TLS protocol for connections.
 boolean isTypesOnly()
          This returns whether the LdapConfig is set to only return attribute types.
 void setAuthoritative(boolean authoritative)
          This specifies whether or not to force this LdapConfig to require an authoritative source.
 void setAuthtype(String authtype)
          This sets the security level for the LdapConfig.
 void setBase(String base)
          Deprecated. use setBaseDn(String)
 void setBaseDn(String baseDn)
          This sets the base dn for the LdapConfig.
 void setBatchSize(int batchSize)
          This sets the batch size for the LdapConfig.
 void setBinaryAttributes(String binaryAttributes)
          This specifies additional attributes that should be considered binary.
 void setBindCredential(Object credential)
          This sets the credential of the bind DN.
 void setBindDn(String dn)
          This sets the bind DN to authenticate as before performing operations.
 void setConnectionHandler(ConnectionHandler connectionHandler)
          This sets the connection handler of the LdapConfig.
 void setContextFactory(String contextFactory)
          This sets the context factory of the LdapConfig.
 void setCountLimit(long countLimit)
          This sets the maximum number of entries that search operations will return.
 void setDerefAliases(String derefAliases)
          This specifies how the LdapConfig should handle aliases.
 void setDerefLinkFlag(boolean derefLinkFlag)
          This specifies whether or not to force this LdapConfig to link dereferencing during searches.
 void setDnsUrl(String dnsUrl)
          This sets the dns url for the LdapConfig.
 void setEnvironmentProperties(String name, String value)
          This adds environment properties to this object. If name or value is null, then this method does nothing.
 void setHandlerIgnoreExceptions(Class<?>[] exceptions)
          This sets the exception types to ignore when handling results.
 void setHost(String host)
          Deprecated. use setLdapUrl(String) instead
 void setHostnameVerifier(HostnameVerifier hostnameVerifier)
          This sets the hostname verifier of the LdapConfig.
 void setLanguage(String language)
          This sets the preferred language for the LdapConfig.
 void setLdapUrl(String ldapUrl)
          This sets the ldap url of the LdapConfig.
 void setLogCredentials(boolean log)
          This sets whether authentication credentials will be logged.
 void setOperationRetry(int operationRetry)
          This sets the number of times that ldap operations will be retried if a communication exception occurs.
 void setOperationRetryBackoff(int backoff)
          This sets the factor by which to multiply the operation retry wait time.
 void setOperationRetryExceptions(Class<?>[] exceptions)
          This sets the exception types to retry operations on.
 void setOperationRetryWait(long wait)
          This sets the amount of time in milliseconds that operations should wait before retrying.
 void setPagedResultsSize(int pageSize)
          This sets the results size to use when the PagedResultsControl is invoked.
 void setPort(String port)
          Deprecated. use setLdapUrl(String) instead
 void setReferral(String referral)
          This specifies how the LdapConfig should handle referrals.
 void setReturningObjFlag(boolean returningObjFlag)
          This specifies whether or not to force this LdapConfig to return objects for searches.
 void setSaslAuthorizationId(String saslAuthorizationId)
          This specifies a SASL authorization id.
 void setSaslRealm(String saslRealm)
          This specifies a SASL realm.
 void setSearchResultHandlers(SearchResultHandler[] handlers)
          This sets the handlers for processing search results.
 void setSearchScope(LdapConfig.SearchScope searchScope)
          This sets the search scope for the LdapConfig.
 void setService(String user, Object credential)
          Deprecated. use setBindDn(String) and setBindCredential(Object) instead
 void setServiceCredential(Object credential)
          Deprecated. use setBindCredential(Object) instead
 void setServiceUser(String user)
          Deprecated. use setBindDn(String) instead
 void setSsl(boolean ssl)
          This sets this LdapConfig to use the SSL protocol for connections.
 void setSslSocketFactory(SSLSocketFactory sslSocketFactory)
          This sets the SSL socket factory of the LdapConfig.
 void setTimeLimit(int timeLimit)
          This sets the maximum amount of time in milliseconds that search operations will block.
 void setTimeout(int timeout)
          This sets the maximum amount of time in milliseconds that connect operations will block.
 void setTls(boolean tls)
          This sets this LdapConfig to use the TLS protocol for connections.
 void setTracePackets(PrintStream stream)
          This sets this LdapConfig to print ASN.1 BER packets to the supplied PrintStream.
 void setTypesOnly(boolean typesOnly)
          This specifies whether or not to force this LdapConfig to return only attribute types.
 String toString()
          Provides a descriptive string representation of this instance.
 boolean useHostnameVerifier()
          This returns whether the LdapConfig is using a custom hostname verifier.
 boolean useSslSocketFactory()
          This returns whether the LdapConfig is using a custom SSL socket factory.
 
Methods inherited from class edu.vt.middleware.ldap.props.AbstractPropertyConfig
checkImmutable, checkStringInput, makeImmutable, setEnvironmentProperties, setEnvironmentProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTIES_DOMAIN

public static final String PROPERTIES_DOMAIN
Domain to look for ldap properties in, value is "edu.vt.middleware.ldap.".

See Also:
Constant Field Values
Constructor Detail

LdapConfig

public LdapConfig()
Default constructor.


LdapConfig

public LdapConfig(String ldapUrl)
This will create a new LdapConfig with the supplied ldap url.

Parameters:
ldapUrl - String LDAP URL

LdapConfig

public LdapConfig(String ldapUrl,
                  String baseDn)
This will create a new LdapConfig with the supplied ldap url and base Strings.

Parameters:
ldapUrl - String LDAP URL
baseDn - String LDAP base DN
Method Detail

getEnvironment

public Hashtable<String,?> getEnvironment()
This returns the Context environment properties that are used to make LDAP connections.

Returns:
Hashtable - context environment

getContextFactory

public String getContextFactory()
This returns the context factory of the LdapConfig.

Returns:
String - context factory

getConnectionHandler

public ConnectionHandler getConnectionHandler()
This returns the connection handler of the LdapConfig.

Returns:
ConnectionHandler - connection handler

getSslSocketFactory

public SSLSocketFactory getSslSocketFactory()
This returns the SSL socket factory of the LdapConfig.

Returns:
SSLSocketFactory - SSL socket factory

useSslSocketFactory

public boolean useSslSocketFactory()
This returns whether the LdapConfig is using a custom SSL socket factory.

Returns:
boolean

getHostnameVerifier

public HostnameVerifier getHostnameVerifier()
This returns the hostname verifier of the LdapConfig.

Returns:
HostnameVerifier - hostname verifier

useHostnameVerifier

public boolean useHostnameVerifier()
This returns whether the LdapConfig is using a custom hostname verifier.

Returns:
boolean

getLdapUrl

public String getLdapUrl()
This returns the ldap url of the LdapConfig.

Returns:
String - ldap url

getHost

@Deprecated
public String getHost()
Deprecated. use getLdapUrl() instead

This returns the hostname of the LdapConfig.

Returns:
String - hostname

getPort

@Deprecated
public String getPort()
Deprecated. use getLdapUrl() instead

This returns the port of the LdapConfig.

Returns:
String - port

getTimeout

public int getTimeout()
This returns the timeout for the LdapConfig. If this value is 0, then connect operations will wait indefinitely.

Returns:
int - timeout

getBindDn

public String getBindDn()
This returns the bind DN.

Returns:
String - DN to bind as

getServiceUser

@Deprecated
public String getServiceUser()
Deprecated. use getBindDn() instead

This returns the username of the service user.

Returns:
String - username

getBindCredential

public Object getBindCredential()
This returns the credential used with the bind DN.

Returns:
Object - bind DN credential

getServiceCredential

@Deprecated
public Object getServiceCredential()
Deprecated. use getBindCredential() instead

This returns the credential of the service user.

Returns:
Object - credential

getBase

public String getBase()
Deprecated. use getBaseDn() instead

This returns the base dn for the LdapConfig.

Returns:
String - base dn

getBaseDn

public String getBaseDn()
This returns the base dn for the LdapConfig.

Returns:
String - base dn

getSearchScope

public LdapConfig.SearchScope getSearchScope()
This returns the search scope for the LdapConfig.

Returns:
SearchScope - search scope

isObjectSearchScope

public boolean isObjectSearchScope()
This returns whether the search scope is set to object.

Returns:
boolean

isOneLevelSearchScope

public boolean isOneLevelSearchScope()
This returns whether the search scope is set to one level.

Returns:
boolean

isSubTreeSearchScope

public boolean isSubTreeSearchScope()
This returns whether the search scope is set to sub tree.

Returns:
boolean

getAuthtype

public String getAuthtype()
This returns the security level for the LdapConfig.

Returns:
String - security level

isAnonymousAuth

public boolean isAnonymousAuth()
This returns whether the security authentication context is set to 'none'.

Returns:
boolean

isSimpleAuth

public boolean isSimpleAuth()
This returns whether the security authentication context is set to 'simple'.

Returns:
boolean

isStrongAuth

public boolean isStrongAuth()
This returns whether the security authentication context is set to 'strong'.

Returns:
boolean

isSaslAuth

public boolean isSaslAuth()
This returns whether the security authentication context will perform a SASL bind as defined by the supported SASL mechanisms.

Returns:
boolean

isExternalAuth

public boolean isExternalAuth()
This returns whether the security authentication context is set to 'EXTERNAL'.

Returns:
boolean

isDigestMD5Auth

public boolean isDigestMD5Auth()
This returns whether the security authentication context is set to 'DIGEST-MD5'.

Returns:
boolean

isCramMD5Auth

public boolean isCramMD5Auth()
This returns whether the security authentication context is set to 'CRAM-MD5'.

Returns:
boolean

isGSSAPIAuth

public boolean isGSSAPIAuth()
This returns whether the security authentication context is set to 'GSSAPI'.

Returns:
boolean

getAuthoritative

public boolean getAuthoritative()
See isAuthoritative().

Returns:
boolean

isAuthoritative

public boolean isAuthoritative()
This returns whether the LdapConfig is set to require a authoritative source.

Returns:
boolean

getTimeLimit

public int getTimeLimit()
This returns the time limit for the LdapConfig. If this value is 0, then search operations will wait indefinitely for an answer.

Returns:
int - time limit

getCountLimit

public long getCountLimit()
This returns the count limit for the LdapConfig. If this value is 0, then search operations will return all the results it finds.

Returns:
long - count limit

getPagedResultsSize

public int getPagedResultsSize()
This returns the paged results size for the LdapConfig. This value is used whenever the PagedResultsControl in invoked.

Returns:
int - page size

getOperationRetry

public int getOperationRetry()
This returns the number of times ldap operations will be retried if a communication exception occurs. If this value is 0, no retries will occur.

Returns:
int - retry count

getOperationRetryExceptions

public Class<?>[] getOperationRetryExceptions()
This returns the exception types to retry operations on.

Returns:
Class[]

getOperationRetryWait

public long getOperationRetryWait()
This returns the operation retry wait time for the LdapConfig.

Returns:
int - time limit

getOperationRetryBackoff

public int getOperationRetryBackoff()
This returns the factor by which to multiply the operation retry wait time. This allows clients to progressively delay each retry. The formula for backoff is (wait * backoff * attempt). So a wait time of 2s with a backoff of 3 will delay by 6s, then 12s, then 18s, and so forth.

Returns:
int - backoff factor

getDerefLinkFlag

public boolean getDerefLinkFlag()
This returns the derefLinkFlag for the LdapConfig.

Returns:
boolean

getReturningObjFlag

public boolean getReturningObjFlag()
This returns the returningObjFlag for the LdapConfig.

Returns:
boolean

getBatchSize

public int getBatchSize()
This returns the batch size for the LdapConfig. If this value is -1, then the default provider setting is being used.

Returns:
int - batch size

getDnsUrl

public String getDnsUrl()
This returns the dns url for the LdapConfig. If this value is null, then this property is not being used.

Returns:
String - dns url

getLanguage

public String getLanguage()
This returns the preferred language for the LdapConfig. If this value is null, then the default provider setting is being used.

Returns:
String - language

getReferral

public String getReferral()
This returns the referral setting for the LdapConfig. If this value is null, then the default provider setting is being used.

Returns:
String - referral

getDerefAliases

public String getDerefAliases()
This returns the alias setting for the LdapConfig. If this value is null, then the default provider setting is being used.

Returns:
String - alias

getBinaryAttributes

public String getBinaryAttributes()
This returns additional binary attributes for the LdapConfig. If this value is null, then the default provider setting is being used.

Returns:
String - binary attributes

getSearchResultHandlers

public SearchResultHandler[] getSearchResultHandlers()
This returns the handlers to use for processing search results.

Returns:
SearchResultHandler[]

getHandlerIgnoreExceptions

public Class<?>[] getHandlerIgnoreExceptions()
This returns the exception types to ignore when handling results.

Returns:
Class[]

getSaslAuthorizationId

public String getSaslAuthorizationId()
This returns ths SASL authorization id for the LdapConfig.

Returns:
String - authorization id

getSaslRealm

public String getSaslRealm()
This returns ths SASL realm for the LdapConfig.

Returns:
String - realm

getTypesOnly

public boolean getTypesOnly()
See isTypesOnly().

Returns:
boolean

isTypesOnly

public boolean isTypesOnly()
This returns whether the LdapConfig is set to only return attribute types.

Returns:
boolean

getEnvironmentProperties

public Map<String,Object> getEnvironmentProperties()
This returns any environment properties that may have been set for the LdapConfig using setEnvironmentProperties(String,String) that do not represent properties of this config. The collection returned is unmodifiable.

Returns:
Map - additional environment properties

getLogCredentials

public boolean getLogCredentials()
This returns whether authentication credentials will be logged.

Returns:
boolean - whether authentication credentials will be logged.

getSsl

public boolean getSsl()
See isSslEnabled().

Returns:
boolean - whether the SSL protocol is being used

isSslEnabled

public boolean isSslEnabled()
This returns whether the LdapConfig is using the SSL protocol for connections.

Returns:
boolean - whether the SSL protocol is being used

getTls

public boolean getTls()
See isTlsEnabled().

Returns:
boolean - whether the TLS protocol is being used

isTlsEnabled

public boolean isTlsEnabled()
This returns whether the LdapConfig is using the TLS protocol for connections.

Returns:
boolean - whether the TLS protocol is being used

setContextFactory

public void setContextFactory(String contextFactory)
This sets the context factory of the LdapConfig.

Parameters:
contextFactory - String context factory

setConnectionHandler

public void setConnectionHandler(ConnectionHandler connectionHandler)
This sets the connection handler of the LdapConfig.

Parameters:
connectionHandler - ConnectionHandler connection handler

setSslSocketFactory

public void setSslSocketFactory(SSLSocketFactory sslSocketFactory)
This sets the SSL socket factory of the LdapConfig.

Parameters:
sslSocketFactory - SSLSocketFactory SSL socket factory

setHostnameVerifier

public void setHostnameVerifier(HostnameVerifier hostnameVerifier)
This sets the hostname verifier of the LdapConfig.

Parameters:
hostnameVerifier - HostnameVerifier hostname verifier

setLdapUrl

public void setLdapUrl(String ldapUrl)
This sets the ldap url of the LdapConfig.

Parameters:
ldapUrl - String url

setHost

@Deprecated
public void setHost(String host)
Deprecated. use setLdapUrl(String) instead

This sets the hostname of the LdapConfig. The host string may be of the form ldap://host.domain.name:389, host.domain.name:389, or host.domain.name. Do not use with setLdapUrl(String).

Parameters:
host - String hostname

setPort

@Deprecated
public void setPort(String port)
Deprecated. use setLdapUrl(String) instead

This sets the port of the LdapConfig. Do not use with setLdapUrl(String).

Parameters:
port - String port

setTimeout

public void setTimeout(int timeout)
This sets the maximum amount of time in milliseconds that connect operations will block.

Parameters:
timeout - int

setBindDn

public void setBindDn(String dn)
This sets the bind DN to authenticate as before performing operations.

Parameters:
dn - String bind DN

setServiceUser

@Deprecated
public void setServiceUser(String user)
Deprecated. use setBindDn(String) instead

This sets the username of the service user. user must be a fully qualified DN.

Parameters:
user - String username

setBindCredential

public void setBindCredential(Object credential)
This sets the credential of the bind DN.

Parameters:
credential - Object

setServiceCredential

@Deprecated
public void setServiceCredential(Object credential)
Deprecated. use setBindCredential(Object) instead

This sets the credential of the service user.

Parameters:
credential - Object

setService

@Deprecated
public void setService(String user,
                                  Object credential)
Deprecated. use setBindDn(String) and setBindCredential(Object) instead

This sets the username and credential of the service user. user must be a fully qualified DN.

Parameters:
user - String service user dn
credential - Object

setBase

public void setBase(String base)
Deprecated. use setBaseDn(String)

This sets the base dn for the LdapConfig.

Parameters:
base - String base dn

setBaseDn

public void setBaseDn(String baseDn)
This sets the base dn for the LdapConfig.

Parameters:
baseDn - String base dn

setSearchScope

public void setSearchScope(LdapConfig.SearchScope searchScope)
This sets the search scope for the LdapConfig.

Parameters:
searchScope - SearchScope

setAuthtype

public void setAuthtype(String authtype)
This sets the security level for the LdapConfig.

Parameters:
authtype - String security level

setAuthoritative

public void setAuthoritative(boolean authoritative)
This specifies whether or not to force this LdapConfig to require an authoritative source.

Parameters:
authoritative - boolean

setTimeLimit

public void setTimeLimit(int timeLimit)
This sets the maximum amount of time in milliseconds that search operations will block.

Parameters:
timeLimit - int

setCountLimit

public void setCountLimit(long countLimit)
This sets the maximum number of entries that search operations will return.

Parameters:
countLimit - long

setPagedResultsSize

public void setPagedResultsSize(int pageSize)
This sets the results size to use when the PagedResultsControl is invoked.

Parameters:
pageSize - int

setOperationRetry

public void setOperationRetry(int operationRetry)
This sets the number of times that ldap operations will be retried if a communication exception occurs.

Parameters:
operationRetry - int

setOperationRetryExceptions

public void setOperationRetryExceptions(Class<?>[] exceptions)
This sets the exception types to retry operations on.

Parameters:
exceptions - Class[]

setOperationRetryWait

public void setOperationRetryWait(long wait)
This sets the amount of time in milliseconds that operations should wait before retrying.

Parameters:
wait - long

setOperationRetryBackoff

public void setOperationRetryBackoff(int backoff)
This sets the factor by which to multiply the operation retry wait time. This allows clients to progressively delay each retry. The formula for backoff is (wait * backoff * attempt). So a wait time of 2s with a backoff of 3 will delay by 6s, then 12s, then 18s, and so forth.

Parameters:
backoff - int

setDerefLinkFlag

public void setDerefLinkFlag(boolean derefLinkFlag)
This specifies whether or not to force this LdapConfig to link dereferencing during searches.

Parameters:
derefLinkFlag - boolean

setReturningObjFlag

public void setReturningObjFlag(boolean returningObjFlag)
This specifies whether or not to force this LdapConfig to return objects for searches.

Parameters:
returningObjFlag - boolean

setBatchSize

public void setBatchSize(int batchSize)
This sets the batch size for the LdapConfig. A value of -1 indicates to use the provider default.

Parameters:
batchSize - int batch size to use when returning results

setDnsUrl

public void setDnsUrl(String dnsUrl)
This sets the dns url for the LdapConfig.

Parameters:
dnsUrl - String

setLanguage

public void setLanguage(String language)
This sets the preferred language for the LdapConfig.

Parameters:
language - String defined by RFC 1766

setReferral

public void setReferral(String referral)
This specifies how the LdapConfig should handle referrals. referral must be one of: "throw", "ignore", or "follow".

Parameters:
referral - String

setDerefAliases

public void setDerefAliases(String derefAliases)
This specifies how the LdapConfig should handle aliases. derefAliases must be one of: "always", "never", "finding", or "searching".

Parameters:
derefAliases - String

setBinaryAttributes

public void setBinaryAttributes(String binaryAttributes)
This specifies additional attributes that should be considered binary. Attributes should be space delimited.

Parameters:
binaryAttributes - String

setSearchResultHandlers

public void setSearchResultHandlers(SearchResultHandler[] handlers)
This sets the handlers for processing search results.

Parameters:
handlers - SearchResultHandler[]

setHandlerIgnoreExceptions

public void setHandlerIgnoreExceptions(Class<?>[] exceptions)
This sets the exception types to ignore when handling results.

Parameters:
exceptions - Class[]

setSaslAuthorizationId

public void setSaslAuthorizationId(String saslAuthorizationId)
This specifies a SASL authorization id.

Parameters:
saslAuthorizationId - String

setSaslRealm

public void setSaslRealm(String saslRealm)
This specifies a SASL realm.

Parameters:
saslRealm - String

setTypesOnly

public void setTypesOnly(boolean typesOnly)
This specifies whether or not to force this LdapConfig to return only attribute types.

Parameters:
typesOnly - boolean

getPropertiesDomain

public String getPropertiesDomain()
This returns the properties domain for this property config.

Specified by:
getPropertiesDomain in interface PropertyConfig
Specified by:
getPropertiesDomain in class AbstractPropertyConfig
Returns:
String properties domain

setEnvironmentProperties

public void setEnvironmentProperties(String name,
                                     String value)
This adds environment properties to this object. If name or value is null, then this method does nothing.

Specified by:
setEnvironmentProperties in interface PropertyConfig
Specified by:
setEnvironmentProperties in class AbstractPropertyConfig
Parameters:
name - String property name
value - String property value

hasEnvironmentProperty

public boolean hasEnvironmentProperty(String name)
This returns whether the supplied property exists.

Specified by:
hasEnvironmentProperty in interface PropertyConfig
Specified by:
hasEnvironmentProperty in class AbstractPropertyConfig
Parameters:
name - String to check
Returns:
boolean whether the supplied property exists

createFromProperties

public static LdapConfig createFromProperties(InputStream is)
Create an instance of this class initialized with properties from the input stream. If the input stream is null, load properties from the default properties file.

Parameters:
is - to load properties from
Returns:
LdapConfig initialized ldap config

setLogCredentials

public void setLogCredentials(boolean log)
This sets whether authentication credentials will be logged.

Parameters:
log - boolean

setSsl

public void setSsl(boolean ssl)
This sets this LdapConfig to use the SSL protocol for connections.

Parameters:
ssl - boolean

setTls

public void setTls(boolean tls)
This sets this LdapConfig to use the TLS protocol for connections. Specifically it sets the connection handler to use TlsConnectionHandler.

Parameters:
tls - boolean

getSearchControls

public SearchControls getSearchControls(String[] retAttrs)
This returns a SearchControls object configured with this LdapConfig.

Parameters:
retAttrs - String[] attributes to return from search
Returns:
SearchControls

getCompareSearchControls

public static SearchControls getCompareSearchControls()
This returns a SearchControls object configured to perform a LDAP compare operation.

Returns:
SearchControls

setTracePackets

public void setTracePackets(PrintStream stream)
This sets this LdapConfig to print ASN.1 BER packets to the supplied PrintStream.

Parameters:
stream - PrintStream

toString

public String toString()
Provides a descriptive string representation of this instance.

Overrides:
toString in class Object
Returns:
String of the form $Classname@hashCode::env=$env.


Copyright © 2003-2010 Virginia Tech. All Rights Reserved.