Package org.apache.sling.distribution.journal.impl.discovery

# Class DiscoveryService

java.lang.Object
org.apache.sling.distribution.journal.impl.discovery.DiscoveryService

All Implemented Interfaces:
  `Runnable`

@ParametersAreNonnullByDefault public class DiscoveryService extends Object implements Runnable
Listens for discovery messages and tracks presence of Subscribers as well as the last processed offset of each Subscriber This component is only activated when there is at least one DistributionSubscriber agent configured. This component is meant to be shared by Publisher agents.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`KEY_MESSAGE`
`static final String`
`TOPIC_DISTRIBUTION_LOG`

## Constructor Summary

Constructors
Constructor
Description
`DiscoveryService()`
`DiscoveryService(org.apache.sling.distribution.journal.MessagingProvider messagingProvider, TopologyChangeHandler topologyChangeHandler, org.osgi.service.event.EventAdmin eventAdmin)`

## Method Summary

Modifier and Type
Method
Description
`void`
`activate(org.osgi.framework.BundleContext context)`
`void`
`deactivate()`
`int`
`getSubscriberCount(String pubAgentName)`
`TopologyView`
`getTopologyView()`
`void`
`handleDiscovery(org.apache.sling.distribution.journal.MessageInfo info, org.apache.sling.distribution.journal.messages.DiscoveryMessage disMsg)`
`void`
`handleLog(org.apache.sling.distribution.journal.MessageInfo info, org.apache.sling.distribution.journal.messages.LogMessage logMsg)`
`void`
`run()`

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

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

## Field Details

### KEY_MESSAGE

public static final String KEY_MESSAGE

See Also:
  - Constant Field Values

### TOPIC_DISTRIBUTION_LOG

public static final String TOPIC_DISTRIBUTION_LOG

See Also:
  - Constant Field Values

## Constructor Details

### DiscoveryService

public DiscoveryService()

### DiscoveryService

public DiscoveryService(org.apache.sling.distribution.journal.MessagingProvider messagingProvider, TopologyChangeHandler topologyChangeHandler, org.osgi.service.event.EventAdmin eventAdmin)

## Method Details

### activate

public void activate(org.osgi.framework.BundleContext context)

### deactivate

public void deactivate()

### getTopologyView

public TopologyView getTopologyView()

### getSubscriberCount

public int getSubscriberCount(String pubAgentName)

### run

public void run()

Specified by:
  `run` in interface `Runnable`

### handleDiscovery

public void handleDiscovery(org.apache.sling.distribution.journal.MessageInfo info, org.apache.sling.distribution.journal.messages.DiscoveryMessage disMsg)

### handleLog

public void handleLog(org.apache.sling.distribution.journal.MessageInfo info, org.apache.sling.distribution.journal.messages.LogMessage logMsg)