public class Bookmarks extends Object implements PrivateData
XMPPConnection con = new XMPPTCPConnection("jabber.org"); con.login("john", "doe"); Bookmarks bookmarks = new Bookmarks(); // Bookmark a URL BookmarkedURL url = new BookmarkedURL(); url.setName("Google"); url.setURL("http://www.jivesoftware.com"); bookmarks.addURL(url); // Bookmark a Conference room. BookmarkedConference conference = new BookmarkedConference(); conference.setName("My Favorite Room"); conference.setAutoJoin("true"); conference.setJID("dev@conference.jivesoftware.com"); bookmarks.addConference(conference); // Save Bookmarks using PrivateDataManager. PrivateDataManager manager = new PrivateDataManager(con); manager.setPrivateData(bookmarks); LastActivity activity = LastActivity.getLastActivity(con, "xray@jabber.org");
Modifier and Type | Class and Description |
---|---|
static class |
Bookmarks.Provider
The IQ Provider for BookmarkStorage.
|
Modifier and Type | Field and Description |
---|---|
static String |
ELEMENT |
static String |
NAMESPACE |
Constructor and Description |
---|
Bookmarks()
Required Empty Constructor to use Bookmarks.
|
Modifier and Type | Method and Description |
---|---|
void |
addBookmarkedConference(BookmarkedConference bookmarkedConference)
Add a BookmarkedConference to bookmarks.
|
void |
addBookmarkedURL(BookmarkedURL bookmarkedURL)
Adds a BookmarkedURL.
|
void |
clearBookmarkedConferences()
Removes all BookmarkedConferences from Bookmarks.
|
void |
clearBookmarkedURLS()
Removes all BookmarkedURLs from user's bookmarks.
|
List<BookmarkedConference> |
getBookmarkedConferences()
Returns a Collection of all Bookmarked Conference for this user.
|
List<BookmarkedURL> |
getBookmarkedURLS()
Returns a Collection of all Bookmarked URLs for this user.
|
String |
getElementName()
Returns the root element name.
|
String |
getNamespace()
Returns the root element XML namespace.
|
void |
removeBookmarkedConference(BookmarkedConference bookmarkedConference)
Removes a BookmarkedConference.
|
void |
removeBookmarkedURL(BookmarkedURL bookmarkedURL)
Removes a bookmarked bookmarkedURL.
|
XmlStringBuilder |
toXML()
Returns the XML representation of the PrivateData.
|
public static final String NAMESPACE
public static final String ELEMENT
public Bookmarks()
public void addBookmarkedURL(BookmarkedURL bookmarkedURL)
bookmarkedURL
- the bookmarked bookmarkedURL.public void removeBookmarkedURL(BookmarkedURL bookmarkedURL)
bookmarkedURL
- the bookmarked bookmarkedURL to remove.public void clearBookmarkedURLS()
public void addBookmarkedConference(BookmarkedConference bookmarkedConference)
bookmarkedConference
- the conference to remove.public void removeBookmarkedConference(BookmarkedConference bookmarkedConference)
bookmarkedConference
- the BookmarkedConference to remove.public void clearBookmarkedConferences()
public List<BookmarkedURL> getBookmarkedURLS()
public List<BookmarkedConference> getBookmarkedConferences()
public String getElementName()
getElementName
in interface PrivateData
public String getNamespace()
getNamespace
in interface PrivateData
public XmlStringBuilder toXML()
toXML
in interface PrivateData