Interface EventStreamManager
public interface EventStreamManager
-
Method Summary
Modifier and TypeMethodDescriptionstatic EventStreamManager
get
(GatewayContext context) Returns the EventStreamManager for the given GatewayContext.@Nullable EventStreamDiagnostics
getDiagnostics
(String project, String path) Returns currentEventStreamDiagnostics
, or null if no Event Stream is found.Returns registry forEncoderFactory
Returns registry forEventStreamHandler.Factory
Returns registry forEventStreamSource.Factory
Returns the current state of the Event Stream.Returns all registered Event Streams.listEventStreams
(String project) Returns a list of registered Event Streams for a project.publishEvent
(String project, String path, String message, boolean ack, @Nullable String gatewayId) Publishes an event to GatewayEvent source.runEventStream
(String project, String path, EventStreamConfig config, EventStreamRunConfig runConfig) Starts an EventStream based onconfig
andrunConfig
.
-
Method Details
-
getSourceRegistry
SourceRegistry getSourceRegistry()Returns registry forEventStreamSource.Factory
-
getHandlerRegistry
HandlerRegistry getHandlerRegistry()Returns registry forEventStreamHandler.Factory
-
getEncoderRegistry
EncoderRegistry getEncoderRegistry()Returns registry forEncoderFactory
-
publishEvent
Future<EventResult> publishEvent(String project, String path, String message, boolean ack, @Nullable @Nullable String gatewayId) Publishes an event to GatewayEvent source.- Parameters:
project
- Project of destination Event Streampath
- Path of destination Event Streammessage
- String to deliver to destination Event Streamack
- True, the Future will complete once processed by destination handlers. False, will complete when the message reaches the destination GatewayEventSource.gatewayId
- GatewayId of remote gateway, if sending across Gateway Area Network.- Returns:
- Result of publish
-
getDiagnostics
Returns currentEventStreamDiagnostics
, or null if no Event Stream is found.- Parameters:
project
- Project Event Stream belongs topath
- Path of Event Stream
-
runEventStream
EventStreamDiagnostics runEventStream(String project, String path, EventStreamConfig config, EventStreamRunConfig runConfig) Starts an EventStream based onconfig
andrunConfig
.
Allows for testing one-off EventStreams.- Parameters:
project
- Project that Event Stream belongs topath
- Path to Event Streamconfig
-EventStreamConfig
of the Event StreamrunConfig
- Special configuration determining how the EventStream should be run- Returns:
EventStreamDiagnostics
produced from the run
-
getState
Returns the current state of the Event Stream.- Parameters:
project
- Project Event Stream belongs topath
- Path of Event Stream- Returns:
EventStreamState
of the Event Stream
-
listAllEventStreams
List<EventStreamDescription> listAllEventStreams()Returns all registered Event Streams. Event Streams can be in any state.- Returns:
- List of
EventStreamDescription
-
listEventStreams
Returns a list of registered Event Streams for a project. Event Streams can be in any state.- Parameters:
project
- Project to target- Returns:
- List of
EventStreamDescription
for the project
-
get
Returns the EventStreamManager for the given GatewayContext.
-