Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.callhistory
Class CallHistorySourceContact

java.lang.Object
  extended by net.java.sip.communicator.impl.callhistory.CallHistorySourceContact
All Implemented Interfaces:
SourceContact

public class CallHistorySourceContact
extends Object
implements SourceContact

The CallHistorySourceContact is an implementation of the SourceContact interface based on a CallRecord.

Author:
Yana Stamcheva

Constructor Summary
CallHistorySourceContact(CallHistoryContactSource contactSource, CallRecord callRecord)
          Creates an instance of CallHistorySourceContact
 
Method Summary
 List<ContactDetail> getContactDetails()
          Returns a list of available contact details.
 List<ContactDetail> getContactDetails(Class<? extends OperationSet> operationSet)
          Returns a list of all ContactDetails supporting the given OperationSet class.
 List<ContactDetail> getContactDetails(String category)
          Returns a list of all ContactDetails corresponding to the given category.
 ContactSourceService getContactSource()
          Returns the parent ContactSourceService from which this contact came from.
static String getDateString(long date)
          Returns the date string to show for the given date.
 String getDisplayDetails()
          Returns the display details of this search contact.
 String getDisplayName()
          Returns the display name of this search contact.
 byte[] getImage()
          An image (or avatar) corresponding to this search contact.
 ContactDetail getPreferredContactDetail(Class<? extends OperationSet> operationSet)
          Returns the preferred ContactDetail for a given OperationSet class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallHistorySourceContact

public CallHistorySourceContact(CallHistoryContactSource contactSource,
                                CallRecord callRecord)
Creates an instance of CallHistorySourceContact

Parameters:
contactSource - the contact source
callRecord - the call record
Method Detail

getContactDetails

public List<ContactDetail> getContactDetails()
Returns a list of available contact details.

Specified by:
getContactDetails in interface SourceContact
Returns:
a list of available contact details

getContactSource

public ContactSourceService getContactSource()
Returns the parent ContactSourceService from which this contact came from.

Specified by:
getContactSource in interface SourceContact
Returns:
the parent ContactSourceService from which this contact came from

getDisplayDetails

public String getDisplayDetails()
Returns the display details of this search contact. This could be any important information that should be shown to the user.

Specified by:
getDisplayDetails in interface SourceContact
Returns:
the display details of the search contact

getDisplayName

public String getDisplayName()
Returns the display name of this search contact. This is a user-friendly name that could be shown in the user interface.

Specified by:
getDisplayName in interface SourceContact
Returns:
the display name of this search contact

getImage

public byte[] getImage()
An image (or avatar) corresponding to this search contact. If such is not available this method will return null.

Specified by:
getImage in interface SourceContact
Returns:
the byte array of the image or null if no image is available

getContactDetails

public List<ContactDetail> getContactDetails(Class<? extends OperationSet> operationSet)
Returns a list of all ContactDetails supporting the given OperationSet class.

Specified by:
getContactDetails in interface SourceContact
Parameters:
operationSet - the OperationSet class we're looking for
Returns:
a list of all ContactDetails supporting the given OperationSet class

getContactDetails

public List<ContactDetail> getContactDetails(String category)
                                      throws OperationNotSupportedException
Returns a list of all ContactDetails corresponding to the given category.

Specified by:
getContactDetails in interface SourceContact
Parameters:
category - the OperationSet class we're looking for
Returns:
a list of all ContactDetails corresponding to the given category
Throws:
OperationNotSupportedException - if categories aren't supported for call history records

getPreferredContactDetail

public ContactDetail getPreferredContactDetail(Class<? extends OperationSet> operationSet)
Returns the preferred ContactDetail for a given OperationSet class.

Specified by:
getPreferredContactDetail in interface SourceContact
Parameters:
operationSet - the OperationSet class, for which we would like to obtain a ContactDetail
Returns:
the preferred ContactDetail for a given OperationSet class

getDateString

public static String getDateString(long date)
Returns the date string to show for the given date.

Parameters:
date - the date to format
Returns:
the date string to show for the given date

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.