Using SwaggerSocket in Atmosphere - Atmosphere/atmosphere Wiki

The Atmosphere Framework includes [SimpleRestInterceptor] (http://async-io.org/apidocs/org/atmosphere/interceptor/SimpleRestInterceptor.html) which enables the existing REST services to be transparently invoked over Websocket.

Default data binding

This binding describes how REST requests and responses are represented in Websocket messages. It is originated from SwaggerSocket and has been simplified and enhanced from its initial version.

This binding has the following characteristics.

The following message format is used for this binding. Each message is represented as a text or binary Websocket message. It consists of the headers part encoded in json and the optional content part which follows the headers part.

Format: General Syntax

{"id": "identifier", "code": status_code, "method": "method", "path": "path", "type": "type_value", "accept": "accept_value", "headers": headers_map, "continue": continue} content

where

Samples

Atmosphere's samples include cxf-greeter-swaggersocket. This sample demonstrates how this interceptor is used to enable DefaultApi to support SwaggerSocket. Some operations perform plain request-response operations, and some utilize an underlining WebSocket connection to publish and deliver responses asynchronous.