net.rim.pushsdk.push.request
Class PushRequestMemoryDataStore

java.lang.Object
  extended by net.rim.pushsdk.push.request.PushRequestMemoryDataStore

public class PushRequestMemoryDataStore
extends Object

Represents in-memory storage of push request data.

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

Author:
mdandrea

Constructor Summary
PushRequestMemoryDataStore()
           
 
Method Summary
 PushRequest loadFromStore(String pushId)
          Loads a push request from in-memory storage.
 List<String> loadKeysFromStore()
          Loads the keys (push ids) for the push requests currently in memory.
 PushRequest removeFromStore(String pushId)
          Removes a push request from memory.
 void saveInStore(String pushId, PushRequest pushRequest)
          Saves a push request in memory.
 void setCache(net.sf.ehcache.Cache cache)
          Sets the cache to be used for storing push request data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PushRequestMemoryDataStore

public PushRequestMemoryDataStore()
Method Detail

setCache

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

Parameters:
cache - the cache for storing push request data

loadFromStore

public PushRequest loadFromStore(String pushId)
Loads a push request from in-memory storage.

Parameters:
pushId - the id of the push
Returns:
the loaded push request

loadKeysFromStore

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

Returns:
the keys (push ids)

saveInStore

public void saveInStore(String pushId,
                        PushRequest pushRequest)
Saves a push request in memory.

Parameters:
pushId - the id of the push
pushCount - the push request to be stored

removeFromStore

public PushRequest removeFromStore(String pushId)
Removes a push request from memory.

Parameters:
pushId - the id of the push
Returns:
the push request that was removed


Copyright © 2011 Research In Motion. All Rights Reserved.