Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber
Class OperationSetGenericNotificationsJabberImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.jabber.OperationSetGenericNotificationsJabberImpl
All Implemented Interfaces:
OperationSet, OperationSetGenericNotifications, org.jivesoftware.smack.PacketListener

public class OperationSetGenericNotificationsJabberImpl
extends Object
implements OperationSetGenericNotifications, org.jivesoftware.smack.PacketListener

Provides notification for generic events with name and value, also option to generate such events.

Author:
Damian Minkov, Emil Ivov

Constructor Summary
OperationSetGenericNotificationsJabberImpl(ProtocolProviderServiceJabberImpl provider)
          Creates an instance of this operation set.
 
Method Summary
 void addGenericEventListener(String eventName, GenericEventListener listener)
          Registers a GenericEventListener with this operation set so that it gets notifications for new event notifications.
 void notifyForEvent(Contact contact, String eventName, String eventValue)
          Generates new event notification.
 void notifyForEvent(String jid, String eventName, String eventValue)
          Generates new generic event notification and send it to the supplied contact.
 void notifyForEvent(String jid, String eventName, String eventValue, String source)
          Generates new generic event notification and send it to the supplied contact.
 void processPacket(org.jivesoftware.smack.packet.Packet packet)
          Process the next packet sent to this packet listener.
 void removeGenericEventListener(String eventName, GenericEventListener listener)
          Unregisters listener so that it won't receive any further notifications upon new event notifications.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationSetGenericNotificationsJabberImpl

OperationSetGenericNotificationsJabberImpl(ProtocolProviderServiceJabberImpl provider)
Creates an instance of this operation set.

Parameters:
provider - a reference to the ProtocolProviderServiceImpl that created us and that we'll use for retrieving the underlying aim connection.
Method Detail

notifyForEvent

public void notifyForEvent(Contact contact,
                           String eventName,
                           String eventValue)
Generates new event notification.

Specified by:
notifyForEvent in interface OperationSetGenericNotifications
Parameters:
contact - the contact to receive the notification.
eventName - the event name of the notification.
eventValue - the event value of the notification.

notifyForEvent

public void notifyForEvent(String jid,
                           String eventName,
                           String eventValue)
Generates new generic event notification and send it to the supplied contact.

Specified by:
notifyForEvent in interface OperationSetGenericNotifications
Parameters:
jid - the contact jid which will receive the event notification.
eventName - the event name of the notification.
eventValue - the event value of the notification.

notifyForEvent

public void notifyForEvent(String jid,
                           String eventName,
                           String eventValue,
                           String source)
Generates new generic event notification and send it to the supplied contact.

Specified by:
notifyForEvent in interface OperationSetGenericNotifications
Parameters:
jid - the contact jid which will receive the event notification.
eventName - the event name of the notification.
eventValue - the event value of the notification.
source - the source that will be reported in the event.

addGenericEventListener

public void addGenericEventListener(String eventName,
                                    GenericEventListener listener)
Registers a GenericEventListener with this operation set so that it gets notifications for new event notifications.

Specified by:
addGenericEventListener in interface OperationSetGenericNotifications
Parameters:
eventName - register the listener for certain event name.
listener - the GenericEventListener to register.

removeGenericEventListener

public void removeGenericEventListener(String eventName,
                                       GenericEventListener listener)
Unregisters listener so that it won't receive any further notifications upon new event notifications.

Specified by:
removeGenericEventListener in interface OperationSetGenericNotifications
Parameters:
eventName - unregister the listener for certain event name.
listener - the GenericEventListener to unregister.

processPacket

public void processPacket(org.jivesoftware.smack.packet.Packet packet)
Process the next packet sent to this packet listener.

Specified by:
processPacket in interface org.jivesoftware.smack.PacketListener
Parameters:
packet - the packet to process.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.