Class WebsocketWebsocketFactory.WebSocketImpl

java.lang.Object
de.oktoflow.platform.support.ws.websocket.WebsocketWebsocketFactory.WebSocketImpl
All Implemented Interfaces:
de.iip_ecosphere.platform.support.websocket.WebsocketFactory.WebSocket
Enclosing class:
WebsocketWebsocketFactory

private static class WebsocketWebsocketFactory.WebSocketImpl extends Object implements de.iip_ecosphere.platform.support.websocket.WebsocketFactory.WebSocket
Implements the actual web socket. Indirection required as the WebSocketClient conflicts in exception types.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • WebSocketImpl

      public WebSocketImpl(URI serverUri)
      Creates a web socket for the given server URI.
      Parameters:
      serverUri - the server URI
  • Method Details

    • connect

      public void connect() throws IOException
      Specified by:
      connect in interface de.iip_ecosphere.platform.support.websocket.WebsocketFactory.WebSocket
      Throws:
      IOException
    • connectBlocking

      public boolean connectBlocking() throws IOException
      Specified by:
      connectBlocking in interface de.iip_ecosphere.platform.support.websocket.WebsocketFactory.WebSocket
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface de.iip_ecosphere.platform.support.websocket.WebsocketFactory.WebSocket
      Throws:
      IOException
    • setReceptionHander

      public void setReceptionHander(Consumer<String> receptionHandler)
      Specified by:
      setReceptionHander in interface de.iip_ecosphere.platform.support.websocket.WebsocketFactory.WebSocket
    • setStatusListener

      public void setStatusListener(de.iip_ecosphere.platform.support.websocket.WebsocketFactory.StatusListener listener)
      Specified by:
      setStatusListener in interface de.iip_ecosphere.platform.support.websocket.WebsocketFactory.WebSocket
    • send

      public void send(String text) throws IOException
      Specified by:
      send in interface de.iip_ecosphere.platform.support.websocket.WebsocketFactory.WebSocket
      Throws:
      IOException
    • closeBocking

      public void closeBocking() throws IOException
      Specified by:
      closeBocking in interface de.iip_ecosphere.platform.support.websocket.WebsocketFactory.WebSocket
      Throws:
      IOException
    • getURI

      public URI getURI()
      Specified by:
      getURI in interface de.iip_ecosphere.platform.support.websocket.WebsocketFactory.WebSocket
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface de.iip_ecosphere.platform.support.websocket.WebsocketFactory.WebSocket
    • isClosed

      public boolean isClosed()
      Specified by:
      isClosed in interface de.iip_ecosphere.platform.support.websocket.WebsocketFactory.WebSocket