ApiEnv.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.config.rs.server.api.impl.api;

  21. import org.openspcoop2.core.config.rs.server.api.impl.Environment;
  22. import org.openspcoop2.core.config.rs.server.api.impl.Helper;
  23. import org.openspcoop2.core.registry.driver.IDAccordoFactory;
  24. import org.openspcoop2.utils.service.beans.ProfiloEnum;
  25. import org.openspcoop2.utils.service.context.IContext;
  26. import org.openspcoop2.web.ctrlstat.servlet.apc.AccordiServizioParteComuneCore;
  27. import org.openspcoop2.web.ctrlstat.servlet.apc.AccordiServizioParteComuneHelper;
  28. import org.openspcoop2.web.ctrlstat.servlet.archivi.ArchiviCore;

  29. /**
  30.  * ApiEnv
  31.  *
  32.  * @author $Author$
  33.  * @version $Rev$, $Date$
  34.  *
  35.  */
  36. public class ApiEnv extends Environment {
  37.    
  38.     public final AccordiServizioParteComuneCore apcCore;
  39.     public final AccordiServizioParteComuneHelper apcHelper;
  40.     public final ArchiviCore archiviCore;
  41.     public final IDAccordoFactory idAccordoFactory = IDAccordoFactory.getInstance();
  42.    
  43.     public final boolean gestisciSoggettoReferente;
  44.    
  45.     ApiEnv(ProfiloEnum profilo, String soggetto, IContext ctx) throws Exception {
  46.         super(ctx.getServletRequest(), profilo, soggetto, ctx);
  47.        
  48.         if (profilo == null)
  49.             profilo = Helper.getProfiloDefault();
  50.        
  51.         //soggetto =
  52.         Helper.getSoggettoOrDefault(soggetto, profilo);
  53.        
  54.         this.apcCore = new AccordiServizioParteComuneCore(this.stationCore);
  55.         this.apcHelper = new AccordiServizioParteComuneHelper(this.stationCore, this.requestWrapper, this.pd, ctx.getServletRequest().getSession());
  56.         this.archiviCore = new ArchiviCore(this.stationCore);
  57.                
  58.         this.gestisciSoggettoReferente =  this.apcCore.isSupportatoSoggettoReferente(this.tipo_protocollo);
  59.        
  60.     }

  61. }