return markup;
}
protected org.gatein.pc.api.cache.CacheControl createCacheControl(LocalMimeResponse mimeResponse)
{
CacheControl cacheControl = mimeResponse.getCacheControl();
org.gatein.pc.api.cache.CacheControl result = DEFAULT_CACHE_CONTROL;
int expires;
if (cacheControl != null)
{
expires = cacheControl.getExpires();
String userScope = cacheControl.getUserScope();
// check that we support the user scope...
if (consumer.supportsUserScope(userScope))
{
if (debug)
{
log.debug("Trying to cache markup " + userScope + " for " + expires + " seconds.");
}
CacheScope scope;
if (WSRPConstants.CACHE_FOR_ALL.equals(userScope))
{
scope = CacheScope.PUBLIC;
}
else if (WSRPConstants.CACHE_PER_USER.equals(userScope))
{
scope = CacheScope.PRIVATE;
}
else
{
throw new IllegalArgumentException("Unknown CacheControl user scope: " + userScope); // should not happen
}
result = new org.gatein.pc.api.cache.CacheControl(expires, scope, cacheControl.getValidateTag());
}
}
return result;
}