net.rim.pushsdk.subscription.match
Class SubActiveMatchManager

java.lang.Object
  extended by net.rim.pushsdk.subscription.match.SubActiveMatchManager
All Implemented Interfaces:
Callable<SubActiveMatchResult>

public class SubActiveMatchManager
extends Object
implements Callable<SubActiveMatchResult>

Performs threaded subscription matching to retrieve a list of active subscriber ids and addresses for a push application that were found in a given list of subscriber ids.

This uses the same matching algorithm as that found in SubStatusMatchManager.

Author:
mdandrea
See Also:
SubStatusMatchManager

Constructor Summary
SubActiveMatchManager()
           
 
Method Summary
 SubActiveMatchResult call()
          Pulls a match request off the queue and performs the subscription matching for that one request.
 SubActiveMatchResult getSubscriptionMatchResults()
          This method must be called after all matchSubscriptions() method calls have been made with requests.
 void matchSubscriptions(String pushAppId, Set<String> subscriberIds, int fromIndex, int toIndex)
          Initiates the process to match the subscriptions from storage with the ones from the given subscriber ids set.
 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
 

Constructor Detail

SubActiveMatchManager

public SubActiveMatchManager()
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)

matchSubscriptions

public void matchSubscriptions(String pushAppId,
                               Set<String> subscriberIds,
                               int fromIndex,
                               int toIndex)
Initiates the process to match the subscriptions from storage with the ones from the given subscriber ids set.

Parameters:
pushAppId - the id of a push application
subscriberIds - the subscriber ids to match
fromIndex - the row/entry number in storage to start looking for subscribers at
toIndex - the row/entry number in storage to stop looking for subscribers at

getSubscriptionMatchResults

public SubActiveMatchResult getSubscriptionMatchResults()
                                                 throws ExecutionException,
                                                        InterruptedException
This method must be called after all matchSubscriptions() method calls have been made with requests.

Returns:
a combined list of subscriber results from all the match requests
Throws:
ExecutionException - if the computation threw an exception
InterruptedException - if the computation was interrupted while processing

call

public SubActiveMatchResult call()
Pulls a match request off the queue and performs the subscription matching for that one request.

Specified by:
call in interface Callable<SubActiveMatchResult>
Returns:
a list of matching subscriber ids from the request


Copyright © 2011 Research In Motion. All Rights Reserved.