| Namespace | http://www.mulesoft.org/schema/mule/objectstore |
| Schema Location | http://www.mulesoft.org/schema/mule/objectstore/current/mule-objectstore.xsd (View Schema) |
| Schema Version | 1.0 |
| Minimum Mule Version | 3.2 |
Module Overview
Generic module for accessing Object Stores.
Can be used with Mule default implementations or one can be passed via ref. It allows to store,
retrieve and remove objects from the store.
Configuration
To use the this module within a flow the namespace to the module must be included. The resulting flow will look
similar to the following:
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:objectstore="http://www.mulesoft.org/schema/mule/objectstore"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/objectstore
http://www.mulesoft.org/schema/mule/objectstore/current/mule-objectstore.xsd">
<!-- here goes your flows and configuration elements -->
</mule>
This module is configured using the config element. This element must be placed outside of your flows and at
the root of your Mule application. You can create as many configurations as you deem necessary as long as each carries
its own name.
Each message processor, message source or transformer carries a config-ref attribute that allows the invoker to
specify which configuration to use.
| Attributes |
| Type | Name | Default Value | Description | Java Type | MIME Type | Encoding |
xs:string |
name |
|
Optional. Give a name to this configuration so it can be later referenced. |
| | |
|
xs:int |
entryTtl |
|
Optional. TimeToLive for stored values in milliseconds. |
|
|
|
|
xs:int |
expirationInterval |
|
Optional. Specifies the expiration check interval in milliseconds. |
|
|
|
|
xs:int |
maxEntries |
|
Optional. Specifies the max number of entries. |
|
|
|
|
|
objectStore |
|
Optional. Reference to an Object Store bean. |
|
|
|
|
xs:string |
partition |
|
Optional. Name of the partition in the default in-memory or persistent object stores (this argument has no
meaning if the object store is passed by ref using objectStore-ref)
|
|
|
|
|
xs:boolean |
persistent |
false |
Optional. Specified whenever the required store needs to be persistent or not (this argument has no
meaning if the object store is passed by ref using objectStore-ref or no partition name is defined)
|
|
|
|
Message Processors
<objectstore:all-keys>
Returns a list of all the keys in the store.
IMPORTANT: Not all stores support this method. If the method is not supported a java.lang.UnsupportedOperationException is thrown
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
Returns
| Return Type |
Description |
| List<Serializable> |
a java.util.List with all the keys in the store. |
Exception Payloads
| Payload Class | Description |
| ObjectStoreException |
if an exception occurred while collecting the list of all keys.
|
<objectstore:contains>
Returns whether the object store contains the given key or not
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| key |
|
The identifier of the object to validate. |
String |
*/* |
UTF-8 |
Returns
| Return Type |
Description |
| boolean |
true if the object store contains the key, or false if it doesn't. |
Exception Payloads
| Payload Class | Description |
| ObjectStoreException |
if the provided key is null.
|
<objectstore:dual-store>
Store value using key, and also store key using value. If an exception is thrown rolls back both operations.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| key |
|
The identifier of the object to store |
String |
*/* |
UTF-8 |
| value |
|
The object to store. If you want this to be the payload then use value-ref="#[payload]". |
Serializable |
*/* |
|
| overwrite |
false |
Optional. True if you want to overwrite the existing object. |
boolean |
*/* |
|
Exception Payloads
| Payload Class | Description |
| ObjectStoreException |
if the given key cannot be stored or is null. |
| ObjectStoreNotAvaliableException |
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. Only thrown if overwrite is false.
|
<objectstore:remove>
Remove the object with key.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| key |
|
The identifier of the object to remove. |
String |
*/* |
UTF-8 |
| ignoreNotExists |
false |
Optional. Indicates if the operation will ignore NotExistsException from ObjectStore. |
boolean |
*/* |
|
Returns
| Return Type |
Description |
| Object |
The object that was previously stored for the given key. If the key does not exist and
ignoreNotExists is true the operation will return a null object. |
Exception Payloads
| Payload Class | Description |
| ObjectStoreException |
if the given key is null or if the store is not
available or any other implementation-specific error occurred |
| ObjectDoesNotExistException |
if no value for the given key was previously stored.
|
<objectstore:retrieve>
Retrieve the given Object.
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| key |
|
The identifier of the object to retrieve. |
String |
*/* |
UTF-8 |
| defaultValue |
|
Optional. The default value if the key does not exists. |
Object |
*/* |
|
| targetProperty |
|
Optional. The Mule Message property where the retrieved value will be stored |
String |
*/* |
UTF-8 |
| targetScope |
INVOCATION |
Optional. The Mule Message property scope, only used when targetProperty is specified |
MulePropertyScope |
*/* |
|
| muleMessage |
|
Injected Mule Message |
MuleMessage |
*/* |
|
Returns
| Return Type |
Description |
| Object |
The object associated with the given key. If no object for the given key was found
this method throws an org.mule.api.store.ObjectDoesNotExistException. |
Exception Payloads
| Payload Class | Description |
| ObjectStoreException |
if the given key is null. |
| ObjectStoreNotAvaliableException |
if the store is not available or any other
implementation-specific error occured. |
| ObjectDoesNotExistException |
if no value for the given key was previously stored.
|
<objectstore:store>
Attributes
| Name | Default Value | Description | Java Type | MIME Type | Encoding |
| config-ref |
|
Optional. Specify which configuration to use. |
|
|
|
| key |
|
The identifier of the object to store |
String |
*/* |
UTF-8 |
| value |
|
The object to store. If you want this to be the payload then use value-ref="#[payload]". |
Serializable |
*/* |
|
| overwrite |
false |
Optional. True if you want to overwrite the existing object. |
boolean |
*/* |
|
Exception Payloads
| Payload Class | Description |
| ObjectStoreException |
if the given key cannot be stored or is null. |
| ObjectStoreNotAvaliableException |
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. Only thrown if overwrite is false.
|
Message Sources
Transformers