Class Bookmarks
java.lang.Object
org.jivesoftware.smackx.bookmarks.Bookmarks
- All Implemented Interfaces:
PrivateData
Bookmarks is used for storing and retrieving URLS and Conference rooms.
Bookmark Storage (XEP-0048) defined a protocol for the storage of bookmarks to conference rooms and other entities
in a Jabber user's account.
See the following code sample for saving Bookmarks:
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");
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
The IQ Provider for BookmarkStorage. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addBookmarkedConference
(BookmarkedConference bookmarkedConference) Add a BookmarkedConference to bookmarks.void
addBookmarkedURL
(BookmarkedURL bookmarkedURL) Adds a BookmarkedURL.void
Removes all BookmarkedConferences from Bookmarks.void
Removes all BookmarkedURLs from user's bookmarks.Returns a Collection of all Bookmarked Conference for this user.Returns a Collection of all Bookmarked URLs for this user.Returns the root element name.Returns the root element XML namespace.void
removeBookmarkedConference
(BookmarkedConference bookmarkedConference) Removes a BookmarkedConference.void
removeBookmarkedURL
(BookmarkedURL bookmarkedURL) Removes a bookmarked bookmarkedURL.toXML()
Returns the XML representation of the PrivateData.
-
Field Details
-
NAMESPACE
- See Also:
-
ELEMENT
- See Also:
-
-
Constructor Details
-
Bookmarks
public Bookmarks()Required Empty Constructor to use Bookmarks.
-
-
Method Details
-
addBookmarkedURL
Adds a BookmarkedURL.- Parameters:
bookmarkedURL
- the bookmarked bookmarkedURL.
-
removeBookmarkedURL
Removes a bookmarked bookmarkedURL.- Parameters:
bookmarkedURL
- the bookmarked bookmarkedURL to remove.
-
clearBookmarkedURLS
Removes all BookmarkedURLs from user's bookmarks. -
addBookmarkedConference
Add a BookmarkedConference to bookmarks.- Parameters:
bookmarkedConference
- the conference to remove.
-
removeBookmarkedConference
Removes a BookmarkedConference.- Parameters:
bookmarkedConference
- the BookmarkedConference to remove.
-
clearBookmarkedConferences
Removes all BookmarkedConferences from Bookmarks. -
getBookmarkedURLS
Returns a Collection of all Bookmarked URLs for this user.- Returns:
- a collection of all Bookmarked URLs.
-
getBookmarkedConferences
Returns a Collection of all Bookmarked Conference for this user.- Returns:
- a collection of all Bookmarked Conferences.
-
getElementName
Returns the root element name.- Specified by:
getElementName
in interfacePrivateData
- Returns:
- the element name.
-
getNamespace
Returns the root element XML namespace.- Specified by:
getNamespace
in interfacePrivateData
- Returns:
- the namespace.
-
toXML
Returns the XML representation of the PrivateData.- Specified by:
toXML
in interfacePrivateData
- Returns:
- the private data as XML.
-