net.rim.pushsdk.push.request
Interface PushRequestDetailService

All Known Implementing Classes:
PushRequestDetailServiceImpl

public interface PushRequestDetailService

Interface defining business operations to manage push request details.

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 created-date range.
 List<PushRequestDetail> findById(String id)
          Finds all the 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 push request details by the specified push request and addresses.
 List<PushRequestDetail> findByIdAndStates(String id, List<MessageState> states)
          Finds all the push request details for the specific push request and given states.
 List<PushRequestDetail> findByIdAndStatusCode(String id, StatusCode statusCode)
          Finds all the 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 subscriber ids.
 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 the 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 setPushRequestDetailDAO(PushRequestDetailDAO pushRequestDetailDAO)
          Support for dependency injection.
 void setPushSDKProperties(PushSDKProperties pushSDKProperties)
          Support for dependency injection.
 void updatePushRequestDetail(PushRequestDetail pushRequestDetail)
          Updates the specified push request detail in the persistent store.
 void updatePushRequestDetail(ResultNotification resultNotification)
          Updates the push request detail based on the specified resultNotification.
 void updatePushRequestDetails(List<ResultNotification> resultNotifications)
          Updates the push request details based on the specified list of resultNotifications.
 

Method Detail

addPushRequestDetail

void addPushRequestDetail(PushRequestDetail pushRequestDetail)
                          throws PushSDKException
Adds the specified push request detail to the persistent store.

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

addPushRequestDetails

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

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

updatePushRequestDetail

void updatePushRequestDetail(ResultNotification resultNotification)
                             throws PushSDKException
Updates the push request detail based on the specified resultNotification.

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

Parameters:
resultNotification - the result notification to update the push request detail (note that the wildcard address "*" is not supported)
Throws:
IllegalArgumentException - if any of the information passed in fails validation
PushSDKException - if any errors occur

updatePushRequestDetails

void updatePushRequestDetails(List<ResultNotification> resultNotifications)
                              throws PushSDKException
Updates the push request details based on the specified list of resultNotifications.

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

Parameters:
resultNotifications - the list of result notifications to update the corresponding push request details (note that the wildcard address "*" is supported)
Throws:
PushSDKException - if any errors occur

updatePushRequestDetail

void updatePushRequestDetail(PushRequestDetail pushRequestDetail)
                             throws PushSDKException
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 (note that the wildcard address "*" is supported by deferring to the updatePushRequestDetails(List resultNotifications) method)
Throws:
IllegalArgumentException - if any of the information passed in fails validation
PushSDKException - if any errors occur

findByIdAndAddress

PushRequestDetail findByIdAndAddress(String id,
                                     String address)
                                     throws PushSDKException
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:
PushSDKException - if any errors occur

findByIdAndAddresses

List<PushRequestDetail> findByIdAndAddresses(String id,
                                             List<String> addresses)
                                             throws PushSDKException
Finds push request details 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:
list of pushRequestDetails, empty if not found
Throws:
PushSDKException - if any errors occur

findByIdAndSubscriberIds

List<PushRequestDetail> findByIdAndSubscriberIds(String id,
                                                 List<String> subscriberIds)
                                                 throws PushSDKException
Finds push request details by the specified push request and subscriber ids.

Parameters:
id - id of the push request
subscriberIds - subscriberIds for the device the push was made to
Returns:
list of pushRequestDetails, empty if not found
Throws:
PushSDKException - if any errors occur

findById

List<PushRequestDetail> findById(String id)
                                 throws PushSDKException
Finds all the push request details for the specific push request.

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

findByIdAndStates

List<PushRequestDetail> findByIdAndStates(String id,
                                          List<MessageState> states)
                                          throws PushSDKException
Finds all the 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:
PushSDKException - if any errors occur

findByIdsAndState

Set<PushIdAndApplicationId> findByIdsAndState(List<String> ids,
                                              MessageState state)
                                              throws PushSDKException
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 PushSDKException
Finds all the 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:
PushSDKException - if any errors occur

findByIdAndStatusCode

List<PushRequestDetail> findByIdAndStatusCode(String id,
                                              StatusCode statusCode)
                                              throws PushSDKException
Finds all the 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:
PushSDKException - if any errors occur

findByDateRange

List<PushRequestDetail> findByDateRange(Date fromDate,
                                        Date toDate,
                                        int startIndex,
                                        int endIndex)
                                        throws PushSDKException
Finds all push request details by the specified created-date range.

Parameters:
fromDate - inclusive 'from' value for the created date of push request details
toDate - inclusive 'to' value for the created date of push requests details
startIndex - inclusive, zero-based start index
endIndex - inclusive, zero-based end index
Returns:
list of pushRequestDetails, empty if not found
Throws:
PushSDKException - if any errors occur

getSizeByDateRange

int getSizeByDateRange(Date fromDate,
                       Date toDate)
                       throws PushSDKException
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 push request details in the date range
Throws:
PushSDKException - if any errors occur

findIncompleteByAppIdAndSubId

List<PushRequestDetail> findIncompleteByAppIdAndSubId(String applicationId,
                                                      String subscriberId)
                                                      throws PushSDKException
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 will 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:
PushSDKException - if any errors occur
Since:
1.0.1

setPushRequestDetailDAO

void setPushRequestDetailDAO(PushRequestDetailDAO pushRequestDetailDAO)
Support for dependency injection. Sets the PushRequestDetailDAO,/code> to use.

Parameters:
pushRequestDetailDAO -

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.