public final class BookmarkManager extends Object
Modifier and Type | Method and Description |
---|---|
void |
addBookmarkedConference(String name,
EntityBareJid jid,
boolean isAutoJoin,
Resourcepart nickname,
String password)
Adds or updates a conference in the bookmarks.
|
void |
addBookmarkedURL(String URL,
String name,
boolean isRSS)
Adds a new url or updates an already existing url in the bookmarks.
|
List<BookmarkedConference> |
getBookmarkedConferences()
Returns all currently bookmarked conferences.
|
List<BookmarkedURL> |
getBookmarkedURLs()
Returns an unmodifiable collection of all bookmarked urls.
|
static BookmarkManager |
getBookmarkManager(XMPPConnection connection)
Returns the BookmarkManager for a connection, if it doesn't exist it is created.
|
boolean |
isSupported()
Check if the service supports bookmarks using private data.
|
void |
removeBookmarkedConference(EntityBareJid jid)
Removes a conference from the bookmarks.
|
void |
removeBookmarkedURL(String bookmarkURL)
Removes a url from the bookmarks.
|
public static BookmarkManager getBookmarkManager(XMPPConnection connection)
connection
- the connection for which the manager is desired.IllegalArgumentException
- when the connection is null.public List<BookmarkedConference> getBookmarkedConferences() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
XMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
InterruptedException
BookmarkedConference
public void addBookmarkedConference(String name, EntityBareJid jid, boolean isAutoJoin, Resourcepart nickname, String password) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
name
- the name of the conferencejid
- the jid of the conferenceisAutoJoin
- whether or not to join this conference automatically on loginnickname
- the nickname to use for the user when joining the conferencepassword
- the password to use for the user when joining the conferenceXMPPException.XMPPErrorException
- thrown when there is an issue retrieving the current bookmarks from
the server.SmackException.NoResponseException
- if there was no response from the server.SmackException.NotConnectedException
InterruptedException
public void removeBookmarkedConference(EntityBareJid jid) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
jid
- the jid of the conference to be removed.XMPPException.XMPPErrorException
- thrown when there is a problem with the connection attempting to
retrieve the bookmarks or persist the bookmarks.SmackException.NoResponseException
- if there was no response from the server.SmackException.NotConnectedException
InterruptedException
IllegalArgumentException
- thrown when the conference being removed is a shared
conferencepublic List<BookmarkedURL> getBookmarkedURLs() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
XMPPException.XMPPErrorException
- thrown when there is a problem retriving bookmarks from the server.SmackException.NoResponseException
- if there was no response from the server.SmackException.NotConnectedException
InterruptedException
public void addBookmarkedURL(String URL, String name, boolean isRSS) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
URL
- the url of the bookmarkname
- the name of the bookmarkisRSS
- whether or not the url is an rss feedXMPPException.XMPPErrorException
- thrown when there is an error retriving or saving bookmarks from or to
the serverSmackException.NoResponseException
- if there was no response from the server.SmackException.NotConnectedException
InterruptedException
public void removeBookmarkedURL(String bookmarkURL) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
bookmarkURL
- the url of the bookmark to removeXMPPException.XMPPErrorException
- thrown if there is an error retriving or saving bookmarks from or to
the server.SmackException.NoResponseException
- if there was no response from the server.SmackException.NotConnectedException
InterruptedException
public boolean isSupported() throws SmackException.NoResponseException, SmackException.NotConnectedException, XMPPException.XMPPErrorException, InterruptedException
SmackException.NoResponseException
SmackException.NotConnectedException
InterruptedException
XMPPException.XMPPErrorException
PrivateDataManager.isSupported()