public class EventResource
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected OrchestrateClient |
client
The Orchestrate client to make requests with.
|
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper
The object mapper used to deserialize JSON responses.
|
| Modifier and Type | Method and Description |
|---|---|
EventResource |
end(long end)
The exclusive end of a time range to query.
|
<T> OrchestrateRequest<EventList<T>> |
get(java.lang.Class<T> clazz)
Fetch events for a key in the Orchestrate service.
|
OrchestrateRequest<java.lang.Boolean> |
put(java.lang.Object value)
|
OrchestrateRequest<java.lang.Boolean> |
put(java.lang.Object value,
java.lang.Long timestamp)
Store an event to a key in the Orchestrate service.
|
EventResource |
start(long start)
The inclusive start of a time range to query.
|
EventResource |
type(java.lang.String type)
The type for an event, e.g.
|
protected final OrchestrateClient client
protected final com.fasterxml.jackson.databind.ObjectMapper mapper
public <T> OrchestrateRequest<EventList<T>> get(java.lang.Class<T> clazz)
Usage:
EventList<DomainObject> events =
client.event("someCollection", "someKey")
.type("eventType")
.get(DomainObject.class)
.get();
T - The type to deserialize the result of the request to.clazz - Type information for marshalling objects at runtime.public OrchestrateRequest<java.lang.Boolean> put(@NonNull java.lang.Object value)
public OrchestrateRequest<java.lang.Boolean> put(@NonNull java.lang.Object value, @Nullable java.lang.Long timestamp)
Usage:
DomainObject obj = new DomainObject(); // a POJO
boolean result =
client.event("someCollection", "someKey")
.type("someType")
.put(obj)
.get();
value - The object to store as the event.timestamp - The timestamp to store the event at.public EventResource type(java.lang.String type)
type - The type of event.public EventResource start(long start)
start - The timestamp to get events from.public EventResource end(long end)
end - The timestamp to get events up to.