Class EventSourceResource.EventSource

java.lang.Object
org.wicketstuff.html5.eventsource.EventSourceResource.EventSource
Enclosing class:
EventSourceResource

public static class EventSourceResource.EventSource extends Object
  • Method Details

    • event

      public EventSourceResource.EventSource event(String eventName)
      Switches the current event.
      Parameters:
      eventName - the name of new event
      Returns:
      this object, for chaining
    • data

      Sends a data message. Must be followed by EventSource#end() call to finish the sending of data.
      Parameters:
      data - the data of new event
      Returns:
      this object, for chaining
    • id

      Sends an id message.
      Parameters:
      id - the new id
      Returns:
      this object, for chaining
    • retry

      public EventSourceResource.EventSource retry(Duration retryTimeout)
      Sends a retry message.
      Parameters:
      retryTimeout - how many millis to wait before the client to try to reconnect
      Returns:
      this object, for chaining
    • raw

      Sends a raw data to the client.
      Parameters:
      rawData - the raw data to send to the client
      Returns:
      this object, for chaining
    • end

      Ends a data message.
      Returns:
      this object, for chaining
    • close

      public void close()
      Closes the connection to the client.
    • getParameters

      public final PageParameters getParameters()
      Returns:
      the request parameters sent by the client when making the connection
    • isClosed

      public final boolean isClosed()
      Checks whether the connection to the client is closed..
      Returns:
      true if the connection is closed, false otherwise