Package org.apache.sling.event.impl.jobs.config

# 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 final class`
`TopologyCapabilities.InstanceDescriptionComparator`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`PROPERTY_TOPICS`

## Constructor Summary

Constructors
Constructor
Description
`TopologyCapabilities(org.apache.sling.discovery.TopologyView view, JobManagerConfiguration config)`
Create a new instance

## Method Summary

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 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?

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### PROPERTY_TOPICS

public static final String PROPERTY_TOPICS

See Also:
  - Constant Field Values

## Constructor Details

### 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 Details

### 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.

### getInstanceCapabilities

public Map<String,List<org.apache.sling.discovery.InstanceDescription>> getInstanceCapabilities()
Get the instance capabilities.

Returns:
  The map of instance capabilities.