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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactivate()voidaddAllExcept(Announcement target, ClusterView clusterView, AnnouncementFilter filter) Add all registered announcements to the given target announcement that are accepted by the given filtervoidCheck for expired announcements and remove any if applicablebooleanhasActiveAnnouncement(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)longregisterAnnouncement(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 AnnouncementRegistryImpltestConstructor(ResourceResolverFactory resourceResolverFactory, SlingSettingsService slingSettingsService, BaseConfig config) static AnnouncementRegistryImpltestConstructorAndActivate(ResourceResolverFactory resourceResolverFactory, SlingSettingsService slingSettingsService, BaseConfig config) voidunregisterAnnouncement(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:AnnouncementRegistryUnregister the announcement owned by the given slingId- Specified by:
unregisterAnnouncementin interfaceAnnouncementRegistry
-
listLocalAnnouncements
Description copied from interface:AnnouncementRegistrylist all announcements that were received (incoming or inherited) by this instance- Specified by:
listLocalAnnouncementsin interfaceAnnouncementRegistry
-
listLocalIncomingAnnouncements
Description copied from interface:AnnouncementRegistrylist all announcements that this instance received (incoming)- Specified by:
listLocalIncomingAnnouncementsin interfaceAnnouncementRegistry
-
listAnnouncementsInSameCluster
Description copied from interface:AnnouncementRegistrylist all announcements that were received by instances in the local cluster- Specified by:
listAnnouncementsInSameClusterin interfaceAnnouncementRegistry
-
hasActiveAnnouncement
Description copied from interface:AnnouncementRegistryWhether or not the given owner has an active (ie not expired) announcement registered- Specified by:
hasActiveAnnouncementin interfaceAnnouncementRegistry
-
registerAnnouncement
Description copied from interface:AnnouncementRegistryRegister 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:
registerAnnouncementin 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:AnnouncementRegistryAdd all registered announcements to the given target announcement that are accepted by the given filter- Specified by:
addAllExceptin interfaceAnnouncementRegistry
-
checkExpiredAnnouncements
public void checkExpiredAnnouncements()Description copied from interface:AnnouncementRegistryCheck for expired announcements and remove any if applicable- Specified by:
checkExpiredAnnouncementsin interfaceAnnouncementRegistry
-
listInstances
Description copied from interface:AnnouncementRegistryReturns the list of instances contained in all non-expired announcements of this registry- Specified by:
listInstancesin interfaceAnnouncementRegistry
-