Class ExpiryHelper


  • public class ExpiryHelper
    extends Object
    Provide utility methods for dealing with expiration of cache entries.
    Since:
    4.0
    Author:
    Manik Surtani, Sanne Grinovero
    • Constructor Detail

      • ExpiryHelper

        public ExpiryHelper()
    • Method Detail

      • isExpiredMortal

        public static boolean isExpiredMortal​(long lifespan,
                                              long created,
                                              long now)
      • isExpiredTransient

        public static boolean isExpiredTransient​(long maxIdle,
                                                 long lastUsed,
                                                 long now)
      • isExpiredTransientMortal

        public static boolean isExpiredTransientMortal​(long maxIdle,
                                                       long lastUsed,
                                                       long lifespan,
                                                       long created,
                                                       long now)
      • mostRecentExpirationTime

        public static long mostRecentExpirationTime​(long firstTime,
                                                    long secondTime)
        Returns the most recent (i.e. smallest number) that is not negative or if both are negative it returns a negative number
        Parameters:
        firstTime - one of the times
        secondTime - one of the times
        Returns:
        the lowest time of each, that is not negative unless both are negative