Package com.fauna.event
Class FeedRequest
- java.lang.Object
-
- com.fauna.event.FeedRequest
-
public class FeedRequest extends java.lang.ObjectRepresents an Event Feed request from Fauna.The
FeedRequestclass contains anEventSourceandFeedOptionsto 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 aFeedRequestwith the specified event source and options.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FeedRequestfromResponse(EventSource resp, FeedOptions options)Creates a newFeedRequestfrom anEventSource.java.lang.Stringserialize()Serializes thisFeedRequestto a JSON string.
-
-
-
Constructor Detail
-
FeedRequest
public FeedRequest(EventSource source, FeedOptions options)
Constructs aFeedRequestwith the specified event source and options.- Parameters:
source- TheEventSourcecontaining the event source token.options- TheFeedOptionsspecifying additional feed request options.- Throws:
java.lang.IllegalArgumentException- ifsourceoroptionsis null.
-
-
Method Detail
-
serialize
public java.lang.String serialize() throws java.io.IOExceptionSerializes thisFeedRequestto a JSON string.- Returns:
- A
Stringrepresentation 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 newFeedRequestfrom anEventSource.- Parameters:
resp- TheEventSourcecontaining the event source token.options- TheFeedOptionsspecifying additional feed request options.- Returns:
- A new
FeedRequestinstance based on the response and options.
-
-