Yes, I already implemented my callback based on request, response and handle() 
provides both as parameters. 
I am also playing around with cache directives etc.. and debugging 
conditionHandle to get the behaviour I want.


public class StrongEtagCallback implements Uniform {

        private static Logger log = 
Logger.getLogger(StrongEtagCallback.class.getName());

        private static List<CacheDirective> cacheDirectives = new 
ArrayList<CacheDirective>();

        private DomainResource d;

        public StrongEtagCallback(DomainResource domainResource) {
                d = domainResource;
                cacheDirectives.add(CacheDirective.mustRevalidate());
        }

        @Override
        public void handle(Request request, Response response) {
                String eTag = ETagFactory.getEtag(d);
                if (eTag != null) {
                        log.log(Level.FINEST, "sending ETag <" + eTag + "> for 
" + d);
                        response.getEntity().setTag(new Tag(eTag, false));
                        
response.getEntity().setModificationDate(d.getLastModified());
                        response.setCacheDirectives(cacheDirectives);
                }
        }
}

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2911869

Reply via email to