Class DirectoryRosterStore
java.lang.Object
org.jivesoftware.smack.roster.rosterstore.DirectoryRosterStore
- All Implemented Interfaces:
RosterStore
Stores roster entries as specified by RFC 6121 for roster versioning
in a set of files.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddEntry(RosterPacket.Item item, String version) This method stores a new roster entry in this store or updates an existing one.This method returns a list of all roster items contained in this store.getEntry(org.jxmpp.jid.Jid bareJid) This method returns the roster item in this store for the given JID.This method returns the version number as specified by the "ver" attribute of the local store.static DirectoryRosterStoreCreates a new roster store on disk.static DirectoryRosterStoreOpens a roster store.booleanremoveEntry(org.jxmpp.jid.Jid bareJid, String version) Removes an entry from the store.booleanresetEntries(Collection<RosterPacket.Item> items, String version) This method updates the store so that it contains only the given entries.voidReset the store by removing all entries and setting the version to the empty String.
-
Method Details
-
init
Creates a new roster store on disk.- Parameters:
baseDir- TODO javadoc me please The directory to create the store in. The directory should be empty- Returns:
- A
DirectoryRosterStoreinstance if successful,nullelse.
-
open
Opens a roster store.- Parameters:
baseDir- TODO javadoc me please The directory containing the roster store.- Returns:
- A
DirectoryRosterStoreinstance if successful,nullelse.
-
getEntries
Description copied from interface:RosterStoreThis method returns a list of all roster items contained in this store. If there was an error while loading the store, thennullis returned.- Specified by:
getEntriesin interfaceRosterStore- Returns:
- List of
RosterEntryornull.
-
getEntry
Description copied from interface:RosterStoreThis method returns the roster item in this store for the given JID.- Specified by:
getEntryin interfaceRosterStore- Parameters:
bareJid- The bare JID of the RosterEntry- Returns:
- The
RosterEntrywhich belongs to that user
-
getRosterVersion
Description copied from interface:RosterStoreThis method returns the version number as specified by the "ver" attribute of the local store. For a fresh store, this MUST be the empty string.- Specified by:
getRosterVersionin interfaceRosterStore- Returns:
- local roster version
-
addEntry
Description copied from interface:RosterStoreThis method stores a new roster entry in this store or updates an existing one.- Specified by:
addEntryin interfaceRosterStore- Parameters:
item- the entry to storeversion- the new roster version- Returns:
- True if successful
-
removeEntry
Description copied from interface:RosterStoreRemoves an entry from the store.- Specified by:
removeEntryin interfaceRosterStore- Parameters:
bareJid- The bare JID of the entry to be removedversion- the new roster version- Returns:
- True if successful
-
resetEntries
Description copied from interface:RosterStoreThis method updates the store so that it contains only the given entries.- Specified by:
resetEntriesin interfaceRosterStore- Parameters:
items- the entries to storeversion- the new roster version- Returns:
- True if successful
-
resetStore
public void resetStore()Description copied from interface:RosterStoreReset the store by removing all entries and setting the version to the empty String.- Specified by:
resetStorein interfaceRosterStore
-