1 5 6 package org.exoplatform.services.wsrp.producer.impl.helpers; 7 8 import org.exoplatform.services.wsrp.type.CacheControl; 9 10 16 17 public class CacheControlProxy { 18 19 private CacheControl cacheControl; 20 private long creationTime; 21 22 public CacheControlProxy(CacheControl cacheControl) { 23 this.cacheControl = cacheControl; 24 creationTime = System.currentTimeMillis(); 25 } 26 27 public CacheControl getCacheControl() { 28 return cacheControl; 29 } 30 31 public boolean isValid(){ 32 if(System.currentTimeMillis() - creationTime < cacheControl.getExpires() * 1000) 33 return true; 34 else 35 return false; 36 } 37 38 } | Popular Tags |