Class TopologyCapabilities
- java.lang.Object
-
- org.apache.sling.event.impl.jobs.config.TopologyCapabilities
-
public class TopologyCapabilities extends Object
The capabilities of a topology.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TopologyCapabilities.InstanceDescriptionComparator
-
Field Summary
Fields Modifier and Type Field Description static String
PROPERTY_TOPICS
-
Constructor Summary
Constructors Constructor Description TopologyCapabilities(org.apache.sling.discovery.TopologyView view, JobManagerConfiguration config)
Create a new instance
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deactivate()
Deactivate this object.String
detectTarget(String jobTopic, Map<String,Object> jobProperties, QueueConfigurationManager.QueueInfo queueInfo)
Detect the target instance.static Map<String,String>
getAllInstancesMap(org.apache.sling.discovery.TopologyView view)
Map<String,List<org.apache.sling.discovery.InstanceDescription>>
getInstanceCapabilities()
Get the instance capabilities.List<org.apache.sling.discovery.InstanceDescription>
getPotentialTargets(String jobTopic)
Return the potential targets (Sling IDs) sorted by IDboolean
isActive()
Is this object still active? If it is not active anymore it should not be used!boolean
isActive(String instanceId)
Is this instance still active?boolean
isLeader()
Is the current instance the leader?boolean
isSame(Map<String,String> newAllInstancesMap)
Is this capabilities the same as represented by the provided instance map?
-
-
-
Field Detail
-
PROPERTY_TOPICS
public static final String PROPERTY_TOPICS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TopologyCapabilities
public TopologyCapabilities(org.apache.sling.discovery.TopologyView view, JobManagerConfiguration config)
Create a new instance- Parameters:
view
- The new viewconfig
- 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.
-
detectTarget
public String detectTarget(String jobTopic, Map<String,Object> jobProperties, QueueConfigurationManager.QueueInfo queueInfo)
Detect the target instance.
-
-