used to represent a call and a call record in the gui call list

cusax-fix
Yana Stamcheva 20 years ago
parent 5182904d34
commit 46ab4ff1ba

@ -0,0 +1,79 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.gui.main.call;
import java.util.*;
import net.java.sip.communicator.service.callhistory.*;
/**
* The <tt>GuiCallParticipantRecord</tt> is meant to be used in the call history
* to represent a history call participant record. It wraps a
* <tt>CallParticipant</tt> or a <tt>CallParticipantRecord</tt> object.
*
* @author Yana Stamcheva
*/
public class GuiCallParticipantRecord
{
public static final String INCOMING_CALL = "IncomingCall";
public static final String OUTGOING_CALL = "OutgoingCall";
private String direction;
private String participantName;
private Date startTime;
private Date endTime;
public GuiCallParticipantRecord(String participantName,
String direction,
Date startTime,
Date endTime)
{
this.direction = direction;
this.participantName = participantName;
this.startTime = startTime;
this.endTime = endTime;
}
public GuiCallParticipantRecord(CallParticipantRecord participantRecord,
String direction)
{
this.direction = direction;
this.participantName = participantRecord.getParticipantAddress();
this.startTime = participantRecord.getStartTime();
this.endTime = participantRecord.getEndTime();
}
public String getDirection()
{
return direction;
}
public Date getEndTime()
{
return endTime;
}
public String getParticipantName()
{
return participantName;
}
public Date getStartTime()
{
return startTime;
}
}

@ -0,0 +1,94 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.gui.main.call;
import java.util.*;
import net.java.sip.communicator.service.callhistory.*;
import net.java.sip.communicator.service.protocol.*;
/**
* The <tt>GuiCallRecord</tt> is meant to be used in the call history to
* represent a history call record. It wraps a <tt>Call</tt> or a
* <tt>CallRecord</tt> object.
*
* @author Yana Stamcheva
*/
public class GuiCallRecord
{
private Vector participants;
private Date startTime;
private Date endTime;
/**
*
* @param guiParticipantRecords
* @param direction
* @param startTime
* @param endTime
*/
public GuiCallRecord(Vector guiParticipantRecords,
Date startTime,
Date endTime)
{
this.startTime = startTime;
this.endTime = endTime;
participants = guiParticipantRecords;
}
/**
* Creates a <tt>GuiCallRecord</tt> from a <tt>CallRecord</tt>. The
* <tt>GuiCallRecord</tt> will be used in the call history.
*
* @param callRecord the <tt>CallParticipantRecord</tt>
*/
public GuiCallRecord(CallRecord callRecord)
{
this.startTime = callRecord.getStartTime();
this.endTime = callRecord.getEndTime();
this.participants = new Vector();
Iterator records = callRecord.getParticipantRecords().iterator();
while(records.hasNext()) {
CallParticipantRecord record
= (CallParticipantRecord)records.next();
GuiCallParticipantRecord newRecord
= new GuiCallParticipantRecord(
record, callRecord.getDirection());
this.participants.add(newRecord);
}
}
public Date getEndTime()
{
return endTime;
}
public Iterator getParticipants()
{
return participants.iterator();
}
public int getParticipantsCount()
{
return participants.size();
}
public Date getStartTime()
{
return startTime;
}
}
Loading…
Cancel
Save