|
Smack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jivesoftware.smackx.bookmark.Bookmarks
public class Bookmarks
Bookmarks is used for storing and retrieving URLS and Conference rooms. Bookmark Storage (JEP-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:
Connection con = new XMPPConnection("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 | |
|---|---|
static class |
Bookmarks.Provider
The IQ Provider for BookmarkStorage. |
| Constructor Summary | |
|---|---|
Bookmarks()
Required Empty Constructor to use Bookmarks. |
|
| Method Summary | |
|---|---|
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. |
String |
toXML()
Returns the XML reppresentation of the PrivateData. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Bookmarks()
| Method Detail |
|---|
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 PrivateDatapublic String getNamespace()
getNamespace in interface PrivateDatapublic String toXML()
toXML in interface PrivateData
|
Smack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||