1 package de.nava.informa.utils; 26 27 import org.apache.commons.logging.Log; 28 import org.apache.commons.logging.LogFactory; 29 30 import de.nava.informa.core.ChannelIF; 31 32 36 public class RSS200Settings implements CacheSettingsIF { 37 38 private static Log logger = LogFactory.getLog(RSS200Settings.class); 39 40 private long defaultTtl = DEFAULT_TTL; 41 42 45 public void setDefaultTtl(long defaultTtl) { 46 this.defaultTtl = defaultTtl; 47 } 48 49 53 public long getTtl(ChannelIF channel, long Ttlms) { 54 if (channel.getTtl() > 0) { 55 long channelTtl = channel.getTtl() * (60 * 1000); if (Ttlms > channelTtl) { 57 return Ttlms; 58 } 59 return channelTtl; 60 } 61 62 if (Ttlms > MINIMAL_TTL ) 63 return Ttlms; 64 65 return defaultTtl; 66 67 } 68 } | Popular Tags |