It's all about the answers!

Ask a question

Jazz Foundation Storage API - ETag header for updating resources


oana hategan (11235) | asked Jan 30 '13, 9:53 a.m.
 Hello,


I am trying to update a resource that I have already stored in a storage area using this example:
https://jazz.net/wiki/bin/view/Main/JAFTutorialStepStorage.

I read here 
https://jazz.net/wiki/bin/view/Main/JFSStorageAPI
 that in order to update a resource, the entity tag (ETag) of that resource must be set as a request header.
The ETag can be obtained by sending a POST/GET/HEAD request and it can be found in the response headers, according to the documentation.
However, when I make such a request programatically, from my Java code, the ETag response header is not retrieved. When I make the same request from the RESTClient plugin, the header is retrieved.

Do you know why this happens ?

(I am using RTC 3.0.1 and I launch the plugin under Jetty server)

Comments
John Vasta commented Jan 30 '13, 5:28 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

Is there any way to turn on HTTP tracing for your code? If you are using log4j, you could add


log4j.logger.org.apache.http.wire=DEBUG

to your log4j.properties file. If you can get the HTTP trace, please post the request generated by your code, and the response you receive. 

2 answers



permanent link
oana hategan (11235) | answered Feb 01 '13, 6:49 a.m.
I deployed the plugin into Jazz Team Server and the ETag header is returned, no special magic required, just like you said. 
In the case when I run the plugin using the Jetty Based Server Launch, the ETag header is not returned. 
Is there maybe a specific bundle that needs to be added to this launch, in order to be able to retrieve the ETag?

permanent link
Philippe Mulet (55112) | answered Jan 31 '13, 4:16 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
There should be no special magic required to obtain the ETag response header back; it is injected always.
In standard way, the motivation for this ETag is to avoid blind concurrent updates for a given resource.

Your answer


Register or to post your answer.