net.rim.pushsdk.pushappmgmt
Class PushAppMemoryDAOImpl

java.lang.Object
  extended by net.rim.pushsdk.pushappmgmt.PushAppMemoryDAOImpl
All Implemented Interfaces:
PushApplicationDAO

public class PushAppMemoryDAOImpl
extends Object
implements PushApplicationDAO

In-memory implementation of the PushApplicationDAO interface.

Warning: This class is not intended for production use.

Dependencies that must be injected to properly initialize this object for use:
- pushAppMemoryDataStore
- subMemoryDataStore
- pushCountMemoryDataStore
- pushRequestMemoryDataStore
- pushRequestDetailMemoryDataStore
- pushStatsMemoryDataStore

Author:
mdicesare

Constructor Summary
PushAppMemoryDAOImpl()
           
 
Method Summary
 void addPushApplication(PushApplication pushApplication)
          Adds the specified push application to the persistent store.
 void changePushApplicationCredentials(String id, String newUsername, String newPassword, String modifiedBy)
          Deprecated. 
 void changePushApplicationEnterpriseCredentials(String id, String newUsername, String newPassword, String modifiedBy)
          Change the enterprise username and password of a push application that has a type of Enterprise Push or Public+Enterprise Push.
 void changePushApplicationPublicCredentials(String id, String newPassword, String modifiedBy)
          Change the public password of a push application that has a type of Public Push, Web Signal, or Public+Enterprise Push.
 void changePushApplicationTypeFromEnterpriseToPublicAndEnterprise(String id, String publicPassword, String publicNotifyUrl, String modifiedBy)
          Changes the type of a push application from Enterprise Push to Public+Enterprise Push.
 void changePushApplicationTypeFromPublicToPublicAndEnterprise(String id, String enterpriseUsername, String enterprisePassword, String enterpriseNotifyUrl, String modifiedBy)
          Changes the type of a push application from Public Push to Public+Enterprise Push.
 void deletePushApplication(String id, String deletedBy)
          Warning!
Removes a push application entirely and permanently from the persistent store (and any related entities if a foreign key cascading relationship exists).
 void disablePushApplication(String id, String modifiedBy)
          Disables (sets to inactive) a push application.
 void enablePushApplication(String id, Date expiryDate, String modifiedBy)
          Enables (sets to active) a push application.
 void enablePushApplication(String id, String modifiedBy)
          Enables (sets to active) a push application.
 List<PushApplication> findAll()
          Finds a list of all the push applications in storage.
 PushApplication findById(String id)
          Finds the push application with the specified push application id.
 PushApplication findByName(String name)
          Finds the push application with the specified name.
 List<PushApplication> findByStatus(PushApplicationStatus status)
          Finds a list of push applications with the specified status.
 List<PushApplication> findByType(PushApplicationType type)
          Finds a list of push applications with the specified type.
 void setPushAppMemoryDataStore(PushAppMemoryDataStore pushAppMemoryDataStore)
          Sets the in-memory data store to use for storing push applications.
 void setPushCountMemoryDataStore(PushCountMemoryDataStore pushCountMemoryDataStore)
          Sets the in-memory data store to use for storing push counts.
 void setPushRequestDetailMemoryDataStore(PushRequestDetailMemoryDataStore pushRequestDetailMemoryDataStore)
          Sets the in-memory data store to use for storing push request details.
 void setPushRequestMemoryDataStore(PushRequestMemoryDataStore pushRequestMemoryDataStore)
          Sets the in-memory data store to use for storing push requests.
 void setPushSDKProperties(PushSDKProperties pushSDKProperties)
          Deprecated. 
 void setPushStatsMemoryDataStore(PushStatsMemoryDataStore pushStatsMemoryDataStore)
          Sets the in-memory data store to use for storing push stats.
 void setSubMemoryDataStore(SubMemoryDataStore subMemoryDataStore)
          Sets the in-memory data store to use for storing subscribers.
 void updatePushApplication(PushApplication pushApplication)
          Updates the details of a push application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PushAppMemoryDAOImpl

public PushAppMemoryDAOImpl()
Method Detail

setPushSDKProperties

@Deprecated
public void setPushSDKProperties(PushSDKProperties pushSDKProperties)
Deprecated. 

Description copied from interface: PushApplicationDAO
Support for dependency injection. This will override the default PushSDKProperties implementation.

Specified by:
setPushSDKProperties in interface PushApplicationDAO

setPushAppMemoryDataStore

public void setPushAppMemoryDataStore(PushAppMemoryDataStore pushAppMemoryDataStore)
Sets the in-memory data store to use for storing push applications.

Parameters:
pushAppMemoryDataStore - push application in-memory data store

setSubMemoryDataStore

public void setSubMemoryDataStore(SubMemoryDataStore subMemoryDataStore)
Sets the in-memory data store to use for storing subscribers.

Parameters:
subMemoryDataStore - subscriber in-memory data store

setPushCountMemoryDataStore

public void setPushCountMemoryDataStore(PushCountMemoryDataStore pushCountMemoryDataStore)
Sets the in-memory data store to use for storing push counts.

Parameters:
pushCountMemoryDataStore - push count in-memory data store

setPushRequestMemoryDataStore

public void setPushRequestMemoryDataStore(PushRequestMemoryDataStore pushRequestMemoryDataStore)
Sets the in-memory data store to use for storing push requests.

Parameters:
pushRequestMemoryDataStore - push request in-memory data store

setPushRequestDetailMemoryDataStore

public void setPushRequestDetailMemoryDataStore(PushRequestDetailMemoryDataStore pushRequestDetailMemoryDataStore)
Sets the in-memory data store to use for storing push request details.

Parameters:
pushRequestDetailMemoryDataStore - push request detail in-memory data store

setPushStatsMemoryDataStore

public void setPushStatsMemoryDataStore(PushStatsMemoryDataStore pushStatsMemoryDataStore)
Sets the in-memory data store to use for storing push stats.

Parameters:
pushStatsMemoryDataStore - push stats in-memory data store

addPushApplication

public void addPushApplication(PushApplication pushApplication)
                        throws org.springframework.dao.DataAccessException
Description copied from interface: PushApplicationDAO
Adds the specified push application to the persistent store.

Specified by:
addPushApplication in interface PushApplicationDAO
Parameters:
pushApplication - the push application to add
Throws:
org.springframework.dao.DataAccessException - if any errors occur

findById

public PushApplication findById(String id)
                         throws org.springframework.dao.DataAccessException
Description copied from interface: PushApplicationDAO
Finds the push application with the specified push application id.

Specified by:
findById in interface PushApplicationDAO
Parameters:
id - the id of the push application to lookup
Returns:
the push application; null if the push application is not found
Throws:
org.springframework.dao.DataAccessException - if any errors occur

findByName

public PushApplication findByName(String name)
                           throws org.springframework.dao.DataAccessException
Description copied from interface: PushApplicationDAO
Finds the push application with the specified name.

Specified by:
findByName in interface PushApplicationDAO
Parameters:
name - the name of the push application to lookup
Returns:
the push application; null if the push application is not found
Throws:
org.springframework.dao.DataAccessException - if any errors occur

findByStatus

public List<PushApplication> findByStatus(PushApplicationStatus status)
                                   throws org.springframework.dao.DataAccessException
Description copied from interface: PushApplicationDAO
Finds a list of push applications with the specified status.

Specified by:
findByStatus in interface PushApplicationDAO
Parameters:
status - the status of a push application
Returns:
a list of push applications; otherwise, an empty list, if no matches could be found
Throws:
org.springframework.dao.DataAccessException - if any errors occur

findByType

public List<PushApplication> findByType(PushApplicationType type)
                                 throws org.springframework.dao.DataAccessException
Description copied from interface: PushApplicationDAO
Finds a list of push applications with the specified type.

Specified by:
findByType in interface PushApplicationDAO
Parameters:
type - the type of a push application
Returns:
a list of push applications; otherwise, an empty list, if no matches could be found
Throws:
org.springframework.dao.DataAccessException - if any errors occur

findAll

public List<PushApplication> findAll()
                              throws org.springframework.dao.DataAccessException
Description copied from interface: PushApplicationDAO
Finds a list of all the push applications in storage.

Specified by:
findAll in interface PushApplicationDAO
Returns:
a list of push applications; otherwise, an empty list, if there are none in storage
Throws:
org.springframework.dao.DataAccessException - if any errors occur

disablePushApplication

public void disablePushApplication(String id,
                                   String modifiedBy)
                            throws org.springframework.dao.DataAccessException
Description copied from interface: PushApplicationDAO
Disables (sets to inactive) a push application.

Specified by:
disablePushApplication in interface PushApplicationDAO
Parameters:
id - the id of the push application
modifiedBy - the user that disabled the push application
Throws:
org.springframework.dao.DataAccessException - if any errors occur

enablePushApplication

public void enablePushApplication(String id,
                                  String modifiedBy)
                           throws org.springframework.dao.DataAccessException
Description copied from interface: PushApplicationDAO
Enables (sets to active) a push application. Expiry date will remain unchanged.

Specified by:
enablePushApplication in interface PushApplicationDAO
Parameters:
id - the id of the push application
modifiedBy - the user that enabled the push application
Throws:
org.springframework.dao.DataAccessException - if any errors occur

enablePushApplication

public void enablePushApplication(String id,
                                  Date expiryDate,
                                  String modifiedBy)
                           throws org.springframework.dao.DataAccessException
Description copied from interface: PushApplicationDAO
Enables (sets to active) a push application.

Specified by:
enablePushApplication in interface PushApplicationDAO
Parameters:
id - the id of the push application
expiryDate - the new expiry date for the push application
modifiedBy - the user that enabled the push application
Throws:
org.springframework.dao.DataAccessException - if any errors occur

deletePushApplication

public void deletePushApplication(String id,
                                  String deletedBy)
                           throws org.springframework.dao.DataAccessException
Description copied from interface: PushApplicationDAO
Warning!
Removes a push application entirely and permanently from the persistent store (and any related entities if a foreign key cascading relationship exists). Related entities may include any push messages sent to the push application and any subscriptions for the push application.

Specified by:
deletePushApplication in interface PushApplicationDAO
Parameters:
id - the id of the push application to remove entirely and permanently
deletedBy - an identifier that identifies the caller of this API. The deletedBy value will be placed into the log files at info level for audit purposes
Throws:
org.springframework.dao.DataAccessException - if any errors occur

changePushApplicationCredentials

@Deprecated
public void changePushApplicationCredentials(String id,
                                                        String newUsername,
                                                        String newPassword,
                                                        String modifiedBy)
                                      throws org.springframework.dao.DataAccessException
Deprecated. 

Description copied from interface: PushApplicationDAO
Change the credentials of a push application.

Specified by:
changePushApplicationCredentials in interface PushApplicationDAO
Parameters:
id - the id of the push application
newUsername - the new username for the push application (Note: for an application with a type of Public Push, this parameter is ignored, since it needs to match the id.)
newPassword - the new password for the push application
modifiedBy - the user that is changing the push application's password
Throws:
org.springframework.dao.DataAccessException - if any errors occur

changePushApplicationPublicCredentials

public void changePushApplicationPublicCredentials(String id,
                                                   String newPassword,
                                                   String modifiedBy)
                                            throws org.springframework.dao.DataAccessException
Description copied from interface: PushApplicationDAO
Change the public password of a push application that has a type of Public Push, Web Signal, or Public+Enterprise Push.

Specified by:
changePushApplicationPublicCredentials in interface PushApplicationDAO
Parameters:
id - the id of the push application
newPassword - the new password for the push application
modifiedBy - the user that is changing the push application's public credentials
Throws:
org.springframework.dao.DataAccessException - if any errors occur

changePushApplicationEnterpriseCredentials

public void changePushApplicationEnterpriseCredentials(String id,
                                                       String newUsername,
                                                       String newPassword,
                                                       String modifiedBy)
                                                throws org.springframework.dao.DataAccessException
Description copied from interface: PushApplicationDAO
Change the enterprise username and password of a push application that has a type of Enterprise Push or Public+Enterprise Push.

Specified by:
changePushApplicationEnterpriseCredentials in interface PushApplicationDAO
Parameters:
id - the id of the push application
newUsername - the new username for the push application (might be null)
newPassword - the new password for the push application (might be null)
modifiedBy - the user that is changing the push application's enterprise credentials
Throws:
org.springframework.dao.DataAccessException - if any errors occur

updatePushApplication

public void updatePushApplication(PushApplication pushApplication)
                           throws org.springframework.dao.DataAccessException
Description copied from interface: PushApplicationDAO
Updates the details of a push application. Note: This method cannot be used to update a push application's status or to change the password of a push application.

Specified by:
updatePushApplication in interface PushApplicationDAO
Parameters:
pushApplication - the updated push application
Throws:
org.springframework.dao.DataAccessException - if any errors occur

changePushApplicationTypeFromPublicToPublicAndEnterprise

public void changePushApplicationTypeFromPublicToPublicAndEnterprise(String id,
                                                                     String enterpriseUsername,
                                                                     String enterprisePassword,
                                                                     String enterpriseNotifyUrl,
                                                                     String modifiedBy)
                                                              throws org.springframework.dao.DataAccessException
Description copied from interface: PushApplicationDAO
Changes the type of a push application from Public Push to Public+Enterprise Push.

Specified by:
changePushApplicationTypeFromPublicToPublicAndEnterprise in interface PushApplicationDAO
Parameters:
id - the id of the push application
enterpriseUsername - an optional username for enterprise (BES) pushes; null if not required
enterprisePassword - an optional password for enterprise (BES) pushes; null if not required
enterpriseNotifyUrl - a full notification URL for enterprise (BES) acknowledgements; null if using a service level of Push Essentials
modifiedBy - the user that is changing the push application's type
Throws:
org.springframework.dao.DataAccessException - if any errors occur

changePushApplicationTypeFromEnterpriseToPublicAndEnterprise

public void changePushApplicationTypeFromEnterpriseToPublicAndEnterprise(String id,
                                                                         String publicPassword,
                                                                         String publicNotifyUrl,
                                                                         String modifiedBy)
                                                                  throws org.springframework.dao.DataAccessException
Description copied from interface: PushApplicationDAO
Changes the type of a push application from Enterprise Push to Public+Enterprise Push.

Specified by:
changePushApplicationTypeFromEnterpriseToPublicAndEnterprise in interface PushApplicationDAO
Parameters:
id - the id of the push application
publicPassword - a password for public (BIS) pushes
publicNotifyUrl - a notification URL fragment for public (BIS) acknowledgements; null if using a service level of Push Essentials
modifiedBy - the user that is changing the push application's type
Throws:
org.springframework.dao.DataAccessException - if any errors occur


Copyright © 2011 Research In Motion. All Rights Reserved.