Package org.ldaptive
Class LdapURLSet
java.lang.Object
org.ldaptive.LdapURLSet
A set of LDAP URLs with helper functions for common connection strategies.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLdapURLSet
(ConnectionStrategy strategy, String ldapUrls) Creates a new LDAP URL set. -
Method Summary
Modifier and TypeMethodDescriptionReturns the active URLs.Returns the inactive URLs.getUrls()
boolean
Returns whether this set has any active URLs.boolean
Returns whether this set has any inactive URLs.protected void
Populates this set with a list of URLs in the order produced byConnectionStrategy.populate(String, LdapURLSet)
.int
size()
Returns the number of URLs in this set.toString()
-
Field Details
-
logger
protected final org.slf4j.Logger loggerLogger for this class. -
urls
List of LDAP URLs to connect to in the order provided by the connection strategy.
-
-
Constructor Details
-
LdapURLSet
Creates a new LDAP URL set.- Parameters:
strategy
- Connection strategy.ldapUrls
- Space-delimited string of URLs describing the LDAP hosts to connect to. The URLs in the string are commonlyldap://
orldaps://
URLs that directly describe the hosts to connect to, but may also describe a resource from which to obtain LDAP connection URLs as is the case forDnsSrvConnectionStrategy
that use URLs with the schemedns:
.
-
-
Method Details
-
getUrls
-
hasActiveUrls
public boolean hasActiveUrls()Returns whether this set has any active URLs.- Returns:
- whether there are any active LDAP URLs in the set, false otherwise.
-
getActiveUrls
Returns the active URLs.- Returns:
- list of active URLs in order they were added.
-
hasInactiveUrls
public boolean hasInactiveUrls()Returns whether this set has any inactive URLs.- Returns:
- whether there are any inactive LDAP URLs in the set, false otherwise.
-
getInactiveUrls
Returns the inactive URLs.- Returns:
- list of inactive URLs in order they were added.
-
size
public int size()Returns the number of URLs in this set.- Returns:
- number of URLs in this set
-
populate
Populates this set with a list of URLs in the order produced byConnectionStrategy.populate(String, LdapURLSet)
. This method MUST be called before the set is used, but MAY be called subsequently periodically to refresh the set of LDAP URLs.- Parameters:
ldapUrls
- LDAP URLs to add to this set.
-
toString
-