Package net.toddm.comm
Enum CacheBehavior
- java.lang.Object
-
- java.lang.Enum<CacheBehavior>
-
- net.toddm.comm.CacheBehavior
-
- All Implemented Interfaces:
Serializable,Comparable<CacheBehavior>
public enum CacheBehavior extends Enum<CacheBehavior>
An enumeration of caching behaviors supported by the Comm Manager.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DO_NOT_CACHEIndicates to the Comm Manager that the related data should not be cached.GET_ONLY_FROM_CACHEIndicates to the Comm Manager that the related request should not result in a network request and should be serviced only from cache.NORMALIndicates to the Comm Manager that normal caching behavior should be used.SERVER_DIRECTED_CACHEIndicates to the Comm Manager that the related data should only be cached if there are response headers defining cache behavior.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CacheBehaviorvalueOf(String name)Returns the enum constant of this type with the specified name.static CacheBehavior[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NORMAL
public static final CacheBehavior NORMAL
Indicates to the Comm Manager that normal caching behavior should be used. If the response includes cache control headers they will be honored. If the response does not include cache control directives then the response is cached without a TTL and will only get evicted if it reaches an LRU limit.
-
DO_NOT_CACHE
public static final CacheBehavior DO_NOT_CACHE
Indicates to the Comm Manager that the related data should not be cached.
-
GET_ONLY_FROM_CACHE
public static final CacheBehavior GET_ONLY_FROM_CACHE
Indicates to the Comm Manager that the related request should not result in a network request and should be serviced only from cache.
-
SERVER_DIRECTED_CACHE
public static final CacheBehavior SERVER_DIRECTED_CACHE
Indicates to the Comm Manager that the related data should only be cached if there are response headers defining cache behavior. If the response does not include cache control directives then the response is not cached.
-
-
Method Detail
-
values
public static CacheBehavior[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CacheBehavior c : CacheBehavior.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CacheBehavior valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
-