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 & port
-
-
Constructor Summary
Constructors Constructor Description VertxWebsocketHost(VertxWebsocketHostConfiguration websocketHostConfiguration, VertxWebsocketHostKey key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connect(VertxWebsocketConsumer consumer)
Sets up a Vert.x route and handler for the WebSocket path specified by the consumer configurationvoid
disconnect(String path)
Removes the Vert.x route and handler for the WebSocket path specified by the consumer configurationMap<String,io.vertx.core.http.ServerWebSocket>
getConnectedPeers()
Gets all WebSocket peers connected to the Vert.x HTTP sever together with their associated connection keyint
getPort()
Gets the port that the server is bound to.void
start()
Starts a Vert.x HTTP server to host the WebSocket routervoid
stop()
Starts a previously started Vert.x HTTP server
-
-
-
Constructor Detail
-
VertxWebsocketHost
public VertxWebsocketHost(VertxWebsocketHostConfiguration websocketHostConfiguration, VertxWebsocketHostKey key)
-
-
Method Detail
-
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 InterruptedException, ExecutionException
Starts a Vert.x HTTP server to host the WebSocket router
-
stop
public void stop() throws ExecutionException, InterruptedException
Starts a previously started Vert.x HTTP server
-
getConnectedPeers
public Map<String,io.vertx.core.http.ServerWebSocket> getConnectedPeers()
Gets all WebSocket peers connected to the Vert.x HTTP sever together with their associated 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
-
-