ICacheImpl.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */

  20. package org.openspcoop2.utils.cache;

  21. import java.io.OutputStream;
  22. import java.io.Serializable;
  23. import java.util.List;

  24. import org.openspcoop2.utils.UtilsException;

  25. /**
  26.  * ICacheImpl
  27.  *
  28.  * @author Poli Andrea (apoli@link.it)
  29.  * @author $Author$
  30.  * @version $Rev$, $Date$
  31.  */
  32. public interface ICacheImpl {

  33.     public CacheType getType();
  34.     public String getName();
  35.    
  36.     //  *** Inizializzazione ***
  37.    
  38.     public int getCacheSize();
  39.     public void setCacheSize(int cacheSize);
  40.    
  41.     public CacheAlgorithm getCacheAlgoritm();
  42.     public void setCacheAlgoritm(CacheAlgorithm cacheAlgoritm);
  43.    
  44.     public long getItemIdleTime() throws UtilsException;
  45.     public void setItemIdleTime(long itemIdleTimeCache) throws UtilsException;

  46.     public long getItemLifeTime() throws UtilsException;
  47.     public boolean isEternal() throws UtilsException;
  48.     public void setItemLifeTime(long itemLifeTimeCache) throws UtilsException;
  49.    
  50.     public void build() throws UtilsException;
  51.    
  52.    
  53.     //  *** Gestione ***
  54.    
  55.     public void clear() throws UtilsException;
  56.    
  57.     public Object get(String key);
  58.    
  59.     public void remove(String key) throws UtilsException;
  60.    
  61.     public void put(String key,org.openspcoop2.utils.cache.CacheResponse value) throws UtilsException;
  62.     public void put(String key,Serializable value) throws UtilsException;
  63.    
  64.     public int getItemCount()  throws UtilsException;
  65.    
  66.     public List<String> keys() throws UtilsException;
  67.    
  68.    
  69.     //  *** Info ***
  70.    
  71.     public String printStats(String separator) throws UtilsException;
  72.    
  73.     public void printStats(OutputStream out, String separator) throws UtilsException;
  74.    
  75.     public String printKeys(String separator) throws UtilsException;
  76.        
  77.    
  78.     //  *** Sincronizzazione ***
  79.    
  80.     @Deprecated
  81.     public default void disableSyncronizedGet() throws UtilsException{
  82.     }
  83.     @Deprecated
  84.     public default boolean isDisableSyncronizedGet() throws UtilsException{
  85.         return false;
  86.     }
  87.     @Deprecated
  88.     public default void enableDebugSystemOut() throws UtilsException {
  89.     }
  90.     @Deprecated
  91.     public default boolean isEnableDebugSystemOut() throws UtilsException {
  92.         return false;
  93.     }
  94. }