Renames CallParticipant to CallPeer so that it would better reflect our new Call architecture that also includes conferencing and ConferenceMembers

cusax-fix
Emil Ivov 16 years ago
parent 15b312cf97
commit 1bcc36b449

@ -566,7 +566,7 @@ private void writeCall(CallRecord callRecord, Contact source,
StringBuffer callParticipantEndTime = new StringBuffer();
StringBuffer callParticipantStates = new StringBuffer();
for (CallParticipantRecord item : callRecord
for (CallPeerRecord item : callRecord
.getParticipantRecords())
{
if (callParticipantIDs.length() > 0)
@ -577,7 +577,7 @@ private void writeCall(CallRecord callRecord, Contact source,
callParticipantStates.append(DELIM);
}
callParticipantIDs.append(item.getParticipantAddress());
callParticipantIDs.append(item.getPeerAddress());
callParticipantStartTime.append(String.valueOf(item
.getStartTime().getTime()));
callParticipantEndTime.append(String.valueOf(item.getEndTime()

@ -16,7 +16,7 @@
* @author Damian Minkov
*/
public class CallParticipantRecordImpl
extends CallParticipantRecord
extends CallPeerRecord
{
/**
* Creates CallParticipantRecord
@ -47,7 +47,7 @@ public void setStartTime(Date startTime)
*/
public void setParticipantAddress(String participantAddress)
{
this.participantAddress = participantAddress;
this.peerAddress = participantAddress;
}
/**

@ -60,7 +60,7 @@ public void setEndTime(Date endTime)
{
this.endTime = endTime;
for (CallParticipantRecord item : participantRecords)
for (CallPeerRecord item : participantRecords)
{
CallParticipantRecordImpl itemImpl =
(CallParticipantRecordImpl) item;

@ -197,14 +197,14 @@ public void run()
for (CallRecord call : historyCalls)
{
List<CallParticipantRecord> callParticipantRecords
List<CallPeerRecord> callParticipantRecords
= call.getParticipantRecords();
//extract all call participants for that call.
for (CallParticipantRecord cpRecord
for (CallPeerRecord cpRecord
: callParticipantRecords)
{
String participant = cpRecord.getParticipantAddress();
String participant = cpRecord.getPeerAddress();
if(!callComboModel.contains(participant))
{

@ -46,12 +46,12 @@ public GuiCallParticipantRecord(String participantName,
this.callDuration = callDuration;
}
public GuiCallParticipantRecord(CallParticipantRecord participantRecord,
public GuiCallParticipantRecord(CallPeerRecord participantRecord,
String direction)
{
this.direction = direction;
this.participantName = participantRecord.getParticipantAddress();
this.participantName = participantRecord.getPeerAddress();
this.startTime = participantRecord.getStartTime();

@ -57,10 +57,10 @@ public GuiCallRecord(CallRecord callRecord)
this.participants = new Vector<GuiCallParticipantRecord>();
Iterator<CallParticipantRecord> records = callRecord.getParticipantRecords().iterator();
Iterator<CallPeerRecord> records = callRecord.getParticipantRecords().iterator();
while(records.hasNext()) {
CallParticipantRecord record
CallPeerRecord record
= records.next();
GuiCallParticipantRecord newRecord

@ -781,18 +781,18 @@ private Object getService(String name)
}
private boolean matchAnyCallParticipant(
List<CallParticipantRecord> cps, String[] keywords, boolean caseSensitive)
List<CallPeerRecord> cps, String[] keywords, boolean caseSensitive)
{
Iterator<CallParticipantRecord> iter = cps.iterator();
Iterator<CallPeerRecord> iter = cps.iterator();
while (iter.hasNext())
{
CallParticipantRecord callParticipant = iter.next();
CallPeerRecord callParticipant = iter.next();
for (int i = 0; i < keywords.length; i++)
{
String k = keywords[i];
if(caseSensitive && callParticipant.getParticipantAddress().contains(k))
if(caseSensitive && callParticipant.getPeerAddress().contains(k))
return true;
else if(callParticipant.getParticipantAddress().toLowerCase().
else if(callParticipant.getPeerAddress().toLowerCase().
contains(k.toLowerCase()))
return true;
}
@ -802,20 +802,20 @@ else if(callParticipant.getParticipantAddress().toLowerCase().
}
private boolean matchCallParticipant(
List<CallParticipantRecord> cps, String[] keywords, boolean caseSensitive)
List<CallPeerRecord> cps, String[] keywords, boolean caseSensitive)
{
Iterator<CallParticipantRecord> iter = cps.iterator();
Iterator<CallPeerRecord> iter = cps.iterator();
while (iter.hasNext())
{
boolean match = false;
CallParticipantRecord callParticipant = iter.next();
CallPeerRecord callParticipant = iter.next();
for (int i = 0; i < keywords.length; i++)
{
String k = keywords[i];
if(caseSensitive)
{
if(callParticipant.getParticipantAddress().contains(k))
if(callParticipant.getPeerAddress().contains(k))
{
match = true;
}
@ -827,7 +827,7 @@ private boolean matchCallParticipant(
continue;
}
else if(callParticipant.getParticipantAddress().toLowerCase().
else if(callParticipant.getPeerAddress().toLowerCase().
contains(k.toLowerCase()))
{
match = true;

@ -443,16 +443,16 @@ private void loadTableRecords(Collection historyCalls, int calltype,
/* PARTICIPANTS Checking */
if (addMe)
{
Iterator<CallParticipantRecord> participants =
Iterator<CallPeerRecord> participants =
callRecord.getParticipantRecords().iterator();
while (participants.hasNext() && addMe)
{
CallParticipantRecord participantRecord =
CallPeerRecord participantRecord =
participants.next();
String participantName = participantRecord
.getParticipantAddress();
.getPeerAddress();
if (participantName.matches(
"(?i).*" + contactNameField.getText() + ".*"))

@ -65,12 +65,12 @@ public GuiCallParticipantRecord(String participantName,
* @param participantRecord the corresponding <tt>CallParticipantRecord</tt>
* @param direction the call direction - INCOMING_CALL or OUTGOING_CALL
*/
public GuiCallParticipantRecord(CallParticipantRecord participantRecord,
public GuiCallParticipantRecord(CallPeerRecord participantRecord,
String direction)
{
this.direction = direction;
this.participantName = participantRecord.getParticipantAddress();
this.participantName = participantRecord.getPeerAddress();
this.startTime = participantRecord.getStartTime();

@ -1,73 +0,0 @@
package net.java.sip.communicator.service.callhistory;
import java.util.*;
import net.java.sip.communicator.service.protocol.*;
/**
* Structure used for encapsulating data when writing or reading
* Call History Data. Also These records are uesd for returning data
* from the Call History Service
*
* @author Damian Minkov
*/
public class CallParticipantRecord
{
protected String participantAddress = null;
protected Date startTime = null;
protected Date endTime = null;
protected CallPeerState state = CallPeerState.UNKNOWN;
/**
* Creates CallParticipantRecord
* @param participantAddress String
* @param startTime Date
* @param endTime Date
*/
public CallParticipantRecord(
String participantAddress,
Date startTime,
Date endTime)
{
this.participantAddress = participantAddress;
this.startTime = startTime;
this.endTime = endTime;
}
/**
* When participant diconnected from the call
*
* @return Date
*/
public Date getEndTime()
{
return endTime;
}
/**
* The participant address
* @return String
*/
public String getParticipantAddress()
{
return participantAddress;
}
/**
* When participant connected to the call
* @return Date
*/
public Date getStartTime()
{
return startTime;
}
/**
* Returns the actual state of the participant
* @return CallParticipantState
*/
public CallPeerState getState()
{
return state;
}
}

@ -19,8 +19,8 @@ public class CallRecord
protected String direction = null;
protected final List<CallParticipantRecord> participantRecords =
new Vector<CallParticipantRecord>();
protected final List<CallPeerRecord> participantRecords =
new Vector<CallPeerRecord>();
protected Date startTime = null;
protected Date endTime = null;
@ -54,11 +54,11 @@ public CallRecord(
* @param address String
* @return CallParticipantRecord
*/
public CallParticipantRecord findParticipantRecord(String address)
public CallPeerRecord findParticipantRecord(String address)
{
for (CallParticipantRecord item : participantRecords)
for (CallPeerRecord item : participantRecords)
{
if (item.getParticipantAddress().equals(address))
if (item.getPeerAddress().equals(address))
return item;
}
@ -88,7 +88,7 @@ public Date getEndTime()
* Return Vector of CallParticipantRecords
* @return Vector
*/
public List<CallParticipantRecord> getParticipantRecords()
public List<CallPeerRecord> getParticipantRecords()
{
return participantRecords;
}

@ -212,18 +212,18 @@ public void readRecords()
assertEquals("Calls must be 2", rs.size(), 2);
CallRecord rec = (CallRecord)resultIter.next();
CallParticipantRecord participant =
(CallParticipantRecord)rec.getParticipantRecords().get(0);
CallPeerRecord participant =
(CallPeerRecord)rec.getParticipantRecords().get(0);
assertTrue("Participant incorrect ",
participant.getParticipantAddress().
participant.getPeerAddress().
equals(participantAddresses.get(2)));
rec = (CallRecord)resultIter.next();
participant = (CallParticipantRecord)rec.getParticipantRecords().get(0);
participant = (CallPeerRecord)rec.getParticipantRecords().get(0);
assertTrue("Participant incorrect ",
participant.getParticipantAddress().
participant.getPeerAddress().
equals(participantAddresses.get(1)));
/**
@ -235,10 +235,10 @@ public void readRecords()
assertEquals("Calls must be 1", rs.size(), 1);
rec = (CallRecord)resultIter.next();
participant = (CallParticipantRecord)rec.getParticipantRecords().get(0);
participant = (CallPeerRecord)rec.getParticipantRecords().get(0);
assertTrue("Participant incorrect ",
participant.getParticipantAddress().
participant.getPeerAddress().
equals(participantAddresses.get(3)));
/**
@ -250,24 +250,24 @@ public void readRecords()
assertEquals("Calls must be 3", rs.size(), 3);
rec = (CallRecord)resultIter.next();
participant = (CallParticipantRecord) rec.getParticipantRecords().get(0);
participant = (CallPeerRecord) rec.getParticipantRecords().get(0);
assertTrue("Participant incorrect ",
participant.getParticipantAddress().
participant.getPeerAddress().
equals(participantAddresses.get(3)));
rec = (CallRecord)resultIter.next();
participant = (CallParticipantRecord) rec.getParticipantRecords().get(0);
participant = (CallPeerRecord) rec.getParticipantRecords().get(0);
assertTrue("Participant incorrect ",
participant.getParticipantAddress().
participant.getPeerAddress().
equals(participantAddresses.get(2)));
rec = (CallRecord)resultIter.next();
participant = (CallParticipantRecord) rec.getParticipantRecords().get(0);
participant = (CallPeerRecord) rec.getParticipantRecords().get(0);
assertTrue("Participant incorrect ",
participant.getParticipantAddress().
participant.getPeerAddress().
equals(participantAddresses.get(1)));
}
@ -324,9 +324,9 @@ public void checkRecordCompleteness()
assertEquals("There must be 2 participants in the call",
callRecord.getParticipantRecords().size(), 2);
CallParticipantRecord callP1 =
CallPeerRecord callP1 =
callRecord.findParticipantRecord(partAddresses[0]);
CallParticipantRecord callP2 =
CallPeerRecord callP2 =
callRecord.findParticipantRecord(partAddresses[1]);
assertTrue("Second participant added after first one",

@ -13,7 +13,7 @@
import junit.framework.*;
import net.java.sip.communicator.impl.protocol.mock.*;
import net.java.sip.communicator.service.callhistory.CallHistoryService;
import net.java.sip.communicator.service.callhistory.CallParticipantRecord;
import net.java.sip.communicator.service.callhistory.CallPeerRecord;
import net.java.sip.communicator.service.callhistory.CallRecord;
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.filehistory.FileHistoryService;
@ -523,18 +523,18 @@ public void callTests()
assertEquals("Calls must be 2", rs.size(), 2);
CallRecord rec = (CallRecord)resultIter.next();
CallParticipantRecord participant =
(CallParticipantRecord)rec.getParticipantRecords().get(0);
CallPeerRecord participant =
(CallPeerRecord)rec.getParticipantRecords().get(0);
assertTrue("Participant incorrect ",
participant.getParticipantAddress().
participant.getPeerAddress().
equals(participantAddresses.get(2)));
rec = (CallRecord)resultIter.next();
participant = (CallParticipantRecord)rec.getParticipantRecords().get(0);
participant = (CallPeerRecord)rec.getParticipantRecords().get(0);
assertTrue("Participant incorrect ",
participant.getParticipantAddress().
participant.getPeerAddress().
equals(participantAddresses.get(3)));
/**
@ -549,17 +549,17 @@ public void callTests()
assertEquals("Calls must be 2", rs.size(), 2);
rec = (CallRecord)resultIter.next();
participant = (CallParticipantRecord)rec.getParticipantRecords().get(0);
participant = (CallPeerRecord)rec.getParticipantRecords().get(0);
assertTrue("Participant incorrect ",
participant.getParticipantAddress().
participant.getPeerAddress().
equals(participantAddresses.get(4)));
rec = (CallRecord)resultIter.next();
participant = (CallParticipantRecord)rec.getParticipantRecords().get(0);
participant = (CallPeerRecord)rec.getParticipantRecords().get(0);
assertTrue("Participant incorrect ",
participant.getParticipantAddress().
participant.getPeerAddress().
equals(participantAddresses.get(5)));
/**
@ -574,24 +574,24 @@ public void callTests()
assertEquals("Calls must be 3", rs.size(), 3);
rec = (CallRecord)resultIter.next();
participant = (CallParticipantRecord) rec.getParticipantRecords().get(0);
participant = (CallPeerRecord) rec.getParticipantRecords().get(0);
assertTrue("Participant incorrect ",
participant.getParticipantAddress().
participant.getPeerAddress().
equals(participantAddresses.get(3)));
rec = (CallRecord)resultIter.next();
participant = (CallParticipantRecord) rec.getParticipantRecords().get(0);
participant = (CallPeerRecord) rec.getParticipantRecords().get(0);
assertTrue("Participant incorrect ",
participant.getParticipantAddress().
participant.getPeerAddress().
equals(participantAddresses.get(4)));
rec = (CallRecord)resultIter.next();
participant = (CallParticipantRecord) rec.getParticipantRecords().get(0);
participant = (CallPeerRecord) rec.getParticipantRecords().get(0);
assertTrue("Participant incorrect ",
participant.getParticipantAddress().
participant.getPeerAddress().
equals(participantAddresses.get(5)));
}

Loading…
Cancel
Save