Interface EventStreamManager
public interface EventStreamManager
-
Method Summary
Modifier and TypeMethodDescriptionstatic EventStreamManagerget(GatewayContext context) Returns the EventStreamManager for the given GatewayContext.@Nullable EventStreamDiagnosticsgetDiagnostics(String project, String path) Returns currentEventStreamDiagnostics, or null if no Event Stream is found.Returns registry forEncoderFactoryReturns registry forEventStreamHandler.FactoryReturns registry forEventStreamSource.FactoryReturns 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 onconfigandrunConfig.
-
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 onconfigandrunConfig.
Allows for testing one-off EventStreams.- Parameters:
project- Project that Event Stream belongs topath- Path to Event Streamconfig-EventStreamConfigof the Event StreamrunConfig- Special configuration determining how the EventStream should be run- Returns:
EventStreamDiagnosticsproduced from the run
-
getState
Returns the current state of the Event Stream.- Parameters:
project- Project Event Stream belongs topath- Path of Event Stream- Returns:
EventStreamStateof 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
EventStreamDescriptionfor the project
-
get
Returns the EventStreamManager for the given GatewayContext.
-