public final class WebsocketEvent extends Object implements Serializable
This web socket event will be fired when a new <f:websocket>
has been
@
WebsocketEvent.Opened
or @
WebsocketEvent.Closed
. An application scoped CDI bean can
@
Observes
them.
For detailed usage instructions, see @
Push
javadoc.
Push
,
WebsocketEvent.Opened
,
WebsocketEvent.Closed
,
Serialized FormModifier and Type | Class and Description |
---|---|
static interface |
WebsocketEvent.Closed
Indicates that a |
static interface |
WebsocketEvent.Opened
Indicates that a |
Constructor and Description |
---|
WebsocketEvent(String channel,
Serializable user,
CloseReason.CloseCode code) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
String |
getChannel()
Returns the
<f:websocket channel> . |
CloseReason.CloseCode |
getCloseCode()
Returns the close code.
|
<S extends Serializable> |
getUser()
Returns the
<f:websocket user> , if any. |
int |
hashCode() |
String |
toString() |
public WebsocketEvent(String channel, Serializable user, CloseReason.CloseCode code)
public String getChannel()
<f:websocket channel>
.public <S extends Serializable> S getUser()
<f:websocket 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 WebsocketEvent.Opened
.
If this returns non-null
, then it was WebsocketEvent.Closed
.Copyright © 1996-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.