Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.history
Interface HistoryService

All Known Implementing Classes:
HistoryServiceImpl

public interface HistoryService

This service provides the functionality to store history records. The records are called HistoryRecords and are grouped by ID. The ID may be used to set hierarchical structure. In a typical usage one may set the first string to be the userID, and the second - the service name.

Author:
Alexander Pelov

Field Summary
static String CACHE_ENABLED_PROPERTY
          Property and values used to be set in configuration Used in implementation to cache every opened history document or not to cache them and to access them on every read
 
Method Summary
 History createHistory(HistoryID id, HistoryRecordStructure recordStructure)
          Creates a new history for this ID.
 Iterator<HistoryID> getExistingIDs()
          Returns the IDs of all existing histories.
 History getHistory(HistoryID id)
          Returns the history associated with this ID.
 boolean isHistoryCreated(HistoryID id)
          Checks whether a history is created and stored.
 boolean isHistoryExisting(HistoryID id)
          Tests if a history with the given ID exists and is loaded.
 void moveHistory(HistoryID oldId, HistoryID newId)
          Moves the content of oldId history to the content of the newId.
 void purgeLocallyStoredHistory(HistoryID id)
          Permamently removes local stored History
 

Field Detail

CACHE_ENABLED_PROPERTY

static final String CACHE_ENABLED_PROPERTY
Property and values used to be set in configuration Used in implementation to cache every opened history document or not to cache them and to access them on every read

See Also:
Constant Field Values
Method Detail

getExistingIDs

Iterator<HistoryID> getExistingIDs()
Returns the IDs of all existing histories.

Returns:
An iterator to a list of IDs.

getHistory

History getHistory(HistoryID id)
                   throws IllegalArgumentException
Returns the history associated with this ID.

Parameters:
id - The ID of the history.
Returns:
Returns the history with this ID.
Throws:
IllegalArgumentException - Thrown if there is no such history.

isHistoryExisting

boolean isHistoryExisting(HistoryID id)
Tests if a history with the given ID exists and is loaded.

Parameters:
id - The ID to test.
Returns:
True if a history with this ID exists. False otherwise.

createHistory

History createHistory(HistoryID id,
                      HistoryRecordStructure recordStructure)
                      throws IllegalArgumentException,
                             IOException
Creates a new history for this ID.

Parameters:
id - The ID of the history to be created.
recordStructure - The structure of the data.
Returns:
Returns the history with this ID.
Throws:
IllegalArgumentException - Thrown if such history already exists.
IOException - Thrown if the history could not be created due to a IO error.

purgeLocallyStoredHistory

void purgeLocallyStoredHistory(HistoryID id)
                               throws IOException
Permamently removes local stored History

Parameters:
id - HistoryID
Throws:
IOException - Thrown if the history could not be removed due to a IO error.

moveHistory

void moveHistory(HistoryID oldId,
                 HistoryID newId)
                 throws IOException
Moves the content of oldId history to the content of the newId.

Parameters:
oldId - id of the old and existing history
newId - the place where content of oldId will be moved
Throws:
IOException - problem moving content to newId.

isHistoryCreated

boolean isHistoryCreated(HistoryID id)
Checks whether a history is created and stored.

Parameters:
id - the history to check
Returns:
whether a history is created and stored.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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