public final class SocketEvent extends Object implements Serializable
This web socket event will be fired by SocketSessionManager when a 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.
Socket,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static interface |
SocketEvent.Closed
Indicates that a socket has closed.
|
static interface |
SocketEvent.Opened
Indicates that a socket has opened.
|
static interface |
SocketEvent.Switched
Indicates that a socket user was switched.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object object) |
String |
getChannel()
Returns the
<o:socket channel>. |
CloseReason.CloseCode |
getCloseCode()
Returns the close code.
|
<S extends Serializable> |
getPreviousUser()
Returns the previous
<o:socket user>, if any. |
<S extends Serializable> |
getUser()
Returns the current
<o:socket user>, if any. |
int |
hashCode() |
String |
toString() |
public String getChannel()
<o:socket channel>.public <S extends Serializable> S getUser()
<o:socket user>, if any.S - The generic type of the user identifier.ClassCastException - When S is of wrong type.public <S extends Serializable> S getPreviousUser()
<o:socket user>, if any.S - The generic type of the user identifier.ClassCastException - When S is of wrong type.public CloseReason.CloseCode getCloseCode()
null, then it was SocketEvent.Opened.
If this returns non-null, then it was SocketEvent.Closed.Copyright © 2012–2020 OmniFaces. All rights reserved.