Class PushService

    • Constructor Detail

      • PushService

        public PushService()
      • PushService

        public PushService​(java.lang.String gcmApiKey)
      • PushService

        public PushService​(java.security.KeyPair keyPair)
      • PushService

        public PushService​(java.security.KeyPair keyPair,
                           java.lang.String subject)
      • PushService

        public PushService​(java.lang.String publicKey,
                           java.lang.String privateKey)
                    throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException
      • PushService

        public PushService​(java.lang.String publicKey,
                           java.lang.String privateKey,
                           java.lang.String subject)
                    throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException
    • Method Detail

      • send

        public org.apache.http.HttpResponse send​(Notification notification,
                                                 Encoding encoding)
                                          throws java.security.GeneralSecurityException,
                                                 java.io.IOException,
                                                 org.jose4j.lang.JoseException,
                                                 java.util.concurrent.ExecutionException,
                                                 java.lang.InterruptedException
        Send a notification and wait for the response.
        Parameters:
        notification -
        encoding -
        Returns:
        Throws:
        java.security.GeneralSecurityException
        java.io.IOException
        org.jose4j.lang.JoseException
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • send

        public org.apache.http.HttpResponse send​(Notification notification)
                                          throws java.security.GeneralSecurityException,
                                                 java.io.IOException,
                                                 org.jose4j.lang.JoseException,
                                                 java.util.concurrent.ExecutionException,
                                                 java.lang.InterruptedException
        Throws:
        java.security.GeneralSecurityException
        java.io.IOException
        org.jose4j.lang.JoseException
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • sendAsync

        @Deprecated
        public java.util.concurrent.Future<org.apache.http.HttpResponse> sendAsync​(Notification notification,
                                                                                   Encoding encoding)
                                                                            throws java.security.GeneralSecurityException,
                                                                                   java.io.IOException,
                                                                                   org.jose4j.lang.JoseException
        Send a notification, but don't wait for the response.
        Parameters:
        notification -
        encoding -
        Returns:
        Throws:
        java.security.GeneralSecurityException
        java.io.IOException
        org.jose4j.lang.JoseException
      • sendAsync

        @Deprecated
        public java.util.concurrent.Future<org.apache.http.HttpResponse> sendAsync​(Notification notification)
                                                                            throws java.security.GeneralSecurityException,
                                                                                   java.io.IOException,
                                                                                   org.jose4j.lang.JoseException
        Deprecated.
        Throws:
        java.security.GeneralSecurityException
        java.io.IOException
        org.jose4j.lang.JoseException
      • preparePost

        public org.apache.http.client.methods.HttpPost preparePost​(Notification notification,
                                                                   Encoding encoding)
                                                            throws java.security.GeneralSecurityException,
                                                                   java.io.IOException,
                                                                   org.jose4j.lang.JoseException
        Prepare a HttpPost for Apache async http client
        Parameters:
        notification -
        encoding -
        Returns:
        Throws:
        java.security.GeneralSecurityException
        java.io.IOException
        org.jose4j.lang.JoseException