Class CacheOperationsHelper


  • public class CacheOperationsHelper
    extends java.lang.Object
    • Method Detail

      • createMetadata

        public static Metadata createMetadata​(Configuration cfg,
                                              java.util.Optional<java.lang.Long> ttl,
                                              java.util.Optional<java.lang.Long> idleTime)
      • supportsExtendedHeaders

        public static boolean supportsExtendedHeaders​(RestServerConfiguration restServerConfiguration,
                                                      java.lang.String extended)
      • calcCacheControl

        public static CacheControl calcCacheControl​(java.util.Date expires)
      • entryFreshEnough

        public static boolean entryFreshEnough​(java.util.Date entryExpires,
                                               java.util.OptionalInt minFresh)
      • calcFreshness

        public static int calcFreshness​(java.util.Date expires)
      • minFresh

        public static java.util.OptionalInt minFresh​(java.lang.String cacheControl)
      • lastModified

        public static <K,​V> java.util.Date lastModified​(InternalCacheEntry<K,​V> ice)
      • ifUnmodifiedIsBeforeEntryModificationDate

        public static boolean ifUnmodifiedIsBeforeEntryModificationDate​(java.util.Optional<java.lang.String> ifUnmodifiedSince,
                                                                        java.util.Date lastMod)
                                                                 throws WrongDateFormatException
        Throws:
        WrongDateFormatException
      • ifMatchDoesntMatchEtag

        public static boolean ifMatchDoesntMatchEtag​(java.util.Optional<java.lang.String> etagIfMatch,
                                                     java.lang.String etag)
      • ifNoneMatchMathesEtag

        public static boolean ifNoneMatchMathesEtag​(java.util.Optional<java.lang.String> etagIfNoneMatch,
                                                    java.lang.String etag)
      • ifModifiedIsAfterEntryModificationDate

        public static boolean ifModifiedIsAfterEntryModificationDate​(java.util.Optional<java.lang.String> etagIfModifiedSince,
                                                                     java.util.Date lastMod)
                                                              throws WrongDateFormatException
        Throws:
        WrongDateFormatException