String key = exchange.getIn().getHeader(CacheConstants.CACHE_KEY, String.class);
String operation = exchange.getIn().getHeader(CacheConstants.CACHE_OPERATION, String.class);
if (operation == null) {
throw new CacheException(CacheConstants.CACHE_OPERATION + " header not specified in message");
}
if ((key == null) && (!operation.equalsIgnoreCase(CacheConstants.CACHE_OPERATION_DELETEALL))) {
throw new CacheException(CacheConstants.CACHE_KEY + " is not specified in message header or endpoint URL.");
}
performCacheOperation(exchange, operation, key);
//cleanup the cache headers