@groovy.transform.CompileStatic abstract class MoquiAbstractEndpoint extends Endpoint implements MessageHandler.Whole<java.lang.String>
An abstract class for WebSocket Endpoint that does basic setup, including creating an ExecutionContext with the user logged if they were logged in for the corresponding HttpSession (based on the WebSocket HandshakeRequest, ie the HTTP upgrade request, tied to an existing HttpSession). The main method to implement is the onMessage(String) method. If you override the onOpen() method call the super method first. If you override the onClose() method call the super method last (will clear out all internal fields).
Modifiers | Name | Description |
---|---|---|
protected boolean |
destroyInitialEci |
|
protected ExecutionContextFactoryImpl |
ecfi |
|
protected javax.websocket.server.HandshakeRequest |
handshakeRequest |
|
protected javax.servlet.http.HttpSession |
httpSession |
|
protected javax.jcr.Session |
session |
|
protected java.lang.String |
userId |
|
protected java.lang.String |
username |
Constructor and description |
---|
MoquiAbstractEndpoint
() |
Type Params | Return Type | Name and description |
---|---|---|
|
ExecutionContextFactoryImpl |
getEcf() |
|
javax.servlet.http.HttpSession |
getHttpSession() |
|
javax.jcr.Session |
getSession() |
|
java.lang.String |
getUserId() |
|
java.lang.String |
getUsername() |
|
void |
onClose(javax.jcr.Session session, javax.websocket.CloseReason closeReason) |
|
void |
onError(javax.jcr.Session session, java.lang.Throwable thr) |
|
abstract void |
onMessage(java.lang.String message) |
|
void |
onOpen(javax.jcr.Session session, javax.websocket.EndpointConfig config) |