Package jetbrains.buildServer.push.impl
Class DefaultTopicsRegistry
- java.lang.Object
-
- jetbrains.buildServer.push.impl.DefaultTopicsRegistry
-
- All Implemented Interfaces:
TopicsRegistry
public class DefaultTopicsRegistry extends Object implements TopicsRegistry
- Author:
- Dmitry Treskunov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DefaultTopicsRegistry.MessagesSender
static interface
DefaultTopicsRegistry.TopicsLifecycleListener
class
DefaultTopicsRegistry.ValueTopic
-
Constructor Summary
Constructors Constructor Description DefaultTopicsRegistry(EventDispatcher<BuildServerListener> events, ServerMetrics serverMetrics)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeTopic(String topicId)
After this call, all resources associated with the topic will be released.DefaultTopicsRegistry.ValueTopic
getValueTopic(String topicId)
Value topic can be used when you want to broadcast messages containing the state of some value.void
init()
void
registerInitialMsgSupplier(Function<String,TopicMessage> initialMsgSupplier)
void
registerLifecycleListener(DefaultTopicsRegistry.TopicsLifecycleListener listener)
void
registerMessagesSender(DefaultTopicsRegistry.MessagesSender sender)
-
-
-
Constructor Detail
-
DefaultTopicsRegistry
@Autowired public DefaultTopicsRegistry(EventDispatcher<BuildServerListener> events, @NotNull ServerMetrics serverMetrics)
-
-
Method Detail
-
init
@PostConstruct public void init()
-
getValueTopic
@NotNull public DefaultTopicsRegistry.ValueTopic getValueTopic(String topicId)
Description copied from interface:TopicsRegistry
Value topic can be used when you want to broadcast messages containing the state of some value. Such messages are not incremental, e.g. every message is self-contained and doesn't depend on previously broadcasted. So at any time only the last published message is important and must be delivered to the clients. For example, you can use it to push the status of the running build or count of investigation for the specific user.- Specified by:
getValueTopic
in interfaceTopicsRegistry
-
closeTopic
public void closeTopic(String topicId)
Description copied from interface:TopicsRegistry
After this call, all resources associated with the topic will be released. Don't publish to the closed topic! If you need - you can open it again using get...() method.- Specified by:
closeTopic
in interfaceTopicsRegistry
-
registerInitialMsgSupplier
public void registerInitialMsgSupplier(Function<String,TopicMessage> initialMsgSupplier)
-
registerLifecycleListener
public void registerLifecycleListener(DefaultTopicsRegistry.TopicsLifecycleListener listener)
-
registerMessagesSender
public void registerMessagesSender(DefaultTopicsRegistry.MessagesSender sender)
-
-