1 28 package de.nava.informa.utils.cleaner; 29 30 import de.nava.informa.core.ChannelIF; 31 import de.nava.informa.core.ItemIF; 32 import de.nava.informa.utils.manager.PersistenceManagerIF; 33 import de.nava.informa.utils.manager.PersistenceManagerException; 34 35 40 public class PersistenceObserver implements CleanerObserverIF { 41 private PersistenceManagerIF manager; 42 43 50 public PersistenceObserver(PersistenceManagerIF manager) { 51 if (manager == null) { 52 throw new IllegalArgumentException ("Manager should be specified."); 53 } 54 55 this.manager = manager; 56 } 57 58 64 public final void unwantedItem(ItemIF item, ChannelIF channel) { 65 try { 66 manager.deleteItem(item); 67 } catch (PersistenceManagerException e) { 68 } 70 } 71 72 77 public void cleaningStarted(ChannelIF channel) { 78 } 79 80 85 public void cleaningFinished(ChannelIF channel) { 86 } 87 } 88 | Popular Tags |