Interface WebsocketEndpointManager

All Superinterfaces:
WebsocketEndpointWriter
All Known Subinterfaces:
WebsocketEndpoint
All Known Implementing Classes:
SpincastWebsocketEndpoint

public interface WebsocketEndpointManager extends WebsocketEndpointWriter
Manager for a WebSocket endpoint. Extends WebsocketEndpointWriter since it can write on the endpoint, but also adds some managements features.
  • Method Details

    • getEndpointId

      String getEndpointId()
      The endpoint id
    • getPeersIds

      Set<String> getPeersIds()
      The connected peers' ids.
    • closePeer

      void closePeer(String peerId)
      Closes a specific peer connection on the endpoint.
    • closePeer

      void closePeer(String peerId, int closingCode, String closingReason)
      Closes a specific peer connection on the endpoint.
    • closeEndpoint

      void closeEndpoint()
      Closes the entire WebSocket endpoint. All peer connections of this endpoint will be closed and the endpoint will be removed.

      Will try to send a "closing" message to the peers before closing their connection.

    • closeEndpoint

      void closeEndpoint(boolean sendClosingMessageToPeers)
      Closes the entire WebSocket endpoint. All peer connections of this endpoint will be closed and the endpoint will be removed.
      Parameters:
      sendClosingMessageToPeers - if true, Spincast will try to send a "closing" message to the peers before closing their connections.
    • closeEndpoint

      void closeEndpoint(int closingCode, String closingReason)
      Closes the entire WebSocket endpoint. All peer connections of this endpoint will be closed and the endpoint will be removed.

      Will try to send a "closing" message to the peers before closing their connection.

    • isClosing

      boolean isClosing()
      Is this endpoint closing?
    • isClosed

      boolean isClosed()
      Is this endpoint closed?