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(org.apache.camel.CamelContext camelContext, VertxWebsocketHostConfiguration websocketHostConfiguration, VertxWebsocketHostKey key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnect(VertxWebsocketConsumer consumer)Sets up a Vert.x route and handler for the WebSocket path specified by the consumer configurationvoiddisconnect(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 keyintgetPort()Gets the port that the server is bound to.booleanisManagedHost(String host)Determines whether the specified host name is one that is managed by this host.booleanisManagedPort(int port)Determines whether the specified port is one that is managed by this host.voidstart()Starts a Vert.x HTTP server to host the WebSocket routervoidstop()Stops a previously started Vert.x HTTP server
-
-
-
Constructor Detail
-
VertxWebsocketHost
public VertxWebsocketHost(org.apache.camel.CamelContext camelContext, 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 ExceptionStarts a Vert.x HTTP server to host the WebSocket router- Throws:
Exception
-
stop
public void stop() throws ExecutionException, InterruptedExceptionStops 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
-
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.
-
-