public class BookmarkManager extends Object
Modifier and Type | Method and Description |
---|---|
void |
addBookmarkedConference(String name,
String jid,
boolean isAutoJoin,
String 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.
|
Collection<BookmarkedConference> |
getBookmarkedConferences()
Returns all currently bookmarked conferences.
|
Collection<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.
|
void |
removeBookmarkedConference(String jid)
Removes a conference from the bookmarks.
|
void |
removeBookmarkedURL(String bookmarkURL)
Removes a url from the bookmarks.
|
public static BookmarkManager getBookmarkManager(XMPPConnection connection) throws XMPPException, SmackException
connection
- the connection for which the manager is desired.XMPPException
SmackException
- thrown has not been authenticated.IllegalArgumentException
- when the connection is null.public Collection<BookmarkedConference> getBookmarkedConferences() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
XMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
BookmarkedConference
public void addBookmarkedConference(String name, String jid, boolean isAutoJoin, String nickname, String password) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
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
public void removeBookmarkedConference(String jid) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
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
IllegalArgumentException
- thrown when the conference being removed is a shared
conferencepublic Collection<BookmarkedURL> getBookmarkedURLs() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
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
public void addBookmarkedURL(String URL, String name, boolean isRSS) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
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
public void removeBookmarkedURL(String bookmarkURL) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
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