SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

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

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

public class ActiveCallsRepository
extends CallChangeAdapter

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

Constructor Summary
ActiveCallsRepository(OperationSetBasicTelephonyJabberImpl opSet)
          It's where we store all active calls
 
Method Summary
 void addCall(CallJabberImpl call)
          Adds the specified call to the list of calls tracked by this repository.
 void callStateChanged(CallChangeEvent evt)
          If evt indicates that the call has been ended we remove it from the repository.
 Iterator<CallJabberImpl> getActiveCalls()
          Returns an iterator over all currently active (non-ended) calls.
 
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

ActiveCallsRepository

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

addCall

public void addCall(CallJabberImpl call)
Adds the specified call to the list of calls tracked by this repository.

Parameters:
call - CallJabberImpl

callStateChanged

public void callStateChanged(CallChangeEvent evt)
If evt indicates that the call has been ended we remove it from the repository.

Specified by:
callStateChanged in interface CallChangeListener
Overrides:
callStateChanged in class CallChangeAdapter
Parameters:
evt - the CallChangeEvent instance containing the source calls and its old and new state.

getActiveCalls

public Iterator<CallJabberImpl> getActiveCalls()
Returns an iterator over all currently active (non-ended) calls.

Returns:
an iterator over all currently active (non-ended) calls.

SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

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