net.rim.pushsdk.subscription.cp
Interface ContentProviderSubscriptionService

All Known Implementing Classes:
ContentProviderSubServiceImpl

public interface ContentProviderSubscriptionService

Interface which allows a content provider to perform their own subscription actions.

This includes performing actions specific to a content provider when a user subscribes, unsubscribes, suspends a subscription, or resumes a subscription to a push application.

A default implementation is provided by the push SDK. However, it is the responsibility of the content provider to provide their own implementation of this interface if they wish to perform their own actions on a subscribe, unsubscribe, suspend, and resume. The content provider's subscription actions will be called once the SDK has successfully (or unsuccessfully) completed its own actions.

Author:
mdandrea
See Also:
ContentProviderSubServiceImpl

Method Summary
 void onAutomaticUnsubscribe(UnsubscribeRequest unsubscribeRequest)
          Allows the content provider to perform an action when the SDK's subscribe triggers an automatic unsubscribe of a user (e.g.
 void onResumeFailure(ResumeRequest resumeRequest, Throwable t)
          Allows the content provider to perform an action when the SDK's resume fails.
 void onResumeSuccess(ResumeRequest resumeRequest)
          Allows the content provider to perform an action when the SDK's resume is successful.
 void onSubscribeFailure(SubscribeRequest subscribeRequest, Throwable t)
          Allows the content provider to perform an action when the SDK's subscribe fails.
 void onSubscribeSuccess(SubscribeRequest subscribeRequest)
          Allows the content provider to perform an action when the SDK's subscribe is successful.
 void onSuspendFailure(SuspendRequest suspendRequest, Throwable t)
          Allows the content provider to perform an action when the SDK's suspend fails.
 void onSuspendSuccess(SuspendRequest suspendRequest)
          Allows the content provider to perform an action when the SDK's suspend is successful.
 void onUnsubscribeFailure(UnsubscribeRequest unsubscribeRequest, Throwable t)
          Allows the content provider to perform an action when the SDK's unsubscribe fails.
 void onUnsubscribeSuccess(UnsubscribeRequest unsubscribeRequest)
          Allows the content provider to perform an action when the SDK's unsubscribe is successful.
 

Method Detail

onSubscribeSuccess

void onSubscribeSuccess(SubscribeRequest subscribeRequest)
                        throws CPSubscriptionFailureException
Allows the content provider to perform an action when the SDK's subscribe is successful.

Parameters:
subscribeRequest - object containing subscribe information
Throws:
CPSubscriptionFailureException - if the subscribe fails; this will force a rollback of the SDK's own subscribe

onSubscribeFailure

void onSubscribeFailure(SubscribeRequest subscribeRequest,
                        Throwable t)
Allows the content provider to perform an action when the SDK's subscribe fails.

Parameters:
subscribeRequest - object containing subscribe information
t - the throwable which caused the subscribe failure

onUnsubscribeSuccess

void onUnsubscribeSuccess(UnsubscribeRequest unsubscribeRequest)
                          throws CPSubscriptionFailureException
Allows the content provider to perform an action when the SDK's unsubscribe is successful.

Parameters:
unsubscribeRequest - object containing unsubscribe information
Throws:
CPSubscriptionFailureException - if the unsubscribe fails; this will force a rollback of the SDK's own unsubscribe

onUnsubscribeFailure

void onUnsubscribeFailure(UnsubscribeRequest unsubscribeRequest,
                          Throwable t)
Allows the content provider to perform an action when the SDK's unsubscribe fails.

Parameters:
unsubscribeRequest - object containing unsubscribe information
t - the throwable which caused the unsubscribe failure

onSuspendSuccess

void onSuspendSuccess(SuspendRequest suspendRequest)
                      throws CPSubscriptionFailureException
Allows the content provider to perform an action when the SDK's suspend is successful.

Parameters:
suspendRequest - object containing suspend information
Throws:
CPSubscriptionFailureException - if the suspend fails; this will force a rollback of the SDK's own suspend

onSuspendFailure

void onSuspendFailure(SuspendRequest suspendRequest,
                      Throwable t)
Allows the content provider to perform an action when the SDK's suspend fails.

Parameters:
suspendRequest - object containing suspend information
t - the throwable which caused the suspend failure

onResumeSuccess

void onResumeSuccess(ResumeRequest resumeRequest)
                     throws CPSubscriptionFailureException
Allows the content provider to perform an action when the SDK's resume is successful.

Parameters:
resumeRequest - object containing resume information
Throws:
CPSubscriptionFailureException - if the resume fails; this will force a rollback of the SDK's own resume

onResumeFailure

void onResumeFailure(ResumeRequest resumeRequest,
                     Throwable t)
Allows the content provider to perform an action when the SDK's resume fails.

Parameters:
resumeRequest - object containing resume information
t - the throwable which caused the resume failure

onAutomaticUnsubscribe

void onAutomaticUnsubscribe(UnsubscribeRequest unsubscribeRequest)
Allows the content provider to perform an action when the SDK's subscribe triggers an automatic unsubscribe of a user (e.g. if user A has subscribed to an application and then later gives his device to another user, user B, and user B subscribes to the same application, then user A's original subscription should become inactive). An automatic unsubscribe is also triggered when acknowledgements are supported for a push application and a notification comes back indicating that the address (e.g. PIN) for a subscriber is invalid or the subscriber has deleted the application on their device.

Important Note: This is a notification method only. If a content provider's action in this method fails, the original transaction which triggered this automatic unsubscribe will not be rolled back.

Important note: As a best practice, it is recommended that a content provider email their customer (if the email address of the customer is known), informing them of the automatic unsubscribe and recommending that the customer explicitly (if they are still in possession of the device) startup the application on the device and manually perform an unsubscribe from the menu options.

Parameters:
unsubscribeRequest - object containing unsubscribe information


Copyright © 2011 Research In Motion. All Rights Reserved.