Class LdapInfo
- java.lang.Object
-
- org.sourceid.saml20.domain.datasource.info.LdapInfo
-
- All Implemented Interfaces:
Serializable,Cloneable
public class LdapInfo extends Object implements Cloneable, Serializable
This class provides an independent wrapper of the LDAP information that was entered by the PingFederate user.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLdapInfo.LdapTagThe Ldap Tag Object.static classLdapInfo.LdapTypeSupported LDAP types by PingFederate
-
Constructor Summary
Constructors Constructor Description LdapInfo()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LdapInfoclone()Provides a clone of the information stored in the LdapInfo class.StringgetAuthenticationMethod()Retrieves the specified authentication method.List<String>getBinaryAttributes()Retrieves a list of LDAP binary attributes for this datastore.StringgetClientTlsCertificate()Retrieves the alias of the client TLS certificate to use.intgetConnTimeoutMillis()Retrieves the maximum length of time in milliseconds that a connection attempt should be allowed to continue before giving up.StringgetCredentials()Retrieves The credentials for this LDAP datastore.intgetDnsTtlMillis()Retrieves the maximum length of time in milliseconds that previously-retrieved DNS information should be cached before it needs to be refreshed.StringgetHost()Retrieves the hostname.StringgetId()Retrieves The PingFederate id that was generated for the corresponding LDAP connection information.StringgetLdapDnsSrvPrefix()Retrieves the prefix used to query LDAP DNS Service Records.StringgetLdapsDnsSrvPrefix()Retrieves the prefix used to query LDAPs DNS Service Records.List<org.sourceid.saml20.domain.datasource.tag.LdapTagConfig>getLdapTagConfigList()Retrieves the List of supported tags for this datastore.List<LdapInfo.LdapTag>getLdapTags()Retrieves the List of supported tags for this datastore.LdapInfo.LdapTypegetLdapType()Retrieves the LDAP type (GENERIC, AD, PingDirectory, Custom or SunONE).StringgetLdapTypeDesc()Retrieves the type of this LDAP datastore.intgetMax()Retrieves the maximum number of connections that should be maintained in the pool.intgetMaxWait()Retrieves the maximum length of time in milliseconds to wait for a connection to become available when trying to obtain a connection from the pool.intgetMin()Retrieves the number of connections to initially establish when the pool is created.StringgetName()Retrieves the name of this LDAP datastore.StringgetPingOneConnection()StringgetPingOneEnvironment()StringgetPingOneGateway()StringgetPrincipal()Retrieves the principal to use.intgetReadTimeoutMillis()Retrieves the maximum length of time in milliseconds that an operation should be allowed to block while waiting for a response from the server.StringgetServerUrl()Creates a url based on the information contained in this class.StringgetServerUrl(String hosts)Creates a url based on the information contained in this class, but uses the provided host names instead of the ones in this class.intgetTimeBetweenEvictionRunsMillis()Retrieves the length of time in milliseconds between periodic background health checks against the available connections in this pool.booleanisCreateIfNecessary()Indicates whether the connection pool should create a new connection if one is requested when there are none available.booleanisRetryFailedOperations()Indicates if retries are enabled.booleanisTestOnBorrow()Indicates that test-on-borrow is enabled or not.booleanisTestOnReturn()Indicates that test-on-return is enabled or not.booleanisUseDnsSrvRecords()Indicates whether to use DNS Service Records to connect to this LDAP datastore.booleanisUseLdapReferral()Indicates whether associated connections should attempt to follow any referrals that they encounter.booleanisUseSSL()Returns true if the useSSL flag is set.booleanisUseStartTLS()Indicates whether StartTLS will be used.booleanisVerifyHost()Indicates whether to verify the hostname during an SSL connection creation or not.voidsetAuthenticationMethod(String authenticationMethod)Specifies the authentication method.voidsetBinaryAttributes(List<String> binaryAttributes)Specifies a list of LDAP binary attributes for this datastore.voidsetClientTlsCertificate(String clientTlsCertificate)Specifies the client TLS certificate.voidsetConnTimeoutMillis(int connTimeoutMillis)Specifies the maximum length of time in milliseconds that a connection attempt should be allowed to continue before giving up.voidsetCreateIfNecessary(boolean createIfNecessary)Specifies whether the connection pool should create a new connection if one is requested when there are none available.voidsetCredentials(String credentials)Specifies the credentials for this class.voidsetDnsTtlMillis(int dnsTtlMillis)Specifies the maximum length of time in milliseconds that DNS information should be cached before it needs to be retrieved again.voidsetHost(String host)Specifies the host name.voidsetId(String id)Specifies the LDAP id.voidsetLdapDnsSrvPrefix(String ldapDnsSrvPrefix)Specifies the prefix used to query LDAP DNS Service Records.voidsetLdapsDnsSrvPrefix(String ldapsDnsSrvPrefix)Specifies the prefix used to query LDAPs DNS Service Records.voidsetLdapTagConfigList(List<org.sourceid.saml20.domain.datasource.tag.LdapTagConfig> ldapTagConfigList)Specifies the List of supported tags for this datastore.voidsetLdapTags(List<LdapInfo.LdapTag> ldapTags)Specifies the List of supported tags for this datastore.voidsetLdapType(LdapInfo.LdapType ldapType)Specifies the LDAP type (GENERIC, AD, PingDirectory, Custom or SunONE).voidsetLdapTypeDesc(String ldapTypeDesc)Specifies the type of this LDAP datastore,voidsetMax(int max)Specifies the maximum number of connections that should be maintained in the pool.voidsetMaxWait(int maxWait)Specifies the maximum length of time in milliseconds to wait for a connection to become available when trying to obtain a connection from the pool.voidsetMin(int min)Specifies the number of connections to initially establish when the pool is created.voidsetName(String name)Specifies the name of this LDAP datastore.voidsetPingOneConnection(String pingOneConnection)voidsetPingOneEnvironment(String pingOneEnvironment)voidsetPingOneGateway(String pingOneGateway)voidsetPrincipal(String principal)Specifies the principal to use.voidsetReadTimeoutMillis(int readTimeoutMillis)Specifies the maximum length of time in milliseconds that an operation should be allowed to block while waiting for a response from the server.voidsetRetryFailedOperations(boolean retryFailedOperations)Enable/disable retries.voidsetTestOnBorrow(boolean testOnBorrow)Specifies the status of test-on-borrow.voidsetTestOnReturn(boolean testOnReturn)Specifies the status of test-on-return.voidsetTimeBetweenEvictionRunsMillis(int timeBetweenEvictionRunsMillis)Specifies the length of time in milliseconds between periodic background health checks against the available connections in this pool.voidsetUseDnsSrvRecords(boolean useDnsSrvRecords)Specifies to use DNS Service Records to connect to the LDAP datastore or not.voidsetUseLdapReferral(boolean useLdapReferral)Specifies whether associated connections should attempt to follow any referrals that they encounter, using the referral connector for the associated connection.voidsetUseSSL(boolean useSSL)Specifies the useSSL flag.voidsetUseStartTLS(boolean useStartTLS)Specifies the useStartTLS flag.voidsetVerifyHost(boolean verifyHost)Specifies to verify the hostname or not during an SSL connection connection.StringtoString()
-
-
-
Method Detail
-
clone
public LdapInfo clone()
Provides a clone of the information stored in the LdapInfo class.- Returns:
- a new LdapInfo with the same information
-
getServerUrl
public String getServerUrl()
Creates a url based on the information contained in this class. It is created in the format: ldap://hostname or ldaps://hostname depending on the UseSSL flag. If multiple hosts name are used, space separated, then each will have the protocol prepended.- Returns:
- A url suitable to use for connection to an LDAP datastore.
-
getServerUrl
public String getServerUrl(String hosts)
Creates a url based on the information contained in this class, but uses the provided host names instead of the ones in this class. It is created in the format: ldap://hostname or ldaps://hostname depending on the UseSSL flag. If multiple hosts name are used, space separated, then each will have the protocol prepended.- Parameters:
hosts- The String containing the host names- Returns:
- A url suitable to use for connection to an LDAP datastore.
-
getAuthenticationMethod
public String getAuthenticationMethod()
Retrieves the specified authentication method. Should be one of: none, simple, clientTlsCert- Returns:
- the authentication method.
- See Also:
Context.SECURITY_AUTHENTICATION
-
setAuthenticationMethod
public void setAuthenticationMethod(String authenticationMethod)
Specifies the authentication method. Because this class is cloned from the actual LDAP information, changing this value will not have any impact on the PingFederate maintained LDAP information.- Parameters:
authenticationMethod- The desired authentication method. Should be one of: none, simple.- See Also:
Context.SECURITY_AUTHENTICATION
-
getCredentials
public String getCredentials()
Retrieves The credentials for this LDAP datastore.- Returns:
- The credentials for this LDAP
- See Also:
Context.SECURITY_CREDENTIALS
-
setCredentials
public void setCredentials(String credentials)
Specifies the credentials for this class. Because this class is cloned from the actual LDAP information, changing this value will not have any impact on the PingFederate maintained LDAP information.- Parameters:
credentials- The credentials for this LDAP datastore.- See Also:
Context.SECURITY_CREDENTIALS
-
getClientTlsCertificate
public String getClientTlsCertificate()
Retrieves the alias of the client TLS certificate to use.- Returns:
- The certificate alias.
-
setClientTlsCertificate
public void setClientTlsCertificate(String clientTlsCertificate)
Specifies the client TLS certificate. The certificate must exist in the PingFederate Trust Store.- Parameters:
clientTlsCertificate- The alias of the certificate to use.
-
getHost
public String getHost()
Retrieves the hostname. It can be a space separated list of hostnames. Used bygetServerUrl().- Returns:
- The hostname. It can be a space separated list of host names.
-
setHost
public void setHost(String host)
Specifies the host name. A list of space separated hostnames can be used. Because this class is cloned from the actual LDAP information, changing this value will not have any impact on the PingFederate maintained LDAP information.- Parameters:
host- The hostname to use. A list of space separated host names can be used.
-
getPrincipal
public String getPrincipal()
Retrieves the principal to use.- Returns:
- The principal information to use.
- See Also:
Context.SECURITY_PRINCIPAL
-
setPrincipal
public void setPrincipal(String principal)
Specifies the principal to use. Because this class is cloned from the actual LDAP information, changing this value will not have any impact on the PingFederate maintained LDAP information.- Parameters:
principal- security principal to set.- See Also:
Context.SECURITY_PRINCIPAL
-
isUseSSL
public boolean isUseSSL()
Returns true if the useSSL flag is set. This flag is used bygetServerUrl()to determine whether to use ldap://hostname or ldaps://hostname.- Returns:
- true to use SSL.
-
setUseSSL
public void setUseSSL(boolean useSSL)
Specifies the useSSL flag. If true,getServerUrl()returnsldaps://hostname. If false,getServerUrl()returnsldap://hostname. Because this class is cloned from the actual LDAP information, changing this value will not have any impact on the PingFederate maintained LDAP information.- Parameters:
useSSL- The value to set for the useSSL flag.
-
getId
public String getId()
Retrieves The PingFederate id that was generated for the corresponding LDAP connection information.- Returns:
- the LDAP datastore information id.
-
setId
public void setId(String id)
Specifies the LDAP id. Because this class is cloned from the actual LDAP information, changing this value will not have any impact on the PingFederate maintained LDAP information.- Parameters:
id- The value to set.
-
getName
public String getName()
Retrieves the name of this LDAP datastore.- Returns:
- the name of this LDAP datastore
-
setName
public void setName(String name)
Specifies the name of this LDAP datastore.- Parameters:
name- the LDAP datastore name
-
getLdapType
public LdapInfo.LdapType getLdapType()
Retrieves the LDAP type (GENERIC, AD, PingDirectory, Custom or SunONE).- Returns:
- the LDAP type
-
setLdapType
public void setLdapType(LdapInfo.LdapType ldapType)
Specifies the LDAP type (GENERIC, AD, PingDirectory, Custom or SunONE).- Parameters:
ldapType- the LDAP type to set.
-
getLdapTypeDesc
public String getLdapTypeDesc()
Retrieves the type of this LDAP datastore.- Returns:
- the type of this LDAP datasotre
- See Also:
LdapInfo.LdapType
-
setLdapTypeDesc
public void setLdapTypeDesc(String ldapTypeDesc)
Specifies the type of this LDAP datastore,- Parameters:
ldapTypeDesc- the LDAP data store type value- See Also:
LdapInfo
-
isTestOnBorrow
public boolean isTestOnBorrow()
Indicates that test-on-borrow is enabled or not.- Returns:
trueif test-on-borrow is enabled,falseotherwise
-
setTestOnBorrow
public void setTestOnBorrow(boolean testOnBorrow)
Specifies the status of test-on-borrow.- Parameters:
testOnBorrow- the test-on-borrow status
-
isTestOnReturn
public boolean isTestOnReturn()
Indicates that test-on-return is enabled or not.- Returns:
trueif test-on-return is enabled,falseotherwise
-
setTestOnReturn
public void setTestOnReturn(boolean testOnReturn)
Specifies the status of test-on-return.- Parameters:
testOnReturn- the test-on-return status
-
isCreateIfNecessary
public boolean isCreateIfNecessary()
Indicates whether the connection pool should create a new connection if one is requested when there are none available.- Returns:
trueif a new connection should be created if none are available when a request is received, otherwisefalse
-
setCreateIfNecessary
public void setCreateIfNecessary(boolean createIfNecessary)
Specifies whether the connection pool should create a new connection if one is requested when there are none available.- Parameters:
createIfNecessary- Specifies whether the connection pool should create a new connection if one is requested when there are none available.
-
isRetryFailedOperations
public boolean isRetryFailedOperations()
Indicates if retries are enabled.- Returns:
- whether retries are enabled
-
setRetryFailedOperations
public void setRetryFailedOperations(boolean retryFailedOperations)
Enable/disable retries.- Parameters:
retryFailedOperations- whether or not to enable retries
-
getMin
public int getMin()
Retrieves the number of connections to initially establish when the pool is created. It must be greater than or equal to one.- Returns:
- the initial connections established in the connection pool
-
setMin
public void setMin(int min)
Specifies the number of connections to initially establish when the pool is created. It must be greater than or equal to one.- Parameters:
min- the initial connections established in the connection pool
-
getMax
public int getMax()
Retrieves the maximum number of connections that should be maintained in the pool.- Returns:
- the maximum number of connections that should be maintained in the pool.
-
setMax
public void setMax(int max)
Specifies the maximum number of connections that should be maintained in the pool. It must be greater than or equal to the initial number of connections.- Parameters:
max- the maximum number of connections that should be maintained in the pool.
-
getMaxWait
public int getMaxWait()
Retrieves the maximum length of time in milliseconds to wait for a connection to become available when trying to obtain a connection from the pool.- Returns:
- The maximum length of time in milliseconds to wait for a connection to become available when trying to obtain a connection from the pool, or zero to indicate that the pool should not block at all if no connections are available and that it should either create a new connection or throw an exception.
-
setMaxWait
public void setMaxWait(int maxWait)
Specifies the maximum length of time in milliseconds to wait for a connection to become available when trying to obtain a connection from the pool.- Parameters:
maxWait- The maximum length of time in milliseconds to wait for a connection to become available when trying to obtain a connection from the pool. A value of zero should be used to indicate that the pool should not block at all if no connections are available and that it should either create a new connection or throw an exception
-
getTimeBetweenEvictionRunsMillis
public int getTimeBetweenEvictionRunsMillis()
Retrieves the length of time in milliseconds between periodic background health checks against the available connections in this pool.- Returns:
- The length of time in milliseconds between the periodic background health checks against the available connections in this pool.
-
setTimeBetweenEvictionRunsMillis
public void setTimeBetweenEvictionRunsMillis(int timeBetweenEvictionRunsMillis)
Specifies the length of time in milliseconds between periodic background health checks against the available connections in this pool.- Parameters:
timeBetweenEvictionRunsMillis- The length of time in milliseconds between periodic background health checks against the available connections in this pool. The provided value must be greater than zero.
-
getBinaryAttributes
public List<String> getBinaryAttributes()
Retrieves a list of LDAP binary attributes for this datastore.- Returns:
- a list of LDAP binary attributes
-
setBinaryAttributes
public void setBinaryAttributes(List<String> binaryAttributes)
Specifies a list of LDAP binary attributes for this datastore.- Parameters:
binaryAttributes- list of LDAP binary attributes
-
getReadTimeoutMillis
public int getReadTimeoutMillis()
Retrieves the maximum length of time in milliseconds that an operation should be allowed to block while waiting for a response from the server.- Returns:
- The maximum length of time in milliseconds that an operation should be allowed to block while waiting for a response from the server, or zero if there should not be any default timeout.
-
setReadTimeoutMillis
public void setReadTimeoutMillis(int readTimeoutMillis)
Specifies the maximum length of time in milliseconds that an operation should be allowed to block while waiting for a response from the server. A value of zero indicates that there should be no timeout.- Parameters:
readTimeoutMillis- The maximum length of time in milliseconds that an operation should be allowed to block while waiting for a response from the server.
-
getConnTimeoutMillis
public int getConnTimeoutMillis()
Retrieves the maximum length of time in milliseconds that a connection attempt should be allowed to continue before giving up.- Returns:
- The maximum length of time in milliseconds that a connection attempt should be allowed to continue before giving up, or zero to indicate that there should be no connect timeout.
-
setConnTimeoutMillis
public void setConnTimeoutMillis(int connTimeoutMillis)
Specifies the maximum length of time in milliseconds that a connection attempt should be allowed to continue before giving up. A value of zero indicates that there should be no connect timeout.- Parameters:
connTimeoutMillis- The maximum length of time in milliseconds that a connection attempt should be allowed to continue before giving up.
-
isVerifyHost
public boolean isVerifyHost()
Indicates whether to verify the hostname during an SSL connection creation or not.- Returns:
trueif the hostname should be verified,falseotherwise
-
setVerifyHost
public void setVerifyHost(boolean verifyHost)
Specifies to verify the hostname or not during an SSL connection connection.- Parameters:
verifyHost-trueto verify the hostname,falseotherwise
-
isUseDnsSrvRecords
public boolean isUseDnsSrvRecords()
Indicates whether to use DNS Service Records to connect to this LDAP datastore.- Returns:
trueif DNS Service Records should be used,falseotherwise
-
setUseDnsSrvRecords
public void setUseDnsSrvRecords(boolean useDnsSrvRecords)
Specifies to use DNS Service Records to connect to the LDAP datastore or not.- Parameters:
useDnsSrvRecords-trueif DNS Service Records should be used,falseotherwise
-
isUseLdapReferral
public boolean isUseLdapReferral()
Indicates whether associated connections should attempt to follow any referrals that they encounter.- Returns:
trueif associated connections should attempt to follow any referrals that they encounter, orfalseif not.
-
setUseLdapReferral
public void setUseLdapReferral(boolean useLdapReferral)
Specifies whether associated connections should attempt to follow any referrals that they encounter, using the referral connector for the associated connection.- Parameters:
useLdapReferral- Specifies whether associated connections should attempt to follow any referrals that they encounter.
-
getDnsTtlMillis
public int getDnsTtlMillis()
Retrieves the maximum length of time in milliseconds that previously-retrieved DNS information should be cached before it needs to be refreshed.- Returns:
- The maximum length of time in milliseconds that previously-retrieved DNS information should be cached before it needs to be refreshed.
-
setDnsTtlMillis
public void setDnsTtlMillis(int dnsTtlMillis)
Specifies the maximum length of time in milliseconds that DNS information should be cached before it needs to be retrieved again. A value less than or equal to zero will use the default TTL of one hour.- Parameters:
dnsTtlMillis- the maximum length of time in milliseconds that DNS information should be cached before it needs to be retrieved again.
-
getLdapDnsSrvPrefix
public String getLdapDnsSrvPrefix()
Retrieves the prefix used to query LDAP DNS Service Records.- Returns:
- the prefix used to query LDAP DNS Service Records
-
setLdapDnsSrvPrefix
public void setLdapDnsSrvPrefix(String ldapDnsSrvPrefix)
Specifies the prefix used to query LDAP DNS Service Records. This prefix would be used whenisUseSSL()isfalse.- Parameters:
ldapDnsSrvPrefix- the prefix used to query LDAP DNS Service Records
-
getLdapsDnsSrvPrefix
public String getLdapsDnsSrvPrefix()
Retrieves the prefix used to query LDAPs DNS Service Records.- Returns:
- the prefix used to query LDAPs DNS Service Records
-
setLdapsDnsSrvPrefix
public void setLdapsDnsSrvPrefix(String ldapsDnsSrvPrefix)
Specifies the prefix used to query LDAPs DNS Service Records. This prefix would be used whenisUseSSL()istrue.- Parameters:
ldapsDnsSrvPrefix- the prefix used to query LDAPs DNS Service Records
-
getPingOneConnection
public String getPingOneConnection()
-
setPingOneConnection
public void setPingOneConnection(String pingOneConnection)
-
getPingOneEnvironment
public String getPingOneEnvironment()
-
setPingOneEnvironment
public void setPingOneEnvironment(String pingOneEnvironment)
-
getPingOneGateway
public String getPingOneGateway()
-
setPingOneGateway
public void setPingOneGateway(String pingOneGateway)
-
getLdapTagConfigList
public List<org.sourceid.saml20.domain.datasource.tag.LdapTagConfig> getLdapTagConfigList()
Retrieves the List of supported tags for this datastore.NOTE: Use
getLdapTags()instead of this Method. This method should only be used By PingFederate internally.- Returns:
- the List of supported tags
-
setLdapTagConfigList
public void setLdapTagConfigList(List<org.sourceid.saml20.domain.datasource.tag.LdapTagConfig> ldapTagConfigList)
Specifies the List of supported tags for this datastore.NOTE: Use
setLdapTags(List)instead of this Method. This method should only be used By PingFederate internally.- Parameters:
ldapTagConfigList- the List of supported tags
-
getLdapTags
public List<LdapInfo.LdapTag> getLdapTags()
Retrieves the List of supported tags for this datastore.- Returns:
- the List of supported tags
- Since:
- 10.3
-
setLdapTags
public void setLdapTags(List<LdapInfo.LdapTag> ldapTags)
Specifies the List of supported tags for this datastore.- Parameters:
ldapTags- the List of supported tags- Since:
- 10.3
-
isUseStartTLS
public boolean isUseStartTLS()
Indicates whether StartTLS will be used.- Returns:
- true to use StartTLS.
- Since:
- 12.1
-
setUseStartTLS
public void setUseStartTLS(boolean useStartTLS)
Specifies the useStartTLS flag.- Parameters:
useStartTLS- The value to set for the useStartTLS flag.- Since:
- 12.1
-
-