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 cad3ab05fe
commit 88753222cc

@ -80,7 +80,7 @@ public HistoryService getHistoryService()
* @param contact MetaContact which contacts participate in
* the returned calls
* @param startDate Date the start date of the calls
* @return Collection of CallRecords with CallParticipantRecord
* @return Collection of CallRecords with CallPeerRecord
* @throws RuntimeException
*/
public Collection<CallRecord> findByStartDate(MetaContact contact, Date startDate)
@ -93,7 +93,7 @@ public Collection<CallRecord> findByStartDate(MetaContact contact, Date startDat
* Returns all the calls made after the given date
*
* @param startDate Date the start date of the calls
* @return Collection of CallRecords with CallParticipantRecord
* @return Collection of CallRecords with CallPeerRecord
* @throws RuntimeException
*/
public Collection<CallRecord> findByStartDate(Date startDate)
@ -129,7 +129,7 @@ public Collection<CallRecord> findByStartDate(Date startDate)
* @param contact MetaContact which contacts participate in
* the returned calls
* @param endDate Date the end date of the calls
* @return Collection of CallRecords with CallParticipantRecord
* @return Collection of CallRecords with CallPeerRecord
* @throws RuntimeException
*/
public Collection<CallRecord> findByEndDate(MetaContact contact, Date endDate)
@ -142,7 +142,7 @@ public Collection<CallRecord> findByEndDate(MetaContact contact, Date endDate)
* Returns all the calls made before the given date
*
* @param endDate Date the end date of the calls
* @return Collection of CallRecords with CallParticipantRecord
* @return Collection of CallRecords with CallPeerRecord
* @throws RuntimeException
*/
public Collection<CallRecord> findByEndDate(Date endDate) throws RuntimeException
@ -177,7 +177,7 @@ public Collection<CallRecord> findByEndDate(Date endDate) throws RuntimeExceptio
* @param contact MetaContact
* @param startDate Date the start date of the calls
* @param endDate Date the end date of the conversations
* @return Collection of CallRecords with CallParticipantRecord
* @return Collection of CallRecords with CallPeerRecord
* @throws RuntimeException
*/
public Collection<CallRecord> findByPeriod(MetaContact contact, Date startDate, Date endDate)
@ -191,7 +191,7 @@ public Collection<CallRecord> findByPeriod(MetaContact contact, Date startDate,
*
* @param startDate Date the start date of the calls
* @param endDate Date the end date of the conversations
* @return Collection of CallRecords with CallParticipantRecord
* @return Collection of CallRecords with CallPeerRecord
* @throws RuntimeException
*/
public Collection<CallRecord> findByPeriod(Date startDate, Date endDate) throws
@ -227,7 +227,7 @@ public Collection<CallRecord> findByPeriod(Date startDate, Date endDate) throws
* @param contact MetaContact which contacts participate in
* the returned calls
* @param count calls count
* @return Collection of CallRecords with CallParticipantRecord
* @return Collection of CallRecords with CallPeerRecord
* @throws RuntimeException
*/
public Collection<CallRecord> findLast(MetaContact contact, int count)
@ -240,7 +240,7 @@ public Collection<CallRecord> findLast(MetaContact contact, int count)
* Returns the supplied number of calls made
*
* @param count calls count
* @return Collection of CallRecords with CallParticipantRecord
* @return Collection of CallRecords with CallPeerRecord
* @throws RuntimeException
*/
public Collection<CallRecord> findLast(int count) throws RuntimeException
@ -266,12 +266,12 @@ public Collection<CallRecord> findLast(int count) throws RuntimeException
}
/**
* Find the calls made by the supplied participant address
* @param address String the address of the participant
* @return Collection of CallRecords with CallParticipantRecord
* Find the calls made by the supplied peer address
* @param address String the address of the peer
* @return Collection of CallRecords with CallPeerRecord
* @throws RuntimeException
*/
public Collection<CallRecord> findByParticipant(String address)
public Collection<CallRecord> findByPeer(String address)
throws RuntimeException
{
TreeSet<CallRecord> result = new TreeSet<CallRecord>(new CallRecordComparator());
@ -333,7 +333,7 @@ private History getHistory(Contact localContact, Contact remoteContact)
}
/**
* Used to convert HistoryRecord in CallReord and CallParticipantRecord
* Used to convert HistoryRecord in CallReord and CallPeerRecord
* which are returned by the finder methods
*
* @param hr HistoryRecord
@ -343,10 +343,10 @@ private CallRecord convertHistoryRecordToCallRecord(HistoryRecord hr)
{
CallRecordImpl result = new CallRecordImpl();
List<String> callParticipantIDs = null;
List<String> callParticipantStart = null;
List<String> callParticipantEnd = null;
List<CallPeerState> callParticipantStates = null;
List<String> callPeerIDs = null;
List<String> callPeerStart = null;
List<String> callPeerEnd = null;
List<CallPeerState> callPeerStates = null;
// History structure
// 0 - callStart
@ -368,28 +368,28 @@ else if(propName.equals(STRUCTURE_NAMES[1]))
else if(propName.equals(STRUCTURE_NAMES[2]))
result.setDirection(value);
else if(propName.equals(STRUCTURE_NAMES[3]))
callParticipantIDs = getCSVs(value);
callPeerIDs = getCSVs(value);
else if(propName.equals(STRUCTURE_NAMES[4]))
callParticipantStart = getCSVs(value);
callPeerStart = getCSVs(value);
else if(propName.equals(STRUCTURE_NAMES[5]))
callParticipantEnd = getCSVs(value);
callPeerEnd = getCSVs(value);
else if(propName.equals(STRUCTURE_NAMES[6]))
callParticipantStates = getStates(value);
callPeerStates = getStates(value);
}
final int callParticipantCount = callParticipantIDs == null ? 0 : callParticipantIDs.size();
for (int i = 0; i < callParticipantCount; i++)
final int callPeerCount = callPeerIDs == null ? 0 : callPeerIDs.size();
for (int i = 0; i < callPeerCount; i++)
{
CallPeerRecordImpl cpr =
new CallPeerRecordImpl(callParticipantIDs.get(i),
new Date(Long.parseLong(callParticipantStart.get(i))),
new Date(Long.parseLong(callParticipantEnd.get(i))));
new CallPeerRecordImpl(callPeerIDs.get(i),
new Date(Long.parseLong(callPeerStart.get(i))),
new Date(Long.parseLong(callPeerEnd.get(i))));
// if there is no record about the states (backward compability)
if (callParticipantStates != null)
cpr.setState(callParticipantStates.get(i));
if (callPeerStates != null)
cpr.setState(callPeerStates.get(i));
result.getParticipantRecords().add(cpr);
result.getPeerRecords().add(cpr);
}
return result;
@ -414,7 +414,7 @@ private List<String> getCSVs(String str)
/**
* Get the delimited strings and converts them to CallParticipantState
*
*
* @param str String delimited string states
* @return LinkedList the converted values list
*/
@ -567,7 +567,7 @@ private void writeCall(CallRecord callRecord, Contact source,
StringBuffer callParticipantStates = new StringBuffer();
for (CallPeerRecord item : callRecord
.getParticipantRecords())
.getPeerRecords())
{
if (callParticipantIDs.length() > 0)
{
@ -742,7 +742,7 @@ public void removeSearchProgressListener(
/**
* Add the registered CallHistorySearchProgressListeners to the given
* HistoryReader
*
*
* @param reader HistoryReader
* @param countContacts number of contacts will search
*/
@ -762,7 +762,7 @@ private void addHistorySearchProgressListeners(HistoryReader reader,
/**
* Removes the registered CallHistorySearchProgressListeners from the given
* HistoryReader
*
*
* @param reader HistoryReader
*/
private void removeHistorySearchProgressListeners(HistoryReader reader)
@ -779,7 +779,7 @@ private void removeHistorySearchProgressListeners(HistoryReader reader)
/**
* Gets all the history readers for the contacts in the given MetaContact
*
*
* @param contact MetaContact
* @return Hashtable
*/
@ -891,7 +891,7 @@ public void peerStateChanged(CallPeerChangeEvent evt)
startDate,
startDate);
callRecord.getParticipantRecords().add(newRec);
callRecord.getPeerRecords().add(newRec);
}
/**
@ -906,7 +906,7 @@ private void handleParticipantRemoved(CallPeer callParticipant,
String pAddress = callParticipant.getAddress();
CallPeerRecordImpl cpRecord =
(CallPeerRecordImpl)callRecord.findParticipantRecord(pAddress);
(CallPeerRecordImpl)callRecord.findPeerRecord(pAddress);
// no such participant
if(cpRecord == null)
@ -926,7 +926,7 @@ private void handleParticipantRemoved(CallPeer callParticipant,
/**
* Finding a CallRecord for the given call
*
*
* @param call Call
* @return CallRecord
*/
@ -954,7 +954,7 @@ private CallPeerRecordImpl findParticipantRecord(
if (record == null)
return null;
return (CallPeerRecordImpl) record.findParticipantRecord(
return (CallPeerRecordImpl) record.findPeerRecord(
callParticipant.getAddress());
}

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

@ -198,7 +198,7 @@ public void run()
for (CallRecord call : historyCalls)
{
List<CallPeerRecord> callParticipantRecords
= call.getParticipantRecords();
= call.getPeerRecords();
//extract all call participants for that call.
for (CallPeerRecord cpRecord

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

@ -343,7 +343,7 @@ else if(serv instanceof CallHistoryService)
CallRecord callRecord = iter.next();
if(matchCallParticipant(
callRecord.getParticipantRecords(), keywords, caseSensitive))
callRecord.getPeerRecords(), keywords, caseSensitive))
result.add(callRecord);
}
chs.removeSearchProgressListener(listenWrapper);
@ -480,7 +480,7 @@ else if(serv instanceof CallHistoryService)
CallRecord callRecord = iter.next();
if(matchCallParticipant(
callRecord.getParticipantRecords(), keywords, caseSensitive))
callRecord.getPeerRecords(), keywords, caseSensitive))
result.add(callRecord);
}
chs.removeSearchProgressListener(listenWrapper);

@ -444,7 +444,7 @@ private void loadTableRecords(Collection historyCalls, int calltype,
if (addMe)
{
Iterator<CallPeerRecord> participants =
callRecord.getParticipantRecords().iterator();
callRecord.getPeerRecords().iterator();
while (participants.hasNext() && addMe)
{

@ -121,7 +121,7 @@ public Collection<CallRecord> findLast(int count)
* @return Collection of CallRecords with CallParticipantRecord
* @throws RuntimeException
*/
public Collection<CallRecord> findByParticipant(String address)
public Collection<CallRecord> findByPeer(String address)
throws RuntimeException;
/**

@ -19,7 +19,7 @@ public class CallRecord
protected String direction = null;
protected final List<CallPeerRecord> participantRecords =
protected final List<CallPeerRecord> peerRecords =
new Vector<CallPeerRecord>();
protected Date startTime = null;
@ -49,14 +49,14 @@ public CallRecord(
}
/**
* Finds a Participant with the supplied address
*
* Finds a CallPeer with the supplied address
*
* @param address String
* @return CallParticipantRecord
* @return CallPeerRecord
*/
public CallPeerRecord findParticipantRecord(String address)
public CallPeerRecord findPeerRecord(String address)
{
for (CallPeerRecord item : participantRecords)
for (CallPeerRecord item : peerRecords)
{
if (item.getPeerAddress().equals(address))
return item;
@ -85,12 +85,12 @@ public Date getEndTime()
}
/**
* Return Vector of CallParticipantRecords
* Return Vector of CallPeerRecords
* @return Vector
*/
public List<CallPeerRecord> getParticipantRecords()
public List<CallPeerRecord> getPeerRecords()
{
return participantRecords;
return peerRecords;
}
/**

@ -213,14 +213,14 @@ public void readRecords()
CallRecord rec = (CallRecord)resultIter.next();
CallPeerRecord participant =
(CallPeerRecord)rec.getParticipantRecords().get(0);
(CallPeerRecord)rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
participant.getPeerAddress().
equals(participantAddresses.get(2)));
rec = (CallRecord)resultIter.next();
participant = (CallPeerRecord)rec.getParticipantRecords().get(0);
participant = (CallPeerRecord)rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
participant.getPeerAddress().
@ -235,7 +235,7 @@ public void readRecords()
assertEquals("Calls must be 1", rs.size(), 1);
rec = (CallRecord)resultIter.next();
participant = (CallPeerRecord)rec.getParticipantRecords().get(0);
participant = (CallPeerRecord)rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
participant.getPeerAddress().
@ -250,21 +250,21 @@ public void readRecords()
assertEquals("Calls must be 3", rs.size(), 3);
rec = (CallRecord)resultIter.next();
participant = (CallPeerRecord) rec.getParticipantRecords().get(0);
participant = (CallPeerRecord) rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
participant.getPeerAddress().
equals(participantAddresses.get(3)));
rec = (CallRecord)resultIter.next();
participant = (CallPeerRecord) rec.getParticipantRecords().get(0);
participant = (CallPeerRecord) rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
participant.getPeerAddress().
equals(participantAddresses.get(2)));
rec = (CallRecord)resultIter.next();
participant = (CallPeerRecord) rec.getParticipantRecords().get(0);
participant = (CallPeerRecord) rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
participant.getPeerAddress().
@ -322,12 +322,12 @@ public void checkRecordCompleteness()
CallRecord callRecord = (CallRecord)lastCall.iterator().next();
assertEquals("There must be 2 participants in the call",
callRecord.getParticipantRecords().size(), 2);
callRecord.getPeerRecords().size(), 2);
CallPeerRecord callP1 =
callRecord.findParticipantRecord(partAddresses[0]);
callRecord.findPeerRecord(partAddresses[0]);
CallPeerRecord callP2 =
callRecord.findParticipantRecord(partAddresses[1]);
callRecord.findPeerRecord(partAddresses[1]);
assertTrue("Second participant added after first one",
callP2.getStartTime().after(callP1.getStartTime()));
@ -343,7 +343,7 @@ private void dumpResult(Collection c)
{
CallRecord hr = (CallRecord)rs.next();
logger.info("----------------------");
logger.info(hr.getParticipantRecords());
logger.info(hr.getPeerRecords());
logger.info("----------------------");
}
}

@ -524,14 +524,14 @@ public void callTests()
CallRecord rec = (CallRecord)resultIter.next();
CallPeerRecord participant =
(CallPeerRecord)rec.getParticipantRecords().get(0);
(CallPeerRecord)rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
participant.getPeerAddress().
equals(participantAddresses.get(2)));
rec = (CallRecord)resultIter.next();
participant = (CallPeerRecord)rec.getParticipantRecords().get(0);
participant = (CallPeerRecord)rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
participant.getPeerAddress().
@ -549,14 +549,14 @@ public void callTests()
assertEquals("Calls must be 2", rs.size(), 2);
rec = (CallRecord)resultIter.next();
participant = (CallPeerRecord)rec.getParticipantRecords().get(0);
participant = (CallPeerRecord)rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
participant.getPeerAddress().
equals(participantAddresses.get(4)));
rec = (CallRecord)resultIter.next();
participant = (CallPeerRecord)rec.getParticipantRecords().get(0);
participant = (CallPeerRecord)rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
participant.getPeerAddress().
@ -574,21 +574,21 @@ public void callTests()
assertEquals("Calls must be 3", rs.size(), 3);
rec = (CallRecord)resultIter.next();
participant = (CallPeerRecord) rec.getParticipantRecords().get(0);
participant = (CallPeerRecord) rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
participant.getPeerAddress().
equals(participantAddresses.get(3)));
rec = (CallRecord)resultIter.next();
participant = (CallPeerRecord) rec.getParticipantRecords().get(0);
participant = (CallPeerRecord) rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
participant.getPeerAddress().
equals(participantAddresses.get(4)));
rec = (CallRecord)resultIter.next();
participant = (CallPeerRecord) rec.getParticipantRecords().get(0);
participant = (CallPeerRecord) rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
participant.getPeerAddress().

Loading…
Cancel
Save