grsf-publisher-ws/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/utils/cache/CacheUtilities.java

25 lines
549 B
Java

package org.gcube.data_catalogue.grsf_publish_ws.utils.cache;
/**
* Utility functions for caches
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public class CacheUtilities {
/**
* Check if the bean expired
* @param beanTimestamp
* @param ttl
* @return <true> if expired, <false> otherwise
*/
public static boolean expired(long beanTimestamp, long ttl){
long currentTime = System.currentTimeMillis();
if((beanTimestamp + ttl) <= currentTime)
return true;
else
return false;
}
}