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
`static String` `KEY_MESSAGE`
`static String` `TOPIC_DISTRIBUTION_LOG`

### Constructor Summary

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

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `activate​(org.osgi.framework.BundleContext context)`
`void` `deactivate()`
`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 Detail

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

#### DiscoveryService

    public DiscoveryService()

#### DiscoveryService

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

### Method Detail

#### activate

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

#### deactivate

    public void deactivate()

#### getTopologyView

    public TopologyView getTopologyView()

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