org.spiffyui.client.rest
Interface ConcurrentRESTCallback

All Superinterfaces:
RESTCallback

public interface ConcurrentRESTCallback
extends RESTCallback

The ConcurrentRESTCallback is a special form of REST callback that can handle an ETag and the If-Match header for concurrency checking.


Method Summary
 void setETag(java.lang.String tag)
           Sets the Etag for this request.
 
Methods inherited from interface org.spiffyui.client.rest.RESTCallback
onError, onError, onSuccess
 

Method Detail

setETag

void setETag(java.lang.String tag)

Sets the Etag for this request.

When the server returns a value that supports concurrency checking it returns a hash value in the etag HTTP header.

This value is sent to the calling code with this special interface. The caller must then pass this value back to RESTility when making the request to save the data. This value will then be added by RESTility to the If-Match HTTP header for the update request.

The server can use these two values to perform optimistic concurrency checking on the update request.

This method will only be called right before a call to onSuccess from the parent interface and only if the server includes the ETag header in the response.

Parameters:
tag - the etag