public abstract class AbstractMpnsService extends Object implements MpnsService
| Constructor and Description |
|---|
AbstractMpnsService() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.http.client.methods.HttpPost |
postMessage(String subscriptionUri,
byte[] requestBody,
Collection<? extends Map.Entry<String,String>> headers) |
protected abstract void |
push(org.apache.http.client.methods.HttpPost request,
MpnsNotification message) |
void |
push(String subscriptionUri,
MpnsNotification message)
Sends the provided notification
message to the desired
destination. |
void |
push(String subscriptionUri,
String payload,
Collection<? extends Map.Entry<String,String>> headers)
Sends a push notification with the provided
payload to the
iPhone of deviceToken. |
void |
start()
Starts the service.
|
void |
stop()
Stops the service and frees any allocated resources it created for this
service.
|
protected org.apache.http.client.methods.HttpPost postMessage(String subscriptionUri, byte[] requestBody, Collection<? extends Map.Entry<String,String>> headers)
protected abstract void push(org.apache.http.client.methods.HttpPost request,
MpnsNotification message)
public void push(String subscriptionUri, String payload, Collection<? extends Map.Entry<String,String>> headers) throws NetworkIOException
MpnsServicepayload to the
iPhone of deviceToken.
The payload needs to be a valid JSON object, otherwise it may fail
silently. It is recommended to use MpnsServiceBuilder to create
one.push in interface MpnsServicesubscriptionUri - the destinationpayload - The payload messageNetworkIOException - if a network error occurred while
attempting to send the messagepublic void push(String subscriptionUri, MpnsNotification message) throws NetworkIOException
MpnsServicemessage to the desired
destination.push in interface MpnsServiceNetworkIOException - if a network error occurred while
attempting to send the messagepublic void start()
MpnsServicestart in interface MpnsServicepublic void stop()
MpnsServicestop in interface MpnsServiceCopyright © 2014 JBoss by Red Hat. All Rights Reserved.