Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

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

public class ActiveCallsRepositoryJabberImpl
extends ActiveCallsRepository<CallJabberImpl,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
ActiveCallsRepositoryJabberImpl(OperationSetBasicTelephonyJabberImpl opSet)
          It's where we store all active calls
 
Method Summary
 CallPeerJabberImpl findCallPeer(String sid)
          Returns the CallPeerJabberImpl whose jingle session has the specified jingle sid.
 CallPeerJabberImpl findCallPeerBySessInitPacketID(String id)
          Returns the CallPeerJabberImpl whose session-init's ID has the specified IQ id.
 CallJabberImpl findJingleSID(String sid)
          Returns the CallJabberImpl containing a CallPeerJabberImpl 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

ActiveCallsRepositoryJabberImpl

public ActiveCallsRepositoryJabberImpl(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

findJingleSID

public CallJabberImpl findJingleSID(String sid)
Returns the CallJabberImpl containing a CallPeerJabberImpl whose corresponding jingle session has the specified jingle sid.

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

findCallPeer

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

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

findCallPeerBySessInitPacketID

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

Parameters:
id - the IQ id we're looking for.
Returns:
the CallPeerJabberImpl 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<CallJabberImpl,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.