Object - RestClientConfig

Top  Previous  Next

During connection establishment the 200 OK response to the 'connect' method contains the JSON object restClientConfig that defines behavior of all subsequent invocations regarding error handling, parameter overwrite and building the set of passed fields. If restClientConfig wasn't passed, the default values from the below table are used.

 

Name

Description

Default

clientExclude

The list of parameter names divided by commas. Parameters in this list will not be passed to the client.

empty

restExclude

The list of parameter names divided by commas. Parameters in this list will not be passed to the web-server.

empty

restOnError

LOG, FAIL

 

See the detailed description in the Method types section.

LOG

restPolicy

OVERWRITE, NOTIFY, DISABLED

 

OVERWRITE - fields listed in the restOverwrite field will be overwritten by the response of the web-server.

 

NOTIFY - Sending of the request to the web-server is performed too, but no fields is overwritten.

 

DISABLED - The web-server isn't invoked, only data sent from the client are used.

NOTIFY

restOverwrite

The list of fields separated by commas. Fields from this list will be overwritten if the restPolicy:'OVERWRITE' is enabled.

empty

 

Here is an example of the restClientConfig. In this example, the config has only the 'ConnectionStatusEvent' method. The same way other method can be described in the config. If a method isn't described, the default values are used.

 

"restClientConfig":

 {

         "ConnectionStatusEvent":

                 {

                         "restExclude":"",

                         "clientExclude":"",

                         "restOnError":"LOG",

                         "restPolicy":"NOTIFY",

                         "restOverwrite":""

                 }

 }

 

Interpreting the example:

For the ConnectionStatusEvent method, the following settings are defined: restExclude, clientExclude, restOnError, restPolicy, restOverwrite.

When this method is invoked, all fields are delivered to the Web-server, because restExclude="".

When this method is invoked, all fields are delivered to the client as well, because clientExclude="".

In case of errors when invoking the web-server, these error are logged, but not passed to the client. At the same time, a normal event ConnectionStatusEvent is passed to the client, because this event is Type II. (see Method types).

Even if the web-server returns new parameters, they are not overwritten, because of restPolicy:"NOTIFY".

The restOverwrite field does not work here, because overwriting is disabled in restPolicy.

 

The same way restClientConfig can describe configuration of other invocations, such as: call, OnCallEvent, CallStatusEvent, sendMessage, OnMessageEvent, MessageStatusEvent, and so on.