T
- the generic type of the store's items.public interface PartitionableObjectStore<T extends Serializable> extends ObjectStore<T>
ObjectStore
which has native support for partitioning. All the methods inherited from the
ObjectStore
interface are executed against the DEFAULT_PARTITION_NAME
. Plus, this interface
adds methods to obtain the same behaviour against specific partitions.
The Mule Runtime will automatically decide when to invoke each version of each method and the partition name to use.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_PARTITION_NAME
The name of the default partition
|
Modifier and Type | Method and Description |
---|---|
List<String> |
allKeys(String partitionName) |
List<String> |
allPartitions() |
void |
clear(String partitionName)
Clears the contents of the partition, but the partition itself remains functional
|
void |
close(String partitionName)
Closes the partition of the give
partitionName |
boolean |
contains(String key,
String partitionName)
Check whether the given
partitionName already contains a value for the given key |
void |
disposePartition(String partitionName)
Disposes the given partition, releasing all associated resources and storage.
|
void |
open(String partitionName)
Open the partition of the given
partitionName |
T |
remove(String key,
String partitionName)
Remove the object with the given
key in the given partitionName |
T |
retrieve(String key,
String partitionName)
Retrieve the object stored under the given
key in the given partitionName |
Map<String,T> |
retrieveAll(String partitionName) |
void |
store(String key,
T value,
String partitionName)
Stores the given Object in the given
partitionName |
allKeys, clear, close, contains, isPersistent, open, remove, retrieve, retrieveAll, store
static final String DEFAULT_PARTITION_NAME
boolean contains(String key, String partitionName) throws ObjectStoreException
partitionName
already contains a value for the given key
key
- the identifier of the object to checktrue
if the key is stored or false
no value was stored for the key.ObjectStoreException
- if the given key is null
.ObjectStoreNotAvailableException
- if any implementation-specific error occured, e.g. when the store is not availablevoid store(String key, T value, String partitionName) throws ObjectStoreException
partitionName
key
- the identifier for value
value
- the Object to store with key
ObjectStoreException
- if the given key cannot be stored or is null
.ObjectStoreNotAvailableException
- if the store is not available or any other implementation-specific error occured.ObjectAlreadyExistsException
- if an attempt is made to store an object for a key that already has an object
associated.T retrieve(String key, String partitionName) throws ObjectStoreException
key
in the given partitionName
key
- the identifier of the object to retrieve.ObjectDoesNotExistException
.ObjectStoreException
- if the given key is null
.ObjectStoreNotAvailableException
- if the store is not available or any other implementation-specific error occured.ObjectDoesNotExistException
- if no value for the given key was previously stored.T remove(String key, String partitionName) throws ObjectStoreException
key
in the given partitionName
key
- the identifier of the object to remove.ObjectStoreException
- if the given key is null
or if the store is not available or any other
implementation-specific error occuredObjectDoesNotExistException
- if no value for the given key was previously stored.List<String> allKeys(String partitionName) throws ObjectStoreException
partitionName
currently holds values for.ObjectStoreException
- if an exception occurred while collecting the list of all keys.Map<String,T> retrieveAll(String partitionName) throws ObjectStoreException
partitionName
ObjectStoreException
- if an exception occurred while collecting the valuesList<String> allPartitions() throws ObjectStoreException
ObjectStoreException
- if an exception occurred while collecting the partition namesvoid open(String partitionName) throws ObjectStoreException
partitionName
partitionName
- the name of the partition to openObjectStoreException
- if an exception occurred while opening the partitionvoid close(String partitionName) throws ObjectStoreException
partitionName
partitionName
- the name of the partition to closeObjectStoreException
- if an exception occurred while closing the partitionvoid disposePartition(String partitionName) throws ObjectStoreException
partitionName
- the name of the partition to disposeObjectStoreException
- if an exception occurred while disposing the partitionvoid clear(String partitionName) throws ObjectStoreException
partitionName
- the name of the partitionObjectStoreException
- if an exception occurred while clearing the partitionCopyright © 2018. All rights reserved.