Interface TopologyView


  • public interface TopologyView
    A topology view is a cross-cluster list of instances and clusters that have announced themselves with the DiscoveryService.

    All instances in a topology must and do have a unique sling.id.

    See Also:
    InstanceDescription.getSlingId()
    • Method Detail

      • isCurrent

        boolean isCurrent()
        Checks if this TopologyView is currently valid - or if the service knows of a topology change just going on (or another uncertainty about the topology such as IOException etc)
        Returns:
        true if this TopologyView is currently valid, false if the service knows of a topology change just going on (or another issue with discovery like IOException etc)
      • getLocalInstance

        InstanceDescription getLocalInstance()
        Provides the InstanceDescription belonging to this instance.
        Returns:
        the InstanceDescription belonging to this instance
      • getInstances

        java.util.Set<InstanceDescription> getInstances()
        Provides the set of InstanceDescriptions in the entire topology, without any particular order
        Returns:
        the set of InstanceDescriptions in the entire topology, without any particular order
      • findInstances

        java.util.Set<InstanceDescription> findInstances​(InstanceFilter filter)
        Searches through this topology and picks those accepted by the provided InstanceFilter - and returns them without any particular order
        Parameters:
        filter - the filter to use
        Returns:
        the set of InstanceDescriptions which were accepted by the InstanceFilter, without any particular order
      • getClusterViews

        java.util.Set<ClusterView> getClusterViews()
        Provides the collection of ClusterViews.

        Note that all InstanceDescriptions belong to exactly one ClusterView - including InstanceDescriptions that form "a cluster of 1"

        Returns:
        the set of ClusterViews, without any particular order