Package io.openems.common.websocket
Interface OnOpen
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescriptiongetFieldFromHandshakeCookie
(com.google.gson.JsonObject handshake, String fieldname) Get field from the 'cookie' field in the handshake.void
run
(org.java_websocket.WebSocket ws, com.google.gson.JsonObject handshake) Handles OnOpen event of WebSocket.
-
Method Details
-
run
void run(org.java_websocket.WebSocket ws, com.google.gson.JsonObject handshake) throws OpenemsError.OpenemsNamedException Handles OnOpen event of WebSocket.- Parameters:
ws
- the WebSockethandshake
- the HTTP handshake/headers- Throws:
OpenemsError.OpenemsNamedException
- on error
-
getFieldFromHandshakeCookie
static Optional<String> getFieldFromHandshakeCookie(com.google.gson.JsonObject handshake, String fieldname) Get field from the 'cookie' field in the handshake.Per specification all variants of 'cookie' are accepted.
- Parameters:
handshake
- the Handshakefieldname
- the field name- Returns:
- value as optional
-