net.rim.pushsdk.push.request
Interface PushRequestDetailDAO

All Known Implementing Classes:
PushRequestDetailMemoryDAOImpl, PushRequestDetailRDBMSDAOImpl

public interface PushRequestDetailDAO

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

Author:
dstrelbytsky

Method Summary
 void addPushRequestDetail(PushRequestDetail pushRequestDetail)
          Adds the specified push request detail to the persistent store.
 void addPushRequestDetails(List<PushRequestDetail> pushRequestDetails)
          Adds the specified push request details to the persistent store.
 List<PushRequestDetail> findByDateRange(Date fromDate, Date toDate, int startIndex, int endIndex)
          Finds all push request details by the specified date range.
 List<PushRequestDetail> findById(String id)
          Finds all push request details for the specific push request.
 PushRequestDetail findByIdAndAddress(String id, String address)
          Finds a push request detail by the specified push request and address.
 List<PushRequestDetail> findByIdAndAddresses(String id, List<String> addresses)
          Finds a push request detail by the specified push request and addresses.
 List<PushRequestDetail> findByIdAndStates(String id, List<MessageState> states)
          Finds all push request details for the specific push request and given states.
 List<PushRequestDetail> findByIdAndStatusCode(String id, StatusCode statusCode)
          Finds all push request details with the given status code for a specific push request.
 List<PushRequestDetail> findByIdAndSubscriberIds(String id, List<String> subscriberIds)
          Finds push request details by the specified push request and subscriberIds.
 Set<PushIdAndApplicationId> findByIdsAndState(List<String> ids, MessageState state)
          Finds push ids and application ids for the specific push requests and given state.
 List<PushRequestDetail> findByStatusCode(StatusCode statusCode, int startIndex, int endIndex)
          Finds all push request details by the specified status code.
 List<PushRequestDetail> findIncompleteByAppIdAndSubId(String applicationId, String subscriberId)
          Finds all push requests that are incomplete for a specific subscriber id and push application.
 int getSizeByDateRange(Date fromDate, Date toDate)
          Gets size of all push request details by the specified date range.
 void updatePushRequestDetail(PushRequestDetail pushRequestDetail)
          Updates the specified push request detail in the persistent store.
 void updatePushRequestDetails(List<PushRequestDetail> pushRequestDetails)
          Updates the specified list of push request details in the persistent store.
 void updatePushRequestDetailsWithoutAddresses(List<PushRequestDetail> pushRequestDetails)
          Updates the specified list of push request details in the persistent store.
 

Method Detail

addPushRequestDetail

void addPushRequestDetail(PushRequestDetail pushRequestDetail)
                          throws org.springframework.dao.DataAccessException
Adds the specified push request detail to the persistent store.

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

addPushRequestDetails

void addPushRequestDetails(List<PushRequestDetail> pushRequestDetails)
                           throws org.springframework.dao.DataAccessException
Adds the specified push request details to the persistent store.

Parameters:
pushRequestDetails - the list of push request details to create
Throws:
org.springframework.dao.DataAccessException - if any errors occur

updatePushRequestDetail

void updatePushRequestDetail(PushRequestDetail pushRequestDetail)
                             throws org.springframework.dao.DataAccessException
Updates the specified push request detail in the persistent store.

Note: Not all fields are updated, only the following fields are: messageState, statusCode, statusDesc, senderName, senderAddress and completedDate.

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

updatePushRequestDetails

void updatePushRequestDetails(List<PushRequestDetail> pushRequestDetails)
                              throws org.springframework.dao.DataAccessException
Updates the specified list of push request details in the persistent store.

Note: Not all fields are updated, only the following fields are: messageState, statusCode, statusDesc, senderName, senderAddress and completedDate.

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

updatePushRequestDetailsWithoutAddresses

void updatePushRequestDetailsWithoutAddresses(List<PushRequestDetail> pushRequestDetails)
                                              throws org.springframework.dao.DataAccessException
Updates the specified list of push request details in the persistent store.

For each given PushRequestDetail, updates all details in the store with the same push-id, regardless of address.

Note: Not all fields are updated, only the following fields are: messageState, statusCode, statusDesc, senderName, senderAddress and completedDate.

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

findByIdAndAddress

PushRequestDetail findByIdAndAddress(String id,
                                     String address)
                                     throws org.springframework.dao.DataAccessException
Finds a push request detail by the specified push request and address.

Parameters:
id - id of the push request
address - address for the device the push was made to
Returns:
the pushRequestDetail, null if not found
Throws:
org.springframework.dao.DataAccessException - if any errors occur

findByIdAndAddresses

List<PushRequestDetail> findByIdAndAddresses(String id,
                                             List<String> addresses)
                                             throws org.springframework.dao.DataAccessException
Finds a push request detail by the specified push request and addresses.

Parameters:
id - id of the push request
addresses - addresses for the device the push was made to
Returns:
the pushRequestDetails, empty if none found
Throws:
org.springframework.dao.DataAccessException - if any errors occur

findByIdAndSubscriberIds

List<PushRequestDetail> findByIdAndSubscriberIds(String id,
                                                 List<String> subscriberIds)
                                                 throws org.springframework.dao.DataAccessException
Finds push request details by the specified push request and subscriberIds.

Parameters:
id - id of the push request
subscriberIds - subscriberIds for the device the push was made to
Returns:
the pushRequestDetails, empty if none found
Throws:
org.springframework.dao.DataAccessException - if any errors occur

findById

List<PushRequestDetail> findById(String id)
                                 throws org.springframework.dao.DataAccessException
Finds all push request details for the specific push request.

Parameters:
id - id of the push request
Returns:
list of pushRequestDetails, empty if not found
Throws:
org.springframework.dao.DataAccessException - if any errors occur

findByIdAndStates

List<PushRequestDetail> findByIdAndStates(String id,
                                          List<MessageState> states)
                                          throws org.springframework.dao.DataAccessException
Finds all push request details for the specific push request and given states.

Parameters:
id - id of the push request
states - a list of message states
Returns:
list of pushRequestDetails, empty if not found
Throws:
org.springframework.dao.DataAccessException - if any errors occur

findByIdsAndState

Set<PushIdAndApplicationId> findByIdsAndState(List<String> ids,
                                              MessageState state)
Finds push ids and application ids for the specific push requests and given state.

Parameters:
ids - ids of the push requests
state - a message state
Returns:
list of PushIdAndApplicationId, empty if not found
Throws:
PushSDKException - if any errors occur

findByStatusCode

List<PushRequestDetail> findByStatusCode(StatusCode statusCode,
                                         int startIndex,
                                         int endIndex)
                                         throws org.springframework.dao.DataAccessException
Finds all push request details by the specified status code.

Parameters:
statusCode - status code of the push request details to look up
startIndex - the index of the first entry to be retrieved
endIndex - the index of the last entry to be retrieved
Returns:
list of pushRequestDetails, empty if not found
Throws:
org.springframework.dao.DataAccessException - if any errors occur

findByIdAndStatusCode

List<PushRequestDetail> findByIdAndStatusCode(String id,
                                              StatusCode statusCode)
                                              throws org.springframework.dao.DataAccessException
Finds all push request details with the given status code for a specific push request.

Parameters:
id - id of the push request
statusCode - status code of the push request details to look up
Returns:
list of pushRequestDetails, empty if not found
Throws:
org.springframework.dao.DataAccessException - if any errors occur

findByDateRange

List<PushRequestDetail> findByDateRange(Date fromDate,
                                        Date toDate,
                                        int startIndex,
                                        int endIndex)
                                        throws org.springframework.dao.DataAccessException
Finds all push request details 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 pushRequestDetails, 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 request details 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 details in the date range
Throws:
org.springframework.dao.DataAccessException - if any errors occur

findIncompleteByAppIdAndSubId

List<PushRequestDetail> findIncompleteByAppIdAndSubId(String applicationId,
                                                      String subscriberId)
                                                      throws org.springframework.dao.DataAccessException
Finds all push requests that are incomplete for a specific subscriber id and push application. In other words, finds all push requests for a given subscriber for a given push application that is still in a pending state.

Note: This method will only return push request details where the push application is of type 'Push Plus' and has its 'storePushRequests' flag set to 'true'.

If the original push request was not accepted by the PPG, there may be no details to return.

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
subscriberId - the subscriber id for which to find incomplete pushes
Returns:
list of incomplete push request details
Throws:
org.springframework.dao.DataAccessException - if any errors occur
Since:
1.0.1


Copyright © 2011 Research In Motion. All Rights Reserved.