T
- CallU
- OperationSetBasicTelephonypublic abstract class ActiveCallsRepository<T extends Call,U extends OperationSetBasicTelephony<? extends ProtocolProviderService>> extends CallChangeAdapter
Modifier and Type | Field and Description |
---|---|
protected U |
parentOperationSet
The operation set that created us.
|
Constructor and Description |
---|
ActiveCallsRepository(U opSet)
Creates a new instance of this repository.
|
Modifier and Type | Method and Description |
---|---|
void |
addCall(T 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.
|
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.
|
protected abstract void |
fireCallEvent(int eventID,
Call sourceCall,
CallChangeEvent cause)
Creates and dispatches a CallEvent notifying registered
listeners that an event with id eventID has occurred on
sourceCall.
|
int |
getActiveCallCount()
Returns the number of calls currently tracked by this repository.
|
java.util.Iterator<T> |
getActiveCalls()
Returns an iterator over all currently active (non-ended) calls.
|
callPeerAdded, callPeerRemoved
protected final U extends OperationSetBasicTelephony<? extends ProtocolProviderService> parentOperationSet
public ActiveCallsRepository(U opSet)
opSet
- a reference to the
AbstractOperationSetBasicTelephony extension that created us.public void addCall(T call)
call
- CallSipImplpublic void callStateChanged(CallChangeEvent evt)
callStateChanged
in interface CallChangeListener
callStateChanged
in class CallChangeAdapter
evt
- the CallChangeEvent instance containing the source
calls and its old and new state.public java.util.Iterator<T> getActiveCalls()
public int getActiveCallCount()
protected void fireCallEvent(int eventID, Call sourceCall)
eventID
- the ID of the event to dispatchsourceCall
- the call on which the event has occurred.protected abstract void fireCallEvent(int eventID, Call sourceCall, CallChangeEvent cause)
TODO The method is ugly because it can be implemented if parentOperationSet is an AbstractOperationSetBasicTelephony. But after the move of the latter in the .service.protocol.media package, it is not visible here.
eventID
- the ID of the event to dispatchsourceCall
- the call on which the event has occurredcause
- the CallChangeEvent, if any, which is the cause
that necessitated a new CallEvent to be fired
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.