T
- the call extension class like for example CallSipImpl
or CallJabberImplU
- the provider extension class like for example
ProtocolProviderServiceSipImpl or
ProtocolProviderServiceJabberImplpublic abstract class AbstractCallPeer<T extends Call,U extends ProtocolProviderService> extends org.jitsi.util.event.PropertyChangeNotifier implements CallPeer
Modifier and Type | Field and Description |
---|---|
protected java.util.List<CallPeerConferenceListener> |
callPeerConferenceListeners
The list of CallPeerConferenceListeners interested in and to be
notified about changes in conference-related information such as this
peer acting or not acting as a conference focus and conference membership
details.
|
protected java.util.List<CallPeerListener> |
callPeerListeners
All the CallPeer listeners registered with this CallPeer.
|
protected java.util.List<CallPeerSecurityListener> |
callPeerSecurityListeners
All the CallPeerSecurityListener-s registered with this CallPeer.
|
static ConferenceMember[] |
NO_CONFERENCE_MEMBERS
The constant which describes an empty set of ConferenceMembers
(and which can be used to reduce allocations).
|
CALL_DURATION_START_TIME_UNKNOWN, MUTE_PROPERTY_NAME
Modifier | Constructor and Description |
---|---|
protected |
AbstractCallPeer()
Initializes a new AbstractCallPeer instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addCallPeerConferenceListener(CallPeerConferenceListener listener)
Implements
CallPeer#addCallPeerConferenceListener(
CallPeerConferenceListener).
|
void |
addCallPeerListener(CallPeerListener listener)
Registers the listener to the list of listeners that would be
receiving CallPeerEvents.
|
void |
addCallPeerSecurityListener(CallPeerSecurityListener listener)
Registers the listener to the list of listeners that would be
receiving CallPeerSecurityEvents.
|
void |
addConferenceMember(ConferenceMember conferenceMember)
Adds a specific ConferenceMember to the list of
ConferenceMembers reported by this peer through
getConferenceMembers() and getConferenceMemberCount()
and fires
CallPeerConferenceEvent#CONFERENCE_MEMBER_ADDED to
the currently registered CallPeerConferenceListeners. |
protected ConferenceMember |
findConferenceMember(long ssrc)
Finds the first ConferenceMember whose audioSsrc is
equals to a specific value.
|
protected void |
fireCallPeerChangeEvent(java.lang.String eventType,
java.lang.Object oldValue,
java.lang.Object newValue)
Constructs a CallPeerChangeEvent using this call peer as source,
setting it to be of type eventType and the corresponding
oldValue and newValue,
|
protected void |
fireCallPeerChangeEvent(java.lang.String eventType,
java.lang.Object oldValue,
java.lang.Object newValue,
java.lang.String reason)
Constructs a CallPeerChangeEvent using this call peer as source,
setting it to be of type eventType and the corresponding
oldValue and newValue.
|
protected void |
fireCallPeerChangeEvent(java.lang.String eventType,
java.lang.Object oldValue,
java.lang.Object newValue,
java.lang.String reason,
int reasonCode)
Constructs a CallPeerChangeEvent using this call peer as source,
setting it to be of type eventType and the corresponding
oldValue and newValue.
|
protected void |
fireCallPeerConferenceEvent(CallPeerConferenceEvent conferenceEvent)
Fires a specific CallPeerConferenceEvent to the
CallPeerConferenceListeners interested in changes in the
conference-related information provided by this peer.
|
protected void |
fireCallPeerSecurityMessageEvent(java.lang.String messageType,
java.lang.String i18nMessage,
int severity)
Constructs a CallPeerSecurityStatusEvent using this call peer as
source, setting it to be of type eventType and the corresponding
oldValue and newValue.
|
protected void |
fireCallPeerSecurityNegotiationStartedEvent(CallPeerSecurityNegotiationStartedEvent evt)
Constructs a CallPeerSecurityStatusEvent using this call peer as
source, setting it to be of type eventType and the corresponding
oldValue and newValue.
|
protected void |
fireCallPeerSecurityOffEvent(CallPeerSecurityOffEvent evt)
Constructs a CallPeerSecurityStatusEvent using this call peer as
source, setting it to be of type eventType and the corresponding
oldValue and newValue.
|
protected void |
fireCallPeerSecurityOnEvent(CallPeerSecurityOnEvent evt)
Constructs a CallPeerSecurityStatusEvent using this call peer as
source, setting it to be of type eventType and the corresponding
oldValue and newValue.
|
protected void |
fireCallPeerSecurityTimeoutEvent(CallPeerSecurityTimeoutEvent evt)
Constructs a CallPeerSecurityStatusEvent using this call peer as
source, setting it to be of type eventType and the corresponding
oldValue and newValue.
|
void |
fireConferenceMemberErrorEvent(java.lang.String errorMessage)
Fires
CallPeerConferenceEvent#CONFERENCE_MEMBER_ERROR_RECEIVED to
the currently registered CallPeerConferenceListeners.
|
java.lang.String |
getAlternativeIMPPAddress()
Returns an alternative IMPP address corresponding to this
CallPeer.
|
abstract T |
getCall()
Returns a reference to the call that this peer belongs to.
|
long |
getCallDurationStartTime()
Gets the time at which this CallPeer transitioned into a state
(likely
CallPeerState.CONNECTED ) marking the start of the
duration of the participation in a Call. |
java.net.URL |
getCallInfoURL()
Returns a URL pointing ta a location with call control information for
this peer or null if no such URL is available for this call
peer.
|
int |
getConferenceMemberCount()
Gets the number of ConferenceMembers currently known to this
peer if it is acting as a conference focus.
|
java.util.List<ConferenceMember> |
getConferenceMembers()
Gets the ConferenceMembers currently known to this
peer if it is acting as a conference focus.
|
CallPeerSecurityStatusEvent |
getCurrentSecuritySettings()
Returns the currently used security settings of this CallPeer.
|
abstract U |
getProtocolProvider()
Returns the protocol provider that this peer belongs to.
|
CallPeerState |
getState()
Returns an object representing the current state of that peer.
|
boolean |
isConferenceFocus()
Determines whether this call peer is currently a conference focus.
|
boolean |
isMute()
Determines whether the audio stream (if any) being sent to this peer is
mute.
|
void |
removeCallPeerConferenceListener(CallPeerConferenceListener listener)
Implements
CallPeer#removeCallPeerConferenceListener(
CallPeerConferenceListener).
|
void |
removeCallPeerListener(CallPeerListener listener)
Unregisters the specified listener.
|
void |
removeCallPeerSecurityListener(CallPeerSecurityListener listener)
Unregisters the specified listener.
|
void |
removeConferenceMember(ConferenceMember conferenceMember)
Removes a specific ConferenceMember from the list of
ConferenceMembers reported by this peer through
getConferenceMembers() and getConferenceMemberCount()
if it is contained and fires
CallPeerConferenceEvent#CONFERENCE_MEMBER_REMOVED to
the currently registered CallPeerConferenceListeners. |
void |
setAlternativeIMPPAddress(java.lang.String address)
Returns an alternative IMPP address corresponding to this
CallPeer.
|
void |
setConferenceFocus(boolean conferenceFocus)
Specifies whether this peer is a conference focus.
|
void |
setMute(boolean newMuteValue)
Sets the mute property for this call peer.
|
void |
setState(CallPeerState newState)
Causes this CallPeer to enter the specified state.
|
void |
setState(CallPeerState newState,
java.lang.String reason)
Causes this CallPeer to enter the specified state.
|
void |
setState(CallPeerState newState,
java.lang.String reason,
int reasonCode)
Causes this CallPeer to enter the specified state.
|
java.lang.String |
toString()
Returns a string representation of the peer in the form of
Display Name <address>;status=CallPeerStatus |
addPropertyChangeListener, firePropertyChange, getPropertyChangeSource, removePropertyChangeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addConferenceMembersSoundLevelListener, addPropertyChangeListener, addStreamSoundLevelListener, getAddress, getContact, getDisplayName, getImage, getPeerID, getURI, removeConferenceMembersSoundLevelListener, removePropertyChangeListener, removeStreamSoundLevelListener
public static final ConferenceMember[] NO_CONFERENCE_MEMBERS
protected final java.util.List<CallPeerConferenceListener> callPeerConferenceListeners
protected final java.util.List<CallPeerListener> callPeerListeners
protected final java.util.List<CallPeerSecurityListener> callPeerSecurityListeners
protected AbstractCallPeer()
public java.lang.String getAlternativeIMPPAddress()
getAlternativeIMPPAddress
in interface CallPeer
public void setAlternativeIMPPAddress(java.lang.String address)
address
- an alternative IMPP address corresponding to this
CallPeerpublic void addCallPeerConferenceListener(CallPeerConferenceListener listener)
addCallPeerConferenceListener
in interface CallPeer
listener
- the CallPeerConferenceListener to addpublic void addCallPeerListener(CallPeerListener listener)
addCallPeerListener
in interface CallPeer
listener
- a listener instance to register with this peer.public void addCallPeerSecurityListener(CallPeerSecurityListener listener)
addCallPeerSecurityListener
in interface CallPeer
listener
- a listener instance to register with this peer.public void addConferenceMember(ConferenceMember conferenceMember)
getConferenceMembers()
and getConferenceMemberCount()
and fires
CallPeerConferenceEvent#CONFERENCE_MEMBER_ADDED to
the currently registered CallPeerConferenceListeners.conferenceMember
- a ConferenceMember to be added to the
list of ConferenceMember reported by this peer. If the specified
ConferenceMember is already contained in the list, it is not
added again and no event is fired.public void fireConferenceMemberErrorEvent(java.lang.String errorMessage)
errorMessage
- error message that can be displayed.protected ConferenceMember findConferenceMember(long ssrc)
ssrc
- the SSRC identifier of the audio RTP streams transmitted by
the ConferenceMember that we are looking for.protected void fireCallPeerChangeEvent(java.lang.String eventType, java.lang.Object oldValue, java.lang.Object newValue)
eventType
- the type of the event to create and dispatch.oldValue
- the value of the source property before it changed.newValue
- the current value of the source property.protected void fireCallPeerChangeEvent(java.lang.String eventType, java.lang.Object oldValue, java.lang.Object newValue, java.lang.String reason)
eventType
- the type of the event to create and dispatch.oldValue
- the value of the source property before it changed.newValue
- the current value of the source property.reason
- a string that could be set to contain a human readable
explanation for the transition (particularly handy when moving into a
FAILED state).protected void fireCallPeerChangeEvent(java.lang.String eventType, java.lang.Object oldValue, java.lang.Object newValue, java.lang.String reason, int reasonCode)
eventType
- the type of the event to create and dispatch.oldValue
- the value of the source property before it changed.newValue
- the current value of the source property.reason
- a string that could be set to contain a human readable
explanation for the transition (particularly handy when moving into a
FAILED state).reasonCode
- the reason code for the reason of this event.protected void fireCallPeerConferenceEvent(CallPeerConferenceEvent conferenceEvent)
conferenceEvent
- a CallPeerConferenceEvent to be fired and
carrying the event dataprotected void fireCallPeerSecurityMessageEvent(java.lang.String messageType, java.lang.String i18nMessage, int severity)
messageType
- the type of the messagei18nMessage
- messageseverity
- severity levelprotected void fireCallPeerSecurityNegotiationStartedEvent(CallPeerSecurityNegotiationStartedEvent evt)
evt
- the event object with details to pass on to the consumersprotected void fireCallPeerSecurityOffEvent(CallPeerSecurityOffEvent evt)
evt
- the event object with details to pass on to the consumersprotected void fireCallPeerSecurityOnEvent(CallPeerSecurityOnEvent evt)
evt
- the event object with details to pass on to the consumersprotected void fireCallPeerSecurityTimeoutEvent(CallPeerSecurityTimeoutEvent evt)
evt
- the event object with details to pass on to the consumerspublic abstract T getCall()
public long getCallDurationStartTime()
CallPeerState.CONNECTED
) marking the start of the
duration of the participation in a Call.getCallDurationStartTime
in interface CallPeer
CallPeer.CALL_DURATION_START_TIME_UNKNOWN
if
such a transition has not been performedpublic java.net.URL getCallInfoURL()
getCallInfoURL
in interface CallPeer
public int getConferenceMemberCount()
getConferenceMemberCount
in interface CallPeer
public java.util.List<ConferenceMember> getConferenceMembers()
getConferenceMembers
in interface CallPeer
public CallPeerSecurityStatusEvent getCurrentSecuritySettings()
getCurrentSecuritySettings
in interface CallPeer
public abstract U getProtocolProvider()
getProtocolProvider
in interface CallPeer
public CallPeerState getState()
public boolean isConferenceFocus()
isConferenceFocus
in interface CallPeer
public boolean isMute()
The default implementation returns false.
public void removeCallPeerConferenceListener(CallPeerConferenceListener listener)
removeCallPeerConferenceListener
in interface CallPeer
listener
- the CallPeerConferenceListener to removepublic void removeCallPeerListener(CallPeerListener listener)
removeCallPeerListener
in interface CallPeer
listener
- the listener to unregister.public void removeCallPeerSecurityListener(CallPeerSecurityListener listener)
removeCallPeerSecurityListener
in interface CallPeer
listener
- the listener to unregister.public void removeConferenceMember(ConferenceMember conferenceMember)
getConferenceMembers()
and getConferenceMemberCount()
if it is contained and fires
CallPeerConferenceEvent#CONFERENCE_MEMBER_REMOVED to
the currently registered CallPeerConferenceListeners.conferenceMember
- a ConferenceMember to be removed from
the list of ConferenceMember reported by this peer. If the
specified ConferenceMember is no contained in the list, no event
is fired.public void setConferenceFocus(boolean conferenceFocus)
conferenceFocus
- true if this peer is to become a
conference focus and false otherwise.public void setMute(boolean newMuteValue)
newMuteValue
- the new value of the mute property for this call peerpublic void setState(CallPeerState newState)
newState
- the state this call peer should enter.public void setState(CallPeerState newState, java.lang.String reason)
newState
- the state this call peer should enter.reason
- a string that could be set to contain a human readable
explanation for the transition (particularly handy when moving into a
FAILED state).public void setState(CallPeerState newState, java.lang.String reason, int reasonCode)
newState
- the state this call peer should enter.reason
- a string that could be set to contain a human readable
explanation for the transition (particularly handy when moving into a
FAILED state).reasonCode
- the code for the reason of the state change.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.