|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.relayrides.pushy.apns.PushManagerFactory<T>
public class PushManagerFactory<T extends ApnsPushNotification>
A PushManagerFactory
is used to configure and construct a new PushManager
.
Constructor Summary | |
---|---|
PushManagerFactory(ApnsEnvironment environment,
SSLContext sslContext)
Constructs a new factory that will construct PushManager s that operate in the given environment with the
given credentials. |
Method Summary | |
---|---|
PushManager<T> |
buildPushManager()
Constructs a new PushManager with the settings provided to this factory. |
static SSLContext |
createDefaultSSLContext(KeyStore keyStore,
char[] keyStorePassword)
Creates a new SSL context using the JVM default trust managers and the certificates in the given keystore. |
static SSLContext |
createDefaultSSLContext(String pathToPKCS12File,
String keystorePassword)
Creates a new SSL context using the JVM default trust managers and the certificates in the given PKCS12 file. |
PushManagerFactory<T> |
setConcurrentConnectionCount(int concurrentConnectionCount)
Sets the number of concurrent connections constructed PushManagers should maintain to the APNs
gateway. |
PushManagerFactory<T> |
setEventLoopGroup(NioEventLoopGroup eventLoopGroup)
Sets a custom event loop group to be used by constructed PushMangers . |
PushManagerFactory<T> |
setListenerExecutorService(ExecutorService listenerExecutorService)
Sets a custom executor service to be used by constructed PushManagers to dispatch notifications to
registered listeners. |
PushManagerFactory<T> |
setQueue(BlockingQueue<T> queue)
Sets the queue to be used to pass new notifications to constructed PushManagers . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PushManagerFactory(ApnsEnvironment environment, SSLContext sslContext)
PushManager
s that operate in the given environment with the
given credentials.
environment
- the environment in which constructed PushManager
s will operatesslContext
- the SSL context in which connections controlled by the constructed PushManager
will
operateMethod Detail |
---|
public PushManagerFactory<T> setConcurrentConnectionCount(int concurrentConnectionCount)
Sets the number of concurrent connections constructed PushManagers
should maintain to the APNs
gateway. By default, constructed PushManagers
will maintain a single connection to the gateway.
concurrentConnectionCount
- the number of parallel connections to maintain
public PushManagerFactory<T> setEventLoopGroup(NioEventLoopGroup eventLoopGroup)
Sets a custom event loop group to be used by constructed PushMangers
. If null
, constructed
PushManagers
will be create and maintain their own event loop groups. If a non-null
event loop
group is provided, callers must shut down the event loop group after shutting down all
PushManager
instances that use that event loop group.
By default, constructed PushManagers
will construct and maintain their own event loop groups.
eventLoopGroup
- the event loop group constructed PushManagers
should use for their connections to
the APNs gateway and feedback service; if not null
, the caller must shut
down the event loop group after shutting down all push managers that use the group
public PushManagerFactory<T> setListenerExecutorService(ExecutorService listenerExecutorService)
Sets a custom executor service to be used by constructed PushManagers
to dispatch notifications to
registered listeners. If null
, constructed PushManager
instances will create and maintain their
own executor services. If a non-null
executor service is provided, callers must shut
down the executor service after shutting down all PushManager
instances that use that executor service.
By default, constructed PushManagers
will construct and maintain their own executor services.
listenerExecutorService
- the executor service to be used by constructed PushManager
instances to
dispatch notifications to registered listeners; if not null
, the caller must shut down
the executor service after shutting down all push managers that use the executor service
public PushManagerFactory<T> setQueue(BlockingQueue<T> queue)
Sets the queue to be used to pass new notifications to constructed PushManagers
. If null
(the
default), constructed push managers will construct their own queues.
queue
- the queue to be used to pass new notifications to constructed push managers
public PushManager<T> buildPushManager()
Constructs a new PushManager
with the settings provided to this factory. The returned push manager
will not be started automatically.
PushManager
public static SSLContext createDefaultSSLContext(String pathToPKCS12File, String keystorePassword) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, UnrecoverableKeyException, KeyManagementException, IOException
pathToPKCS12File
- the path to a PKCS12 file that contains the client certificatekeystorePassword
- the password to read the PKCS12 file; may be null
KeyStoreException
NoSuchAlgorithmException
CertificateException
UnrecoverableKeyException
KeyManagementException
IOException
public static SSLContext createDefaultSSLContext(KeyStore keyStore, char[] keyStorePassword) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException, KeyManagementException
keyStore
- A KeyStore
containing the client certificates to present during a TLS handshake; may be
null
if the environment does not require TLS. The KeyStore
should be loaded before being used
here.keyStorePassword
- a password to unlock the given KeyStore
; may be null
KeyStoreException
NoSuchAlgorithmException
UnrecoverableKeyException
KeyManagementException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |