diff --git a/src/net/java/sip/communicator/impl/gui/main/call/GuiCallParticipantRecord.java b/src/net/java/sip/communicator/impl/gui/main/call/GuiCallParticipantRecord.java new file mode 100644 index 000000000..04562f2bf --- /dev/null +++ b/src/net/java/sip/communicator/impl/gui/main/call/GuiCallParticipantRecord.java @@ -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 GuiCallParticipantRecord is meant to be used in the call history + * to represent a history call participant record. It wraps a + * CallParticipant or a CallParticipantRecord 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; + } +} diff --git a/src/net/java/sip/communicator/impl/gui/main/call/GuiCallRecord.java b/src/net/java/sip/communicator/impl/gui/main/call/GuiCallRecord.java new file mode 100644 index 000000000..027615b2c --- /dev/null +++ b/src/net/java/sip/communicator/impl/gui/main/call/GuiCallRecord.java @@ -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 GuiCallRecord is meant to be used in the call history to + * represent a history call record. It wraps a Call or a + * CallRecord 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 GuiCallRecord from a CallRecord. The + * GuiCallRecord will be used in the call history. + * + * @param callRecord the CallParticipantRecord + */ + 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; + } +}