public final class WebsocketEvent
extends java.lang.Object
implements java.io.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(java.lang.String channel,
java.io.Serializable user,
CloseReason.CloseCode code) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
java.lang.String |
getChannel()
Returns the
<f:websocket channel> . |
CloseReason.CloseCode |
getCloseCode()
Returns the close code.
|
<S extends java.io.Serializable> |
getUser()
Returns the
<f:websocket user> , if any. |
int |
hashCode() |
java.lang.String |
toString() |
public WebsocketEvent(java.lang.String channel, java.io.Serializable user, CloseReason.CloseCode code)
public java.lang.String getChannel()
<f:websocket channel>
.public <S extends java.io.Serializable> S getUser()
<f:websocket user>
, if any.S
- The generic type of the user identifier.java.lang.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
.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object