Class FeedRequest


  • public class FeedRequest
    extends java.lang.Object
    Represents an Event Feed request from Fauna.

    The FeedRequest class contains an EventSource and FeedOptions to specify the details of the feed request, such as the cursor, start timestamp, and page size.

    • Constructor Detail

      • FeedRequest

        public FeedRequest​(EventSource source,
                           FeedOptions options)
        Constructs a FeedRequest with the specified event source and options.
        Parameters:
        source - The EventSource containing the event source token.
        options - The FeedOptions specifying additional feed request options.
        Throws:
        java.lang.IllegalArgumentException - if source or options is null.
    • Method Detail

      • serialize

        public java.lang.String serialize()
                                   throws java.io.IOException
        Serializes this FeedRequest 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 new FeedRequest from an EventSource.
        Parameters:
        resp - The EventSource containing the event source token.
        options - The FeedOptions specifying additional feed request options.
        Returns:
        A new FeedRequest instance based on the response and options.