public class CallHistoryServiceImpl extends java.lang.Object implements CallHistoryService, CallListener, org.osgi.framework.ServiceListener
Constructor and Description |
---|
CallHistoryServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addCallHistoryRecordListener(CallHistoryPeerRecordListener listener)
Adding CallHistoryRecordListener listener to the list.
|
void |
addSearchProgressListener(CallHistorySearchProgressListener listener)
Adding progress listener for monitoring progress of search process
|
void |
callEnded(CallEvent event)
CallListener implementation for call endings
|
(package private) static CallRecord |
convertHistoryRecordToCallRecord(HistoryRecord hr)
Used to convert HistoryRecord in CallReord and CallPeerRecord
which are returned by the finder methods
|
void |
eraseLocallyStoredHistory()
Permanently removes all locally stored call history.
|
java.util.Collection<CallRecord> |
findByEndDate(java.util.Date endDate)
Returns all the calls made before the given date
|
java.util.Collection<CallRecord> |
findByEndDate(MetaContact contact,
java.util.Date endDate)
Returns all the calls made by all the contacts
in the supplied metacontact before the given date
|
CallHistoryQuery |
findByPeer(java.lang.String address,
int recordCount)
Find the calls made by the supplied peer address
|
java.util.Collection<CallRecord> |
findByPeriod(java.util.Date startDate,
java.util.Date endDate)
Returns all the calls made between the given dates
|
java.util.Collection<CallRecord> |
findByPeriod(MetaContact contact,
java.util.Date startDate,
java.util.Date endDate)
Returns all the calls made by all the contacts
in the supplied metacontact between the given dates
|
java.util.Collection<CallRecord> |
findByStartDate(java.util.Date startDate)
Returns all the calls made after the given date
|
java.util.Collection<CallRecord> |
findByStartDate(MetaContact contact,
java.util.Date startDate)
Returns all the calls made by all the contacts in the supplied
contact after the given date.
|
java.util.Collection<CallRecord> |
findLast(int count)
Returns the supplied number of calls made
|
java.util.Collection<CallRecord> |
findLast(MetaContact contact,
int count)
Returns the supplied number of calls by all the contacts
in the supplied metacontact
|
HistoryService |
getHistoryService()
Returns the underlying history service.
|
void |
incomingCallReceived(CallEvent event)
CallListener implementation for incoming calls
|
void |
outgoingCallCreated(CallEvent event)
CallListener implementation for outgoing calls
|
void |
removeCallHistoryRecordListener(CallHistoryPeerRecordListener listener)
Removing CallHistoryRecordListener listener
|
void |
removeSearchProgressListener(CallHistorySearchProgressListener listener)
Removing progress listener
|
void |
serviceChanged(org.osgi.framework.ServiceEvent serviceEvent)
When new protocol provider is registered we check
does it supports BasicTelephony and if so add a listener to it
|
void |
setHistoryService(HistoryService historyService)
Set the configuration service.
|
void |
start(org.osgi.framework.BundleContext bc)
starts the service.
|
void |
stop(org.osgi.framework.BundleContext bc)
stops the service.
|
void |
unsetHistoryService(HistoryService hService)
Remove a configuration service.
|
void |
updateCallRecordPeerSecondaryAddress(java.util.Date date,
java.lang.String peerAddress,
java.lang.String address)
Updates the secondary address field of call record.
|
public HistoryService getHistoryService()
public java.util.Collection<CallRecord> findByStartDate(MetaContact contact, java.util.Date startDate) throws java.lang.RuntimeException
findByStartDate
in interface CallHistoryService
contact
- MetaContact which contacts participate in
the returned callsstartDate
- Date the start date of the callsjava.lang.RuntimeException
public java.util.Collection<CallRecord> findByStartDate(java.util.Date startDate)
findByStartDate
in interface CallHistoryService
startDate
- Date the start date of the callsjava.lang.RuntimeException
public java.util.Collection<CallRecord> findByEndDate(MetaContact contact, java.util.Date endDate) throws java.lang.RuntimeException
findByEndDate
in interface CallHistoryService
contact
- MetaContact which contacts participate in
the returned callsendDate
- Date the end date of the callsjava.lang.RuntimeException
public java.util.Collection<CallRecord> findByEndDate(java.util.Date endDate) throws java.lang.RuntimeException
findByEndDate
in interface CallHistoryService
endDate
- Date the end date of the callsjava.lang.RuntimeException
public java.util.Collection<CallRecord> findByPeriod(MetaContact contact, java.util.Date startDate, java.util.Date endDate) throws java.lang.RuntimeException
findByPeriod
in interface CallHistoryService
contact
- MetaContactstartDate
- Date the start date of the callsendDate
- Date the end date of the conversationsjava.lang.RuntimeException
public java.util.Collection<CallRecord> findByPeriod(java.util.Date startDate, java.util.Date endDate) throws java.lang.RuntimeException
findByPeriod
in interface CallHistoryService
startDate
- Date the start date of the callsendDate
- Date the end date of the conversationsjava.lang.RuntimeException
public java.util.Collection<CallRecord> findLast(MetaContact contact, int count) throws java.lang.RuntimeException
findLast
in interface CallHistoryService
contact
- MetaContact which contacts participate in
the returned callscount
- calls countjava.lang.RuntimeException
public java.util.Collection<CallRecord> findLast(int count) throws java.lang.RuntimeException
findLast
in interface CallHistoryService
count
- calls countjava.lang.RuntimeException
public CallHistoryQuery findByPeer(java.lang.String address, int recordCount) throws java.lang.RuntimeException
findByPeer
in interface CallHistoryService
address
- String the address of the peerrecordCount
- the number of records to returnjava.lang.RuntimeException
static CallRecord convertHistoryRecordToCallRecord(HistoryRecord hr)
hr
- HistoryRecordpublic void start(org.osgi.framework.BundleContext bc)
bc
- BundleContextpublic void stop(org.osgi.framework.BundleContext bc)
bc
- BundleContextpublic void setHistoryService(HistoryService historyService) throws java.lang.IllegalArgumentException, java.io.IOException
historyService
- HistoryServicejava.io.IOException
java.lang.IllegalArgumentException
public void unsetHistoryService(HistoryService hService)
hService
- HistoryServicepublic void eraseLocallyStoredHistory() throws java.io.IOException
eraseLocallyStoredHistory
in interface CallHistoryService
java.io.IOException
- Thrown if the history could not be removed due to a IO error.public void serviceChanged(org.osgi.framework.ServiceEvent serviceEvent)
serviceChanged
in interface org.osgi.framework.ServiceListener
serviceEvent
- ServiceEventpublic void addSearchProgressListener(CallHistorySearchProgressListener listener)
addSearchProgressListener
in interface CallHistoryService
listener
- HistorySearchProgressListenerpublic void removeSearchProgressListener(CallHistorySearchProgressListener listener)
removeSearchProgressListener
in interface CallHistoryService
listener
- HistorySearchProgressListenerpublic void addCallHistoryRecordListener(CallHistoryPeerRecordListener listener)
addCallHistoryRecordListener
in interface CallHistoryService
listener
- CallHistoryRecordListenerpublic void removeCallHistoryRecordListener(CallHistoryPeerRecordListener listener)
removeCallHistoryRecordListener
in interface CallHistoryService
listener
- CallHistoryRecordListenerpublic void incomingCallReceived(CallEvent event)
incomingCallReceived
in interface CallListener
event
- CallEventpublic void outgoingCallCreated(CallEvent event)
outgoingCallCreated
in interface CallListener
event
- CallEventpublic void callEnded(CallEvent event)
callEnded
in interface CallListener
event
- CallEventpublic void updateCallRecordPeerSecondaryAddress(java.util.Date date, java.lang.String peerAddress, java.lang.String address)
updateCallRecordPeerSecondaryAddress
in interface CallHistoryService
date
- the start date of the record which will be updated.peerAddress
- the address of the peer of the record which will be
updated.address
- the value of the secondary address .
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.