/** * Fires roster exchange listeners. */ private void firePEPListeners(String from, PEPEvent event) { PEPListener[] listeners = null; synchronized (pepListeners) { listeners = new PEPListener[pepListeners.size()]; pepListeners.toArray(listeners); } for (int i = 0; i < listeners.length; i++) { listeners[i].eventReceived(from, event); } }
private void init() { // Listens for all roster exchange packets and fire the roster exchange listeners. packetListener = new PacketListener() { public void processPacket(Packet packet) { Message message = (Message) packet; PEPEvent event = (PEPEvent) message.getExtension("event", "http://jabber.org/protocol/pubsub#event"); // Fire event for roster exchange listeners firePEPListeners(message.getFrom(), event); }; }; connection.addPacketListener(packetListener, packetFilter); }
private void init() { // Listens for all roster exchange packets and fire the roster exchange // listeners. packetListener = new PacketListener() { public void processPacket(Packet packet) { Message message = (Message) packet; PEPEvent event = (PEPEvent) message.getExtension("event", "http://jabber.org/protocol/pubsub#event"); // Fire event for roster exchange listeners firePEPListeners(message.getFrom(), event); }; }; connection.addPacketListener(packetListener, packetFilter); }
/** * Called when PEP events are received as part of a presence subscribe or message filter. * * @param from the user that sent the entries. * @param event the event contained in the message. */ public void eventReceived(String from, PEPEvent event);
/** * Called when PEP events are received as part of a presence subscribe or * message filter. * * @param from * the user that sent the entries. * @param event * the event contained in the message. */ public void eventReceived(String from, PEPEvent event);