Package org.infinispan.container.entries
Class ExpiryHelper
java.lang.Object
org.infinispan.container.entries.ExpiryHelper
Provide utility methods for dealing with expiration of cache entries.
- Since:
- 4.0
- Author:
- Manik Surtani, Sanne Grinovero
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isExpiredMortal
(long lifespan, long created, long now) static boolean
isExpiredTransient
(long maxIdle, long lastUsed, long now) static boolean
isExpiredTransientMortal
(long maxIdle, long lastUsed, long lifespan, long created, long now) static long
mostRecentExpirationTime
(long firstTime, long secondTime) Returns the most recent (i.e.
-
Constructor Details
-
ExpiryHelper
public ExpiryHelper()
-
-
Method Details
-
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 timessecondTime
- one of the times- Returns:
- the lowest time of each, that is not negative unless both are negative
-