1 16 package org.apache.cocoon.caching; 17 18 import java.util.Map ; 19 20 27 public final class CachedStreamObject implements java.io.Serializable { 28 29 private Map validityObjects; 30 private byte[] response; 31 32 39 public CachedStreamObject(Map validityObjects, 40 byte[] response) { 41 this.validityObjects = validityObjects; 42 this.response = response; 43 } 44 45 48 public boolean isValid(ComponentCacheKey componentKey, 49 CacheValidity componentValidity) { 50 CacheValidity ownValidity = (CacheValidity)this.validityObjects.get(componentKey); 51 if (ownValidity != null && ownValidity.isValid(componentValidity)) { 52 return true; 53 } 54 return false; 55 } 56 57 61 public CacheValidity getCacheValidity(ComponentCacheKey componentKey) { 62 return (CacheValidity)this.validityObjects.get(componentKey); 63 } 64 65 70 public byte[] getResponse() { 71 return this.response; 72 } 73 } 74 | Popular Tags |