WWWAuthenticateConfig.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.autenticazione;

  21. import org.openspcoop2.message.utils.WWWAuthenticateGenerator;

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

  30.     private String authType;
  31.     private String realm;
  32.     private String notFound_error;
  33.     private String notFound_error_description;
  34.     private String invalid_error;
  35.     private String invalid_error_description;
  36.    
  37.     public String buildWWWAuthenticateHeaderValue_notFound() {
  38.         return WWWAuthenticateGenerator.buildCustomHeaderValue(this.authType, this.realm, this.notFound_error, this.notFound_error_description);
  39.     }
  40.     public String buildWWWAuthenticateHeaderValue_invalid() {
  41.         return WWWAuthenticateGenerator.buildCustomHeaderValue(this.authType, this.realm, this.invalid_error, this.invalid_error_description);
  42.     }
  43.    
  44.     @Override
  45.     public Object clone() {
  46.         WWWAuthenticateConfig newInstance = new WWWAuthenticateConfig();
  47.        
  48.         newInstance.authType = new String(this.authType);
  49.         newInstance.realm = new String(this.realm);
  50.        
  51.         if(this.notFound_error!=null) {
  52.             newInstance.notFound_error = new String(this.notFound_error);
  53.         }
  54.         if(this.notFound_error_description!=null) {
  55.             newInstance.notFound_error_description = new String(this.notFound_error_description);
  56.         }
  57.        
  58.         if(this.invalid_error!=null) {
  59.             newInstance.invalid_error = new String(this.invalid_error);
  60.         }
  61.         if(this.invalid_error_description!=null) {
  62.             newInstance.invalid_error_description = new String(this.invalid_error_description);
  63.         }
  64.        
  65.         return newInstance;
  66.     }
  67.    
  68.     public String getAuthType() {
  69.         return this.authType;
  70.     }
  71.     public void setAuthType(String authType) {
  72.         this.authType = authType;
  73.     }
  74.     public String getRealm() {
  75.         return this.realm;
  76.     }
  77.     public void setRealm(String realm) {
  78.         this.realm = realm;
  79.     }

  80.     public String getNotFound_error() {
  81.         return this.notFound_error;
  82.     }
  83.     public void setNotFound_error(String notFound_error) {
  84.         this.notFound_error = notFound_error;
  85.     }
  86.     public String getNotFound_error_description() {
  87.         return this.notFound_error_description;
  88.     }
  89.     public void setNotFound_error_description(String notFound_error_description) {
  90.         this.notFound_error_description = notFound_error_description;
  91.     }

  92.     public String getInvalid_error() {
  93.         return this.invalid_error;
  94.     }
  95.     public void setInvalid_error(String invalid_error) {
  96.         this.invalid_error = invalid_error;
  97.     }
  98.     public String getInvalid_error_description() {
  99.         return this.invalid_error_description;
  100.     }
  101.     public void setInvalid_error_description(String invalid_error_description) {
  102.         this.invalid_error_description = invalid_error_description;
  103.     }
  104. }