Package com.fauna.event
Class FeedRequest
- java.lang.Object
-
- com.fauna.event.FeedRequest
-
public class FeedRequest extends java.lang.Object
Represents an Event Feed request from Fauna.The
FeedRequest
class contains anEventSource
andFeedOptions
to specify the details of the feed request, such as the cursor, start timestamp, and page size.
-
-
Constructor Summary
Constructors Constructor Description FeedRequest(EventSource source, FeedOptions options)
Constructs aFeedRequest
with the specified event source and options.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FeedRequest
fromResponse(EventSource resp, FeedOptions options)
Creates a newFeedRequest
from anEventSource
.java.lang.String
serialize()
Serializes thisFeedRequest
to a JSON string.
-
-
-
Constructor Detail
-
FeedRequest
public FeedRequest(EventSource source, FeedOptions options)
Constructs aFeedRequest
with the specified event source and options.- Parameters:
source
- TheEventSource
containing the event source token.options
- TheFeedOptions
specifying additional feed request options.- Throws:
java.lang.IllegalArgumentException
- ifsource
oroptions
is null.
-
-
Method Detail
-
serialize
public java.lang.String serialize() throws java.io.IOException
Serializes thisFeedRequest
to a JSON string.- Returns:
- A
String
representation of this feed request in JSON format. - Throws:
java.io.IOException
- if an error occurs during serialization.
-
fromResponse
public static FeedRequest fromResponse(EventSource resp, FeedOptions options)
Creates a newFeedRequest
from anEventSource
.- Parameters:
resp
- TheEventSource
containing the event source token.options
- TheFeedOptions
specifying additional feed request options.- Returns:
- A new
FeedRequest
instance based on the response and options.
-
-