|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.notnoop.mpns.MpnsServiceBuilder
public class MpnsServiceBuilder
The class is used to create instances of 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()
| Nested Class Summary | |
|---|---|
static class |
MpnsServiceBuilder.SecurityInfo
|
| Constructor Summary | |
|---|---|
MpnsServiceBuilder()
Constructs a new instance of MpnsServiceBuilder |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MpnsServiceBuilder()
MpnsServiceBuilder
| Method Detail |
|---|
public 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 server
public MpnsServiceBuilder withHttpClient(org.apache.http.client.HttpClient httpClient)
httpClient - the httpClient to be used
public 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 millis
public MpnsServiceBuilder delegate(MpnsDelegate delegate)
public MpnsService build()
MpnsService,
according to the requested settings.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||