Class PushNotificationsManager


  • public final class PushNotificationsManager
    extends org.jivesoftware.smack.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​(org.jxmpp.jid.Jid pushJid, java.lang.String node)
      Disable push notifications of an specific node.
      boolean disableAll​(org.jxmpp.jid.Jid pushJid)
      Disable all push notifications.
      boolean enable​(org.jxmpp.jid.Jid pushJid, java.lang.String node)
      Enable push notifications.
      boolean enable​(org.jxmpp.jid.Jid pushJid, java.lang.String node, java.util.HashMap<java.lang.String,​java.lang.String> publishOptions)
      Enable push notifications.
      static PushNotificationsManager getInstanceFor​(org.jivesoftware.smack.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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstanceFor

        public static PushNotificationsManager getInstanceFor​(org.jivesoftware.smack.XMPPConnection connection)
        Get the singleton instance of PushNotificationsManager.
        Parameters:
        connection - TODO javadoc me please
        Returns:
        the instance of PushNotificationsManager
      • isSupported

        public boolean isSupported()
                            throws org.jivesoftware.smack.SmackException.NoResponseException,
                                   org.jivesoftware.smack.XMPPException.XMPPErrorException,
                                   org.jivesoftware.smack.SmackException.NotConnectedException,
                                   java.lang.InterruptedException
        Returns true if Push Notifications are supported by this account.
        Returns:
        true if Push Notifications are supported by this account.
        Throws:
        org.jivesoftware.smack.SmackException.NoResponseException - if there was no response from the remote entity.
        org.jivesoftware.smack.XMPPException.XMPPErrorException - if there was an XMPP error returned.
        org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.
        java.lang.InterruptedException - if the calling thread was interrupted.
        Since:
        4.2.2
      • enable

        public boolean enable​(org.jxmpp.jid.Jid pushJid,
                              java.lang.String node)
                       throws org.jivesoftware.smack.SmackException.NoResponseException,
                              org.jivesoftware.smack.XMPPException.XMPPErrorException,
                              org.jivesoftware.smack.SmackException.NotConnectedException,
                              java.lang.InterruptedException
        Enable push notifications.
        Parameters:
        pushJid - TODO javadoc me please
        node - TODO javadoc me please
        Returns:
        true if it was successfully enabled, false if not
        Throws:
        org.jivesoftware.smack.SmackException.NoResponseException - if there was no response from the remote entity.
        org.jivesoftware.smack.XMPPException.XMPPErrorException - if there was an XMPP error returned.
        org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.
        java.lang.InterruptedException - if the calling thread was interrupted.
      • enable

        public boolean enable​(org.jxmpp.jid.Jid pushJid,
                              java.lang.String node,
                              java.util.HashMap<java.lang.String,​java.lang.String> publishOptions)
                       throws org.jivesoftware.smack.SmackException.NoResponseException,
                              org.jivesoftware.smack.XMPPException.XMPPErrorException,
                              org.jivesoftware.smack.SmackException.NotConnectedException,
                              java.lang.InterruptedException
        Enable push notifications.
        Parameters:
        pushJid - TODO javadoc me please
        node - TODO javadoc me please
        publishOptions - TODO javadoc me please
        Returns:
        true if it was successfully enabled, false if not
        Throws:
        org.jivesoftware.smack.SmackException.NoResponseException - if there was no response from the remote entity.
        org.jivesoftware.smack.XMPPException.XMPPErrorException - if there was an XMPP error returned.
        org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.
        java.lang.InterruptedException - if the calling thread was interrupted.
      • disableAll

        public boolean disableAll​(org.jxmpp.jid.Jid pushJid)
                           throws org.jivesoftware.smack.SmackException.NoResponseException,
                                  org.jivesoftware.smack.XMPPException.XMPPErrorException,
                                  org.jivesoftware.smack.SmackException.NotConnectedException,
                                  java.lang.InterruptedException
        Disable all push notifications.
        Parameters:
        pushJid - TODO javadoc me please
        Returns:
        true if it was successfully disabled, false if not
        Throws:
        org.jivesoftware.smack.SmackException.NoResponseException - if there was no response from the remote entity.
        org.jivesoftware.smack.XMPPException.XMPPErrorException - if there was an XMPP error returned.
        org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.
        java.lang.InterruptedException - if the calling thread was interrupted.
      • disable

        public boolean disable​(org.jxmpp.jid.Jid pushJid,
                               java.lang.String node)
                        throws org.jivesoftware.smack.SmackException.NoResponseException,
                               org.jivesoftware.smack.XMPPException.XMPPErrorException,
                               org.jivesoftware.smack.SmackException.NotConnectedException,
                               java.lang.InterruptedException
        Disable push notifications of an specific node.
        Parameters:
        pushJid - TODO javadoc me please
        node - TODO javadoc me please
        Returns:
        true if it was successfully disabled, false if not
        Throws:
        org.jivesoftware.smack.SmackException.NoResponseException - if there was no response from the remote entity.
        org.jivesoftware.smack.XMPPException.XMPPErrorException - if there was an XMPP error returned.
        org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.
        java.lang.InterruptedException - if the calling thread was interrupted.