sharedCache.valueSet¶
Signature: sharedCache.valueSet(namespace*, global*, persist*)
Returns: Collection<java.lang.Object> values - the Collection of values for the Shared Cache
Get the shared cache valueSet collection associated with the namespace.
When no namespace is specified, only the values set in the current channel are returned. When a namespace is specified, the values stored under that namespace across the same zone are returned. When global is set to true, the values stored under the namespace across all zones are returned.
Note
When global is set to true, namespace becomes a required field.
Parameters¶
| Type | Name | Description | Default |
|---|---|---|---|
| String | namespace* | (optional) a unique string used to limit the scope of the shared cache | Channel ID |
| Boolean | global* | (optional) specifies whether or not the shared cache is a global cache | false |
| Boolean | persist* | (optional) specifies whether or not the shared cache is stored in the database | false |
Example¶
// Example: Retrieve the collection of values stored in the shared cache.
// Populate the shared cache with a namespaced entry
var map = new java.util.HashMap();
map.put("Today", new java.util.Date(qie.getSystemTimeMilliseconds()));
map.put("Jon's Bday", qie.deduceDate("2001-09-17"));
sharedCache.setValue(
"dates", // key
map, // value
600 // TTL (seconds)
);
sharedCache.setValue(
"something", // key
"important", // value
600 // TTL (seconds)
);
// Get all values from the shared cache
var values = sharedCache.valueSet(); // Collection<java.lang.Object>
// Note: order is not guaranteed and values may be of mixed types