net.rim.pushsdk.pushappmgmt
Class PushAppMemoryDataStore

java.lang.Object
  extended by net.rim.pushsdk.pushappmgmt.PushAppMemoryDataStore

public class PushAppMemoryDataStore
extends Object

Represents in-memory storage of push application data. The in-memory storage is persisted to a disk store on shutdown and read from the disk store on startup.

Warning: For testing use only. It is not meant for production use.

Author:
mdandrea

Constructor Summary
PushAppMemoryDataStore()
           
 
Method Summary
 void destroy()
          Flushes the cache to disk.
 PushApplication loadFromStore(String appId)
          Loads a push application from in-memory storage.
 List<String> loadKeysFromStore()
          Loads the keys (app ids) for the push applications currently in memory.
 PushApplication removeFromStore(String appId)
          Removes a push application from memory.
 void saveInStore(String appId, PushApplication pushApplication)
          Saves a push application in memory.
 void setCache(net.sf.ehcache.Cache cache)
          Sets the cache to be used for storing push application data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PushAppMemoryDataStore

public PushAppMemoryDataStore()
Method Detail

setCache

public void setCache(net.sf.ehcache.Cache cache)
Sets the cache to be used for storing push application data. This should not be null.

Parameters:
cache - the cache for storing push app data

destroy

public void destroy()
Flushes the cache to disk.


loadFromStore

public PushApplication loadFromStore(String appId)
Loads a push application from in-memory storage.

Parameters:
appId - the id of the push application to lookup
Returns:
the loaded push application

loadKeysFromStore

public List<String> loadKeysFromStore()
Loads the keys (app ids) for the push applications currently in memory.

Returns:
the keys (app ids)

saveInStore

public void saveInStore(String appId,
                        PushApplication pushApplication)
Saves a push application in memory.

Parameters:
appId - the id of the push application
pushApplication - the push application to be stored

removeFromStore

public PushApplication removeFromStore(String appId)
Removes a push application from memory.

Parameters:
appId - the id of the push application
Returns:
the push application that was removed


Copyright © 2011 Research In Motion. All Rights Reserved.