Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.event.CallChangeAdapter
      extended by net.java.sip.communicator.service.protocol.ActiveCallsRepository<CallGTalkImpl,OperationSetBasicTelephonyJabberImpl>
          extended by net.java.sip.communicator.impl.protocol.jabber.ActiveCallsRepositoryGTalkImpl
All Implemented Interfaces:
EventListener, CallChangeListener

public class ActiveCallsRepositoryGTalkImpl
extends ActiveCallsRepository<CallGTalkImpl,OperationSetBasicTelephonyJabberImpl>

Keeps a list of all calls currently active and maintained by this protocol provider. Offers methods for finding a call by its ID, peer session and others.

Author:
Emil Ivov, Symphorien Wanko

Field Summary
 
Fields inherited from class net.java.sip.communicator.service.protocol.ActiveCallsRepository
parentOperationSet
 
Constructor Summary
ActiveCallsRepositoryGTalkImpl(OperationSetBasicTelephonyJabberImpl opSet)
          It's where we store all active calls
 
Method Summary
 CallPeerGTalkImpl findCallPeer(String sid)
          Returns the CallPeerGTalkImpl whose jingle session has the specified jingle sid.
 CallPeerGTalkImpl findCallPeerBySessInitPacketID(String id)
          Returns the CallPeerGTalkImpl whose session-init's ID has the specified IQ id.
 CallGTalkImpl findSessionID(String sid)
          Returns the CallGTalkImpl containing a CallPeerGTalkImpl whose corresponding jingle session has the specified jingle sid.
protected  void fireCallEvent(int eventID, Call sourceCall)
          Creates and dispatches a CallEvent notifying registered listeners that an event with id eventID has occurred on sourceCall.
 
Methods inherited from class net.java.sip.communicator.service.protocol.ActiveCallsRepository
addCall, callStateChanged, getActiveCallCount, getActiveCalls
 
Methods inherited from class net.java.sip.communicator.service.protocol.event.CallChangeAdapter
callPeerAdded, callPeerRemoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActiveCallsRepositoryGTalkImpl

public ActiveCallsRepositoryGTalkImpl(OperationSetBasicTelephonyJabberImpl opSet)
It's where we store all active calls

Parameters:
opSet - the OperationSetBasicTelphony instance which has been used to create calls in this repository
Method Detail

findSessionID

public CallGTalkImpl findSessionID(String sid)
Returns the CallGTalkImpl containing a CallPeerGTalkImpl whose corresponding jingle session has the specified jingle sid.

Parameters:
sid - the jingle sid we're looking for.
Returns:
the CallGTalkImpl containing the peer with the specified sid or null if we couldn't find one matching it.

findCallPeer

public CallPeerGTalkImpl findCallPeer(String sid)
Returns the CallPeerGTalkImpl whose jingle session has the specified jingle sid.

Parameters:
sid - the jingle sid we're looking for.
Returns:
the CallPeerGTalkImpl with the specified sid or tt>null if we couldn't find one matching it.

findCallPeerBySessInitPacketID

public CallPeerGTalkImpl findCallPeerBySessInitPacketID(String id)
Returns the CallPeerGTalkImpl whose session-init's ID has the specified IQ id.

Parameters:
id - the IQ id we're looking for.
Returns:
the CallPeerGTalkImpl with the specified id or null if we couldn't find one matching it.

fireCallEvent

protected void fireCallEvent(int eventID,
                             Call sourceCall)
Creates and dispatches a CallEvent notifying registered listeners that an event with id eventID has occurred on sourceCall.

Specified by:
fireCallEvent in class ActiveCallsRepository<CallGTalkImpl,OperationSetBasicTelephonyJabberImpl>
Parameters:
eventID - the ID of the event to dispatch
sourceCall - the call on which the event has occurred
See Also:
ActiveCallsRepository.fireCallEvent(int, Call)

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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