String key = (String) exchange.getIn().getHeader("CACHE_KEY");
String operation = (String) exchange.getIn().getHeader("CACHE_OPERATION");
if (operation == null) {
throw new CacheException("Operation property is not specified in the incoming exchange header."
+ "A valid Operation property must be set to ADD, UPDATE, DELETE, DELETEALL");
}
if ((key == null) && (!operation.equalsIgnoreCase("DELETEALL"))) {
throw new CacheException("Cache Key is not specified in exchange either header or URL. Unable to add objects to the cache without a Key");
}
performCacheOperation(operation, key, buffer);
}