sharedCache.keySet¶
Signature: sharedCache.keySet(namespace*, global*, persist*)
Returns: Set<java.lang.Object> keys - the Set of keys for the Shared Cache
Get the shared cache keySet associated with the namespace.
When no namespace is specified, only the keys set in the current channel are returned. When a namespace is specified, the keys stored under that namespace across the same zone are returned. When global is set to true, the keys 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 set of keys stored in the shared cache.
// Populate the shared cache
var simpleString = "I am just a simple String";
var hashMap = new java.util.HashMap();
hashMap.put("Today", new java.util.Date(qie.getSystemTimeMilliseconds()));
hashMap.put("Jon's Bday", qie.deduceDate("2001-09-17"));
sharedCache.setValue("the map", hashMap, 600);
sharedCache.setValue("simple", simpleString);
// Get the set of keys in the shared cache
var keySet = sharedCache.keySet(); // Set<java.lang.Object>
// Note: order is not guaranteed