com.voidsearch.voidbase.apps.cache.module.messages
Class MessagePersistenceStore

java.lang.Object
  extended by com.voidsearch.voidbase.apps.cache.VoidBaseCache
      extended by com.voidsearch.voidbase.apps.cache.module.messages.MessagePersistenceStore
All Implemented Interfaces:
VoidBaseCacheHandler, java.lang.Cloneable

public class MessagePersistenceStore
extends VoidBaseCache

MessagePersistenceStore implementation of VoidBaseCache. This is a simple String key/value store on top of a BerkeleyDB.


Field Summary
protected static java.lang.String DEFAULT_STORE_PATH
           
protected static MessagePersistenceStore instance
           
protected static java.lang.String STORE
           
 
Fields inherited from class com.voidsearch.voidbase.apps.cache.VoidBaseCache
config, logger, name, operations
 
Constructor Summary
MessagePersistenceStore()
          Creates a new instance of a MessagePersistenceStore
 
Method Summary
 void delete(java.lang.String key)
          Deletes a key from a messages store
 void flush()
          Flushes a messages store
 CacheValue get(java.lang.String key)
          Returns value from a messages store
static MessagePersistenceStore getInstance()
          Creates a new instance of a MessagePersistenceStore
protected  void initializeStore()
          Initializes BDB store for message persistence
 CacheValue process(java.lang.String method, java.util.List<java.lang.String> route, java.util.Map<java.lang.String,java.lang.String> params, java.lang.String key, java.lang.String value)
          Processes cache requests
 CacheValue process(java.lang.String method, java.lang.String name, java.lang.String key, java.lang.String value)
           
 void put(java.lang.String key, java.lang.String value)
          Puts a key/value pair in messages store
 
Methods inherited from class com.voidsearch.voidbase.apps.cache.VoidBaseCache
clone, getLockType, initialize, isRegistered
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

protected static MessagePersistenceStore instance

STORE

protected static final java.lang.String STORE
See Also:
Constant Field Values

DEFAULT_STORE_PATH

protected static final java.lang.String DEFAULT_STORE_PATH
See Also:
Constant Field Values
Constructor Detail

MessagePersistenceStore

public MessagePersistenceStore()
                        throws CacheException
Creates a new instance of a MessagePersistenceStore

Throws:
CacheException
Method Detail

getInstance

public static MessagePersistenceStore getInstance()
                                           throws CacheException
Creates a new instance of a MessagePersistenceStore

Returns:
a MessagePersistenceStore instance
Throws:
CacheException

initializeStore

protected void initializeStore()
                        throws CacheException
Initializes BDB store for message persistence

Throws:
CacheException

process

public CacheValue process(java.lang.String method,
                          java.util.List<java.lang.String> route,
                          java.util.Map<java.lang.String,java.lang.String> params,
                          java.lang.String key,
                          java.lang.String value)
                   throws CacheException
Processes cache requests

Parameters:
method -
route -
params -
key -
value -
Returns:
a result of cache request operation
Throws:
CacheException

process

public CacheValue process(java.lang.String method,
                          java.lang.String name,
                          java.lang.String key,
                          java.lang.String value)
                   throws CacheException
Parameters:
method -
name -
key -
value -
Returns:
Throws:
CacheException

put

public void put(java.lang.String key,
                java.lang.String value)
         throws CacheException
Puts a key/value pair in messages store

Parameters:
key -
value -
Throws:
CacheException

get

public CacheValue get(java.lang.String key)
               throws CacheException
Returns value from a messages store

Parameters:
key -
Returns:
value from a messages store
Throws:
CacheException

delete

public void delete(java.lang.String key)
            throws CacheException
Deletes a key from a messages store

Parameters:
key -
Throws:
CacheException

flush

public void flush()
           throws CacheException
Flushes a messages store

Throws:
CacheException


Copyright © 2009. All Rights Reserved.