Interface OnOpen

All Known Implementing Classes:
OnOpen, OnOpen, OnOpen, OnOpen, OnOpen
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface OnOpen
  • Method Summary

    Modifier and Type
    Method
    Description
    getFieldFromHandshakeCookie(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 WebSocket
      handshake - 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 Handshake
      fieldname - the field name
      Returns:
      value as optional