Renames occurrences of callParticipant to callPeer so that it would better reflect our new Call architecture that also includes conferencing and ConferenceMembers

cusax-fix
Emil Ivov 17 years ago
parent 88753222cc
commit ffe238c250

@ -413,7 +413,7 @@ private List<String> getCSVs(String str)
}
/**
* Get the delimited strings and converts them to CallParticipantState
* Get the delimited strings and converts them to CallPeerState
*
* @param str String delimited string states
* @return LinkedList the converted values list
@ -435,7 +435,7 @@ private List<CallPeerState> getStates(String str)
/**
* Converts the state string to state
* @param state String the string
* @return CallParticipantState the state
* @return CallPeerState the state
*/
private CallPeerState convertStateStringToState(String state)
{
@ -561,38 +561,38 @@ private void writeCall(CallRecord callRecord, Contact source,
History history = this.getHistory(source, destination);
HistoryWriter historyWriter = history.getWriter();
StringBuffer callParticipantIDs = new StringBuffer();
StringBuffer callParticipantStartTime = new StringBuffer();
StringBuffer callParticipantEndTime = new StringBuffer();
StringBuffer callParticipantStates = new StringBuffer();
StringBuffer callPeerIDs = new StringBuffer();
StringBuffer callPeerStartTime = new StringBuffer();
StringBuffer callPeerEndTime = new StringBuffer();
StringBuffer callPeerStates = new StringBuffer();
for (CallPeerRecord item : callRecord
.getPeerRecords())
{
if (callParticipantIDs.length() > 0)
if (callPeerIDs.length() > 0)
{
callParticipantIDs.append(DELIM);
callParticipantStartTime.append(DELIM);
callParticipantEndTime.append(DELIM);
callParticipantStates.append(DELIM);
callPeerIDs.append(DELIM);
callPeerStartTime.append(DELIM);
callPeerEndTime.append(DELIM);
callPeerStates.append(DELIM);
}
callParticipantIDs.append(item.getPeerAddress());
callParticipantStartTime.append(String.valueOf(item
callPeerIDs.append(item.getPeerAddress());
callPeerStartTime.append(String.valueOf(item
.getStartTime().getTime()));
callParticipantEndTime.append(String.valueOf(item.getEndTime()
callPeerEndTime.append(String.valueOf(item.getEndTime()
.getTime()));
callParticipantStates.append(item.getState().getStateString());
callPeerStates.append(item.getState().getStateString());
}
historyWriter.addRecord(new String[] {
String.valueOf(callRecord.getStartTime().getTime()),
String.valueOf(callRecord.getEndTime().getTime()),
callRecord.getDirection(),
callParticipantIDs.toString(),
callParticipantStartTime.toString(),
callParticipantEndTime.toString(),
callParticipantStates.toString()},
callPeerIDs.toString(),
callPeerStartTime.toString(),
callPeerEndTime.toString(),
callPeerStates.toString()},
new Date()); // this date is when the history record is written
} catch (IOException e)
{
@ -843,18 +843,18 @@ public void callEnded(CallEvent event)
}
/**
* Adding a record for joining participant
* @param callParticipant CallParticipant
* Adding a record for joining peer
* @param callPeer CallParticipant
*/
private void handleParticipantAdded(CallPeer callParticipant)
private void handlePeerAdded(CallPeer callPeer)
{
CallRecord callRecord = findCallRecord(callParticipant.getCall());
CallRecord callRecord = findCallRecord(callPeer.getCall());
// no such call
if(callRecord == null)
return;
callParticipant.addCallPeerListener(new CallPeerAdapter()
callPeer.addCallPeerListener(new CallPeerAdapter()
{
public void peerStateChanged(CallPeerChangeEvent evt)
{
@ -862,10 +862,10 @@ public void peerStateChanged(CallPeerChangeEvent evt)
return;
else
{
CallPeerRecordImpl participantRecord =
findParticipantRecord(evt.getSourceCallParticipant());
CallPeerRecordImpl peerRecord =
findPeerRecord(evt.getSourceCallPeer());
if(participantRecord == null)
if(peerRecord == null)
return;
CallPeerState newState =
@ -874,9 +874,9 @@ public void peerStateChanged(CallPeerChangeEvent evt)
if (newState.equals(CallPeerState.CONNECTED)
&& !CallPeerState.isOnHold((CallPeerState)
evt.getOldValue()))
participantRecord.setStartTime(new Date());
peerRecord.setStartTime(new Date());
participantRecord.setState(newState);
peerRecord.setState(newState);
//Disconnected / Busy
//Disconnected / Connecting - fail
@ -887,7 +887,7 @@ public void peerStateChanged(CallPeerChangeEvent evt)
Date startDate = new Date();
CallPeerRecordImpl newRec = new CallPeerRecordImpl(
callParticipant.getAddress(),
callPeer.getAddress(),
startDate,
startDate);
@ -895,25 +895,25 @@ public void peerStateChanged(CallPeerChangeEvent evt)
}
/**
* Adding a record for removing participant from call
* @param callParticipant CallParticipant
* Adding a record for removing peer from call
* @param callPeer CallPeer
* @param srcCall Call
*/
private void handleParticipantRemoved(CallPeer callParticipant,
private void handlePeerRemoved(CallPeer callPeer,
Call srcCall)
{
CallRecord callRecord = findCallRecord(srcCall);
String pAddress = callParticipant.getAddress();
String pAddress = callPeer.getAddress();
CallPeerRecordImpl cpRecord =
(CallPeerRecordImpl)callRecord.findPeerRecord(pAddress);
// no such participant
// no such peer
if(cpRecord == null)
return;
if(!callParticipant.getState().equals(CallPeerState.DISCONNECTED))
cpRecord.setState(callParticipant.getState());
if(!callPeer.getState().equals(CallPeerState.DISCONNECTED))
cpRecord.setState(callPeer.getState());
CallPeerState cpRecordState = cpRecord.getState();
@ -942,20 +942,20 @@ private CallRecordImpl findCallRecord(Call call)
}
/**
* Returns the participant record for the given participant
* @param callParticipant CallParticipant participant
* @return CallParticipantRecordImpl the corresponding record
* Returns the peer record for the given peer
* @param callPeer CallPeer peer
* @return CallPeerRecordImpl the corresponding record
*/
private CallPeerRecordImpl findParticipantRecord(
CallPeer callParticipant)
private CallPeerRecordImpl findPeerRecord(
CallPeer callPeer)
{
CallRecord record = findCallRecord(callParticipant.getCall());
CallRecord record = findCallRecord(callPeer.getCall());
if (record == null)
return null;
return (CallPeerRecordImpl) record.findPeerRecord(
callParticipant.getAddress());
callPeer.getAddress());
}
/**
@ -983,7 +983,7 @@ private void handleNewCall(Call sourceCall, String direction)
Iterator<CallPeer> iter = sourceCall.getCallPeers();
while (iter.hasNext())
{
handleParticipantAdded(iter.next());
handlePeerAdded(iter.next());
}
}
@ -1067,19 +1067,19 @@ public int compare(CallRecord o1, CallRecord o2)
}
/**
* Receive events for adding or removing participants from a call
* Receive events for adding or removing peers from a call
*/
private class HistoryCallChangeListener
extends CallChangeAdapter
{
public void callParticipantAdded(CallPeerEvent evt)
public void callPeerAdded(CallPeerEvent evt)
{
handleParticipantAdded(evt.getSourceCallPeer());
handlePeerAdded(evt.getSourceCallPeer());
}
public void callParticipantRemoved(CallPeerEvent evt)
public void callPeerRemoved(CallPeerEvent evt)
{
handleParticipantRemoved(evt.getSourceCallPeer(),
handlePeerRemoved(evt.getSourceCallPeer(),
evt.getSourceCall());
}
}

@ -133,7 +133,7 @@ public String getTitle()
* Implements the CallChangeListener.callParticipantAdded method. When a new
* participant is added to our call add it to the call panel.
*/
public void callParticipantAdded(CallPeerEvent evt)
public void callPeerAdded(CallPeerEvent evt)
{
if (evt.getSourceCall() == call)
{
@ -148,7 +148,7 @@ public void callParticipantAdded(CallPeerEvent evt)
* Implements the CallChangeListener.callParticipantRemoved method. When a
* call participant is removed from our call remove it from the call panel.
*/
public void callParticipantRemoved(CallPeerEvent evt)
public void callPeerRemoved(CallPeerEvent evt)
{
if (evt.getSourceCall() == call)
{
@ -191,7 +191,7 @@ public void callStateChanged(CallChangeEvent evt)
*/
public void peerStateChanged(CallPeerChangeEvent evt)
{
CallPeer sourceParticipant = evt.getSourceCallParticipant();
CallPeer sourceParticipant = evt.getSourceCallPeer();
if (sourceParticipant.getCall() != call)
return;

@ -444,7 +444,7 @@ private void addVideoListener()
* to the Call, starts listening for changes in the video in order
* to display it.
*/
public synchronized void callParticipantAdded(
public synchronized void callPeerAdded(
CallPeerEvent event)
{
if (callParticipant.equals(event.getSourceCallPeer())
@ -464,7 +464,7 @@ public synchronized void callParticipantAdded(
* Call, stops listening for changes in the video because it should
* no longer be updated anyway.
*/
public synchronized void callParticipantRemoved(
public synchronized void callPeerRemoved(
CallPeerEvent event)
{
if (callParticipant.equals(event.getSourceCallPeer())

@ -2604,7 +2604,7 @@ private void disposePlayer(Player player)
* @param evt the <tt>CallParticipantEvent</tt> containing the source call
* and call participant.
*/
public synchronized void callParticipantAdded(CallPeerEvent evt)
public synchronized void callPeerAdded(CallPeerEvent evt)
{
}
@ -2613,7 +2613,7 @@ public synchronized void callParticipantAdded(CallPeerEvent evt)
* @param evt the <tt>CallParticipantEvent</tt> containing the source call
* and call participant.
*/
public void callParticipantRemoved(CallPeerEvent evt)
public void callPeerRemoved(CallPeerEvent evt)
{
}

@ -57,9 +57,9 @@ public void callEnded(CallEvent callEvent)
* on hold when a new call becomes in-progress and just implements
* <code>CallChangeListener</code>.
*
* @see CallChangeListener#callParticipantAdded(CallPeerEvent)
* @see CallChangeListener#callPeerAdded(CallPeerEvent)
*/
public void callParticipantAdded(
public void callPeerAdded(
CallPeerEvent callParticipantEvent)
{
@ -75,9 +75,9 @@ public void callParticipantAdded(
* on hold when a new call becomes in-progress and just implements
* <code>CallChangeListener</code>.
*
* @see CallChangeListener#callParticipantRemoved(CallPeerEvent)
* @see CallChangeListener#callPeerRemoved(CallPeerEvent)
*/
public void callParticipantRemoved(
public void callPeerRemoved(
CallPeerEvent callParticipantEvent)
{

@ -166,7 +166,7 @@ public void peerStateChanged(CallPeerChangeEvent evt)
== CallPeerState.FAILED)
{
removeCallParticipant(
(CallPeerJabberImpl)evt.getSourceCallParticipant());
(CallPeerJabberImpl)evt.getSourceCallPeer());
}
else if (((CallPeerState)evt.getNewValue())
== CallPeerState.CONNECTED

@ -106,7 +106,7 @@ public void peerStateChanged(CallPeerChangeEvent evt)
== CallPeerState.FAILED)
{
removeCallParticipant(
(MockCallParticipant) evt.getSourceCallParticipant());
(MockCallParticipant) evt.getSourceCallPeer());
}
else if ( ( (CallPeerState) evt.getNewValue())
== CallPeerState.CONNECTED

@ -209,11 +209,11 @@ public CallPeer addNewCallParticipant(Call call, String address)
return callPArt;
}
public void callParticipantAdded(CallPeerEvent evt)
public void callPeerAdded(CallPeerEvent evt)
{
}
public void callParticipantRemoved(CallPeerEvent evt)
public void callPeerRemoved(CallPeerEvent evt)
{
}

@ -179,7 +179,7 @@ public void peerStateChanged(CallPeerChangeEvent evt)
|| newState == CallPeerState.FAILED)
{
removeCallParticipant((CallPeerSipImpl) evt
.getSourceCallParticipant());
.getSourceCallPeer());
}
else if ((newState == CallPeerState.CONNECTED
|| newState == CallPeerState.CONNECTING_WITH_EARLY_MEDIA))

@ -201,9 +201,9 @@ protected void fireCallParticipantEvent(CallPeer sourceCallParticipant,
CallChangeListener listener = listeners.next();
if(eventID == CallPeerEvent.CALL_PEER_ADDED)
listener.callParticipantAdded(cpEvent);
listener.callPeerAdded(cpEvent);
else if (eventID == CallPeerEvent.CALL_PEER_REMVOVED)
listener.callParticipantRemoved(cpEvent);
listener.callPeerRemoved(cpEvent);
}
}

@ -33,7 +33,7 @@ public abstract class CallChangeAdapter
* callParticipantAdded
* (net.java.sip.communicator.service.protocol.event.CallParticipantEvent)
*/
public void callParticipantAdded(CallPeerEvent evt)
public void callPeerAdded(CallPeerEvent evt)
{
}
@ -44,7 +44,7 @@ public void callParticipantAdded(CallPeerEvent evt)
* callParticipantRemoved
* (net.java.sip.communicator.service.protocol.event.CallParticipantEvent)
*/
public void callParticipantRemoved(CallPeerEvent evt)
public void callPeerRemoved(CallPeerEvent evt)
{
}

@ -22,14 +22,14 @@ public interface CallChangeListener
* @param evt the <tt>CallParticipantEvent</tt> containing the source call
* and call participant.
*/
public void callParticipantAdded(CallPeerEvent evt);
public void callPeerAdded(CallPeerEvent evt);
/**
* Indicates that a call participant has left the source call.
* @param evt the <tt>CallParticipantEvent</tt> containing the source call
* and call participant.
*/
public void callParticipantRemoved(CallPeerEvent evt);
public void callPeerRemoved(CallPeerEvent evt);
/**
* Indicates that a change has occurred in the state of the source call.

Loading…
Cancel
Save