Class Notification


  • public class Notification
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      ConstructorDescription
      Notification​(Subscription subscription, java.lang.String payload) 
      Notification​(Subscription subscription, java.lang.String payload, Urgency urgency) 
      Notification​(java.lang.String endpoint, java.lang.String userPublicKey, java.lang.String userAuth, byte[] payload) 
      Notification​(java.lang.String endpoint, java.lang.String userPublicKey, java.lang.String userAuth, byte[] payload, int ttl) 
      Notification​(java.lang.String endpoint, java.lang.String userPublicKey, java.lang.String userAuth, java.lang.String payload) 
      Notification​(java.lang.String endpoint, java.lang.String userPublicKey, java.lang.String userAuth, java.lang.String payload, Urgency urgency) 
      Notification​(java.lang.String endpoint, java.security.PublicKey userPublicKey, byte[] userAuth, byte[] payload) 
      Notification​(java.lang.String endpoint, java.security.PublicKey userPublicKey, byte[] userAuth, byte[] payload, int ttl) 
      Notification​(java.lang.String endpoint, org.bouncycastle.jce.interfaces.ECPublicKey userPublicKey, byte[] userAuth, byte[] payload, int ttl, Urgency urgency, java.lang.String topic) 
    • Constructor Detail

      • Notification

        public Notification​(java.lang.String endpoint,
                            org.bouncycastle.jce.interfaces.ECPublicKey userPublicKey,
                            byte[] userAuth,
                            byte[] payload,
                            int ttl,
                            Urgency urgency,
                            java.lang.String topic)
      • Notification

        public Notification​(java.lang.String endpoint,
                            java.security.PublicKey userPublicKey,
                            byte[] userAuth,
                            byte[] payload,
                            int ttl)
      • Notification

        public Notification​(java.lang.String endpoint,
                            java.lang.String userPublicKey,
                            java.lang.String userAuth,
                            byte[] payload,
                            int ttl)
                     throws java.security.NoSuchAlgorithmException,
                            java.security.NoSuchProviderException,
                            java.security.spec.InvalidKeySpecException
        Throws:
        java.security.NoSuchAlgorithmException
        java.security.NoSuchProviderException
        java.security.spec.InvalidKeySpecException
      • Notification

        public Notification​(java.lang.String endpoint,
                            java.security.PublicKey userPublicKey,
                            byte[] userAuth,
                            byte[] payload)
      • Notification

        public Notification​(java.lang.String endpoint,
                            java.lang.String userPublicKey,
                            java.lang.String userAuth,
                            byte[] payload)
                     throws java.security.NoSuchAlgorithmException,
                            java.security.NoSuchProviderException,
                            java.security.spec.InvalidKeySpecException
        Throws:
        java.security.NoSuchAlgorithmException
        java.security.NoSuchProviderException
        java.security.spec.InvalidKeySpecException
      • Notification

        public Notification​(java.lang.String endpoint,
                            java.lang.String userPublicKey,
                            java.lang.String userAuth,
                            java.lang.String payload)
                     throws java.security.NoSuchAlgorithmException,
                            java.security.NoSuchProviderException,
                            java.security.spec.InvalidKeySpecException
        Throws:
        java.security.NoSuchAlgorithmException
        java.security.NoSuchProviderException
        java.security.spec.InvalidKeySpecException
      • Notification

        public Notification​(java.lang.String endpoint,
                            java.lang.String userPublicKey,
                            java.lang.String userAuth,
                            java.lang.String payload,
                            Urgency urgency)
                     throws java.security.NoSuchAlgorithmException,
                            java.security.NoSuchProviderException,
                            java.security.spec.InvalidKeySpecException
        Throws:
        java.security.NoSuchAlgorithmException
        java.security.NoSuchProviderException
        java.security.spec.InvalidKeySpecException
      • Notification

        public Notification​(Subscription subscription,
                            java.lang.String payload)
                     throws java.security.NoSuchAlgorithmException,
                            java.security.NoSuchProviderException,
                            java.security.spec.InvalidKeySpecException
        Throws:
        java.security.NoSuchAlgorithmException
        java.security.NoSuchProviderException
        java.security.spec.InvalidKeySpecException
      • Notification

        public Notification​(Subscription subscription,
                            java.lang.String payload,
                            Urgency urgency)
                     throws java.security.NoSuchAlgorithmException,
                            java.security.NoSuchProviderException,
                            java.security.spec.InvalidKeySpecException
        Throws:
        java.security.NoSuchAlgorithmException
        java.security.NoSuchProviderException
        java.security.spec.InvalidKeySpecException
    • Method Detail

      • getEndpoint

        public java.lang.String getEndpoint()
      • getUserPublicKey

        public org.bouncycastle.jce.interfaces.ECPublicKey getUserPublicKey()
      • getUserAuth

        public byte[] getUserAuth()
      • getPayload

        public byte[] getPayload()
      • hasPayload

        public boolean hasPayload()
      • hasUrgency

        public boolean hasUrgency()
      • hasTopic

        public boolean hasTopic()
      • isGcm

        public boolean isGcm()
        Detect if the notification is for a GCM-based subscription
        Returns:
      • isFcm

        public boolean isFcm()
      • getTTL

        public int getTTL()
      • getUrgency

        public Urgency getUrgency()
      • getTopic

        public java.lang.String getTopic()
      • getOrigin

        public java.lang.String getOrigin()
                                   throws java.net.MalformedURLException
        Throws:
        java.net.MalformedURLException