Class SseEvent

java.lang.Object
org.omnifaces.cdi.push.SseEvent
All Implemented Interfaces:
Serializable

public final class SseEvent extends Object

This SSE event will be fired by SseSessionManager when an SSE connection has been @SseEvent.Opened, @SseEvent.Switched or @SseEvent.Closed. An application scoped CDI bean can @Observes them.

For detailed usage instructions, see Sse javadoc.

Since:
5.2
Author:
Bauke Scholtz
See Also:
  • Method Details

    • getChannel

      public String getChannel()
      Returns the push channel name.
      Returns:
      The push channel name.
    • getUser

      public <S extends Serializable> S getUser()
      Returns the current user identifier, if any.
      Type Parameters:
      S - The generic type of the user identifier.
      Returns:
      The current user identifier, if any.
      Throws:
      ClassCastException - When S is of wrong type.
    • getPreviousUser

      public <S extends Serializable> S getPreviousUser()
      Returns the previous user identifier, if any.
      Type Parameters:
      S - The generic type of the user identifier.
      Returns:
      The previous user identifier, if any.
      Throws:
      ClassCastException - When S is of wrong type.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object