net.rim.pushsdk.subscription.sync
Class SubscriberSyncManager

java.lang.Object
  extended by net.rim.pushsdk.subscription.sync.SubscriberSyncManager
All Implemented Interfaces:
Callable<SubscriberSyncResult>
Direct Known Subclasses:
SubSyncByAddressManager, SubSyncByStatusManager

public abstract class SubscriberSyncManager
extends Object
implements Callable<SubscriberSyncResult>

Abstract class that is used in performing threaded subscriber status syncing.

Contains functionality shared between the SubSyncByAddressManager and SubSyncByStatusManager classes.

Author:
mdandrea

Field Summary
protected  ExecutorService executor
          The executor used to execute the subscriber status syncing operations.
protected  Set<Future<SubscriberSyncResult>> futureList
          The results of the subscriber status syncing process.
protected  String pushAppId
          The id of the push application involved in subscriber status syncing.
protected  String pushAppPassword
          The password of the push application involved in subscriber status syncing.
protected  PushSDKProperties pushSDKProperties
          An instance of a PushSDKProperties implementation.
protected  SubscriptionService subscriptionService
          An instance of a SubscriptionService implementation.
 
Constructor Summary
SubscriberSyncManager()
           
 
Method Summary
 String getPushAppId()
          Gets the push application id associated with the subscriber sync manager.
 String getPushAppPassword()
          Gets the push application password associated with the subscriber sync manager.
 SubscriberSyncResult getSubscriberSyncResult()
          Returns the result of performing a subscriber status sync operation.
 void setPushAppId(String pushAppId)
          Sets the push application id associated with the subscriber sync manager.
 void setPushAppPassword(String pushAppPassword)
          Sets the push application password associated with the subscriber sync manager.
 void setPushSDKProperties(PushSDKProperties pushSDKProperties)
          Support for dependency injection.
 void setSubscriptionService(SubscriptionService subscriptionService)
          Support for dependency injection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.concurrent.Callable
call
 

Field Detail

pushSDKProperties

protected PushSDKProperties pushSDKProperties
An instance of a PushSDKProperties implementation. Properties used include: subscription.ppg.sync.threads, subscription.ppg.sync.queuesize.


subscriptionService

protected SubscriptionService subscriptionService
An instance of a SubscriptionService implementation.


pushAppId

protected String pushAppId
The id of the push application involved in subscriber status syncing.


pushAppPassword

protected String pushAppPassword
The password of the push application involved in subscriber status syncing.


futureList

protected Set<Future<SubscriberSyncResult>> futureList
The results of the subscriber status syncing process.


executor

protected ExecutorService executor
The executor used to execute the subscriber status syncing operations.

Constructor Detail

SubscriberSyncManager

public SubscriberSyncManager()
Method Detail

setPushSDKProperties

public void setPushSDKProperties(PushSDKProperties pushSDKProperties)
Support for dependency injection. This will override the default PushSDKProperties implementation.

Parameters:
pushSDKProperties -

setSubscriptionService

public void setSubscriptionService(SubscriptionService subscriptionService)
Support for dependency injection. Inject an implementation of a SubscriptionService collaborating object.

Parameters:
subscriptionService - an instance of a SubscriptionService implementation (must be thread safe)

setPushAppId

public void setPushAppId(String pushAppId)
Sets the push application id associated with the subscriber sync manager.

Parameters:
pushAppId - the push application id

setPushAppPassword

public void setPushAppPassword(String pushAppPassword)
Sets the push application password associated with the subscriber sync manager.

Parameters:
pushAppPassword - the push application password

getPushAppId

public String getPushAppId()
Gets the push application id associated with the subscriber sync manager.

Returns:
the push application id

getPushAppPassword

public String getPushAppPassword()
Gets the push application password associated with the subscriber sync manager.

Returns:
the push application password

getSubscriberSyncResult

public SubscriberSyncResult getSubscriberSyncResult()
                                             throws InvalidPushAppException,
                                                    SubQueryFailureException,
                                                    PushSDKException
Returns the result of performing a subscriber status sync operation.

Returns:
the failed results of a subscriber status sync operation
Throws:
InvalidPushAppException - if the push application the sync is being performed for could not be found
SubQueryFailureException - if the request message sent to the PPG for the sync could not be processed successfully
PushSDKException - if any unrecoverable errors occurred for the sync request


Copyright © 2011 Research In Motion. All Rights Reserved.