Class AnnouncementRegistryImpl
java.lang.Object
org.apache.sling.discovery.base.connectors.announcement.AnnouncementRegistryImpl
- All Implemented Interfaces:
AnnouncementRegistry
Default implementation of the AnnouncementRegistry which
handles JSON-backed announcements and does so by storing
them in a local like /var/discovery/impl/clusterNodes/$slingId/announcement.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
activate()
void
addAllExcept
(Announcement target, ClusterView clusterView, AnnouncementFilter filter) Add all registered announcements to the given target announcement that are accepted by the given filtervoid
Check for expired announcements and remove any if applicableboolean
hasActiveAnnouncement
(String ownerId) Whether or not the given owner has an active (ie not expired) announcement registeredlistAnnouncementsInSameCluster
(ClusterView localClusterView) list all announcements that were received by instances in the local clusterlistInstances
(ClusterView localClusterView) Returns the list of instances contained in all non-expired announcements of this registrylist all announcements that were received (incoming or inherited) by this instancelist 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)static AnnouncementRegistryImpl
testConstructor
(ResourceResolverFactory resourceResolverFactory, SlingSettingsService slingSettingsService, BaseConfig config) static AnnouncementRegistryImpl
testConstructorAndActivate
(ResourceResolverFactory resourceResolverFactory, SlingSettingsService slingSettingsService, BaseConfig config) void
unregisterAnnouncement
(String ownerId) Unregister the announcement owned by the given slingId
-
Constructor Details
-
AnnouncementRegistryImpl
public AnnouncementRegistryImpl()
-
-
Method Details
-
testConstructorAndActivate
public static AnnouncementRegistryImpl testConstructorAndActivate(ResourceResolverFactory resourceResolverFactory, SlingSettingsService slingSettingsService, BaseConfig config) -
testConstructor
public static AnnouncementRegistryImpl testConstructor(ResourceResolverFactory resourceResolverFactory, SlingSettingsService slingSettingsService, BaseConfig config) -
activate
protected void activate() -
unregisterAnnouncement
Description copied from interface:AnnouncementRegistry
Unregister the announcement owned by the given slingId- Specified by:
unregisterAnnouncement
in interfaceAnnouncementRegistry
-
listLocalAnnouncements
Description copied from interface:AnnouncementRegistry
list all announcements that were received (incoming or inherited) by this instance- Specified by:
listLocalAnnouncements
in interfaceAnnouncementRegistry
-
listLocalIncomingAnnouncements
Description copied from interface:AnnouncementRegistry
list all announcements that this instance received (incoming)- Specified by:
listLocalIncomingAnnouncements
in interfaceAnnouncementRegistry
-
listAnnouncementsInSameCluster
Description copied from interface:AnnouncementRegistry
list all announcements that were received by instances in the local cluster- Specified by:
listAnnouncementsInSameCluster
in interfaceAnnouncementRegistry
-
hasActiveAnnouncement
Description copied from interface:AnnouncementRegistry
Whether or not the given owner has an active (ie not expired) announcement registered- Specified by:
hasActiveAnnouncement
in interfaceAnnouncementRegistry
-
registerAnnouncement
Description copied from interface:AnnouncementRegistry
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)- Specified by:
registerAnnouncement
in interfaceAnnouncementRegistry
- Returns:
- the backoff interval (in seconds) for stable connectors - or -1 if the registration was not successful (likely indicating a loop)
-
addAllExcept
Description copied from interface:AnnouncementRegistry
Add all registered announcements to the given target announcement that are accepted by the given filter- Specified by:
addAllExcept
in interfaceAnnouncementRegistry
-
checkExpiredAnnouncements
public void checkExpiredAnnouncements()Description copied from interface:AnnouncementRegistry
Check for expired announcements and remove any if applicable- Specified by:
checkExpiredAnnouncements
in interfaceAnnouncementRegistry
-
listInstances
Description copied from interface:AnnouncementRegistry
Returns the list of instances contained in all non-expired announcements of this registry- Specified by:
listInstances
in interfaceAnnouncementRegistry
-