Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.sip
Class OperationSetTypingNotificationsSipImpl

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.AbstractOperationSetTypingNotifications<ProtocolProviderServiceSipImpl>
      extended by net.java.sip.communicator.impl.protocol.sip.OperationSetTypingNotificationsSipImpl
All Implemented Interfaces:
EventListener, SipMessageProcessor, MessageListener, OperationSet, OperationSetTypingNotifications

public class OperationSetTypingNotificationsSipImpl
extends AbstractOperationSetTypingNotifications<ProtocolProviderServiceSipImpl>
implements SipMessageProcessor, MessageListener

A implementation of the typing notification operation set. rfc3994

Author:
Damian Minkov

Field Summary
 
Fields inherited from class net.java.sip.communicator.service.protocol.AbstractOperationSetTypingNotifications
parentProvider
 
Fields inherited from interface net.java.sip.communicator.service.protocol.OperationSetTypingNotifications
STATE_PAUSED, STATE_STALE, STATE_STOPPED, STATE_TYPING, STATE_UNKNOWN
 
Constructor Summary
OperationSetTypingNotificationsSipImpl(ProtocolProviderServiceSipImpl provider, OperationSetBasicInstantMessagingSipImpl opSetBasicIm)
          Creates an instance of this operation set.
 
Method Summary
 void messageDelivered(MessageDeliveredEvent evt)
          Called when the underlying implementation has received an indication that a message, sent earlier has been successfully received by the destination.
 void messageDeliveryFailed(MessageDeliveryFailedEvent evt)
          Called to indicated that delivery of a message sent earlier has failed.
 void messageReceived(MessageReceivedEvent evt)
          When a message is delivered fire that typing has stopped.
 boolean processMessage(javax.sip.RequestEvent requestEvent)
          Process the incoming sip messages
 boolean processResponse(javax.sip.ResponseEvent responseEvent, Map<String,Message> sentMsg)
          Process the responses of sent messages
 boolean processTimeout(javax.sip.TimeoutEvent timeoutEvent, Map<String,Message> sentMessages)
          Process the timeouts of sent messages
 void sendTypingNotification(Contact to, int typingState)
          Sends a notification to notifiedContatct that we have entered typingState.
 
Methods inherited from class net.java.sip.communicator.service.protocol.AbstractOperationSetTypingNotifications
addTypingNotificationsListener, assertConnected, fireTypingNotificationsEvent, removeTypingNotificationsListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationSetTypingNotificationsSipImpl

OperationSetTypingNotificationsSipImpl(ProtocolProviderServiceSipImpl provider,
                                       OperationSetBasicInstantMessagingSipImpl opSetBasicIm)
Creates an instance of this operation set.

Parameters:
provider - a ref to the ProtocolProviderServiceImpl that created us and that we'll use for retrieving the underlying aim connection.
opSetBasicIm - the parent instant messaging operation set.
Method Detail

processMessage

public boolean processMessage(javax.sip.RequestEvent requestEvent)
Process the incoming sip messages

Specified by:
processMessage in interface SipMessageProcessor
Parameters:
requestEvent - the incoming event holding the message
Returns:
whether this message needs further processing(true) or no(false)

processResponse

public boolean processResponse(javax.sip.ResponseEvent responseEvent,
                               Map<String,Message> sentMsg)
Process the responses of sent messages

Specified by:
processResponse in interface SipMessageProcessor
Parameters:
responseEvent - the incoming event holding the response
sentMsg - map containing sent messages
Returns:
whether this message needs further processing(true) or no(false)

processTimeout

public boolean processTimeout(javax.sip.TimeoutEvent timeoutEvent,
                              Map<String,Message> sentMessages)
Process the timeouts of sent messages

Specified by:
processTimeout in interface SipMessageProcessor
Parameters:
timeoutEvent - the event holding the request
sentMessages - map containing sent messages
Returns:
whether this message needs further processing(true) or no(false)

sendTypingNotification

public void sendTypingNotification(Contact to,
                                   int typingState)
                            throws IllegalStateException,
                                   IllegalArgumentException
Description copied from interface: OperationSetTypingNotifications
Sends a notification to notifiedContatct that we have entered typingState.

Specified by:
sendTypingNotification in interface OperationSetTypingNotifications
Parameters:
to - the Contact to notify
typingState - the typing state that we have entered.
Throws:
IllegalStateException - if the underlying ICQ stack is not registered and initialized.
IllegalArgumentException - if notifiedContact is not an instance belonging to the underlying implementation.

messageReceived

public void messageReceived(MessageReceivedEvent evt)
When a message is delivered fire that typing has stopped.

Specified by:
messageReceived in interface MessageListener
Parameters:
evt - the received message event

messageDelivered

public void messageDelivered(MessageDeliveredEvent evt)
Description copied from interface: MessageListener
Called when the underlying implementation has received an indication that a message, sent earlier has been successfully received by the destination.

Specified by:
messageDelivered in interface MessageListener
Parameters:
evt - the MessageDeliveredEvent containing the id of the message that has caused the event.

messageDeliveryFailed

public void messageDeliveryFailed(MessageDeliveryFailedEvent evt)
Description copied from interface: MessageListener
Called to indicated that delivery of a message sent earlier has failed. Reason code and phrase are contained by the MessageFailedEvent

Specified by:
messageDeliveryFailed in interface MessageListener
Parameters:
evt - the MessageFailedEvent containing the ID of the message whose delivery has failed.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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