1 package fr.ifremer.quadrige2.core.service.technical; 2 3 /*- 4 * #%L 5 * Quadrige2 Core :: Quadrige2 Core Shared 6 * $Id:$ 7 * $HeadURL:$ 8 * %% 9 * Copyright (C) 2017 Ifremer 10 * %% 11 * This program is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Affero General Public License as published by 13 * the Free Software Foundation, either version 3 of the License, or 14 * (at your option) any later version. 15 * 16 * This program is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU Affero General Public License 22 * along with this program. If not, see <http://www.gnu.org/licenses/>. 23 * #L% 24 */ 25 26 27 import org.springframework.cache.Cache; 28 29 /** 30 * <p>CacheService interface.</p> 31 * 32 */ 33 public interface CacheService { 34 35 /** 36 * Clear all caches declared in EhCache config. 37 */ 38 void clearAllCaches(); 39 40 /** 41 * Clear a specific cache declared in EhCache config, using a cache name.</br> 42 * If the cache does not exists, it just log a message (warn level). 43 * 44 * @param cacheName The cache name (or region name) using by EhCache 45 */ 46 void clearCache(String cacheName); 47 48 /** 49 * Retrieve spring-cache, or null if not exists 50 * 51 * @param cacheName a {@link java.lang.String} object. 52 * @return a {@link org.springframework.cache.Cache} object. 53 */ 54 Cache getCache(String cacheName); 55 }