added max-age to cache control

This commit is contained in:
Sebastian Sdorra
2011-02-13 17:49:41 +01:00
parent a8b468d50e
commit cb6357f53c
2 changed files with 29 additions and 0 deletions

View File

@@ -262,6 +262,30 @@ public abstract class AbstractManagerResource<T extends ModelObject,
return createResponse(request, items);
}
/**
* Method description
*
*
* @return
*/
public int getCacheMaxAge()
{
return cacheMaxAge;
}
//~--- set methods ----------------------------------------------------------
/**
* Method description
*
*
* @param cacheMaxAge
*/
public void setCacheMaxAge(int cacheMaxAge)
{
this.cacheMaxAge = cacheMaxAge;
}
//~--- methods --------------------------------------------------------------
/**
@@ -324,6 +348,7 @@ public abstract class AbstractManagerResource<T extends ModelObject,
{
CacheControl cc = new CacheControl();
cc.setMaxAge(cacheMaxAge);
rb.cacheControl(cc);
}
@@ -395,6 +420,9 @@ public abstract class AbstractManagerResource<T extends ModelObject,
//~--- fields ---------------------------------------------------------------
/** Field description */
protected int cacheMaxAge = 1;
/** Field description */
protected Manager<T, E> manager;
}