/** {@inheritDoc} */ @Override public void updateCacheManager(UriInfo info, CacheManagerEntity resource) { LOG.info(String.format("Invoking updateCacheManager: %s", info.getRequestUri())); validator.validate(info); String cacheManagerName = info.getPathSegments().get(1).getMatrixParameters().getFirst("names"); try { cacheMgrSvc.updateCacheManager(cacheManagerName, resource); } catch (ServiceExecutionException e) { LOG.error("Failed to update cache manager.", e.getCause()); throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST).entity(e.getCause().getMessage()).build()); } }
/** {@inheritDoc} */ @Override public void createOrUpdateCache(final UriInfo info, CacheEntity resource) { LOG.debug( String.format( "Invoking CachesResourceServiceImpl.createOrUpdateCache: %s", info.getRequestUri())); validator.validate(info); String cacheManagerName = info.getPathSegments().get(1).getMatrixParameters().getFirst("names"); String cacheName = info.getPathSegments().get(2).getMatrixParameters().getFirst("names"); try { cacheSvc.createOrUpdateCache(cacheManagerName, cacheName, resource); } catch (ServiceExecutionException e) { throw new ResourceRuntimeException( "Failed to create or update cache", e, Response.Status.BAD_REQUEST.getStatusCode()); } }