Client application can connect to WCS OAM backend server to receive metrics data and to manage data aquisition by two ways:

Interaction using Websocket API

To get WCS stream information in realtime and to manage WCS monitoring, STOMP based Websocket API can be used

Connecting to backend server via STOMP over Websocket

To connect to backend server, do the following:

1. Establish Secure Websocket connection to https://hostname:8090/ws, where hostname is backend server host name

2. Establish STOMP connection by sending the message

CONNECT
accept-version:1.2
host:hostname

^@

3. Subscribe to /alarms queue for alarms receiving by sending the message

SUBSCRIBE
id:sub-0
destination:/alarm

^@

4. Subscribe to /user/service queue to receive responses to requests by sending the message

SUBSCRIBE
id:sub-1
destination:/user/service

^@

Requests sending and responses receiving

Requests should be sent as STOMP messages, for example

SEND
destination:/app/api/metric/list
content-length:100

{"requestId":"eb2c2807-8c2f-4418-aebe-03622404e4bb","realm":"/api/metric/list","payload":{"id":"3"}}^@

Where:

Request body is JSON object with te following parameters:

Response will be received asynchronously in /user/service queue as STOMP message, for example

MESSAGE
destination:/user/service
content-type:application/json;charset=UTF-8
subscription:sub-1
message-id:3-8
content-length:159

{"requestId":"eb2c2807-8c2f-4418-aebe-03622404e4bb","status":200,"reason":"SUCCESS","payload":[{"id":3,"name":"Video rate","note":"","enumName":"VIDEO_RATE"}]}^@

Where:

Response body is JSON object with te following parameters:

Interaction using REST API

To receive WCS stream information and to manage WCS monitoring, REST API can be used

REST query should be HTTPS POST request as follows:

Здесь:

Connection setup

Port configuration

HTTPS port to handle REST queries and WSS connections can be set with the following parameter in wcsoam.properties file

server.port = 8090

Websocket connection timeout configuration

Websocket connection timeout is set with the following parameter in wcsoam.properties file

stomp_max_timeout=1000

CORS configuration

Cross-domain requests should be allowed to establish connection from browser with the following parameter in wcsoam.properties file

access_control_allow_origin=*