Package org.ldaptive
Class LdapURLSet
- java.lang.Object
-
- org.ldaptive.LdapURLSet
-
public class LdapURLSet extends java.lang.Object
A set of LDAP URLs with helper functions for common connection strategies.- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
logger
Logger for this class.
-
Constructor Summary
Constructors Constructor Description LdapURLSet(ConnectionStrategy strategy, java.lang.String ldapUrls)
Creates a new LDAP URL set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<LdapURL>
getActiveUrls()
Returns the active URLs.java.util.List<LdapURL>
getInactiveUrls()
Returns the inactive URLs.java.util.List<LdapURL>
getUrls()
boolean
hasActiveUrls()
Returns whether this set has any active URLs.boolean
hasInactiveUrls()
Returns whether this set has any inactive URLs.protected void
populate(java.util.List<LdapURL> ldapUrls)
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.java.lang.String
toString()
-
-
-
Constructor Detail
-
LdapURLSet
public LdapURLSet(ConnectionStrategy strategy, java.lang.String ldapUrls)
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 Detail
-
getUrls
public java.util.List<LdapURL> 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
public java.util.List<LdapURL> 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
public java.util.List<LdapURL> 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
protected void populate(java.util.List<LdapURL> ldapUrls)
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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-