public class MpnsServiceBuilder extends Object
MpnsService.
Note that this class is not synchronized. If multiple threads access a
MpnsServiceBuilder instance concurrently, and at least on of the
threads modifies one of the attributes structurally, it must be
synchronized externally.
Starting a new MpnsService is easy:
MpnsService service = MPNS.newService()
.build()
| Modifier and Type | Class and Description |
|---|---|
static class |
MpnsServiceBuilder.SecurityInfo |
| Constructor and Description |
|---|
MpnsServiceBuilder()
Constructs a new instance of
MpnsServiceBuilder |
| Modifier and Type | Method and Description |
|---|---|
MpnsServiceBuilder |
asAuthenticated(MpnsServiceBuilder.SecurityInfo securityInfo)
Authenticated
|
MpnsServiceBuilder |
asPool(ExecutorService executor,
int maxConnections)
Constructs a pool of connections to the notification servers.
|
MpnsServiceBuilder |
asPool(int maxConnections)
Constructs a pool of connections to the notification servers.
|
MpnsServiceBuilder |
asQueued()
Constructs a new thread with a processing queue to process
notification requests.
|
MpnsService |
build()
Returns a fully initialized instance of
MpnsService,
according to the requested settings. |
MpnsServiceBuilder |
delegate(MpnsDelegate delegate) |
MpnsServiceBuilder |
timeout(int timeout)
Sets the timeout for the connection
|
MpnsServiceBuilder |
withHttpClient(org.apache.http.client.HttpClient httpClient)
Sets the HttpClient instance along with any configuration
NOTE: This is an advanced option that should be probably be used as a
last resort.
|
MpnsServiceBuilder |
withHttpProxy(String host,
int port)
Specify the address of the HTTP proxy the connection should
use.
|
public MpnsServiceBuilder()
MpnsServiceBuilderpublic MpnsServiceBuilder withHttpProxy(String host, int port)
Read the Java Networking and Proxies guide to understand the proxies complexity.
host - the hostname of the HTTP proxyport - the port of the HTTP proxy serverpublic MpnsServiceBuilder withHttpClient(org.apache.http.client.HttpClient httpClient)
httpClient - the httpClient to be usedpublic MpnsServiceBuilder asPool(int maxConnections)
public MpnsServiceBuilder asPool(ExecutorService executor, int maxConnections)
public MpnsServiceBuilder asQueued()
public MpnsServiceBuilder asAuthenticated(MpnsServiceBuilder.SecurityInfo securityInfo)
public MpnsServiceBuilder timeout(int timeout)
timeout - the time out period in millispublic MpnsServiceBuilder delegate(MpnsDelegate delegate)
public MpnsService build()
MpnsService,
according to the requested settings.Copyright © 2014 JBoss by Red Hat. All Rights Reserved.