net.rim.pushsdk.acknowledgement
Class AcknowledgementServiceImpl

java.lang.Object
  extended by net.rim.pushsdk.acknowledgement.AcknowledgementServiceImpl
All Implemented Interfaces:
AcknowledgementService

public class AcknowledgementServiceImpl
extends Object
implements AcknowledgementService

Implementation of the AcknowledgementService interface.

Dependencies that must be injected to properly initialize this object for use:
- pushRequestDetailService
- pushApplicationService
- pushSDKProperties
- papService
- pushCountService
- notificationProcessorService

Author:
dstrelbytsky

Constructor Summary
AcknowledgementServiceImpl()
           
 
Method Summary
 List<String> requestNotification(List<String> pushIds)
          Requests notification for the given push ids.
protected  void sendNotifications(Set<PushIdAndApplicationId> pushIdAndApplicationIds)
          Sends out result notifications for the specified push ids (in the push id-application id pairs).
 void setNotificationProcessorService(NotificationProcessorService notificationProcessorService)
          Support for dependency injection.
 void setPapService(PapService papService)
          Support for dependency injection.
 void setPushApplicationService(PushApplicationService pushApplicationService)
          Support for dependency injection.
 void setPushCountService(PushCountService pushCountService)
          Support for dependency injection.
 void setPushRequestDetailService(PushRequestDetailService pushRequestDetailService)
          Support for dependency injection.
 void setPushSDKProperties(PushSDKProperties properties)
          Support for dependency injection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AcknowledgementServiceImpl

public AcknowledgementServiceImpl()
Method Detail

setPushSDKProperties

public void setPushSDKProperties(PushSDKProperties properties)
Description copied from interface: AcknowledgementService
Support for dependency injection. Inject an implementation of a PushSDKProperties collaborating object - this is used to read global configuration properties.

Specified by:
setPushSDKProperties in interface AcknowledgementService
Parameters:
properties - an instance of a PushSDKProperties implementation (must be thread safe)

setPushApplicationService

public void setPushApplicationService(PushApplicationService pushApplicationService)
Description copied from interface: AcknowledgementService
Support for dependency injection. Inject an implementation of a PushApplicationService collaborating object - this is used to interface with the business service that manages push applications.

Specified by:
setPushApplicationService in interface AcknowledgementService
Parameters:
pushApplicationService - an instance of a PushApplicationService implementation (must be thread safe)

setPapService

public void setPapService(PapService papService)
Description copied from interface: AcknowledgementService
Support for dependency injection. Inject an implementation of a PapService collaborating object - this is used to send the PAP messages to the PPG.

Specified by:
setPapService in interface AcknowledgementService
Parameters:
papService - an instance of a PapService implementation (must be thread safe)

setPushCountService

public void setPushCountService(PushCountService pushCountService)
Description copied from interface: AcknowledgementService
Support for dependency injection. Inject an implementation of a PushCountService collaborating object - this is used to interface with the business service that manages tracking pushes that are complete.

Specified by:
setPushCountService in interface AcknowledgementService
Parameters:
pushCountService - an instance of a PushCountService implementation (must be thread safe)

setPushRequestDetailService

public void setPushRequestDetailService(PushRequestDetailService pushRequestDetailService)
Description copied from interface: AcknowledgementService
Support for dependency injection. Inject an implementation of a PushRequestDetailService collaborating object - this is used to interface with the business service that manages push request details.

Specified by:
setPushRequestDetailService in interface AcknowledgementService
Parameters:
pushRequestDetailService - an instance of a PushRequestDetailService implementation (must be thread safe)

setNotificationProcessorService

public void setNotificationProcessorService(NotificationProcessorService notificationProcessorService)
Description copied from interface: AcknowledgementService
Support for dependency injection. Inject an implementation of a NotificationProcessorService collaborating object - this is used to interface with the business service that processes result notifications.

Specified by:
setNotificationProcessorService in interface AcknowledgementService
Parameters:
notificationProcessorService - an instance of a NotificationProcessorService implementation (must be thread safe)

requestNotification

public List<String> requestNotification(List<String> pushIds)
                                 throws PushSDKException
Description copied from interface: AcknowledgementService
Requests notification for the given push ids. Used in the case where result notifications may have been lost.

Note: The push requests corresponding to the ids must have previously been persisted by the SDK (i.e. for applications with the 'storePushRequests' property set to true).

Specified by:
requestNotification in interface AcknowledgementService
Parameters:
pushIds - a list of push ids to request notifications for
Returns:
list of invalid pushIds for which there are no pending requests
Throws:
PushSDKException - if any errors occur

sendNotifications

protected void sendNotifications(Set<PushIdAndApplicationId> pushIdAndApplicationIds)
Sends out result notifications for the specified push ids (in the push id-application id pairs).

Parameters:
pushIdAndApplicationIds - the push id-application id pairs


Copyright © 2011 Research In Motion. All Rights Reserved.