Package edu.vt.middleware.ldap
Class LdapConfig
- java.lang.Object
-
- edu.vt.middleware.ldap.props.AbstractPropertyConfig
-
- edu.vt.middleware.ldap.LdapConfig
-
- All Implemented Interfaces:
PropertyConfig
- Direct Known Subclasses:
AuthenticatorConfig
public class LdapConfig extends AbstractPropertyConfig
LdapConfigcontains all the configuration data that theLdapneeds to control connections and searching.- Version:
- $Revision: 1786 $ $Date: 2011-01-05 15:45:07 +0100 (Wed, 05 Jan 2011) $
- Author:
- Middleware Services
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLdapConfig.SearchScopeEnum to define the type of search scope.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROPERTIES_DOMAINDomain 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
Constructors Constructor Description LdapConfig()Default constructor.LdapConfig(java.lang.String ldapUrl)This will create a newLdapConfigwith the supplied ldap url.LdapConfig(java.lang.String ldapUrl, java.lang.String baseDn)This will create a newLdapConfigwith the supplied ldap url and base Strings.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static LdapConfigcreateFromProperties(java.io.InputStream is)Create an instance of this class initialized with properties from the input stream.booleangetAuthoritative()SeeisAuthoritative().java.lang.StringgetAuthtype()This returns the security level for theLdapConfig.java.lang.StringgetBase()Deprecated.usegetBaseDn()insteadjava.lang.StringgetBaseDn()This returns the base dn for theLdapConfig.intgetBatchSize()This returns the batch size for theLdapConfig.java.lang.StringgetBinaryAttributes()This returns additional binary attributes for theLdapConfig.java.lang.ObjectgetBindCredential()This returns the credential used with the bind DN.java.lang.StringgetBindDn()This returns the bind DN.static javax.naming.directory.SearchControlsgetCompareSearchControls()This returns aSearchControlsobject configured to perform a LDAP compare operation.ConnectionHandlergetConnectionHandler()This returns the connection handler of theLdapConfig.java.lang.StringgetContextFactory()This returns the context factory of theLdapConfig.longgetCountLimit()This returns the count limit for theLdapConfig.java.lang.StringgetDerefAliases()This returns the alias setting for theLdapConfig.booleangetDerefLinkFlag()This returns the derefLinkFlag for theLdapConfig.java.lang.StringgetDnsUrl()This returns the dns url for theLdapConfig.java.util.Hashtable<java.lang.String,?>getEnvironment()This returns the Context environment properties that are used to make LDAP connections.java.util.Map<java.lang.String,java.lang.Object>getEnvironmentProperties()This returns any environment properties that may have been set for theLdapConfigusingsetEnvironmentProperties(String,String)that do not represent properties of this config.java.lang.Class<?>[]getHandlerIgnoreExceptions()This returns the exception types to ignore when handling results.java.lang.StringgetHost()Deprecated.usegetLdapUrl()insteadjavax.net.ssl.HostnameVerifiergetHostnameVerifier()This returns the hostname verifier of theLdapConfig.java.lang.StringgetLanguage()This returns the preferred language for theLdapConfig.java.lang.StringgetLdapUrl()This returns the ldap url of theLdapConfig.booleangetLogCredentials()This returns whether authentication credentials will be logged.intgetOperationRetry()This returns the number of times ldap operations will be retried if a communication exception occurs.intgetOperationRetryBackoff()This returns the factor by which to multiply the operation retry wait time.java.lang.Class<?>[]getOperationRetryExceptions()This returns the exception types to retry operations on.longgetOperationRetryWait()This returns the operation retry wait time for theLdapConfig.intgetPagedResultsSize()This returns the paged results size for theLdapConfig.java.lang.StringgetPort()Deprecated.usegetLdapUrl()insteadjava.lang.StringgetPropertiesDomain()This returns the properties domain for this property config.java.lang.StringgetReferral()This returns the referral setting for theLdapConfig.booleangetReturningObjFlag()This returns the returningObjFlag for theLdapConfig.java.lang.StringgetSaslAuthorizationId()This returns ths SASL authorization id for theLdapConfig.java.lang.StringgetSaslRealm()This returns ths SASL realm for theLdapConfig.javax.naming.directory.SearchControlsgetSearchControls(java.lang.String[] retAttrs)This returns aSearchControlsobject configured with thisLdapConfig.SearchResultHandler[]getSearchResultHandlers()This returns the handlers to use for processing search results.LdapConfig.SearchScopegetSearchScope()This returns the search scope for theLdapConfig.java.lang.ObjectgetServiceCredential()Deprecated.usegetBindCredential()insteadjava.lang.StringgetServiceUser()Deprecated.usegetBindDn()insteadbooleangetSsl()SeeisSslEnabled().javax.net.ssl.SSLSocketFactorygetSslSocketFactory()This returns the SSL socket factory of theLdapConfig.intgetTimeLimit()This returns the time limit for theLdapConfig.intgetTimeout()This returns the timeout for theLdapConfig.booleangetTls()SeeisTlsEnabled().booleangetTypesOnly()SeeisTypesOnly().booleanhasEnvironmentProperty(java.lang.String name)This returns whether the supplied property exists.booleanisAnonymousAuth()This returns whether the security authentication context is set to 'none'.booleanisAuthoritative()This returns whether theLdapConfigis set to require a authoritative source.booleanisCramMD5Auth()This returns whether the security authentication context is set to 'CRAM-MD5'.booleanisDigestMD5Auth()This returns whether the security authentication context is set to 'DIGEST-MD5'.booleanisExternalAuth()This returns whether the security authentication context is set to 'EXTERNAL'.booleanisGSSAPIAuth()This returns whether the security authentication context is set to 'GSSAPI'.booleanisObjectSearchScope()This returns whether the search scope is set to object.booleanisOneLevelSearchScope()This returns whether the search scope is set to one level.booleanisSaslAuth()This returns whether the security authentication context will perform a SASL bind as defined by the supported SASL mechanisms.booleanisSimpleAuth()This returns whether the security authentication context is set to 'simple'.booleanisSslEnabled()This returns whether theLdapConfigis using the SSL protocol for connections.booleanisStrongAuth()This returns whether the security authentication context is set to 'strong'.booleanisSubTreeSearchScope()This returns whether the search scope is set to sub tree.booleanisTlsEnabled()This returns whether theLdapConfigis using the TLS protocol for connections.booleanisTypesOnly()This returns whether theLdapConfigis set to only return attribute types.voidsetAuthoritative(boolean authoritative)This specifies whether or not to force thisLdapConfigto require an authoritative source.voidsetAuthtype(java.lang.String authtype)This sets the security level for theLdapConfig.voidsetBase(java.lang.String base)Deprecated.voidsetBaseDn(java.lang.String baseDn)This sets the base dn for theLdapConfig.voidsetBatchSize(int batchSize)This sets the batch size for theLdapConfig.voidsetBinaryAttributes(java.lang.String binaryAttributes)This specifies additional attributes that should be considered binary.voidsetBindCredential(java.lang.Object credential)This sets the credential of the bind DN.voidsetBindDn(java.lang.String dn)This sets the bind DN to authenticate as before performing operations.voidsetConnectionHandler(ConnectionHandler connectionHandler)This sets the connection handler of theLdapConfig.voidsetContextFactory(java.lang.String contextFactory)This sets the context factory of theLdapConfig.voidsetCountLimit(long countLimit)This sets the maximum number of entries that search operations will return.voidsetDerefAliases(java.lang.String derefAliases)This specifies how theLdapConfigshould handle aliases.voidsetDerefLinkFlag(boolean derefLinkFlag)This specifies whether or not to force thisLdapConfigto link dereferencing during searches.voidsetDnsUrl(java.lang.String dnsUrl)This sets the dns url for theLdapConfig.voidsetEnvironmentProperties(java.lang.String name, java.lang.String value)This adds environment properties to this object.voidsetHandlerIgnoreExceptions(java.lang.Class<?>[] exceptions)This sets the exception types to ignore when handling results.voidsetHost(java.lang.String host)Deprecated.usesetLdapUrl(String)insteadvoidsetHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)This sets the hostname verifier of theLdapConfig.voidsetLanguage(java.lang.String language)This sets the preferred language for theLdapConfig.voidsetLdapUrl(java.lang.String ldapUrl)This sets the ldap url of theLdapConfig.voidsetLogCredentials(boolean log)This sets whether authentication credentials will be logged.voidsetOperationRetry(int operationRetry)This sets the number of times that ldap operations will be retried if a communication exception occurs.voidsetOperationRetryBackoff(int backoff)This sets the factor by which to multiply the operation retry wait time.voidsetOperationRetryExceptions(java.lang.Class<?>[] exceptions)This sets the exception types to retry operations on.voidsetOperationRetryWait(long wait)This sets the amount of time in milliseconds that operations should wait before retrying.voidsetPagedResultsSize(int pageSize)This sets the results size to use when the PagedResultsControl is invoked.voidsetPort(java.lang.String port)Deprecated.usesetLdapUrl(String)insteadvoidsetReferral(java.lang.String referral)This specifies how theLdapConfigshould handle referrals.voidsetReturningObjFlag(boolean returningObjFlag)This specifies whether or not to force thisLdapConfigto return objects for searches.voidsetSaslAuthorizationId(java.lang.String saslAuthorizationId)This specifies a SASL authorization id.voidsetSaslRealm(java.lang.String saslRealm)This specifies a SASL realm.voidsetSearchResultHandlers(SearchResultHandler[] handlers)This sets the handlers for processing search results.voidsetSearchScope(LdapConfig.SearchScope searchScope)This sets the search scope for theLdapConfig.voidsetService(java.lang.String user, java.lang.Object credential)Deprecated.usesetBindDn(String)andsetBindCredential(Object)insteadvoidsetServiceCredential(java.lang.Object credential)Deprecated.usesetBindCredential(Object)insteadvoidsetServiceUser(java.lang.String user)Deprecated.usesetBindDn(String)insteadvoidsetSsl(boolean ssl)This sets thisLdapConfigto use the SSL protocol for connections.voidsetSslSocketFactory(javax.net.ssl.SSLSocketFactory sslSocketFactory)This sets the SSL socket factory of theLdapConfig.voidsetTimeLimit(int timeLimit)This sets the maximum amount of time in milliseconds that search operations will block.voidsetTimeout(int timeout)This sets the maximum amount of time in milliseconds that connect operations will block.voidsetTls(boolean tls)This sets thisLdapConfigto use the TLS protocol for connections.voidsetTracePackets(java.io.PrintStream stream)This sets thisLdapConfigto print ASN.1 BER packets to the suppliedPrintStream.voidsetTypesOnly(boolean typesOnly)This specifies whether or not to force thisLdapConfigto return only attribute types.java.lang.StringtoString()Provides a descriptive string representation of this instance.booleanuseHostnameVerifier()This returns whether theLdapConfigis using a custom hostname verifier.booleanuseSslSocketFactory()This returns whether theLdapConfigis using a custom SSL socket factory.-
Methods inherited from class edu.vt.middleware.ldap.props.AbstractPropertyConfig
checkImmutable, checkStringInput, makeImmutable, setEnvironmentProperties, setEnvironmentProperties
-
-
-
-
Field Detail
-
PROPERTIES_DOMAIN
public static final java.lang.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(java.lang.String ldapUrl)
This will create a newLdapConfigwith the supplied ldap url.- Parameters:
ldapUrl-StringLDAP URL
-
LdapConfig
public LdapConfig(java.lang.String ldapUrl, java.lang.String baseDn)This will create a newLdapConfigwith the supplied ldap url and base Strings.- Parameters:
ldapUrl-StringLDAP URLbaseDn-StringLDAP base DN
-
-
Method Detail
-
getEnvironment
public java.util.Hashtable<java.lang.String,?> getEnvironment()
This returns the Context environment properties that are used to make LDAP connections.- Returns:
Hashtable- context environment
-
getContextFactory
public java.lang.String getContextFactory()
This returns the context factory of theLdapConfig.- Returns:
String- context factory
-
getConnectionHandler
public ConnectionHandler getConnectionHandler()
This returns the connection handler of theLdapConfig.- Returns:
ConnectionHandler- connection handler
-
getSslSocketFactory
public javax.net.ssl.SSLSocketFactory getSslSocketFactory()
This returns the SSL socket factory of theLdapConfig.- Returns:
SSLSocketFactory- SSL socket factory
-
useSslSocketFactory
public boolean useSslSocketFactory()
This returns whether theLdapConfigis using a custom SSL socket factory.- Returns:
boolean
-
getHostnameVerifier
public javax.net.ssl.HostnameVerifier getHostnameVerifier()
This returns the hostname verifier of theLdapConfig.- Returns:
HostnameVerifier- hostname verifier
-
useHostnameVerifier
public boolean useHostnameVerifier()
This returns whether theLdapConfigis using a custom hostname verifier.- Returns:
boolean
-
getLdapUrl
public java.lang.String getLdapUrl()
This returns the ldap url of theLdapConfig.- Returns:
String- ldap url
-
getHost
@Deprecated public java.lang.String getHost()
Deprecated.usegetLdapUrl()insteadThis returns the hostname of theLdapConfig.- Returns:
String- hostname
-
getPort
@Deprecated public java.lang.String getPort()
Deprecated.usegetLdapUrl()insteadThis returns the port of theLdapConfig.- Returns:
String- port
-
getTimeout
public int getTimeout()
This returns the timeout for theLdapConfig. If this value is 0, then connect operations will wait indefinitely.- Returns:
int- timeout
-
getBindDn
public java.lang.String getBindDn()
This returns the bind DN.- Returns:
String- DN to bind as
-
getServiceUser
@Deprecated public java.lang.String getServiceUser()
Deprecated.usegetBindDn()insteadThis returns the username of the service user.- Returns:
String- username
-
getBindCredential
public java.lang.Object getBindCredential()
This returns the credential used with the bind DN.- Returns:
Object- bind DN credential
-
getServiceCredential
@Deprecated public java.lang.Object getServiceCredential()
Deprecated.usegetBindCredential()insteadThis returns the credential of the service user.- Returns:
Object- credential
-
getBase
public java.lang.String getBase()
Deprecated.usegetBaseDn()insteadThis returns the base dn for theLdapConfig.- Returns:
String- base dn
-
getBaseDn
public java.lang.String getBaseDn()
This returns the base dn for theLdapConfig.- Returns:
String- base dn
-
getSearchScope
public LdapConfig.SearchScope getSearchScope()
This returns the search scope for theLdapConfig.- 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 java.lang.String getAuthtype()
This returns the security level for theLdapConfig.- 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()
SeeisAuthoritative().- Returns:
boolean
-
isAuthoritative
public boolean isAuthoritative()
This returns whether theLdapConfigis set to require a authoritative source.- Returns:
boolean
-
getTimeLimit
public int getTimeLimit()
This returns the time limit for theLdapConfig. 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 theLdapConfig. 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 theLdapConfig. 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 java.lang.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 theLdapConfig.- 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 theLdapConfig.- Returns:
boolean
-
getReturningObjFlag
public boolean getReturningObjFlag()
This returns the returningObjFlag for theLdapConfig.- Returns:
boolean
-
getBatchSize
public int getBatchSize()
This returns the batch size for theLdapConfig. If this value is -1, then the default provider setting is being used.- Returns:
int- batch size
-
getDnsUrl
public java.lang.String getDnsUrl()
This returns the dns url for theLdapConfig. If this value is null, then this property is not being used.- Returns:
String- dns url
-
getLanguage
public java.lang.String getLanguage()
This returns the preferred language for theLdapConfig. If this value is null, then the default provider setting is being used.- Returns:
String- language
-
getReferral
public java.lang.String getReferral()
This returns the referral setting for theLdapConfig. If this value is null, then the default provider setting is being used.- Returns:
String- referral
-
getDerefAliases
public java.lang.String getDerefAliases()
This returns the alias setting for theLdapConfig. If this value is null, then the default provider setting is being used.- Returns:
String- alias
-
getBinaryAttributes
public java.lang.String getBinaryAttributes()
This returns additional binary attributes for theLdapConfig. 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 java.lang.Class<?>[] getHandlerIgnoreExceptions()
This returns the exception types to ignore when handling results.- Returns:
Class[]
-
getSaslAuthorizationId
public java.lang.String getSaslAuthorizationId()
This returns ths SASL authorization id for theLdapConfig.- Returns:
String- authorization id
-
getSaslRealm
public java.lang.String getSaslRealm()
This returns ths SASL realm for theLdapConfig.- Returns:
String- realm
-
getTypesOnly
public boolean getTypesOnly()
SeeisTypesOnly().- Returns:
boolean
-
isTypesOnly
public boolean isTypesOnly()
This returns whether theLdapConfigis set to only return attribute types.- Returns:
boolean
-
getEnvironmentProperties
public java.util.Map<java.lang.String,java.lang.Object> getEnvironmentProperties()
This returns any environment properties that may have been set for theLdapConfigusingsetEnvironmentProperties(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()
SeeisSslEnabled().- Returns:
boolean- whether the SSL protocol is being used
-
isSslEnabled
public boolean isSslEnabled()
This returns whether theLdapConfigis using the SSL protocol for connections.- Returns:
boolean- whether the SSL protocol is being used
-
getTls
public boolean getTls()
SeeisTlsEnabled().- Returns:
boolean- whether the TLS protocol is being used
-
isTlsEnabled
public boolean isTlsEnabled()
This returns whether theLdapConfigis using the TLS protocol for connections.- Returns:
boolean- whether the TLS protocol is being used
-
setContextFactory
public void setContextFactory(java.lang.String contextFactory)
This sets the context factory of theLdapConfig.- Parameters:
contextFactory-Stringcontext factory
-
setConnectionHandler
public void setConnectionHandler(ConnectionHandler connectionHandler)
This sets the connection handler of theLdapConfig.- Parameters:
connectionHandler-ConnectionHandlerconnection handler
-
setSslSocketFactory
public void setSslSocketFactory(javax.net.ssl.SSLSocketFactory sslSocketFactory)
This sets the SSL socket factory of theLdapConfig.- Parameters:
sslSocketFactory-SSLSocketFactorySSL socket factory
-
setHostnameVerifier
public void setHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)
This sets the hostname verifier of theLdapConfig.- Parameters:
hostnameVerifier-HostnameVerifierhostname verifier
-
setLdapUrl
public void setLdapUrl(java.lang.String ldapUrl)
This sets the ldap url of theLdapConfig.- Parameters:
ldapUrl-Stringurl
-
setHost
@Deprecated public void setHost(java.lang.String host)
Deprecated.usesetLdapUrl(String)insteadThis sets the hostname of theLdapConfig. The host string may be of the form ldap://host.domain.name:389, host.domain.name:389, or host.domain.name. Do not use withsetLdapUrl(String).- Parameters:
host-Stringhostname
-
setPort
@Deprecated public void setPort(java.lang.String port)
Deprecated.usesetLdapUrl(String)insteadThis sets the port of theLdapConfig. Do not use withsetLdapUrl(String).- Parameters:
port-Stringport
-
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(java.lang.String dn)
This sets the bind DN to authenticate as before performing operations.- Parameters:
dn-Stringbind DN
-
setServiceUser
@Deprecated public void setServiceUser(java.lang.String user)
Deprecated.usesetBindDn(String)insteadThis sets the username of the service user. user must be a fully qualified DN.- Parameters:
user-Stringusername
-
setBindCredential
public void setBindCredential(java.lang.Object credential)
This sets the credential of the bind DN.- Parameters:
credential-Object
-
setServiceCredential
@Deprecated public void setServiceCredential(java.lang.Object credential)
Deprecated.usesetBindCredential(Object)insteadThis sets the credential of the service user.- Parameters:
credential-Object
-
setService
@Deprecated public void setService(java.lang.String user, java.lang.Object credential)Deprecated.usesetBindDn(String)andsetBindCredential(Object)insteadThis sets the username and credential of the service user. user must be a fully qualified DN.- Parameters:
user-Stringservice user dncredential-Object
-
setBase
public void setBase(java.lang.String base)
Deprecated.This sets the base dn for theLdapConfig.- Parameters:
base-Stringbase dn
-
setBaseDn
public void setBaseDn(java.lang.String baseDn)
This sets the base dn for theLdapConfig.- Parameters:
baseDn-Stringbase dn
-
setSearchScope
public void setSearchScope(LdapConfig.SearchScope searchScope)
This sets the search scope for theLdapConfig.- Parameters:
searchScope-SearchScope
-
setAuthtype
public void setAuthtype(java.lang.String authtype)
This sets the security level for theLdapConfig.- Parameters:
authtype-Stringsecurity level
-
setAuthoritative
public void setAuthoritative(boolean authoritative)
This specifies whether or not to force thisLdapConfigto 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(java.lang.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 thisLdapConfigto link dereferencing during searches.- Parameters:
derefLinkFlag-boolean
-
setReturningObjFlag
public void setReturningObjFlag(boolean returningObjFlag)
This specifies whether or not to force thisLdapConfigto return objects for searches.- Parameters:
returningObjFlag-boolean
-
setBatchSize
public void setBatchSize(int batchSize)
This sets the batch size for theLdapConfig. A value of -1 indicates to use the provider default.- Parameters:
batchSize-intbatch size to use when returning results
-
setDnsUrl
public void setDnsUrl(java.lang.String dnsUrl)
This sets the dns url for theLdapConfig.- Parameters:
dnsUrl-String
-
setLanguage
public void setLanguage(java.lang.String language)
This sets the preferred language for theLdapConfig.- Parameters:
language-Stringdefined by RFC 1766
-
setReferral
public void setReferral(java.lang.String referral)
This specifies how theLdapConfigshould handle referrals. referral must be one of: "throw", "ignore", or "follow".- Parameters:
referral-String
-
setDerefAliases
public void setDerefAliases(java.lang.String derefAliases)
This specifies how theLdapConfigshould handle aliases. derefAliases must be one of: "always", "never", "finding", or "searching".- Parameters:
derefAliases-String
-
setBinaryAttributes
public void setBinaryAttributes(java.lang.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(java.lang.Class<?>[] exceptions)
This sets the exception types to ignore when handling results.- Parameters:
exceptions-Class[]
-
setSaslAuthorizationId
public void setSaslAuthorizationId(java.lang.String saslAuthorizationId)
This specifies a SASL authorization id.- Parameters:
saslAuthorizationId-String
-
setSaslRealm
public void setSaslRealm(java.lang.String saslRealm)
This specifies a SASL realm.- Parameters:
saslRealm-String
-
setTypesOnly
public void setTypesOnly(boolean typesOnly)
This specifies whether or not to force thisLdapConfigto return only attribute types.- Parameters:
typesOnly-boolean
-
getPropertiesDomain
public java.lang.String getPropertiesDomain()
This returns the properties domain for this property config.- Specified by:
getPropertiesDomainin interfacePropertyConfig- Specified by:
getPropertiesDomainin classAbstractPropertyConfig- Returns:
Stringproperties domain
-
setEnvironmentProperties
public void setEnvironmentProperties(java.lang.String name, java.lang.String value)This adds environment properties to this object. If name or value is null, then this method does nothing.- Specified by:
setEnvironmentPropertiesin interfacePropertyConfig- Specified by:
setEnvironmentPropertiesin classAbstractPropertyConfig- Parameters:
name-Stringproperty namevalue-Stringproperty value
-
hasEnvironmentProperty
public boolean hasEnvironmentProperty(java.lang.String name)
This returns whether the supplied property exists.- Specified by:
hasEnvironmentPropertyin interfacePropertyConfig- Specified by:
hasEnvironmentPropertyin classAbstractPropertyConfig- Parameters:
name-Stringto check- Returns:
booleanwhether the supplied property exists
-
createFromProperties
public static LdapConfig createFromProperties(java.io.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:
LdapConfiginitialized 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 thisLdapConfigto use the SSL protocol for connections.- Parameters:
ssl-boolean
-
setTls
public void setTls(boolean tls)
This sets thisLdapConfigto use the TLS protocol for connections. Specifically it sets the connection handler to useTlsConnectionHandler.- Parameters:
tls-boolean
-
getSearchControls
public javax.naming.directory.SearchControls getSearchControls(java.lang.String[] retAttrs)
This returns aSearchControlsobject configured with thisLdapConfig.- Parameters:
retAttrs-String[]attributes to return from search- Returns:
SearchControls
-
getCompareSearchControls
public static javax.naming.directory.SearchControls getCompareSearchControls()
This returns aSearchControlsobject configured to perform a LDAP compare operation.- Returns:
SearchControls
-
setTracePackets
public void setTracePackets(java.io.PrintStream stream)
This sets thisLdapConfigto print ASN.1 BER packets to the suppliedPrintStream.- Parameters:
stream-PrintStream
-
toString
public java.lang.String toString()
Provides a descriptive string representation of this instance.- Overrides:
toStringin classjava.lang.Object- Returns:
- String of the form $Classname@hashCode::env=$env.
-
-