Package org.opends.admin.ads
Class TopologyCache
- java.lang.Object
-
- org.opends.admin.ads.TopologyCache
-
public class TopologyCache extends Object
This class allows to read the configuration of the different servers that are registered in a given ADS server. It provides a read only view of the configuration of the servers and of the replication topologies that might be configured between them.
-
-
Constructor Summary
Constructors Constructor Description TopologyCache(ADSContext adsContext, ApplicationTrustManager trustManager, int timeout)Constructor of the TopologyCache.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ADSContextgetAdsContext()Returns the adsContext used by this TopologyCache.Set<org.forgerock.i18n.LocalizableMessage>getErrorMessages()Returns a set of error messages encountered in the TopologyCache.TopologyCacheFiltergetFilter()Returns the filter to be used when retrieving information.LinkedHashSet<PreferredConnection>getPreferredConnections()Returns the list of LDAP URLs and connection type that are preferred to be used to connect to the servers.Set<ServerDescriptor>getServers()Returns a Set containing all the servers that are registered in the ADS.Set<SuffixDescriptor>getSuffixes()Returns a Set containing the suffixes (replication topologies) that could be retrieved after the last call to reloadTopology.voidreloadTopology()Reads the configuration of the registered servers.voidsetPreferredConnections(Set<PreferredConnection> cnx)Sets the list of LDAP URLs and connection type that are preferred to be used to connect to the servers.StringtoString()
-
-
-
Constructor Detail
-
TopologyCache
public TopologyCache(ADSContext adsContext, ApplicationTrustManager trustManager, int timeout)
Constructor of the TopologyCache.- Parameters:
adsContext- the adsContext to the ADS registry.trustManager- the ApplicationTrustManager that must be used to trust certificates when we create connections to the registered servers to read their configuration.timeout- the timeout to establish the connection in milliseconds. Use0to express no timeout.
-
-
Method Detail
-
reloadTopology
public void reloadTopology() throws TopologyCacheExceptionReads the configuration of the registered servers.- Throws:
TopologyCacheException- if there is an issue reading the configuration of the registered servers.
-
setPreferredConnections
public void setPreferredConnections(Set<PreferredConnection> cnx)
Sets the list of LDAP URLs and connection type that are preferred to be used to connect to the servers. When we have a server to which we can connect using a URL on the list we will try to use it.- Parameters:
cnx- the list of preferred connections.
-
getPreferredConnections
public LinkedHashSet<PreferredConnection> getPreferredConnections()
Returns the list of LDAP URLs and connection type that are preferred to be used to connect to the servers. If a URL is on this list, when we have a server to which we can connect using that URL and the associated connection type we will try to use it.- Returns:
- the list of preferred connections.
-
getServers
public Set<ServerDescriptor> getServers()
Returns a Set containing all the servers that are registered in the ADS.- Returns:
- a Set containing all the servers that are registered in the ADS.
-
getSuffixes
public Set<SuffixDescriptor> getSuffixes()
Returns a Set containing the suffixes (replication topologies) that could be retrieved after the last call to reloadTopology.- Returns:
- a Set containing the suffixes (replication topologies) that could be retrieved after the last call to reloadTopology.
-
getFilter
public TopologyCacheFilter getFilter()
Returns the filter to be used when retrieving information.- Returns:
- the filter to be used when retrieving information.
-
getAdsContext
public ADSContext getAdsContext()
Returns the adsContext used by this TopologyCache.- Returns:
- the adsContext used by this TopologyCache.
-
getErrorMessages
public Set<org.forgerock.i18n.LocalizableMessage> getErrorMessages()
Returns a set of error messages encountered in the TopologyCache.- Returns:
- a set of error messages encountered in the TopologyCache.
-
-