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