Class TopologyCapabilities


  • public class TopologyCapabilities
    extends Object
    The capabilities of a topology.
    • Constructor Detail

      • TopologyCapabilities

        public TopologyCapabilities​(org.apache.sling.discovery.TopologyView view,
                                    JobManagerConfiguration config)
        Create a new instance
        Parameters:
        view - The new view
        config - The current job manager configuration.
    • Method Detail

      • getAllInstancesMap

        public static Map<String,​String> getAllInstancesMap​(org.apache.sling.discovery.TopologyView view)
      • isSame

        public boolean isSame​(Map<String,​String> newAllInstancesMap)
        Is this capabilities the same as represented by the provided instance map?
        Parameters:
        newAllInstancesMap - The instance map
        Returns:
        true if they represent the same state.
      • deactivate

        public void deactivate()
        Deactivate this object.
      • isActive

        public boolean isActive()
        Is this object still active? If it is not active anymore it should not be used!
        Returns:
        true if still active.
      • isActive

        public boolean isActive​(String instanceId)
        Is this instance still active?
        Parameters:
        instanceId - The instance id
        Returns:
        true if the instance is active.
      • isLeader

        public boolean isLeader()
        Is the current instance the leader?
      • getPotentialTargets

        public List<org.apache.sling.discovery.InstanceDescription> getPotentialTargets​(String jobTopic)
        Return the potential targets (Sling IDs) sorted by ID
        Returns:
        A list of instance descriptions. The list might be empty.
      • getInstanceCapabilities

        public Map<String,​List<org.apache.sling.discovery.InstanceDescription>> getInstanceCapabilities()
        Get the instance capabilities.
        Returns:
        The map of instance capabilities.