Package org.infinispan.rest.operations
Class CacheOperationsHelper
- java.lang.Object
-
- org.infinispan.rest.operations.CacheOperationsHelper
-
public class CacheOperationsHelper extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CacheControl
calcCacheControl(Date expires)
static int
calcFreshness(Date expires)
static Metadata
createMetadata(Configuration cfg, Optional<Long> ttl, Optional<Long> idleTime)
static boolean
entryFreshEnough(Date entryExpires, OptionalInt minFresh)
static boolean
ifMatchDoesntMatchEtag(Optional<String> etagIfMatch, String etag)
static boolean
ifModifiedIsAfterEntryModificationDate(Optional<String> etagIfModifiedSince, Date lastMod)
static boolean
ifNoneMatchMathesEtag(Optional<String> etagIfNoneMatch, String etag)
static boolean
ifUnmodifiedIsBeforeEntryModificationDate(Optional<String> ifUnmodifiedSince, Date lastMod)
static <K,V>
DatelastModified(InternalCacheEntry<K,V> ice)
static OptionalInt
minFresh(String cacheControl)
static boolean
supportsExtendedHeaders(RestServerConfiguration restServerConfiguration, String extended)
-
-
-
Method Detail
-
createMetadata
public static Metadata createMetadata(Configuration cfg, Optional<Long> ttl, Optional<Long> idleTime)
-
supportsExtendedHeaders
public static boolean supportsExtendedHeaders(RestServerConfiguration restServerConfiguration, String extended)
-
calcCacheControl
public static CacheControl calcCacheControl(Date expires)
-
entryFreshEnough
public static boolean entryFreshEnough(Date entryExpires, OptionalInt minFresh)
-
calcFreshness
public static int calcFreshness(Date expires)
-
minFresh
public static OptionalInt minFresh(String cacheControl)
-
lastModified
public static <K,V> Date lastModified(InternalCacheEntry<K,V> ice)
-
ifUnmodifiedIsBeforeEntryModificationDate
public static boolean ifUnmodifiedIsBeforeEntryModificationDate(Optional<String> ifUnmodifiedSince, Date lastMod) throws WrongDateFormatException
- Throws:
WrongDateFormatException
-
ifMatchDoesntMatchEtag
public static boolean ifMatchDoesntMatchEtag(Optional<String> etagIfMatch, String etag)
-
ifNoneMatchMathesEtag
public static boolean ifNoneMatchMathesEtag(Optional<String> etagIfNoneMatch, String etag)
-
ifModifiedIsAfterEntryModificationDate
public static boolean ifModifiedIsAfterEntryModificationDate(Optional<String> etagIfModifiedSince, Date lastMod) throws WrongDateFormatException
- Throws:
WrongDateFormatException
-
-