java.lang.Object
org.omnifaces.cdi.push.SocketEvent
- All Implemented Interfaces:
Serializable
This web socket event will be fired by SocketSessionManager when a web socket has been
@SocketEvent.Opened, @SocketEvent.Switched or @SocketEvent.Closed.
An application scoped CDI bean can @Observes them.
For detailed usage instructions, see Socket javadoc.
- Since:
- 2.3
- Author:
- Bauke Scholtz
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceIndicates that a web socket has closed.static @interfaceIndicates that a web socket has opened.static @interfaceIndicates that a web socket user was switched. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the push channel name.Returns the close code.<S extends Serializable>
SReturns the previous user identifier, if any.<S extends Serializable>
SgetUser()Returns the current user identifier, if any.inthashCode()toString()
-
Method Details
-
getCloseCode
Returns the close code. If this returnsnull, then it wasSocketEvent.Opened. If this returns non-null, then it wasSocketEvent.Closed.- Returns:
- The close code.
-
hashCode
public int hashCode() -
equals
-
toString
-
getChannel
Returns the push channel name.- Returns:
- The push channel name.
-
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- WhenSis of wrong type.
-
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- WhenSis of wrong type.
-