Class VertxWebsocketHost

java.lang.Object
org.apache.camel.component.vertx.websocket.VertxWebsocketHost

public class VertxWebsocketHost extends Object
A Vert.x backed WebSocket host bound to a specified host invalid input: '&' port
  • Constructor Details

  • Method Details

    • connect

      public void connect(VertxWebsocketConsumer consumer)
      Sets up a Vert.x route and handler for the WebSocket path specified by the consumer configuration
    • disconnect

      public void disconnect(String path)
      Removes the Vert.x route and handler for the WebSocket path specified by the consumer configuration
    • start

      public void start() throws Exception
      Starts a Vert.x HTTP server to host the WebSocket router
      Throws:
      Exception
    • stop

      public void stop() throws ExecutionException, InterruptedException
      Stops a previously started Vert.x HTTP server
      Throws:
      ExecutionException
      InterruptedException
    • getConnectedPeers

      public List<VertxWebsocketPeer> getConnectedPeers()
      Gets all WebSocket peers connected to the Vert.x HTTP sever together with their associated connection key
    • getConnectedPeer

      public VertxWebsocketPeer getConnectedPeer(String connectionKey)
      Gets a connected peer for the given connection key
    • getPort

      public int getPort()
      Gets the port that the server is bound to. This could be a random value if 0 was specified as the initial port number
    • isManagedHost

      public boolean isManagedHost(String host)
      Determines whether the specified host name is one that is managed by this host.
    • isManagedPort

      public boolean isManagedPort(int port)
      Determines whether the specified port is one that is managed by this host.