Class TopologyCapabilities

java.lang.Object
org.apache.sling.event.impl.jobs.config.TopologyCapabilities

public class TopologyCapabilities extends Object
The capabilities of a topology.
  • Field Details

  • Constructor Details

    • TopologyCapabilities

      public TopologyCapabilities(TopologyView view, JobManagerConfiguration config)
      Create a new instance
      Parameters:
      view - The new view
      config - The current job manager configuration.
  • Method Details

    • getAllInstancesMap

      public static Map<String,String> getAllInstancesMap(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<InstanceDescription> getPotentialTargets(String jobTopic)
      Return the potential targets (Sling IDs) sorted by ID
      Returns:
      A list of instance descriptions. The list might be empty.
    • detectTarget

      public String detectTarget(String jobTopic, Map<String,Object> jobProperties, QueueConfigurationManager.QueueInfo queueInfo)
      Detect the target instance.
    • getInstanceCapabilities

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