ar.com.fernandospr.wns.client
Class WnsClient

java.lang.Object
  extended by ar.com.fernandospr.wns.client.WnsClient

public class WnsClient
extends Object


Constructor Summary
WnsClient(String sid, String clientSecret, boolean logging)
           
WnsClient(String sid, String clientSecret, WnsProxyProperties proxyProps, boolean logging)
           
 
Method Summary
protected  String getAuthenticationUri()
           
 List<WnsNotificationResponse> push(WnsResourceBuilder resourceBuilder, List<String> channelUris, WnsAbstractNotification notification, int retriesLeft, WnsNotificationRequestOptional optional)
           
 WnsNotificationResponse push(WnsResourceBuilder resourceBuilder, String channelUri, WnsAbstractNotification notification, int retriesLeft, WnsNotificationRequestOptional optional)
           
 void refreshAccessToken()
          Based on http://msdn.microsoft.com/en-us/library/windows/apps/hh465407.aspx
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WnsClient

public WnsClient(String sid,
                 String clientSecret,
                 boolean logging)

WnsClient

public WnsClient(String sid,
                 String clientSecret,
                 WnsProxyProperties proxyProps,
                 boolean logging)
Method Detail

getAuthenticationUri

protected String getAuthenticationUri()

refreshAccessToken

public void refreshAccessToken()
                        throws WnsException
Based on http://msdn.microsoft.com/en-us/library/windows/apps/hh465407.aspx

Throws:
WnsException - when authentication fails

push

public WnsNotificationResponse push(WnsResourceBuilder resourceBuilder,
                                    String channelUri,
                                    WnsAbstractNotification notification,
                                    int retriesLeft,
                                    WnsNotificationRequestOptional optional)
                             throws WnsException
Parameters:
channelUri -
resourceBuilder -
notification -
retriesLeft - to push the notification if the token expires
Returns:
WnsNotificationResponse please see response headers from http://msdn.microsoft.com/en-us/library/windows/apps/hh465435.aspx#send_notification_response
Throws:
WnsException - when authentication fails

push

public List<WnsNotificationResponse> push(WnsResourceBuilder resourceBuilder,
                                          List<String> channelUris,
                                          WnsAbstractNotification notification,
                                          int retriesLeft,
                                          WnsNotificationRequestOptional optional)
                                   throws WnsException
Parameters:
channelUris -
resourceBuilder -
notification -
retriesLeft - to push the notification if the token expires
Returns:
list of WnsNotificationResponse for each channelUri, please see response headers from http://msdn.microsoft.com/en-us/library/windows/apps/hh465435.aspx#send_notification_response
Throws:
WnsException - when authentication fails


Copyright © 2016. All Rights Reserved.