|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.notnoop.mpns.internal.AbstractMpnsService
public abstract class AbstractMpnsService
| Constructor Summary | |
|---|---|
AbstractMpnsService()
|
|
| Method Summary | |
|---|---|
protected String |
getSubscriptionUri(org.apache.http.client.methods.HttpPost request)
|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractMpnsService()
| Method Detail |
|---|
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 PayloadBuilder to create
one.
push in interface MpnsServicepayload - The payload message
NetworkIOException - if a network error occured while
attempting to send the message
public void push(String subscriptionUri,
MpnsNotification message)
throws NetworkIOException
MpnsServicemessage to the desired
destination.
push in interface MpnsServiceNetworkIOException - if a network error occured while
attempting to send the messageprotected String getSubscriptionUri(org.apache.http.client.methods.HttpPost request)
public void start()
MpnsService
start in interface MpnsServicepublic void stop()
MpnsService
stop in interface MpnsService
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||