Technical overview over channels and parameters.

Communication channel overview

The communication between the comet client and java webapp comet server is asynchronous. The communication is initiated with a call, and returned with a reply (except in the case of notify, which is a special case).

The communication channels are as follows:

Channel purpose
/semispace/call/read/number Initiate a read request.
/semispace/reply/read/number Reply of a read, with the payload being the result if it was obtained.
/semispace/call/take/number Initiate a take request.
/semispace/reply/take/number Result of take.
/semispace/call/write/number Insert an object into the space. This is a synchronous operation when using the comet java client.
/semispace/reply/write/number Acknowledge that the element has been written.
/semispace/call/notify/number/type Register a notification. This is a synchronous operation when using the comet java client.
/semispace/reply/notify/number/type Acknowledge that the notification has been registered.
/semispace/event/notify/number/type Attached is a notification event.
/semispace/call/leasecancel/number Cancel lease with callId as mapped parameter. CallId is the number from the notify method
/semispace/reply/leasecancel/number Acknowledge of listener cancellation

Channel parameters are:

Channel number. When having, for example, two simultaneous read operations, this number must be different for the two operation. The easiest is to have a client side sequence number, which is just incremented for each call.
Notification type
The type is one of availability, expiration, taken, renewal and all. The Java client only uses all, and the proxy will translate this into the correct response object. This is as the Java client does not know in beforehand what kind of notification that is registered.

It does not matter if several different clients use the same channel numbers. The communication to the client is based on the client ID, and has nothing to do with the channel number.

Parameter overview

The parameters sent over the channel are packed JSON style. Then the control elements are extracted. The following is an overview:

Operation Parameter Significance
read duration json How long to wait for an object if it is not in the space. Payload to match. First level is object type, the second level are elements to match. (I.e. in a person object with firstname, lastname, it would be firstname=xxx). You cannot have 2 levels.
take ... Same parameters as read
write timeToLiveMs json How long the object shall live in the space TODO Shall change to duration Payload. This is the String representation of the client side JSON object.
notify duration json How long the notification registration shall exist. As for read
lease cancel callId The caller id the notification lease is registered to.

Servlet configuration parameters

If you want to exclude either take or write as feature, you can do this in the web.xml file. This is relevant when you have a service which shall provide a read-only interface to the clients, probably due to data entering the space from a backend service.

Init parameter Significance
disableTake If disableTake is true, clients will be unable to remove anything from the space
disableWrite If disableWrite is true, clients will not be able to write anything to the space