DatiInvocazionePortaDelegata.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.pdd.core.autorizzazione.pd;

  21. import org.openspcoop2.core.config.PortaDelegata;
  22. import org.openspcoop2.core.config.ServizioApplicativo;
  23. import org.openspcoop2.core.id.IDPortaDelegata;
  24. import org.openspcoop2.core.id.IDServizioApplicativo;
  25. import org.openspcoop2.pdd.core.autorizzazione.AbstractDatiInvocazione;

  26. /**
  27.  * DatiInvocazionePortaDelegata
  28.  *
  29.  * @author Andrea Poli (apoli@link.it)
  30.  * @author $Author$
  31.  * @version $Rev$, $Date$
  32.  */
  33. public class DatiInvocazionePortaDelegata extends AbstractDatiInvocazione {

  34.     private IDPortaDelegata idPD;
  35.     private PortaDelegata pd;
  36.    
  37.     private IDServizioApplicativo idServizioApplicativo;
  38.     private ServizioApplicativo servizioApplicativo;
  39.    
  40.     public IDPortaDelegata getIdPD() {
  41.         return this.idPD;
  42.     }
  43.     public void setIdPD(IDPortaDelegata idPD) {
  44.         this.idPD = idPD;
  45.     }

  46.     public PortaDelegata getPd() {
  47.         return this.pd;
  48.     }
  49.     public void setPd(PortaDelegata pd) {
  50.         this.pd = pd;
  51.     }

  52.     public IDServizioApplicativo getIdServizioApplicativo() {
  53.         return this.idServizioApplicativo;
  54.     }
  55.     public void setIdServizioApplicativo(IDServizioApplicativo idServizioApplicativo) {
  56.         this.idServizioApplicativo = idServizioApplicativo;
  57.     }
  58.     public ServizioApplicativo getServizioApplicativo() {
  59.         return this.servizioApplicativo;
  60.     }
  61.     public void setServizioApplicativo(ServizioApplicativo servizioApplicativo) {
  62.         this.servizioApplicativo = servizioApplicativo;
  63.     }
  64.    
  65.     public static final String APPLICATIVO_PREFIX = " IDServizioApplicativo(";
  66.     public static final String APPLICATIVO_SUFFIX = ")";
  67.    
  68.     @Override
  69.     public String getKeyCache(){
  70.         return this._toString(true);
  71.     }
  72.    
  73.     @Override
  74.     public String toString(){
  75.         return this._toString(false);
  76.     }
  77.     @Override
  78.     public String _toString(boolean keyCache){
  79.         StringBuilder bf = new StringBuilder();
  80.        
  81.         bf.append(super._toString(keyCache));
  82.        
  83.         if(this.idPD!=null){
  84.             bf.append(" IDPortaDelegata(");
  85.             bf.append(this.idPD.toString());
  86.             bf.append(")");
  87.         }
  88.        
  89.         if(keyCache==false){
  90.             if(this.pd!=null){
  91.                 bf.append(" PortaDelegata:defined");
  92.             }
  93.         }
  94.        
  95.         if(this.idServizioApplicativo!=null){
  96.             bf.append(APPLICATIVO_PREFIX);
  97.             bf.append(this.idServizioApplicativo.toString());
  98.             bf.append(APPLICATIVO_SUFFIX);
  99.         }
  100.        
  101.         if(keyCache==false){
  102.             if(this.servizioApplicativo!=null){
  103.                 bf.append(" ServizioApplicativo:defined");
  104.             }
  105.         }
  106.        
  107.         return bf.toString();
  108.     }
  109. }