org.apache.servicemix.store.krati
Class KratiStore

java.lang.Object
  extended by org.apache.servicemix.store.base.BaseStore
      extended by org.apache.servicemix.store.krati.KratiStore
All Implemented Interfaces:
java.io.Serializable, Store

public class KratiStore
extends BaseStore

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.servicemix.store.base.BaseStore
storeListeners
 
Fields inherited from interface org.apache.servicemix.store.Store
CLUSTERED, PERSISTENT, TRANSACTIONAL
 
Constructor Summary
KratiStore(krati.store.DataStore<byte[],byte[]> store)
          Constructor
KratiStore(krati.store.DataStore<byte[],byte[]> store, long timeout)
          Constructor
KratiStore(krati.store.DataStore<byte[],byte[]> store, long timeout, IdGenerator idGenerator)
          Constructor
 
Method Summary
 void delete(java.lang.String id)
           Deletes an object that has been previously stored under the specified key.
 krati.store.DataStore<byte[],byte[]> getDatas()
           
 IdGenerator getIdGenerator()
           
 boolean hasFeature(java.lang.String feature)
           Returns true if feature is provided by the store (clustered), false else.
 java.lang.Object load(java.lang.String id)
           Loads an object that has been previously stored under the specified key.
 java.lang.Object peek(java.lang.String id)
           Loads an object that has been previously stored under the specified key.
 void setDatas(krati.store.DataStore<byte[],byte[]> datas)
           
 void setIdGenerator(IdGenerator idGenerator)
           
 java.lang.String store(java.lang.Object data)
           Put an object into the store and return the unique id that may be used at a later time to retrieve the object.
 void store(java.lang.String key, java.lang.Object value)
           Put an object in the store under the given id.
 
Methods inherited from class org.apache.servicemix.store.base.BaseStore
addListener, fireAddedEvent, fireEvictedEvent, fireRemovedEvent, getStoreListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KratiStore

public KratiStore(krati.store.DataStore<byte[],byte[]> store)
Constructor

Parameters:
store -

KratiStore

public KratiStore(krati.store.DataStore<byte[],byte[]> store,
                  long timeout)
Constructor

Parameters:
store -
timeout -

KratiStore

public KratiStore(krati.store.DataStore<byte[],byte[]> store,
                  long timeout,
                  IdGenerator idGenerator)
Constructor

Parameters:
store -
timeout -
Method Detail

hasFeature

public boolean hasFeature(java.lang.String feature)

Returns true if feature is provided by the store (clustered), false else.

Parameters:
feature - the feature.
Returns:
true if the given feature is provided by the store, false else.

store

public void store(java.lang.String key,
                  java.lang.Object value)

Put an object in the store under the given id. This method must be used with caution and the behavior is unspecified if an object already exist for the same id.

Parameters:
id - the id of the object to store
data - the object to store
Throws:
java.io.IOException - if an error occurs

store

public java.lang.String store(java.lang.Object data)
                       throws java.io.IOException

Put an object into the store and return the unique id that may be used at a later time to retrieve the object.

Parameters:
data - the object to store
Returns:
the id of the object stored
Throws:
java.io.IOException - if an error occurs

load

public java.lang.Object load(java.lang.String id)
                      throws java.io.IOException

Loads an object that has been previously stored under the specified key. The object is removed from the store.

Parameters:
id - the id of the object
Returns:
the object, or null> if the object could not be found
Throws:
java.io.IOException - if an error occurs

peek

public java.lang.Object peek(java.lang.String id)
                      throws java.io.IOException

Loads an object that has been previously stored under the specified key. The object is not removed from the store.

Parameters:
id - the id of the object
Returns:
the object, or null if the object could not be found
Throws:
java.io.IOException - if an error occurs

delete

public void delete(java.lang.String id)
            throws java.lang.Exception

Deletes an object that has been previously stored under the specified key.

Parameters:
id - the id of the object
Throws:
java.lang.Exception - if an error occurs

getDatas

public krati.store.DataStore<byte[],byte[]> getDatas()

setDatas

public void setDatas(krati.store.DataStore<byte[],byte[]> datas)

getIdGenerator

public IdGenerator getIdGenerator()

setIdGenerator

public void setIdGenerator(IdGenerator idGenerator)


Copyright © 2005-2011 FuseSource. All Rights Reserved.