javapns.notification
Class AppleNotificationServerBasicImpl

java.lang.Object
  extended by javapns.communication.AppleServerBasicImpl
      extended by javapns.notification.AppleNotificationServerBasicImpl
All Implemented Interfaces:
AppleServer, AppleNotificationServer

public class AppleNotificationServerBasicImpl
extends AppleServerBasicImpl
implements AppleNotificationServer

Basic implementation of the AppleNotificationServer interface, intended to facilitate rapid deployment.

Author:
Sylvain Pedneault

Field Summary
 
Fields inherited from interface javapns.notification.AppleNotificationServer
DEVELOPMENT_HOST, DEVELOPMENT_PORT, PRODUCTION_HOST, PRODUCTION_PORT
 
Constructor Summary
AppleNotificationServerBasicImpl(Object keystore, String password, boolean production)
          Communication settings for interacting with Apple's default production or sandbox notification server.
AppleNotificationServerBasicImpl(Object keystore, String password, String type, boolean production)
          Communication settings for interacting with Apple's default production or sandbox notification server.
AppleNotificationServerBasicImpl(Object keystore, String password, String type, String host, int port)
          Communication settings for interacting with a specific Apple Push Notification Server.
 
Method Summary
 String getNotificationServerHost()
           
 int getNotificationServerPort()
           
 
Methods inherited from class javapns.communication.AppleServerBasicImpl
getKeystorePassword, getKeystoreStream, getKeystoreType, getProxyAuthorization, getProxyHost, getProxyPort, setProxy, setProxyAuthorization
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javapns.communication.AppleServer
getKeystorePassword, getKeystoreStream, getKeystoreType, getProxyAuthorization, getProxyHost, getProxyPort, setProxy, setProxyAuthorization
 

Constructor Detail

AppleNotificationServerBasicImpl

public AppleNotificationServerBasicImpl(Object keystore,
                                        String password,
                                        boolean production)
                                 throws KeystoreException
Communication settings for interacting with Apple's default production or sandbox notification server. This constructor uses the recommended keystore type "PCKS12".

Parameters:
keystore - a keystore containing your private key and the certificate signed by Apple (File, InputStream, byte[], KeyStore or String for a file path)
password - the keystore's password
production - true to use Apple's production servers, false to use the sandbox
Throws:
KeystoreException - thrown if an error occurs when loading the keystore

AppleNotificationServerBasicImpl

public AppleNotificationServerBasicImpl(Object keystore,
                                        String password,
                                        String type,
                                        boolean production)
                                 throws KeystoreException
Communication settings for interacting with Apple's default production or sandbox notification server.

Parameters:
keystore - a keystore containing your private key and the certificate signed by Apple (File, InputStream, byte[], KeyStore or String for a file path)
password - the keystore's password
type - the keystore's type
production - true to use Apple's production servers, false to use the sandbox
Throws:
KeystoreException - thrown if an error occurs when loading the keystore

AppleNotificationServerBasicImpl

public AppleNotificationServerBasicImpl(Object keystore,
                                        String password,
                                        String type,
                                        String host,
                                        int port)
                                 throws KeystoreException
Communication settings for interacting with a specific Apple Push Notification Server.

Parameters:
keystore - a keystore containing your private key and the certificate signed by Apple (File, InputStream, byte[], KeyStore or String for a file path)
password - the keystore's password
type - the keystore's type
host - a specific APNS host
port - a specific APNS port
Throws:
KeystoreException - thrown if an error occurs when loading the keystore
Method Detail

getNotificationServerHost

public String getNotificationServerHost()
Specified by:
getNotificationServerHost in interface AppleNotificationServer

getNotificationServerPort

public int getNotificationServerPort()
Specified by:
getNotificationServerPort in interface AppleNotificationServer