SDK
SDK Java v3.x
2

This SDK is deprecated. We recommend to use the Kuzzle SDK-JVM.
A migration guide is available here

Constructor #

Initializes a new instance of the WebSocket class pointing to the Kuzzle server specified by the uri.

Arguments #

public WebSocket(URI uri, WebSocketOptions options) throws URISyntaxException, IllegalArgumentException

ArgumentTypeDescription
uri
Uri
URI pointing to a Kuzzle server
options
WebSocketOptions
Class which contains websocket options

uri #

A Uri object pointing to a Kuzzle server.

Use wss://<host>:<ip> to initiate a secure SSL connection.

options #

The options used to connect to the Kuzzle instance. WebSocketOptions

Return #

A WebSocket protocol instance.

Arguments #

public WebSocket(String host, WebSocketOptions options) 
  throws URISyntaxException, IllegalArgumentException

ArgumentTypeDescription
host
String
Host pointing to a Kuzzle server
options
WebSocketOptions
Class which contains websocket options

host #

A host pointing to a Kuzzle server.

Use wss://<host>:<ip> to initiate a secure SSL connection.

options #

The options used to connect to the Kuzzle instance. WebSocketOptions

Return #

A WebSocket protocol instance.

Usage #

WebSocketOptions options = new WebSocketOptions();
options.setAutoReconnect(true)
  .setConnectionTimeout(42000)
  .setPort(7513)
  .setSsl(false);
WebSocket ws = new WebSocket("localhost", options);