Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.protocol
Class AbstractCall<T extends CallPeer,U extends ProtocolProviderService>

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.Call
      extended by net.java.sip.communicator.service.protocol.AbstractCall<T,U>
Type Parameters:
T - the peer extension class like for example CallPeerSipImpl or CallPeerJabberImpl
U - the provider extension class like for example ProtocolProviderServiceSipImpl or ProtocolProviderServiceJabberImpl
All Implemented Interfaces:
EventListener, CallGroupListener
Direct Known Subclasses:
CallGibberishImpl, MediaAwareCall, MockCall

public abstract class AbstractCall<T extends CallPeer,U extends ProtocolProviderService>
extends Call

Provides implementations for some of the methods in the Call abstract class to facilitate implementations.

Author:
Emil Ivov

Field Summary
protected  CallGroup callGroup
          The CallGroup of this Call.
 
Constructor Summary
protected AbstractCall(U sourceProvider)
          Creates a new Call instance.
 
Method Summary
 CallGroup getCallGroup()
          Returns the CallGroup from which this Call belongs.
 int getCallPeerCount()
          Returns the number of peers currently associated with this call.
 Iterator<T> getCallPeers()
          Returns an iterator over all call peers.
protected  Vector<T> getCallPeersVector()
          Returns the Vector containing CallPeers currently part of this call.
 int getCrossProtocolCallPeerCount()
          Returns the number of cross-protocol peers currently associated with this call.
 Iterator<CallPeer> getCrossProtocolCallPeers()
          Returns an iterator over all cross-protocol call peers.
protected  Vector<CallPeer> getCrossProtocolCallPeersVector()
          Returns the Vector containing cross-protocol CallPeers currently part of this call.
 U getProtocolProvider()
          Returns a reference to the ProtocolProviderService instance that created this call.
 void setCallGroup(CallGroup callGroup)
          Sets the CallGroup of this Call.
 
Methods inherited from class net.java.sip.communicator.service.protocol.Call
addCallChangeListener, addLocalUserSoundLevelListener, equals, fireCallChangeEvent, fireCallChangeEvent, fireCallPeerEvent, getCallID, getCallState, hashCode, isConferenceFocus, isDefaultEncrypted, isSipZrtpAttribute, removeCallChangeListener, removeLocalUserSoundLevelListener, setCallState, setCallState, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.java.sip.communicator.service.protocol.event.CallGroupListener
callAdded, callRemoved
 

Field Detail

callGroup

protected CallGroup callGroup
The CallGroup of this Call.

Constructor Detail

AbstractCall

protected AbstractCall(U sourceProvider)
Creates a new Call instance.

Parameters:
sourceProvider - the proto provider that created us.
Method Detail

getCallPeers

public Iterator<T> getCallPeers()
Returns an iterator over all call peers.

Specified by:
getCallPeers in class Call
Returns:
an Iterator over all peers currently involved in the call.

getCallPeerCount

public int getCallPeerCount()
Returns the number of peers currently associated with this call.

Specified by:
getCallPeerCount in class Call
Returns:
an int indicating the number of peers currently associated with this call.

getCallPeersVector

protected Vector<T> getCallPeersVector()
Returns the Vector containing CallPeers currently part of this call. This method should eventually be removed and code that is using it in the descendants should be brought here.

Returns:
the Vector containing CallPeers currently participating in this call.

getCrossProtocolCallPeers

public Iterator<CallPeer> getCrossProtocolCallPeers()
Returns an iterator over all cross-protocol call peers.

Specified by:
getCrossProtocolCallPeers in class Call
Returns:
an Iterator over all cross-protocol peers currently involved in the call.

getCrossProtocolCallPeerCount

public int getCrossProtocolCallPeerCount()
Returns the number of cross-protocol peers currently associated with this call.

Specified by:
getCrossProtocolCallPeerCount in class Call
Returns:
an int indicating the number of cross-protocol peers currently associated with this call.

getCrossProtocolCallPeersVector

protected Vector<CallPeer> getCrossProtocolCallPeersVector()
Returns the Vector containing cross-protocol CallPeers currently part of this call. This method should eventually be removed and code that is using it in the descendants should be brought here.

Returns:
the Vector containing cross-protocol CallPeers currently participating in this call.

getProtocolProvider

public U getProtocolProvider()
Returns a reference to the ProtocolProviderService instance that created this call.

Overrides:
getProtocolProvider in class Call
Returns:
a reference to the ProtocolProviderService instance that created this call.

getCallGroup

public CallGroup getCallGroup()
Returns the CallGroup from which this Call belongs.

Specified by:
getCallGroup in class Call
Returns:
CallGroup or null if the Call does not belongs to a CallGroup

setCallGroup

public void setCallGroup(CallGroup callGroup)
Sets the CallGroup of this Call.

Specified by:
setCallGroup in class Call
Parameters:
callGroup - CallGroup to set

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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