Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

ETag convenience #5

Open
mkovatsc opened this issue Jun 10, 2014 · 1 comment
Open

ETag convenience #5

mkovatsc opened this issue Jun 10, 2014 · 1 comment

Comments

@mkovatsc
Copy link

Add convenience support for ETags to ResourceBase or wherever applicable, so that there is out-of-the-box validation support (GET+ETag -> 2.03 Valid). The developer will need to define a hash method or otherwise register the current ETag for the resource.

martinlanter added a commit to martinlanter/californium that referenced this issue Jul 30, 2014
…rface ETagSupport

and a default implementation ETagDefaultSupport and JUnit tests. A
CoapResource now has a ETagSupport object that generates ETags if
required. If an incoming request has ETags, the resource automatically
validates them against the current value in the ETagSupport object and
responds with a 2.03 (Valid) if an ETag matches.
@martinlanter
Copy link
Contributor

I have implemented a proposal for this issue (https://github.com/Lanterm/californium/tree/accept-and-etag). I have added an Interface ETagSupport and a default implementation ETagDefaultSupport. A CoapResource (new name for ResourceBase) now holds such an ETagSupport object. If the content changes, the resoource just invokes getETagSupport().nextETag();. If the resource later handles a request holding ETags, it automatically compares the ETags against the current ETag of the ETagSupport object and if one matches responds with a 2.03 (Valid). Only if no ETag matches, the resource calls it handleGET method.

martinlanter added a commit to martinlanter/californium that referenced this issue Aug 3, 2014
…rface ETagSupport

and a default implementation ETagDefaultSupport and JUnit tests. A
CoapResource now has a ETagSupport object that generates ETags if
required. If an incoming request has ETags, the resource automatically
validates them against the current value in the ETagSupport object and
responds with a 2.03 (Valid) if an ETag matches.
martinlanter added a commit to martinlanter/californium that referenced this issue Aug 3, 2014
…rface ETagSupport

and a default implementation ETagDefaultSupport and JUnit tests. A
CoapResource now has a ETagSupport object that generates ETags if
required. If an incoming request has ETags, the resource automatically
validates them against the current value in the ETagSupport object and
responds with a 2.03 (Valid) if an ETag matches.
sbernard31 pushed a commit to sbernard31/californium that referenced this issue Sep 14, 2017
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

2 participants