Package org.apache.sling.discovery.base.connectors.announcement

# Interface AnnouncementRegistry

All Known Implementing Classes:
  `AnnouncementRegistryImpl`

public interface AnnouncementRegistry
The announcement registry keeps track of all the announcement that this instance either received by a joined topology connector or that a topology connector inherited from the counterpart (the topology connector servlet)

## Method Summary

Modifier and Type
Method
Description
`void`
`addAllExcept(Announcement target, org.apache.sling.discovery.ClusterView localClusterView, AnnouncementFilter filter)`
Add all registered announcements to the given target announcement that are accepted by the given filter
`void`
`checkExpiredAnnouncements()`
Check for expired announcements and remove any if applicable
`boolean`
`hasActiveAnnouncement(String ownerId)`
Whether or not the given owner has an active (ie not expired) announcement registered
`Collection<Announcement>`
`listAnnouncementsInSameCluster(org.apache.sling.discovery.ClusterView localClusterView)`
list all announcements that were received by instances in the local cluster
`Collection<org.apache.sling.discovery.InstanceDescription>`
`listInstances(org.apache.sling.discovery.ClusterView localClusterView)`
Returns the list of instances contained in all non-expired announcements of this registry
`Collection<Announcement>`
`listLocalAnnouncements()`
list all announcements that were received (incoming or inherited) by this instance
`Collection<CachedAnnouncement>`
`listLocalIncomingAnnouncements()`
list all announcements that this instance received (incoming)
`long`
`registerAnnouncement(Announcement topologyAnnouncement)`
Register the given announcement - and returns the backoff interval (in seconds) for stable connectors - or -1 if the registration was not successful (likely indicating a loop)
`void`
`unregisterAnnouncement(String ownerId)`
Unregister the announcement owned by the given slingId

## Method Details

### registerAnnouncement

long registerAnnouncement(Announcement topologyAnnouncement)
Register the given announcement - and returns the backoff interval (in seconds) for stable connectors - or -1 if the registration was not successful (likely indicating a loop)

Returns:
  the backoff interval (in seconds) for stable connectors - or -1 if the registration was not successful (likely indicating a loop)

### listAnnouncementsInSameCluster

Collection<Announcement> listAnnouncementsInSameCluster(org.apache.sling.discovery.ClusterView localClusterView)
list all announcements that were received by instances in the local cluster

### listLocalAnnouncements

Collection<Announcement> listLocalAnnouncements()
list all announcements that were received (incoming or inherited) by this instance

### listLocalIncomingAnnouncements

Collection<CachedAnnouncement> listLocalIncomingAnnouncements()
list all announcements that this instance received (incoming)

### checkExpiredAnnouncements

void checkExpiredAnnouncements()
Check for expired announcements and remove any if applicable

### listInstances

Collection<org.apache.sling.discovery.InstanceDescription> listInstances(org.apache.sling.discovery.ClusterView localClusterView)
Returns the list of instances contained in all non-expired announcements of this registry

### addAllExcept

void addAllExcept(Announcement target, org.apache.sling.discovery.ClusterView localClusterView, AnnouncementFilter filter)
Add all registered announcements to the given target announcement that are accepted by the given filter

### unregisterAnnouncement

void unregisterAnnouncement(String ownerId)
Unregister the announcement owned by the given slingId

### hasActiveAnnouncement

boolean hasActiveAnnouncement(String ownerId)
Whether or not the given owner has an active (ie not expired) announcement registered