Hi Tim
Thx for your message.
I tried this approach without luck :
@Override
public Account retrieve() {
AccountDAO dao = new AccountDAO(user.getNamespace());
Account ret =
dao.getAccountByEmail(UserServiceFactory.getUserService().getCurrentUser().getEmail());
log.info("retrieved " + ret);
setOnSent(new StrongEtagCallback<Account>(ret));
return ret;
}
And implementation of the StrongEtagCallback like this :
public class StrongEtagCallback<T extends DomainResource> implements Uniform {
private static SimpleDateFormat df = new
SimpleDateFormat("ddMMyyyyHHmmssSSS");
private DomainResource d;
public StrongEtagCallback(T domainResource) {
d = domainResource;
}
@Override
public void handle(Request request, Response response) {
String eTag = d.getClass().getSimpleName() + "-" + d.getId() +
"-" + df.format(d.getLastModified());
response.getEntity().setTag(new Tag(eTag, false));
}
}
Where all my entities implement DomainResource which require them to have an ID
and LastModified date.
But it does NOT work. I really expected this to work, it is very elegant !
I will try your approach and come back.
thx for the followup.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2911381