/** * Register an listener for item delete events. This listener * gets called whenever an item is deleted from the node. * * @param listener The handler for the event */ public void addItemDeleteListener(ItemDeleteListener listener) { StanzaListener delListener = new ItemDeleteTranslator(listener); itemDeleteToListenerMap.put(listener, delListener); EventContentFilter deleteItem = new EventContentFilter(EventElementType.items.toString(), "retract"); EventContentFilter purge = new EventContentFilter(EventElementType.purge.toString()); con.addSyncStanzaListener(delListener, new OrFilter(deleteItem, purge)); }
/** * Unregister a listener for item delete events. * * @param listener The handler to unregister */ public void removeItemDeleteListener(ItemDeleteListener listener) { StanzaListener conListener = itemDeleteToListenerMap .remove(listener); if (conListener != null) con.removeSyncStanzaListener(conListener); }
/** * Register an listener for item delete events. This listener * gets called whenever an item is deleted from the node. * * @param listener The handler for the event */ public void addItemDeleteListener(ItemDeleteListener listener) { PacketListener delListener = new ItemDeleteTranslator(listener); itemDeleteToListenerMap.put(listener, delListener); EventContentFilter deleteItem = new EventContentFilter(EventElementType.items.toString(), "retract"); EventContentFilter purge = new EventContentFilter(EventElementType.purge.toString()); con.addPacketListener(delListener, new OrFilter(deleteItem, purge)); }
/** * Unregister a listener for item delete events. * * @param listener The handler to unregister */ public void removeItemDeleteListener(ItemDeleteListener listener) { PacketListener conListener = itemDeleteToListenerMap .remove(listener); if (conListener != null) con.removePacketListener(conListener); }
/** * Register an listener for item delete events. This listener gets called * whenever an item is deleted from the node. * * @param listener * The handler for the event */ public void addItemDeleteListener(ItemDeleteListener listener) { PacketListener delListener = new ItemDeleteTranslator(listener); itemDeleteToListenerMap.put(listener, delListener); EventContentFilter deleteItem = new EventContentFilter( EventElementType.items.toString(), "retract"); EventContentFilter purge = new EventContentFilter( EventElementType.purge.toString()); con.addPacketListener(delListener, new OrFilter(deleteItem, purge)); }
/** * Unregister a listener for item delete events. * * @param listener * The handler to unregister */ public void removeItemDeleteListener(ItemDeleteListener listener) { PacketListener conListener = itemDeleteToListenerMap.remove(listener); if (conListener != null) con.removePacketListener(conListener); }
public ItemDeleteTranslator(ItemDeleteListener eventListener) { listener = eventListener; }