Interface EventStreamManager


public interface EventStreamManager
  • Method Details

    • getSourceRegistry

      SourceRegistry getSourceRegistry()
      Returns registry for EventStreamSource.Factory
    • getHandlerRegistry

      HandlerRegistry getHandlerRegistry()
      Returns registry for EventStreamHandler.Factory
    • getEncoderRegistry

      EncoderRegistry getEncoderRegistry()
      Returns registry for EncoderFactory
    • 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 Stream
      path - Path of destination Event Stream
      message - String to deliver to destination Event Stream
      ack - 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

      @Nullable @Nullable EventStreamDiagnostics getDiagnostics(String project, String path)
      Returns current EventStreamDiagnostics, or null if no Event Stream is found.
      Parameters:
      project - Project Event Stream belongs to
      path - Path of Event Stream
    • runEventStream

      EventStreamDiagnostics runEventStream(String project, String path, EventStreamConfig config, EventStreamRunConfig runConfig)
      Starts an EventStream based on config and runConfig.
      Allows for testing one-off EventStreams.
      Parameters:
      project - Project that Event Stream belongs to
      path - Path to Event Stream
      config - EventStreamConfig of the Event Stream
      runConfig - Special configuration determining how the EventStream should be run
      Returns:
      EventStreamDiagnostics produced from the run
    • getState

      EventStreamState getState(String project, String path)
      Returns the current state of the Event Stream.
      Parameters:
      project - Project Event Stream belongs to
      path - 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

      List<EventStreamDescription> listEventStreams(String project)
      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

      static EventStreamManager get(GatewayContext context)
      Returns the EventStreamManager for the given GatewayContext.