The module enables support for exposing RESTful Web Services in the OSGi runtime. An overview of the RESTful Web Services implementation is presented below, including a couple of usage scenarios:
REST Calls via HTTP Server
Remote Eventing via HTTP or WebSockets Server
REST Calls
Application – makes REST Calls to the OSGi HTTP Service implementation, i.e the HTTP Server.
HTTP Server – processes the REST Calls and forwards them to the REST Container.
REST Container – maps the REST Calls to the corresponding Service Applications. The REST Container handles the security as well via a global Container Request Filter, which advanced users can use for customization.
Service Applications – implement the REST Calls and run on the OSGi Framework.
Remote Eventing
For this module the Remote Eventing functions in the following way:
In REST Remote EventsPull the information is requested continuously – Long Polling. In order to get an event, the Application makes a REST Call. A protocol for the datagrams is followed for subscription and reception of event messages from the OSGi Event Admin.
In REST Remote Events Push the Application subscribes for/ receives events via a WebSockets Application, deployed on a WebSockets Server. Once the connection has been established, the WebSockets Application sends the events as JSON objects. For further information on the communication with the WebSockets Application, refer to the WebSocket's OSGi Events Application Specification.
The available options for serialization of events are the Gson or Jackson libraries.