Skip to main content

Connection

It maintains a WebSocket/SSE connection:

Supported methods

connect

Connects to the Event Delivery Service. This method can be used to reconnect after a disconnection, such as after using the disconnect method:

connection.connect();

getConfig

Retrieves the configuration of the connection. Returns a Config instance:

connection.getConfig();
ArgumentTypeDescription
returnConfigClient configuration of the connection

getId

Retrieves the connection ID:

connection.getId();
ArgumentTypeDescription
returnnumberID of the connection

getStatus

Checks status of the connection:

connection.getStatus();

The method can return the next ConnectionType enum values:

TypeDescription
ConnectionType.ClosedConnection closed
ConnectionType.ConnectingConnection is opening
ConnectionType.OpenConnection opened
ConnectionType.ClosingConnection is closing

getProperty

Get property of a connection:

connection.getProperty(name);
ArgumentTypeDescription
namestringName of a property
returnstringValue of a property

getProperties

Get all properties of a connection:

connection.getProperties();
ArgumentTypeDescription
returnobjectObject of all property:value pairs

querySet

Create a QuerySet instance:

connection.querySet();
ArgumentTypeDescription
returnQuerySetQuery set instance

disconnect

Disconnect from the Event Delivery Service:

connection.disconnect();
ArgumentTypeDescription
returnbooleantrue if disconnected; false if it was not connected