public class TopologyCapabilities extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TopologyCapabilities.InstanceDescriptionComparator |
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_TOPICS |
Constructor and Description |
---|
TopologyCapabilities(org.apache.sling.discovery.TopologyView view,
JobManagerConfiguration config)
Create a new instance
|
Modifier and Type | Method and 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,
Map<String,Object> jobProperties)
Return the potential targets (Sling IDs) sorted by ID
|
boolean |
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?
|
public static final String PROPERTY_TOPICS
public TopologyCapabilities(org.apache.sling.discovery.TopologyView view, JobManagerConfiguration config)
view
- The new viewconfig
- The current job manager configuration.public static Map<String,String> getAllInstancesMap(org.apache.sling.discovery.TopologyView view)
public boolean isSame(Map<String,String> newAllInstancesMap)
newAllInstancesMap
- The instance maptrue
if they represent the same state.public void deactivate()
public boolean isActive()
true
if still active.public boolean isActive(String instanceId)
instanceId
- The instance idtrue
if the instance is active.public boolean isLeader()
public List<org.apache.sling.discovery.InstanceDescription> getPotentialTargets(String jobTopic, Map<String,Object> jobProperties)
public String detectTarget(String jobTopic, Map<String,Object> jobProperties, QueueConfigurationManager.QueueInfo queueInfo)
Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.