Record Class SubscribeRequest
java.lang.Object
java.lang.Record
io.umadb.client.SubscribeRequest
- Record Components:
query- optional filter selecting which events to listen to; may benullto receive all eventsafter- optional position to resume from; only events strictly after this position are delivered. May benullto start from the beginning of the streambatchSize- optional hint for how many events to deliver per stream push; must be > 0 if provided
Represents a request to open a real-time, continuous stream of events.
A subscription first replays already-recorded events matching the query and
then continues to deliver new events as they are appended. Unlike a
ReadRequest, the stream does not terminate at the current head.
-
Constructor Summary
ConstructorsConstructorDescriptionSubscribeRequest(Query query, Long after, Integer batchSize) Creates a newSubscribeRequest. -
Method Summary
Modifier and TypeMethodDescriptionafter()Returns the value of theafterrecord component.after(long after) Returns a copy of this request resuming strictly after the given position.static SubscribeRequestall()Creates a subscription to all events, starting from the beginning of the stream.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.static SubscribeRequestCreates a subscription filtered by the given query.query()Returns the value of thequeryrecord component.final StringtoString()Returns a string representation of this record class.withBatchSize(int batchSize) Returns a copy of this request with the given batch size hint.
-
Constructor Details
-
SubscribeRequest
Creates a newSubscribeRequest.- Throws:
IllegalArgumentException- if validation constraints are violated
-
-
Method Details
-
all
Creates a subscription to all events, starting from the beginning of the stream.- Returns:
- a
SubscribeRequestwith default parameters
-
of
Creates a subscription filtered by the given query.- Parameters:
query- the query to filter events; may benullto receive all events- Returns:
- a
SubscribeRequestfor the given query
-
after
Returns a copy of this request resuming strictly after the given position.- Parameters:
after- the position to resume from- Returns:
- a new
SubscribeRequestwith the specified resume point
-
withBatchSize
Returns a copy of this request with the given batch size hint.- Parameters:
batchSize- the maximum number of events per stream push- Returns:
- a new
SubscribeRequestwith 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
-
after
-
batchSize
-