org.opends.admin.ads
Class TopologyCache

java.lang.Object
  extended by org.opends.admin.ads.TopologyCache

public class TopologyCache
extends java.lang.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
TopologyCache(ADSContext adsContext, ApplicationTrustManager trustManager)
          Constructor of the TopologyCache.
 
Method Summary
 ADSContext getAdsContext()
          Returns the adsContext used by this TopologyCache.
 TopologyCacheFilter getFilter()
          Returns the filter to be used when retrieving information.
 java.util.LinkedHashSet<PreferredConnection> getPreferredConnections()
          Returns the list of LDAP URLs and connection type that are preferred to be used to connect to the servers.
 java.util.Set<ServerDescriptor> getServers()
          Returns a Set containing all the servers that are registered in the ADS.
 java.util.Set<SuffixDescriptor> getSuffixes()
          Returns a Set containing the suffixes (replication topologies) that could be retrieved after the last call to reloadTopology.
 void reloadTopology()
          Reads the configuration of the registered servers.
 void setPreferredConnections(java.util.LinkedHashSet<PreferredConnection> cnx)
          Sets the list of LDAP URLs and connection type that are preferred to be used to connect to the servers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopologyCache

public TopologyCache(ADSContext adsContext,
                     ApplicationTrustManager trustManager)
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.
Method Detail

reloadTopology

public void reloadTopology()
                    throws TopologyCacheException
Reads the configuration of the registered servers.

Throws:
TopologyCacheException - if there is an issue reading the configuration of the registered servers.

setPreferredConnections

public void setPreferredConnections(java.util.LinkedHashSet<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 java.util.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 java.util.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 java.util.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.