1 26 package de.nava.informa.utils; 27 28 import org.apache.commons.logging.Log; 29 import org.apache.commons.logging.LogFactory; 30 31 import de.nava.informa.core.ChannelIF; 32 33 39 public class Atom030Settings implements CacheSettingsIF { 40 41 private static Log logger = LogFactory.getLog(Atom030Settings.class); 42 43 private long defaultTtl = DEFAULT_TTL; 44 45 48 public void setDefaultTtl(long defaultTtl) { 49 this.defaultTtl = defaultTtl; 50 } 51 52 56 public long getTtl(ChannelIF channel, long ttlms) { 57 if (channel.getTtl() > 0) { 59 long channelTtl = channel.getTtl() * (60 * 1000); if (ttlms > channelTtl) { 61 return ttlms; 62 } 63 return channelTtl; 64 } 65 66 if (ttlms > MINIMAL_TTL ) 67 return ttlms; 68 69 return this.defaultTtl; 70 71 } 72 } 73 | Popular Tags |