class CachesResource {

    @GET
    public List<Cache> getCaches() {
        LOG.debug("GET Caches");

        String[] cacheNames = MANAGER.getCacheNames();

        List<Cache> cacheList = new ArrayList<Cache>();

        for (String cacheName : cacheNames) {
            Ehcache ehcache = MANAGER.getCache(cacheName);
            URI cacheUri = uriInfo.getAbsolutePathBuilder().path(cacheName).build().normalize();
            Cache cache = new Cache(cacheName, cacheUri.toString(), ehcache.toString(),
                    new Statistics(ehcache.getStatistics()), ehcache.getCacheConfiguration());
            cacheList.add(cache);
        }

        return cacheList;
    }

}