Interface EventService


  • public interface EventService
    The EventService interface.

    Is instantiated using the static create methods within the interface eg:

    final EventService eventService = EventService.usingPeer("...");
    • Method Detail

      • consumeEvents

        <EventT extends Event<?>> void consumeEvents​(EventType eventType,
                                                     EventTarget eventTarget,
                                                     java.lang.Long startFrom,
                                                     java.util.function.Consumer<EventT> eventConsumer)
        Reads a stream of events from a node *
        Type Parameters:
        EventT - the type of the event
        Parameters:
        eventType - the type of event to read
        eventTarget - the target of the event JSON string or POJO
        startFrom - the optional event to start streaming from, if not present only obtains new events
        eventConsumer - the consumer of the events
      • usingPeer

        static EventService usingPeer​(java.net.URI uri)
        Creates a new EventService for the specified host including protocol and port
        Parameters:
        uri - the uri of the host to connect to must include protocol, hostname, and port number
        Returns:
        the event service for the specified host