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
Nested ClassesModifier and TypeClassDescriptionstatic classThe IQ Provider for BookmarkStorage. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBookmarkedConference(BookmarkedConference bookmarkedConference) Add a BookmarkedConference to bookmarks.voidaddBookmarkedURL(BookmarkedURL bookmarkedURL) Adds a BookmarkedURL.voidRemoves all BookmarkedConferences from Bookmarks.voidRemoves 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.voidremoveBookmarkedConference(BookmarkedConference bookmarkedConference) Removes a BookmarkedConference.voidremoveBookmarkedURL(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:
getElementNamein interfacePrivateData- Returns:
- the element name.
-
getNamespace
Returns the root element XML namespace.- Specified by:
getNamespacein interfacePrivateData- Returns:
- the namespace.
-
toXML
Returns the XML representation of the PrivateData.- Specified by:
toXMLin interfacePrivateData- Returns:
- the private data as XML.
-