Software AG Products 10.7 | Integrating On-Premises and Cloud Applications | Integration Server Built-In Services | Cache Folder | Summary of Elements in this Folder | pub.cache.atomic:replaceIfKeyExists
 
pub.cache.atomic:replaceIfKeyExists
WmPublic. Replaces the cached element if an element for the specified key exists in a cache.
Input Parameters
cacheManagerName
String Name of the cache manager that manages the cache. This parameter is case sensitive.
cacheName
String Name of the cache that contains the key. This parameter is case sensitive.
key
Object Key of the element whose value you want to replace.
value
Object Value with which to replace the value of the cached element.
Output Parameters
keyExists
String Indicates whether the element with the passed key exists in the cache.
*true indicates that the element with the key already exists in the cache.
*false indicates that the element with the key does not exist in the cache.
oldValue
Object Conditional. Value of the element the service replaced with value. Returned only if keyExists is true.
Usage Notes
The pub.cache.atomic:replaceIfKeyExists service replaces an element in the cache only if the specified key already exists in the cache. If an element with the specified key exists, pub.cache.atomic:replaceIfKeyExists replaces value of the cached element with the one specified in value.
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.