|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.ldap.props.AbstractPropertyConfig
edu.vt.middleware.ldap.LdapConfig
public class LdapConfig
LdapConfig contains all the configuration data that the
Ldap needs to control connections and searching.
| 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 |
|---|
public static final String PROPERTIES_DOMAIN
| Constructor Detail |
|---|
public LdapConfig()
public LdapConfig(String ldapUrl)
LdapConfig with the supplied ldap url.
ldapUrl - String LDAP URL
public LdapConfig(String ldapUrl,
String baseDn)
LdapConfig with the supplied ldap url
and base Strings.
ldapUrl - String LDAP URLbaseDn - String LDAP base DN| Method Detail |
|---|
public Hashtable<String,?> getEnvironment()
Hashtable - context environmentpublic String getContextFactory()
LdapConfig.
String - context factorypublic ConnectionHandler getConnectionHandler()
LdapConfig.
ConnectionHandler - connection handlerpublic SSLSocketFactory getSslSocketFactory()
LdapConfig.
SSLSocketFactory - SSL socket factorypublic boolean useSslSocketFactory()
LdapConfig is using a custom SSL
socket factory.
booleanpublic HostnameVerifier getHostnameVerifier()
LdapConfig.
HostnameVerifier - hostname verifierpublic boolean useHostnameVerifier()
LdapConfig is using a custom hostname
verifier.
booleanpublic String getLdapUrl()
LdapConfig.
String - ldap url@Deprecated public String getHost()
getLdapUrl() instead
LdapConfig.
String - hostname@Deprecated public String getPort()
getLdapUrl() instead
LdapConfig.
String - portpublic int getTimeout()
LdapConfig. If this value is
0, then connect operations will wait indefinitely.
int - timeoutpublic String getBindDn()
String - DN to bind as@Deprecated public String getServiceUser()
getBindDn() instead
String - usernamepublic Object getBindCredential()
Object - bind DN credential@Deprecated public Object getServiceCredential()
getBindCredential() instead
Object - credentialpublic String getBase()
getBaseDn() instead
LdapConfig.
String - base dnpublic String getBaseDn()
LdapConfig.
String - base dnpublic LdapConfig.SearchScope getSearchScope()
LdapConfig.
SearchScope - search scopepublic boolean isObjectSearchScope()
booleanpublic boolean isOneLevelSearchScope()
booleanpublic boolean isSubTreeSearchScope()
booleanpublic String getAuthtype()
LdapConfig.
String - security levelpublic boolean isAnonymousAuth()
booleanpublic boolean isSimpleAuth()
booleanpublic boolean isStrongAuth()
booleanpublic boolean isSaslAuth()
booleanpublic boolean isExternalAuth()
booleanpublic boolean isDigestMD5Auth()
booleanpublic boolean isCramMD5Auth()
booleanpublic boolean isGSSAPIAuth()
booleanpublic boolean getAuthoritative()
isAuthoritative().
booleanpublic boolean isAuthoritative()
LdapConfig is set to require a
authoritative source.
booleanpublic int getTimeLimit()
LdapConfig. If this value
is 0, then search operations will wait indefinitely for an answer.
int - time limitpublic long getCountLimit()
LdapConfig. If this value
is 0, then search operations will return all the results it finds.
long - count limitpublic int getPagedResultsSize()
LdapConfig. This
value is used whenever the PagedResultsControl in invoked.
int - page sizepublic int getOperationRetry()
int - retry countpublic Class<?>[] getOperationRetryExceptions()
Class[]public long getOperationRetryWait()
LdapConfig.
int - time limitpublic int getOperationRetryBackoff()
int - backoff factorpublic boolean getDerefLinkFlag()
LdapConfig.
booleanpublic boolean getReturningObjFlag()
LdapConfig.
booleanpublic int getBatchSize()
LdapConfig. If this value
is -1, then the default provider setting is being used.
int - batch sizepublic String getDnsUrl()
LdapConfig. If this value is
null, then this property is not being used.
String - dns urlpublic String getLanguage()
LdapConfig. If
this value is null, then the default provider setting is being used.
String - languagepublic String getReferral()
LdapConfig. If this
value is null, then the default provider setting is being used.
String - referralpublic String getDerefAliases()
LdapConfig. If this
value is null, then the default provider setting is being used.
String - aliaspublic String getBinaryAttributes()
LdapConfig.
If this value is null, then the default provider setting is being used.
String - binary attributespublic SearchResultHandler[] getSearchResultHandlers()
SearchResultHandler[]public Class<?>[] getHandlerIgnoreExceptions()
Class[]public String getSaslAuthorizationId()
LdapConfig.
String - authorization idpublic String getSaslRealm()
LdapConfig.
String - realmpublic boolean getTypesOnly()
isTypesOnly().
booleanpublic boolean isTypesOnly()
LdapConfig is set to only return
attribute types.
booleanpublic Map<String,Object> getEnvironmentProperties()
LdapConfig using setEnvironmentProperties(String,String) that do not represent properties
of this config. The collection returned is unmodifiable.
Map - additional environment propertiespublic boolean getLogCredentials()
boolean - whether authentication credentials will be
logged.public boolean getSsl()
isSslEnabled().
boolean - whether the SSL protocol is being usedpublic boolean isSslEnabled()
LdapConfig is using the SSL protocol
for connections.
boolean - whether the SSL protocol is being usedpublic boolean getTls()
isTlsEnabled().
boolean - whether the TLS protocol is being usedpublic boolean isTlsEnabled()
LdapConfig is using the TLS protocol
for connections.
boolean - whether the TLS protocol is being usedpublic void setContextFactory(String contextFactory)
LdapConfig.
contextFactory - String context factorypublic void setConnectionHandler(ConnectionHandler connectionHandler)
LdapConfig.
connectionHandler - ConnectionHandler connection
handlerpublic void setSslSocketFactory(SSLSocketFactory sslSocketFactory)
LdapConfig.
sslSocketFactory - SSLSocketFactory SSL socket factorypublic void setHostnameVerifier(HostnameVerifier hostnameVerifier)
LdapConfig.
hostnameVerifier - HostnameVerifier hostname verifierpublic void setLdapUrl(String ldapUrl)
LdapConfig.
ldapUrl - String url@Deprecated public void setHost(String host)
setLdapUrl(String) instead
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).
host - String hostname@Deprecated public void setPort(String port)
setLdapUrl(String) instead
LdapConfig. Do not use with setLdapUrl(String).
port - String portpublic void setTimeout(int timeout)
timeout - intpublic void setBindDn(String dn)
dn - String bind DN@Deprecated public void setServiceUser(String user)
setBindDn(String) instead
user - String usernamepublic void setBindCredential(Object credential)
credential - Object@Deprecated public void setServiceCredential(Object credential)
setBindCredential(Object) instead
credential - Object
@Deprecated
public void setService(String user,
Object credential)
setBindDn(String) and setBindCredential(Object) instead
user - String service user dncredential - Objectpublic void setBase(String base)
setBaseDn(String)
LdapConfig.
base - String base dnpublic void setBaseDn(String baseDn)
LdapConfig.
baseDn - String base dnpublic void setSearchScope(LdapConfig.SearchScope searchScope)
LdapConfig.
searchScope - SearchScopepublic void setAuthtype(String authtype)
LdapConfig.
authtype - String security levelpublic void setAuthoritative(boolean authoritative)
LdapConfig to
require an authoritative source.
authoritative - booleanpublic void setTimeLimit(int timeLimit)
timeLimit - intpublic void setCountLimit(long countLimit)
countLimit - longpublic void setPagedResultsSize(int pageSize)
pageSize - intpublic void setOperationRetry(int operationRetry)
operationRetry - intpublic void setOperationRetryExceptions(Class<?>[] exceptions)
exceptions - Class[]public void setOperationRetryWait(long wait)
wait - longpublic void setOperationRetryBackoff(int backoff)
backoff - intpublic void setDerefLinkFlag(boolean derefLinkFlag)
LdapConfig to link
dereferencing during searches.
derefLinkFlag - booleanpublic void setReturningObjFlag(boolean returningObjFlag)
LdapConfig to
return objects for searches.
returningObjFlag - booleanpublic void setBatchSize(int batchSize)
LdapConfig. A value of -1
indicates to use the provider default.
batchSize - int batch size to use when returning
resultspublic void setDnsUrl(String dnsUrl)
LdapConfig.
dnsUrl - Stringpublic void setLanguage(String language)
LdapConfig.
language - String defined by RFC 1766public void setReferral(String referral)
LdapConfig should handle referrals.
referral must be one of: "throw", "ignore", or "follow".
referral - Stringpublic void setDerefAliases(String derefAliases)
LdapConfig should handle aliases.
derefAliases must be one of: "always", "never", "finding", or "searching".
derefAliases - Stringpublic void setBinaryAttributes(String binaryAttributes)
binaryAttributes - Stringpublic void setSearchResultHandlers(SearchResultHandler[] handlers)
handlers - SearchResultHandler[]public void setHandlerIgnoreExceptions(Class<?>[] exceptions)
exceptions - Class[]public void setSaslAuthorizationId(String saslAuthorizationId)
saslAuthorizationId - Stringpublic void setSaslRealm(String saslRealm)
saslRealm - Stringpublic void setTypesOnly(boolean typesOnly)
LdapConfig to
return only attribute types.
typesOnly - booleanpublic String getPropertiesDomain()
getPropertiesDomain in interface PropertyConfiggetPropertiesDomain in class AbstractPropertyConfigString properties domain
public void setEnvironmentProperties(String name,
String value)
setEnvironmentProperties in interface PropertyConfigsetEnvironmentProperties in class AbstractPropertyConfigname - String property namevalue - String property valuepublic boolean hasEnvironmentProperty(String name)
hasEnvironmentProperty in interface PropertyConfighasEnvironmentProperty in class AbstractPropertyConfigname - String to check
boolean whether the supplied property existspublic static LdapConfig createFromProperties(InputStream is)
is - to load properties from
LdapConfig initialized ldap configpublic void setLogCredentials(boolean log)
log - booleanpublic void setSsl(boolean ssl)
LdapConfig to use the SSL protocol for
connections.
ssl - booleanpublic void setTls(boolean tls)
LdapConfig to use the TLS protocol for
connections. Specifically it sets the connection handler to use TlsConnectionHandler.
tls - booleanpublic SearchControls getSearchControls(String[] retAttrs)
SearchControls object configured with this
LdapConfig.
retAttrs - String[] attributes to return from search
SearchControlspublic static SearchControls getCompareSearchControls()
SearchControls object configured to perform a
LDAP compare operation.
SearchControlspublic void setTracePackets(PrintStream stream)
LdapConfig to print ASN.1 BER packets to the
supplied PrintStream.
stream - PrintStreampublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||