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("Operation not specified in the message header [" + CacheConstants.CACHE_KEY + "]");
}
if ((key == null) && (!operation.equalsIgnoreCase(CacheConstants.CACHE_OPERATION_DELETEALL))) {
throw new CacheException("Cache Key is not specified in message header header or endpoint URL.");
}
performCacheOperation(exchange, operation, key);
}