1 8 9 package org.roller.business; 10 11 import org.apache.commons.logging.Log; 12 import org.apache.commons.logging.LogFactory; 13 import org.roller.RollerException; 14 import org.roller.model.PingQueueManager; 15 import org.roller.pojos.PingQueueEntryData; 16 17 20 public abstract class PingQueueManagerImpl implements PingQueueManager 21 { 22 protected PersistenceStrategy persistenceStrategy; 23 24 private static Log logger = LogFactory.getLog(PingQueueManagerImpl.class); 25 26 public PingQueueManagerImpl(PersistenceStrategy persistenceStrategy) 27 { 28 this.persistenceStrategy = persistenceStrategy; 29 } 30 31 public void release() 32 { 33 } 34 35 public PingQueueEntryData retrieveQueueEntry(String id) throws RollerException 36 { 37 return (PingQueueEntryData) persistenceStrategy.load(id, PingQueueEntryData.class); 38 } 39 40 public void storeQueueEntry(PingQueueEntryData pingQueueEntry) throws RollerException 41 { 42 if (logger.isDebugEnabled()) logger.debug("Storing ping queue entry: " + pingQueueEntry); 43 persistenceStrategy.store(pingQueueEntry); 44 } 45 46 public void removeQueueEntry(String id) throws RollerException 47 { 48 if (logger.isDebugEnabled()) logger.debug("Removing ping queue entry with id: " + id); 49 persistenceStrategy.remove(id, PingQueueEntryData.class); 50 } 51 52 public void removeQueueEntry(PingQueueEntryData pingQueueEntry) throws RollerException 53 { 54 if (logger.isDebugEnabled()) logger.debug("Removing ping queue entry: " + pingQueueEntry); 55 persistenceStrategy.remove(pingQueueEntry); 56 } 57 58 } 59 | Popular Tags |