1 16 package org.apache.cocoon.caching; 17 18 import org.apache.excalibur.source.SourceValidity; 19 20 29 public final class CacheValidityToSourceValidity 30 implements SourceValidity { 31 32 protected CacheValidity cacheValidity; 33 34 37 public static CacheValidityToSourceValidity createValidity(CacheValidity validity) { 38 if ( null != validity) { 39 return new CacheValidityToSourceValidity(validity); 40 } 41 return null; 42 } 43 44 47 protected CacheValidityToSourceValidity(CacheValidity validity) { 48 this.cacheValidity = validity; 49 } 50 51 52 59 public int isValid() { 60 return 0; 61 } 62 63 70 public int isValid( SourceValidity newValidity ) { 71 if (newValidity instanceof CacheValidityToSourceValidity) { 72 if (this.cacheValidity.isValid(((CacheValidityToSourceValidity)newValidity).cacheValidity)) { 73 return 1; 74 } 75 return -1; 76 } 77 return -1; 78 } 79 80 public String toString() { 81 return "Cache Validity To Source Validity[" + this.cacheValidity + ']'; 82 } 83 } 84 | Popular Tags |