Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.protocol
Class AbstractOperationSetTypingNotifications<T extends ProtocolProviderService>

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.AbstractOperationSetTypingNotifications<T>
Type Parameters:
T - the type of the ProtocolProviderService implementation providing the AbstractOperationSetTypingNotifications implementation
All Implemented Interfaces:
OperationSet, OperationSetTypingNotifications
Direct Known Subclasses:
OperationSetTypingNotificationsGibberishImpl, OperationSetTypingNotificationsIcqImpl, OperationSetTypingNotificationsJabberImpl, OperationSetTypingNotificationsMsnImpl, OperationSetTypingNotificationsSipImpl, OperationSetTypingNotificationsYahooImpl, OperationSetTypingNotificationsZeroconfImpl

public abstract class AbstractOperationSetTypingNotifications<T extends ProtocolProviderService>
extends Object
implements OperationSetTypingNotifications

Represents a default implementation of OperationSetTypingNotifications in order to make it easier for implementers to provide complete solutions while focusing on implementation-specific details.

Author:
Lubomir Marinov

Field Summary
protected  T parentProvider
          The provider that created us.
 
Fields inherited from interface net.java.sip.communicator.service.protocol.OperationSetTypingNotifications
STATE_PAUSED, STATE_STALE, STATE_STOPPED, STATE_TYPING, STATE_UNKNOWN
 
Constructor Summary
protected AbstractOperationSetTypingNotifications(T parentProvider)
          Initializes a new AbstractOperationSetTypingNotifications instance created by a specific ProtocolProviderService instance.
 
Method Summary
 void addTypingNotificationsListener(TypingNotificationsListener listener)
          Adds listener to the list of listeners registered for receiving TypingNotificationEvents.
protected  void assertConnected()
          Utility method throwing an exception if the stack is not properly initialized.
 void fireTypingNotificationsEvent(Contact sourceContact, int evtCode)
          Delivers a TypingNotificationEvent to all registered listeners.
 void removeTypingNotificationsListener(TypingNotificationsListener listener)
          Removes listener from the list of listeners registered for receiving TypingNotificationEvents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.java.sip.communicator.service.protocol.OperationSetTypingNotifications
sendTypingNotification
 

Field Detail

parentProvider

protected final T extends ProtocolProviderService parentProvider
The provider that created us.

Constructor Detail

AbstractOperationSetTypingNotifications

protected AbstractOperationSetTypingNotifications(T parentProvider)
Initializes a new AbstractOperationSetTypingNotifications instance created by a specific ProtocolProviderService instance.

Parameters:
parentProvider - the ProtocolProviderService which creates the new instance
Method Detail

addTypingNotificationsListener

public void addTypingNotificationsListener(TypingNotificationsListener listener)
Adds listener to the list of listeners registered for receiving TypingNotificationEvents.

Specified by:
addTypingNotificationsListener in interface OperationSetTypingNotifications
Parameters:
listener - the TypingNotificationsListener listener that we'd like to add
See Also:
OperationSetTypingNotifications.addTypingNotificationsListener( TypingNotificationsListener)

assertConnected

protected void assertConnected()
                        throws IllegalStateException
Utility method throwing an exception if the stack is not properly initialized.

Throws:
IllegalStateException - if the underlying stack is not registered and initialized

fireTypingNotificationsEvent

public void fireTypingNotificationsEvent(Contact sourceContact,
                                         int evtCode)
Delivers a TypingNotificationEvent to all registered listeners.

Parameters:
sourceContact - the contact who has sent the notification
evtCode - the code of the event to deliver

removeTypingNotificationsListener

public void removeTypingNotificationsListener(TypingNotificationsListener listener)
Removes listener from the list of listeners registered for receiving TypingNotificationEvents.

Specified by:
removeTypingNotificationsListener in interface OperationSetTypingNotifications
Parameters:
listener - the TypingNotificationsListener listener that we'd like to remove
See Also:
OperationSetTypingNotifications.removeTypingNotificationsListener( TypingNotificationsListener)

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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