コード例 #1
0
  private boolean checkForRefresh(Element elem, long accessTime, long timeToRefreshMillis) {
    if (elem == null) {
      return false;
    }

    long minAccessForRefreshTime = elem.getCreationTime() + timeToRefreshMillis;

    return (accessTime >= minAccessForRefreshTime);
  }
コード例 #2
0
 /**
  * Create a new write operation for a particular element and creation time
  *
  * @param element the element to write
  * @param creationTime the creation time of the operation
  */
 public WriteOperation(Element element, long creationTime) {
   this.element =
       new Element(
           element.getObjectKey(),
           element.getObjectValue(),
           element.getVersion(),
           element.getCreationTime(),
           element.getLastAccessTime(),
           element.getHitCount(),
           false,
           element.getTimeToLive(),
           element.getTimeToIdle(),
           element.getLastUpdateTime());
   this.creationTime = creationTime;
 }
コード例 #3
0
ファイル: OtCache.java プロジェクト: mcolak/Eba-Auth
 public void oturumKaldir(String key) {
   Element elem = getCache().get(key);
   getCache().remove(key);
   oturumSayisiAzalt(elem.getCreationTime());
 }