XEP-0048: Bookmarks


XEP-0048: Bookmarks allows you to store bookmarks for multi-user chat rooms and web pages by using the server-side XML storage.

The BookmarkManager facilitates the access to the private storage by providing convenient method for adding, retrieving or removing bookmarks.

Adding a Bookmark

BookmarkManager bookmarkManager = xmppClient.getManager(BookmarkManager.class);
bookmarkManager.addBookmark(new ChatRoomBookmark("chatroom", Jid.of("chat@conference.domain")));
bookmarkManager.addBookmark(new WebPageBookmark("chatroom", new URL("http://www.xmpp.org")));

Retrieving Bookmarks

Collection<ChatRoomBookmark> chatRoomBookmarks = bookmarkManager.getChatRoomBookmarks().getResult();
Collection<WebPageBookmark> webPageBookmarks = bookmarkManager.getWebPageBookmarks().getResult();

Removing a Bookmark

bookmarkManager.removeChatRoomBookmark(Jid.of("chat@conference.domain"));
bookmarkManager.removeWebPageBookmark(url);