Class ClusterMessageServiceImpl
java.lang.Object
com.atlassian.crowd.manager.cluster.message.ClusterMessageServiceImpl
- All Implemented Interfaces:
ClusterMessageManager,ClusterMessageService,com.atlassian.scheduler.JobRunner
public class ClusterMessageServiceImpl
extends Object
implements ClusterMessageService, ClusterMessageManager, com.atlassian.scheduler.JobRunner
-
Constructor Summary
ConstructorsConstructorDescriptionClusterMessageServiceImpl(com.atlassian.scheduler.SchedulerService schedulerService, ClusterMessageDao dao, ClusterService clusterService, com.atlassian.event.api.EventPublisher eventPublisher, Supplier<Long> timestampSupplier) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteMessagesOlderThan(Instant instant) Removes all stored messages older than the specified instantvoidDelete messages with timestamp older than an implementation-defined threshold.voidonApplicationStarted(com.atlassian.config.lifecycle.events.ApplicationStartedEvent e) voidonXMLRestore(XMLRestoreFinishedEvent restoreFinishedEvent) voidSend a message to other nodes (excluding the sender), notifying all listeners on a specific channel.voidregisterListener(ClusterMessageListener listener, String channel) Register a listener on a channel.voidcom.atlassian.scheduler.JobRunnerResponserunJob(com.atlassian.scheduler.JobRunnerRequest request) voidstart()Start polling for new messages.voidstop()Stop polling for new messages and ignore any late messages on start().voidunregisterListener(ClusterMessageListener listener) Unregister a listener from all channels.voidunregisterListener(ClusterMessageListener listener, String channel) Unregister a listener from a specific channel.void
-
Constructor Details
-
ClusterMessageServiceImpl
public ClusterMessageServiceImpl(com.atlassian.scheduler.SchedulerService schedulerService, ClusterMessageDao dao, ClusterService clusterService, com.atlassian.event.api.EventPublisher eventPublisher, Supplier<Long> timestampSupplier)
-
-
Method Details
-
registerSelf
@PostConstruct public void registerSelf() -
unregisterSelf
@PreDestroy public void unregisterSelf() -
onApplicationStarted
@EventListener public void onApplicationStarted(com.atlassian.config.lifecycle.events.ApplicationStartedEvent e) -
onXMLRestore
-
start
public void start()Description copied from interface:ClusterMessageManagerStart polling for new messages.- Specified by:
startin interfaceClusterMessageManager
-
stop
public void stop()Description copied from interface:ClusterMessageManagerStop polling for new messages and ignore any late messages on start().- Specified by:
stopin interfaceClusterMessageManager
-
deleteOldMessages
public void deleteOldMessages()Description copied from interface:ClusterMessageManagerDelete messages with timestamp older than an implementation-defined threshold.- Specified by:
deleteOldMessagesin interfaceClusterMessageManager
-
deleteMessagesOlderThan
Description copied from interface:ClusterMessageManagerRemoves all stored messages older than the specified instant- Specified by:
deleteMessagesOlderThanin interfaceClusterMessageManager
-
registerListener
Description copied from interface:ClusterMessageServiceRegister a listener on a channel.- Specified by:
registerListenerin interfaceClusterMessageService
-
unregisterListener
Description copied from interface:ClusterMessageServiceUnregister a listener from a specific channel.- Specified by:
unregisterListenerin interfaceClusterMessageService
-
unregisterListener
Description copied from interface:ClusterMessageServiceUnregister a listener from all channels.- Specified by:
unregisterListenerin interfaceClusterMessageService
-
publish
Description copied from interface:ClusterMessageServiceSend a message to other nodes (excluding the sender), notifying all listeners on a specific channel.- Specified by:
publishin interfaceClusterMessageService- Parameters:
channel- channel name, max. 64 characters.message- message content, max. 1024 characters.
-
runJob
@Nullable public com.atlassian.scheduler.JobRunnerResponse runJob(com.atlassian.scheduler.JobRunnerRequest request) - Specified by:
runJobin interfacecom.atlassian.scheduler.JobRunner
-
getAllMessages
- Specified by:
getAllMessagesin interfaceClusterMessageManager- Returns:
- all stored messages, including entries already processed or sent by the calling node.
-