net.rim.pushsdk.push.request
Interface PushRequestDAO

All Known Implementing Classes:
PushRequestMemoryDAOImpl, PushRequestRDBMSDAOImpl

public interface PushRequestDAO

Interface defining data access methods needed to manage PushRequest objects in the persistent store.

Author:
dstrelbytsky

Method Summary
 void addPushRequest(PushRequest pushRequest)
          Adds the specified push request to the persistent store.
 void deletePushRequest(String pushId)
          Deletes a push request with the given id.
 void deletePushRequests(boolean completed, String deletedBy)
          Deletes all push requests.
 void deletePushRequests(List<String> pushIds)
          Deletes push requests with the given ids.
 void deletePushRequestsByDate(Date toDate, boolean completed, String deletedBy)
          Deletes push requests that are older than the provided date.
 void deletePushRequestsByPushAppId(String pushApplicationId, boolean completed, String deletedBy)
          Deletes push requests for the specified push application.
 void deletePushRequestsByPushAppIdAndDate(String pushApplicationId, Date toDate, boolean completed, 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 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 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 org.springframework.dao.DataAccessException
Adds the specified push request to the persistent store.

Parameters:
pushRequest - the push request to create
Throws:
org.springframework.dao.DataAccessException - if any errors occur

updatePushRequest

@Deprecated
void updatePushRequest(PushRequest pushRequest)
                       throws org.springframework.dao.DataAccessException
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 status code and status description specified push request in the persistent store.

Parameters:
pushRequest - the push request to update
Throws:
org.springframework.dao.DataAccessException - if any errors occur

deletePushRequestsByPushAppIdAndDate

void deletePushRequestsByPushAppIdAndDate(String pushApplicationId,
                                          Date toDate,
                                          boolean completed,
                                          String deletedBy)
                                          throws org.springframework.dao.DataAccessException
Deletes push requests for the specified push application that are older than the provided date.

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
completed - if true, delete only completed requests
deletedBy - the id of the user deleting the push requests; used for logging purposes only
Throws:
org.springframework.dao.DataAccessException - if any errors occur

deletePushRequestsByPushAppId

void deletePushRequestsByPushAppId(String pushApplicationId,
                                   boolean completed,
                                   String deletedBy)
                                   throws org.springframework.dao.DataAccessException
Deletes push requests for the specified push application.

Parameters:
pushApplicationId - id of the push application for which the corresponding push requests should be deleted
completed - if true, delete only completed requests
deletedBy - the id of the user deleting the push requests; used for logging purposes only
Throws:
org.springframework.dao.DataAccessException - if any errors occur

deletePushRequestsByDate

void deletePushRequestsByDate(Date toDate,
                              boolean completed,
                              String deletedBy)
                              throws org.springframework.dao.DataAccessException
Deletes push requests that are older than the provided date.

Parameters:
toDate - specifies the cut off date for the push request deletion.
completed - if true, delete only completed requests
deletedBy - the id of the user deleting the push requests; used for logging purposes only
Throws:
org.springframework.dao.DataAccessException - if any errors occur

deletePushRequests

void deletePushRequests(boolean completed,
                        String deletedBy)
                        throws org.springframework.dao.DataAccessException
Deletes all push requests.

Parameters:
completed - if true, delete only completed requests
deletedBy - the id of the user deleting the push requests; used for logging purposes only
Throws:
org.springframework.dao.DataAccessException - if any errors occur

deletePushRequests

void deletePushRequests(List<String> pushIds)
                        throws org.springframework.dao.DataAccessException
Deletes push requests with the given ids.

Parameters:
pushIds - ids of the requests to be deleted
Throws:
org.springframework.dao.DataAccessException - if any errors occur

deletePushRequest

void deletePushRequest(String pushId)
                       throws org.springframework.dao.DataAccessException
Deletes a push request with the given id.

Parameters:
pushId - id of the request to be deleted
Throws:
org.springframework.dao.DataAccessException - if any errors occur

findById

PushRequest findById(String id)
                     throws org.springframework.dao.DataAccessException
Finds push request by the specified id.

Parameters:
id - id of the push request to find
Returns:
the pushRequest, null if not found
Throws:
org.springframework.dao.DataAccessException - if any errors occur

findAll

List<PushRequest> findAll()
                          throws org.springframework.dao.DataAccessException
Finds all push requests.

Returns:
list of pushRequests, empty if not found
Throws:
org.springframework.dao.DataAccessException - if any errors occur

findByAppId

List<PushRequest> findByAppId(String id)
                              throws org.springframework.dao.DataAccessException
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:
org.springframework.dao.DataAccessException - if any errors occur

findByStatusCode

@Deprecated
List<PushRequest> findByStatusCode(StatusCode statusCode)
                                   throws org.springframework.dao.DataAccessException
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:
org.springframework.dao.DataAccessException - if any errors occur

findByDateRange

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

Parameters:
fromDate - from date parameter of the range
toDate - 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:
org.springframework.dao.DataAccessException - if any errors occur

getSizeByDateRange

int getSizeByDateRange(Date fromDate,
                       Date toDate)
                       throws org.springframework.dao.DataAccessException
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 requests in the date range
Throws:
org.springframework.dao.DataAccessException - if any errors occur

findIncomplete

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

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


Copyright © 2011 Research In Motion. All Rights Reserved.