IProvider.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.core.mvc.properties.provider;

  21. import java.util.List;
  22. import java.util.Map;
  23. import java.util.Properties;

  24. import org.openspcoop2.core.mvc.properties.Item;

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

  33.     public default void validateId(String name) throws ProviderException, ProviderValidationException { }
  34.     public default void validateDescription(String description) throws ProviderException, ProviderValidationException { }
  35.    
  36.     public void validate(Map<String, Properties> mapProperties) throws ProviderException, ProviderValidationException;
  37.    
  38.     public List<String> getValues(String id) throws ProviderException;
  39.     public default List<String> getValues(String id, ExternalResources externalResources) throws ProviderException{
  40.         return this.getValues(id);
  41.     }
  42.     public List<String> getLabels(String id) throws ProviderException;
  43.     public default List<String> getLabels(String id, ExternalResources externalResources) throws ProviderException{
  44.         return this.getLabels(id);
  45.     }
  46.    
  47.     public String getDefault(String id) throws ProviderException;
  48.     public default String getDefault(String id, ExternalResources externalResources) throws ProviderException{
  49.         return this.getDefault(id);
  50.     }
  51.    
  52.     public default String getNote(String id, String actualValue) throws ProviderException{ return null; }
  53.    
  54.     public default ProviderInfo getProviderInfo(String id) throws ProviderException{
  55.         return null;
  56.     }
  57.     public default String dynamicUpdate(List<?> items, Map<String, String> mapNameValue, Item item, String actualValue) {
  58.         return actualValue;
  59.     }
  60.     public default String dynamicUpdate(List<?> items, Map<String, String> mapNameValue, Item item, String actualValue, ExternalResources externalResources) {
  61.         return dynamicUpdate(items, mapNameValue, item, actualValue);
  62.     }
  63.    
  64. }