Class PushNotificationsManager
- java.lang.Object
-
- org.jivesoftware.smack.Manager
-
- org.jivesoftware.smackx.push_notifications.PushNotificationsManager
-
public final class PushNotificationsManager extends Manager
Push Notifications manager class.- See Also:
- XEP-0357: Push Notifications
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
disable(Jid pushJid, String node)
Disable push notifications of an specific node.boolean
disableAll(Jid pushJid)
Disable all push notifications.boolean
enable(Jid pushJid, String node)
Enable push notifications.boolean
enable(Jid pushJid, String node, HashMap<String,String> publishOptions)
Enable push notifications.static PushNotificationsManager
getInstanceFor(XMPPConnection connection)
Get the singleton instance of PushNotificationsManager.boolean
isSupported()
Returns true if Push Notifications are supported by this account.-
Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
-
-
-
Method Detail
-
getInstanceFor
public static PushNotificationsManager getInstanceFor(XMPPConnection connection)
Get the singleton instance of PushNotificationsManager.- Parameters:
connection
- TODO javadoc me please- Returns:
- the instance of PushNotificationsManager
-
isSupported
public boolean isSupported() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Returns true if Push Notifications are supported by this account.- Returns:
- true if Push Notifications are supported by this account.
- Throws:
SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.- Since:
- 4.2.2
-
enable
public boolean enable(Jid pushJid, String node) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Enable push notifications.- Parameters:
pushJid
- TODO javadoc me pleasenode
- TODO javadoc me please- Returns:
- true if it was successfully enabled, false if not
- Throws:
SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
enable
public boolean enable(Jid pushJid, String node, HashMap<String,String> publishOptions) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Enable push notifications.- Parameters:
pushJid
- TODO javadoc me pleasenode
- TODO javadoc me pleasepublishOptions
- TODO javadoc me please- Returns:
- true if it was successfully enabled, false if not
- Throws:
SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
disableAll
public boolean disableAll(Jid pushJid) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Disable all push notifications.- Parameters:
pushJid
- TODO javadoc me please- Returns:
- true if it was successfully disabled, false if not
- Throws:
SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
disable
public boolean disable(Jid pushJid, String node) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Disable push notifications of an specific node.- Parameters:
pushJid
- TODO javadoc me pleasenode
- TODO javadoc me please- Returns:
- true if it was successfully disabled, false if not
- Throws:
SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
-