|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.data.CacheDirective
public final class CacheDirective
Directive for caching mechanisms along the call chain. This overrides the
default behavior of those caches and proxies.
Note that when used with HTTP connectors, this class maps to the
"Cache-Control" header.
Constructor Summary | |
---|---|
CacheDirective(String name)
Constructor for directives with no value. |
|
CacheDirective(String name,
String value)
Constructor for directives with a value. |
|
CacheDirective(String name,
String value,
boolean digit)
Constructor for directives with a value. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
String |
getName()
Returns the name. |
String |
getValue()
Returns the value. |
int |
hashCode()
|
boolean |
isDigit()
Returns true if the directive contains a digit value. |
static CacheDirective |
maxAge(int maxAge)
Creates a "max-age" directive. |
static CacheDirective |
maxStale()
Creates a "max-stale" directive. |
static CacheDirective |
maxStale(int maxStale)
Creates a "max-stale" directive. |
static CacheDirective |
minFresh(int minFresh)
Creates a "min-fresh" directive. |
static CacheDirective |
mustRevalidate()
Creates a "must-revalidate" directive. |
static CacheDirective |
noCache()
Creates a "no-cache" directive. |
static CacheDirective |
noCache(List<String> fieldNames)
Creates a "no-cache" directive. |
static CacheDirective |
noCache(String fieldName)
Creates a "no-cache" directive. |
static CacheDirective |
noStore()
Creates a "no-store" directive. |
static CacheDirective |
noTransform()
Creates a "no-transform" directive. |
static CacheDirective |
onlyIfCached()
Creates a "onlyIfCached" directive. |
static CacheDirective |
privateInfo()
Creates a "private" directive. |
static CacheDirective |
privateInfo(List<String> fieldNames)
Creates a "private" directive. |
static CacheDirective |
privateInfo(String fieldName)
Creates a "private" directive. |
static CacheDirective |
proxyMustRevalidate()
Creates a "proxy-revalidate" directive. |
static CacheDirective |
publicInfo()
Creates a "public" directive. |
void |
setDigit(boolean digit)
Indicates if the directive is a digit value. |
void |
setName(String name)
Sets the name. |
void |
setValue(String value)
Sets the value. |
static CacheDirective |
sharedMaxAge(int sharedMaxAge)
Creates a "s-maxage" directive. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CacheDirective(String name)
name
- The directive name.public CacheDirective(String name, String value)
name
- The directive name.value
- The directive value.public CacheDirective(String name, String value, boolean digit)
name
- The directive name.value
- The directive value.digit
- The kind of value (true for a digit value, false otherwise).Method Detail |
---|
public static CacheDirective maxAge(int maxAge)
maxAge
- Maximum age in seconds.
public static CacheDirective maxStale()
public static CacheDirective maxStale(int maxStale)
maxStale
- Maximum stale age in seconds.
public static CacheDirective minFresh(int minFresh)
minFresh
- Minimum freshness lifetime in seconds.
public static CacheDirective mustRevalidate()
public static CacheDirective noCache()
public static CacheDirective noCache(List<String> fieldNames)
fieldNames
- Field names, typically a HTTP header name, that must not be
sent by caches.
public static CacheDirective noCache(String fieldName)
fieldName
- A field name, typically a HTTP header name, that must not be
sent by caches.
public static CacheDirective noStore()
public static CacheDirective noTransform()
public static CacheDirective onlyIfCached()
public static CacheDirective privateInfo()
public static CacheDirective privateInfo(List<String> fieldNames)
fieldNames
- Field names, typically a HTTP header name, that must be
private.
public static CacheDirective privateInfo(String fieldName)
fieldName
- A field name, typically a HTTP header name, that is private.
public static CacheDirective proxyMustRevalidate()
public static CacheDirective publicInfo()
public static CacheDirective sharedMaxAge(int sharedMaxAge)
sharedMaxAge
- Maximum age in seconds.
public boolean equals(Object obj)
equals
in class Object
public String getName()
getName
in interface NamedValue<String>
public String getValue()
getValue
in interface NamedValue<String>
public int hashCode()
hashCode
in class Object
public boolean isDigit()
public void setDigit(boolean digit)
digit
- True if the directive contains a digit value.public void setName(String name)
name
- The name.public void setValue(String value)
setValue
in interface NamedValue<String>
value
- The value.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |