Package jakarta.faces.event
Class WebsocketEvent
- java.lang.Object
- 
- jakarta.faces.event.WebsocketEvent
 
- 
- All Implemented Interfaces:
- Serializable
 
 public final class WebsocketEvent extends Object implements Serializable This web socket event will be fired when a new <f:websocket>has been@WebsocketEvent.Openedor@WebsocketEvent.Closed. An application scoped CDI bean can@Observesthem.For detailed usage instructions, see @Pushjavadoc.- Since:
- 2.3
- See Also:
- Push,- WebsocketEvent.Opened,- WebsocketEvent.Closed, Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static interfaceWebsocketEvent.ClosedIndicates that a<f:websocket>has closed.static interfaceWebsocketEvent.OpenedIndicates that a<f:websocket>has opened.
 - 
Constructor SummaryConstructors Constructor Description WebsocketEvent(String channel, Serializable user, CloseReason.CloseCode code)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)StringgetChannel()Returns the<f:websocket channel>.CloseReason.CloseCodegetCloseCode()Returns the close code.<S extends Serializable>
 SgetUser()Returns the<f:websocket user>, if any.inthashCode()StringtoString()
 
- 
- 
- 
Constructor Detail- 
WebsocketEventpublic WebsocketEvent(String channel, Serializable user, CloseReason.CloseCode code) 
 
- 
 - 
Method Detail- 
getChannelpublic String getChannel() Returns the<f:websocket channel>.- Returns:
- The web socket channel name.
 
 - 
getUserpublic <S extends Serializable> S getUser() Returns the<f:websocket user>, if any.- Type Parameters:
- S- The generic type of the user identifier.
- Returns:
- The web socket user identifier, if any.
- Throws:
- ClassCastException- When- Sis of wrong type.
 
 - 
getCloseCodepublic CloseReason.CloseCode getCloseCode() Returns the close code. If this returnsnull, then it wasWebsocketEvent.Opened. If this returns non-null, then it wasWebsocketEvent.Closed.- Returns:
- The close code.
 
 
- 
 
-