com.notnoop.mpns
Interface MpnsService

All Known Implementing Classes:
AbstractMpnsService, MpnsPooledService, MpnsQueuedService, MpnsServiceImpl

public interface MpnsService

Represents the connection and interface to the Microsoft MPNS servers. The service is created by MpnsServiceBuilder like:

   MpnsService service = MPNS.newService()
                  .build()
 


Method Summary
 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.
 

Method Detail

push

void push(String subscriptionUri,
          String payload,
          Collection<? extends Map.Entry<String,String>> headers)
          throws NetworkIOException
Sends a push notification with the provided payload 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.

Parameters:
deviceToken - the destination iPhone device token
payload - The payload message
Throws:
NetworkIOException - if a network error occured while attempting to send the message

push

void push(String subscriptionUri,
          MpnsNotification message)
          throws NetworkIOException
Sends the provided notification message to the desired destination.

Throws:
NetworkIOException - if a network error occured while attempting to send the message

start

void start()
Starts the service. The underlying implementation may prepare its connections or datastructures to be able to send the messages. This method is a blocking call, even if the service represents a Non-blocking push service. Once the service is returned, it is ready to accept push requests.

Throws:
NetworkIOException - if a network error occurred while starting the service

stop

void stop()
Stops the service and frees any allocated resources it created for this service. The underlying implementation should close all connections it created, and possibly stop any threads as well.



Copyright © 2015. All Rights Reserved.