Class 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 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. Use 0 to express no timeout.
    • 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​(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.