Package rife.engine

Interface SseConnectionFilter

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface SseConnectionFilter
The method of a SseConnectionFilter will be executed for each of the connections of a SseBroadcaster, so that an operation is limited to the connections that it accepts.

This makes it possible to address the clients that belong together, for instance the ones that are watching the same document or that are logged in as the same user, which relies on the attributes that you gave the connections when they were established.

Note that a filter is executed again when a client reconnects and the events that it missed are replayed from the history, so that it has to keep deciding the same way to stay consistent.

Since:
1.10
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accepts(SseConnection connection)
    Executed to determine whether an operation applies to a connection.
  • Method Details

    • accepts

      boolean accepts(SseConnection connection)
      Executed to determine whether an operation applies to a connection.
      Parameters:
      connection - the connection that is being considered
      Returns:
      true if the operation applies to the connection; or

      false if it doesn't

      Since:
      1.10