Record Class ReadRequest
java.lang.Object
java.lang.Record
io.umadb.client.ReadRequest
- Record Components:
query- optional filter for selecting specific event types or tags; may benullto read all eventsstart- optional sequence number to start reading from; must be >= 0 if providedbackwards- optional flag to read in reverse order; defaults tofalseif nulllimit- optional maximum number of events to return; must be > 0 if providedbatchSize- optional batch size hint for streaming responses; must be > 0 if provided
public record ReadRequest(Query query, Long start, Boolean backwards, Integer limit, Integer batchSize)
extends Record
Represents a request to read events from the event store.
A ReadRequest can be sent to the Read RPC to retrieve events matching a Query.
Optional fields allow controlling the starting position, reading direction, maximum number of events,
and batch size.
A read terminates at the head position captured when the request was received. To keep
receiving events as they are appended, use SubscribeRequest with
UmaDbClient.subscribe(SubscribeRequest) instead.
Defaults:
backwardsdefaults tofalsestart,limit, andbatchSizeare optional
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ReadRequestall()Creates a minimalReadRequestselecting all events from the beginning.Returns the value of thebackwardsrecord component.Returns the value of thebatchSizerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.limit()Returns the value of thelimitrecord component.static ReadRequestCreates aReadRequestfor a specific query.query()Returns the value of thequeryrecord component.start()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.withBatchSize(int batchSize) Returns a copy of this request with a specified batch size hint.withDirection(boolean backwards) Returns a copy of this request with a specified read direction.withLimit(int limit) Returns a copy of this request with a specified limit.withStart(long start) Returns a copy of this request with a specified start position.
-
Constructor Details
-
ReadRequest
Creates an instance of aReadRequestrecord class.
-
-
Method Details
-
all
Creates a minimalReadRequestselecting all events from the beginning.- Returns:
- a
ReadRequestwith default parameters
-
of
Creates aReadRequestfor a specific query.- Parameters:
query- the query to filter events; may benullto read all events- Returns:
- a
ReadRequestwith default parameters
-
withStart
Returns a copy of this request with a specified start position.- Parameters:
start- sequence number to start reading from- Returns:
- a new
ReadRequestwith the specified start
-
withDirection
Returns a copy of this request with a specified read direction.- Parameters:
backwards- true to read in reverse order- Returns:
- a new
ReadRequestwith the specified direction
-
withLimit
Returns a copy of this request with a specified limit.- Parameters:
limit- maximum number of events to return- Returns:
- a new
ReadRequestwith the specified limit
-
withBatchSize
Returns a copy of this request with a specified batch size hint.- Parameters:
batchSize- maximum number of events per response chunk- Returns:
- a new
ReadRequestwith the specified batch size
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
query
-
start
-
backwards
-
limit
-
batchSize
-