net.rim.pushsdk.push.request
Interface PushRequestService

All Known Implementing Classes:
PushRequestServiceImpl

public interface PushRequestService

Interface defining business operations to manage push requests.

Author:
dstrelbytsky

Method Summary
 void addPushRequest(PushRequest pushRequest)
          Adds the specified push request to the persistent store.
 void deleteCompletedPushRequests(String pushApplicationId, Date toDate, String deletedBy)
          Deletes completed push requests for the specified push application that are older than the provided date.
 void deletePushRequest(String pushId)
          Deletes a push request with the given push id.
 void deletePushRequests(List<String> pushIds)
          Deletes push requests with the given push ids.
 void deletePushRequests(String pushApplicationId, Date toDate, String deletedBy)
          Deletes push requests for the specified push application that are older than the provided date.
 List<PushRequest> findAll()
          Finds all push requests.
 List<PushRequest> findByAppId(String id)
          Finds all push requests associated with a specified push application.
 List<PushRequest> findByDateRange(Date fromDate, Date toDate, int startIndex, int endIndex)
          Finds all push requests by the specified date range.
 PushRequest findById(String id)
          Finds a push request by the specified id.
 List<PushRequest> findByStatusCode(StatusCode statusCode)
          Deprecated. As of release 1.1, the StatusCode associated with the PushRequest is no longer supported since the push may be sent to both the public/BIS and enterprise/BES PPG simultaneously. Please refer to the PushRequestDetail records for the push to find out the status for each subscriber instead.
 List<PushRequest> findIncomplete(String applicationId)
          Finds all push requests that are incomplete for a given push application.
 int getSizeByDateRange(Date fromDate, Date toDate)
          Gets size of all push requests by the specified date range.
 void setPushApplicationService(PushApplicationService pushApplicationService)
          Support for dependency injection.
 void setPushRequestDAO(PushRequestDAO pushRequestDAO)
          Support for dependency injection.
 void setPushRequestDetailService(PushRequestDetailService pushRequestDetailService)
          Support for dependency injection.
 void setPushSDKProperties(PushSDKProperties pushSDKProperties)
          Support for dependency injection.
 void updatePushRequest(PushRequest pushRequest)
          Deprecated. As of release 1.1, the StatusCode associated with the PushRequest is no longer supported since the push may be sent to both the public/BIS and enterprise/BES PPG simultaneously. Please refer to the PushRequestDetail records for the push to find out the status for each subscriber instead.
 

Method Detail

addPushRequest

void addPushRequest(PushRequest pushRequest)
                    throws PushSDKException
Adds the specified push request to the persistent store.

Parameters:
pushRequest - the push request to create
Throws:
IllegalArgumentException - if any of the information passed in fails validation
PushSDKException - if any errors occur

updatePushRequest

@Deprecated
void updatePushRequest(PushRequest pushRequest)
                       throws PushSDKException
Deprecated. As of release 1.1, the StatusCode associated with the PushRequest is no longer supported since the push may be sent to both the public/BIS and enterprise/BES PPG simultaneously. Please refer to the PushRequestDetail records for the push to find out the status for each subscriber instead.

Updates the specified push request status and status description (no push request details are updated) in the persistent store.

Parameters:
pushRequest - the push request to update
Throws:
IllegalArgumentException - if any of the information passed in fails validation
PushSDKException - if any errors occur

deletePushRequests

void deletePushRequests(String pushApplicationId,
                        Date toDate,
                        String deletedBy)
                        throws PushSDKException
Deletes push requests for the specified push application that are older than the provided date. If push application id is null, all push requests older than the the specified date will be deleted. If the provided date is null, all push requests for the specified push application will be deleted.

Parameters:
pushApplicationId - id of the push application for which the corresponding push requests should be deleted
toDate - specifies the cut off date for the push request deletion
deletedBy - the id of the user deleting the push requests; used for logging purposes only
Throws:
PushSDKException - if any errors occur

deleteCompletedPushRequests

void deleteCompletedPushRequests(String pushApplicationId,
                                 Date toDate,
                                 String deletedBy)
                                 throws PushSDKException
Deletes completed push requests for the specified push application that are older than the provided date. If push application id is null, all push requests older than the the specified date will be deleted. If the provided date is null, all push requests for the specified push application will be deleted.

Parameters:
pushApplicationId - id of the push application for which the corresponding push requests should be deleted
toDate - specifies the cut off date for the push request deletion
deletedBy - the id of the user deleting the push requests; used for logging purposes only
Throws:
PushSDKException - if any errors occur

deletePushRequests

void deletePushRequests(List<String> pushIds)
                        throws PushSDKException
Deletes push requests with the given push ids.

Parameters:
pushIds - ids of the requests to be deleted
Throws:
PushSDKException - if any errors occur

deletePushRequest

void deletePushRequest(String pushId)
                       throws PushSDKException
Deletes a push request with the given push id.

Parameters:
pushId - id of the request to be deleted
Throws:
PushSDKException - if any errors occur

findById

PushRequest findById(String id)
                     throws PushSDKException
Finds a push request by the specified id.

Parameters:
id - id of the push request to find
Returns:
the pushRequest, null if not found
Throws:
PushSDKException - if any errors occur

findAll

List<PushRequest> findAll()
                          throws PushSDKException
Finds all push requests.

Returns:
list of pushRequests, empty if not found
Throws:
PushSDKException - if any errors occur

findByAppId

List<PushRequest> findByAppId(String id)
                              throws PushSDKException
Finds all push requests associated with a specified push application.

Parameters:
id - id of the push application
Returns:
list of pushRequests, empty if not found
Throws:
PushSDKException - if any errors occur

findByStatusCode

@Deprecated
List<PushRequest> findByStatusCode(StatusCode statusCode)
                                   throws PushSDKException
Deprecated. As of release 1.1, the StatusCode associated with the PushRequest is no longer supported since the push may be sent to both the public/BIS and enterprise/BES PPG simultaneously. Please refer to the PushRequestDetail records for the push to find out the status for each subscriber instead.

Finds all push requests by the specified status code.

Parameters:
statusCode - status code of the push request
Returns:
list of pushRequests, empty if not found
Throws:
PushSDKException - if any errors occur

findIncomplete

List<PushRequest> findIncomplete(String applicationId)
                                 throws PushSDKException
Finds all push requests that are incomplete for a given push application. In other words, finds all push requests for a given push application that have at least one push request detail (one address) that is still in a pending state.

Note: This method will only return push requests where the push application has a service level of 'Push Plus' and has its 'storePushRequests' flag set to 'true'.

Note: A large number of push request/push request details in the persistent store may make this query take a long time to complete.

Parameters:
applicationId - application for which to find the incomplete pushes
Returns:
list of incomplete push requests
Throws:
PushSDKException - if any errors occur
Since:
1.0.1

findByDateRange

List<PushRequest> findByDateRange(Date fromDate,
                                  Date toDate,
                                  int startIndex,
                                  int endIndex)
                                  throws PushSDKException
Finds all push requests by the specified date range.

Parameters:
fromDate - inclusive from date parameter of the range
toDate - inclusive to date parameter of the range
startIndex - the index of the first entry to be retrieved
endIndex - the index of the last entry to be retrieved
Returns:
list of pushRequests, empty if not found
Throws:
PushSDKException - if any errors occur

getSizeByDateRange

int getSizeByDateRange(Date fromDate,
                       Date toDate)
                       throws PushSDKException
Gets size of all push requests by the specified date range.

Parameters:
fromDate - inclusive from date parameter of the range
toDate - inclusive to date parameter of the range
Returns:
number of push requests in the date range
Throws:
PushSDKException - if any errors occur

setPushRequestDAO

void setPushRequestDAO(PushRequestDAO pushRequestDAO)
Support for dependency injection. Sets the PushRequestDAO to use.

Parameters:
pushRequestDAO - an instance of a PushRequestDAO implementation

setPushRequestDetailService

void setPushRequestDetailService(PushRequestDetailService pushRequestDetailService)
Support for dependency injection. Sets the PushRequestDetailService to use.

Parameters:
pushRequestDetailService - an instance of a PushRequestDetailService implementation

setPushApplicationService

void setPushApplicationService(PushApplicationService pushApplicationService)
Support for dependency injection. Sets the PushApplicationService to use.

Parameters:
pushApplicationService - an instance of a PushApplicationService implementation

setPushSDKProperties

void setPushSDKProperties(PushSDKProperties pushSDKProperties)
Support for dependency injection. Inject an implementation of a PushSDKProperties collaborating object - this is used to read global configuration properties.

Parameters:
pushSDKProperties - an instance of a PushSDKProperties implementation (must be thread safe)


Copyright © 2011 Research In Motion. All Rights Reserved.