public final class SocketEvent extends Object implements Serializable
This web socket event will be fired by SocketSessionManager
when a new socket has been
@
SocketEvent.Opened
or @
SocketEvent.Closed
. An application scoped CDI bean can
@
Observes
them.
For detailed usage instructions, see Socket
javadoc.
Socket
,
Serialized FormModifier 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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
String |
getChannel()
Returns the
<o:socket channel> . |
CloseReason.CloseCode |
getCloseCode()
Returns the close code.
|
<S extends Serializable> |
getUser()
Returns the
<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 CloseReason.CloseCode getCloseCode()
null
, then it was SocketEvent.Opened
.
If this returns non-null
, then it was SocketEvent.Closed
.Copyright © 2012–2016 OmniFaces. All rights reserved.