public class DirectoryRosterStore extends Object implements RosterStore
| Modifier and Type | Method and Description |
|---|---|
boolean |
addEntry(RosterPacket.Item item,
String version)
This method stores a new roster entry in this store or updates an existing one.
|
List<RosterPacket.Item> |
getEntries()
This method returns a collection of all roster items contained in this store.
|
RosterPacket.Item |
getEntry(String bareJid)
This method returns the roster item in this store for the given JID.
|
String |
getRosterVersion()
This method returns the version number as specified by the "ver" attribute
of the local store.
|
static DirectoryRosterStore |
init(File baseDir)
Creates a new roster store on disk
|
static DirectoryRosterStore |
open(File baseDir)
Opens a roster store
|
boolean |
removeEntry(String bareJid,
String version)
Removes an entry from the store
|
boolean |
resetEntries(Collection<RosterPacket.Item> items,
String version)
This method updates the store so that it contains only the given entries.
|
public static DirectoryRosterStore init(File baseDir)
baseDir - The directory to create the store in. The directory should
be emptyDirectoryRosterStore instance if successful,
null else.public static DirectoryRosterStore open(File baseDir)
baseDir - The directory containing the roster store.DirectoryRosterStore instance if successful,
null else.public List<RosterPacket.Item> getEntries()
RosterStoregetEntries in interface RosterStoreRosterEntrypublic RosterPacket.Item getEntry(String bareJid)
RosterStoregetEntry in interface RosterStorebareJid - The bare JID of the RosterEntryRosterEntry which belongs to that userpublic String getRosterVersion()
RosterStoregetRosterVersion in interface RosterStorepublic boolean addEntry(RosterPacket.Item item, String version)
RosterStoreaddEntry in interface RosterStoreitem - the entry to storeversion - the new roster versionpublic boolean removeEntry(String bareJid, String version)
RosterStoreremoveEntry in interface RosterStorebareJid - The bare JID of the entry to be removedversion - the new roster versionpublic boolean resetEntries(Collection<RosterPacket.Item> items, String version)
RosterStoreresetEntries in interface RosterStoreitems - the entries to storeversion - the new roster version