/** * Register a listener for item publication events. This * listener will get called whenever an item is published to * this node. * * @param listener The handler for the event */ @SuppressWarnings("unchecked") public void addItemEventListener(@SuppressWarnings("rawtypes") ItemEventListener listener) { StanzaListener conListener = new ItemEventTranslator(listener); itemEventToListenerMap.put(listener, conListener); con.addSyncStanzaListener(conListener, new EventContentFilter(EventElementType.items.toString(), "item")); }
/** * Unregister a listener for publication events. * * @param listener The handler to unregister */ public void removeItemEventListener(@SuppressWarnings("rawtypes") ItemEventListener listener) { StanzaListener conListener = itemEventToListenerMap.remove(listener); if (conListener != null) con.removeSyncStanzaListener(conListener); }
/** * Unregister a listener for publication events. * * @param listener The handler to unregister */ public void removeItemEventListener(ItemEventListener listener) { PacketListener conListener = itemEventToListenerMap.remove(listener); if (conListener != null) con.removePacketListener(conListener); }
/** * Unregister a listener for publication events. * * @param listener * The handler to unregister */ public void removeItemEventListener(ItemEventListener listener) { PacketListener conListener = itemEventToListenerMap.remove(listener); if (conListener != null) con.removePacketListener(conListener); }
public ItemEventTranslator(@SuppressWarnings("rawtypes") ItemEventListener eventListener) { listener = eventListener; }
public ItemEventTranslator(ItemEventListener eventListener) { listener = eventListener; }
/** * Register a listener for item publication events. This * listener will get called whenever an item is published to * this node. * * @param listener The handler for the event */ public void addItemEventListener(ItemEventListener listener) { PacketListener conListener = new ItemEventTranslator(listener); itemEventToListenerMap.put(listener, conListener); con.addPacketListener(conListener, new EventContentFilter(EventElementType.items.toString(), "item")); }
/** * Register a listener for item publication events. This listener will get * called whenever an item is published to this node. * * @param listener * The handler for the event */ public void addItemEventListener(ItemEventListener listener) { PacketListener conListener = new ItemEventTranslator(listener); itemEventToListenerMap.put(listener, conListener); con.addPacketListener(conListener, new EventContentFilter( EventElementType.items.toString(), "item")); }