The first key function of the SmartWeb platform is the possibility to uniformly access the data and services of D2000 using the universal API interface. This API is independent of the used client's technology and with the API, it is possible to acquire data and call services implemented in D2000.
In general, we can distinguish online technologies of client-server communication into two categories according to the communication character. The first category includes technologies in which the client always initiates data change and the server responds, so-called Request - Response communication. The second category covers Publish - Subscribe communication in which the client registers for subscription of certain data types (subscribe) and the server publishes these data for clients who asked for them.
SmartWeb server implements both Request - Response and Publish - Subscribe communication through following interface:
- REST API realizes Request - Response communication
- Comet API realizes both Request - Response and Publish - Subscribe communication
Both interfaces communicate with the D2000 system through JAPI library.
Rest API
Rest API is a standard API for web and mobile applications. The SmartWeb Rest API offers following possibilities:
- reading archives
- calling of any ESL RPC and Java RPC
- downloading/uploading of binary content from/into D2000 through SBA RPC
- serialization of all types and structure
- selection of return data (time tag, flags, ...), downscaling
- performance monitoring
- authentication, security, compression, response streaming, and so on...
This figure illustrates the example of using the REST API interface for calling on simple D2000 RPC procedure.
Comet API
Comet API provides the same functions as REST API and more:
- subscription of D2000 objects
- registration of javascript RPC asynchronously calling from D2000
- notifications about session from the SmartWeb server (expiration, session expiration)
The SmartWeb Comet API is implemented through the cometd library which robust functionality is certified based on solutions with 150 thousand users. Among the advantages of this library belong:
- intelligent choice of optimal communication protocol based on actual connection possibilities - Websocket, HTTP 1.1/2.0
- connection implementable in any language - open specification
- low payload for keeping connection
0 komentárov