Interface EventReader
- All Known Implementing Classes:
EventRepository
public interface EventReader
Interface specifying operations for reading events from an
EsdbClient
. This includes reading raw
Event
s, upcasted Event
s, or events converted to Java Object
s and meta-data.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Generically wrapsEsdbClient
calls to consumeEvent
s.static interface
Callback interface specifying operations to deal with an encapsulated rawEvent
.static interface
Callback interface specifying operations to deal with an encapsulated upcastedEvent
. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
consumeAsObject
(EventReader.ClientRequestor clientRequestor, BiConsumer<Map<String, ?>, Object> eventConsumer) Consumes upcasted and converted meta-data and Java event objects from the givenEventReader.ClientRequestor
and passes them to the given event consumer.default void
consumeAsObject
(EventReader.ClientRequestor clientRequestor, Consumer<Object> eventConsumer) Consumes upcasted and converted Java event objects from the givenEventReader.ClientRequestor
and passes them to the given event consumer.void
consumeRaw
(EventReader.ClientRequestor clientRequestor, BiConsumer<EventReader.RawCallback, Event> eventConsumer) Consumes rawEvent
s from the givenEventReader.ClientRequestor
and passes them to the given event consumer.default void
consumeUpcasted
(EventReader.ClientRequestor clientRequestor, BiConsumer<EventReader.UpcastedCallback, Event> eventConsumer) Consumes upcastedEvent
s from the givenEventReader.ClientRequestor
and passes them to the given event consumer.readAsObject
(String subject, Set<Option> options) Retrieves a list of upcasted and converted Java event objects matching the given subject and options.Retrieves a list of rawEvent
s matching the given subject and options.readUpcasted
(String subject, Set<Option> options) Retrieves a list of upcastedEvent
s matching the given subject and options.
-
Method Details
-
consumeRaw
void consumeRaw(EventReader.ClientRequestor clientRequestor, BiConsumer<EventReader.RawCallback, Event> eventConsumer) Consumes rawEvent
s from the givenEventReader.ClientRequestor
and passes them to the given event consumer.- Parameters:
clientRequestor
- wrapping the client fetch operationeventConsumer
- a bi-consumer called for each rawEvent
accompanied by aEventReader.RawCallback
for futher event processing, if needed
-
consumeUpcasted
default void consumeUpcasted(EventReader.ClientRequestor clientRequestor, BiConsumer<EventReader.UpcastedCallback, Event> eventConsumer) Consumes upcastedEvent
s from the givenEventReader.ClientRequestor
and passes them to the given event consumer.- Parameters:
clientRequestor
- wrapping the client fetch operationeventConsumer
- a bi-consumer called for each upcastedEvent
accompanied by anEventReader.UpcastedCallback
for further event processing, if needed- See Also:
-
consumeAsObject
default void consumeAsObject(EventReader.ClientRequestor clientRequestor, Consumer<Object> eventConsumer) Consumes upcasted and converted Java event objects from the givenEventReader.ClientRequestor
and passes them to the given event consumer.- Parameters:
clientRequestor
- wrapping the client fetch operationeventConsumer
- a consumer called for each upcasted and converted Java event object- See Also:
-
consumeAsObject
default void consumeAsObject(EventReader.ClientRequestor clientRequestor, BiConsumer<Map<String, ?>, Object> eventConsumer) Consumes upcasted and converted meta-data and Java event objects from the givenEventReader.ClientRequestor
and passes them to the given event consumer.- Parameters:
clientRequestor
- wrapping the client fetch operationeventConsumer
- a bi-consumer called for each upcasted and converted meta-data and Java event object- See Also:
-
readRaw
Retrieves a list of rawEvent
s matching the given subject and options.- Parameters:
subject
- the subject to fetch fromoptions
- set of fetch options- Returns:
- a list of raw
Event
s, may be empty
-
readUpcasted
Retrieves a list of upcastedEvent
s matching the given subject and options.- Parameters:
subject
- the subject to fetch fromoptions
- set of fetch options- Returns:
- a list of upcasted
Event
s, may be empty
-
readAsObject
Retrieves a list of upcasted and converted Java event objects matching the given subject and options.- Parameters:
subject
- the subject to fetch fromoptions
- set of fetch options- Returns:
- a list of Java event objects, may be empty
-