Integration Server 10.5 | Built-In Services Reference Guide | Cache Folder | Summary of Elements in this Folder | pub.cache.atomic:putIfAbsent
 
pub.cache.atomic:putIfAbsent
WmPublic. Adds an element to the cache if the cache does not contain an element with the specified key.
Input Parameters
cacheManagerName
String Name of the cache manager that manages the cache. This parameter is case sensitive.
cacheName
String Name of the cache to which to add the element. This parameter is case sensitive.
key
Object Key of the element.
value
Object Value to add to the element.
Output Parameters
keyExists
String Indicates whether an element with the specified key exists in the cache.
*true indicates that an element with the key already exists in the cache.
*false indicates that an element with the key does not exist in the cache.
oldValue
Object Conditional. Value of the element that already exists in the cache. Returned only if keyExists is true.
Usage Notes
The pub.cache.atomic:putIfAbsent service adds the specified value to the cache only if the specified key does not already exist in the cache. If the specified key already exists in the cache, pub.cache.atomic:putIfAbsent returns true for keyExists and the value of the cached element for oldValue.
Integration Server issues a ServiceException in the following cases:
*If you do not specify all required input parameters.
*If Integration Server cannot find the specified cache manager or cache.
*If a cache operation fails.