SecurityToken.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.protocol.sdk;

  21. import java.io.Serializable;

  22. /**    
  23.  * SecurityToken
  24.  *
  25.  * @author Poli Andrea (poli@link.it)
  26.  * @author $Author$
  27.  * @version $Rev$, $Date$
  28.  */
  29. public class SecurityToken implements Serializable {

  30.     /**
  31.      *
  32.      */
  33.     private static final long serialVersionUID = 1L;
  34.    
  35.     private ChannelSecurityToken channel;
  36.     private RestMessageSecurityToken accessToken;
  37.     private SecurityTokenModI modI;
  38.    
  39.     public ChannelSecurityToken getChannel() {
  40.         return this.channel;
  41.     }
  42.     public void setChannel(ChannelSecurityToken channel) {
  43.         this.channel = channel;
  44.     }
  45.     public RestMessageSecurityToken getAccessToken() {
  46.         return this.accessToken;
  47.     }
  48.     public void setAccessToken(RestMessageSecurityToken accessToken) {
  49.         this.accessToken = accessToken;
  50.     }
  51.    
  52.     public SecurityTokenModI getModI() {
  53.         return this.modI;
  54.     }
  55.     public SecurityTokenModI getModi() {
  56.         return this.modI;
  57.     }
  58.     public void setModI(SecurityTokenModI modI) {
  59.         this.modI = modI;
  60.     }
  61.    
  62.     // -- shortcut
  63.     public RestMessageSecurityToken getAuthorization() {
  64.         return this.modI!=null ? this.modI.getAuthorization() : null;
  65.     }
  66.     public void setAuthorization(RestMessageSecurityToken authorization) {
  67.         if(this.modI==null) {
  68.             this.modI = new SecurityTokenModI();
  69.         }
  70.         this.modI.setAuthorization(authorization);
  71.     }
  72.     public RestMessageSecurityToken getIntegrity() {
  73.         return this.modI!=null ? this.modI.getIntegrity() : null;
  74.     }
  75.     public void setIntegrity(RestMessageSecurityToken integrity) {
  76.         if(this.modI==null) {
  77.             this.modI = new SecurityTokenModI();
  78.         }
  79.         this.modI.setIntegrity(integrity);
  80.     }
  81.     public SoapMessageSecurityToken getEnvelope() {
  82.         return this.modI!=null ? this.modI.getEnvelope() : null;
  83.     }
  84.     public void setEnvelope(SoapMessageSecurityToken envelope) {
  85.         if(this.modI==null) {
  86.             this.modI = new SecurityTokenModI();
  87.         }
  88.         this.modI.setEnvelope(envelope);
  89.     }
  90.     public RestMessageSecurityToken getAudit() {
  91.         return this.modI!=null ? this.modI.getAudit() : null;
  92.     }
  93.     public void setAudit(RestMessageSecurityToken audit) {
  94.         if(this.modI==null) {
  95.             this.modI = new SecurityTokenModI();
  96.         }
  97.         this.modI.setAudit(audit);
  98.     }
  99.     public PDNDTokenInfo getPdnd() {
  100.         return this.modI!=null ? this.modI.getPdnd() : null;
  101.     }
  102.     public void setPdnd(PDNDTokenInfo pdnd) {
  103.         if(this.modI==null) {
  104.             this.modI = new SecurityTokenModI();
  105.         }
  106.         this.modI.setPdnd(pdnd);
  107.     }

  108. }