View Javadoc
1   /*
2   This file is part of the talbotgui/psl project.
3   Authors: talbotgui.
4   
5   This program is offered under a commercial and under the AGPL license.
6   For commercial licensing, contact me at talbotgui@gmail.com.
7   For AGPL licensing, see below.
8   
9   AGPL licensing:
10  This program is free software: you can redistribute it and/or modify 
11  it under the terms of the GNU Affero General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14  
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  GNU Affero General Public License for more details.
19  
20  AGPL license is available in LICENSE.md file and https://www.gnu.org/licenses/#AGPL
21   */
22  package com.github.talbotgui.psl.socle.securite.exception;
23  
24  import java.io.Serializable;
25  
26  import com.github.talbotgui.psl.socle.commun.exception.ExceptionId;
27  import com.github.talbotgui.psl.socle.commun.exception.ExceptionId.NiveauException;
28  
29  /** Classe d'erreur de ce micro-service. */
30  public class SecuriteException extends com.github.talbotgui.psl.socle.commun.exception.AbstractException {
31  
32  	/** Impossible d'enregistrer l'accessToken */
33  	public static final ExceptionId ACCESSTOKEN_NON_ENREGISTRABLE = new ExceptionId("ACCESSTOKEN_NON_ENREGISTRABLE", NiveauException.INFORMATION, 400,
34  			"Le token PSL ou l'accessToken OIDC sont invalides ou incohérents entre eux ({})");
35  
36  	/** Impossible de créer un token avec un mot de passe à cause des données fournies */
37  	public static final ExceptionId DONNEES_AUTHENTIFICATION_INVALIDE = new ExceptionId("DONNEES_AUTHENTIFICATION_INVALIDE",
38  			NiveauException.INFORMATION, 400, "Les données de connexion fournies ne permettent pas la création d'un token ({})");
39  
40  	/** Impossible de charger les données de l'usager */
41  	public static final ExceptionId DONNEES_USAGER_INDISPONIBLES = new ExceptionId("DONNEES_USAGER_INDISPONIBLES", NiveauException.INFORMATION, 401,
42  			"Les données de l'usager sont indisponibles ({})");
43  
44  	private static final long serialVersionUID = 1L;
45  
46  	/** @see com.github.talbotgui.psl.socle.commun.exception.AbstractException */
47  	public SecuriteException(ExceptionId id) {
48  		super(id);
49  	}
50  
51  	/** @see com.github.talbotgui.psl.socle.commun.exception.AbstractException */
52  	public SecuriteException(ExceptionId id, Serializable... parametres) {
53  		super(id, parametres);
54  	}
55  
56  	/** @see com.github.talbotgui.psl.socle.commun.exception.AbstractException */
57  	public SecuriteException(ExceptionId exceptionId, Throwable nestedException) {
58  		super(exceptionId, nestedException);
59  	}
60  
61  	/** @see com.github.talbotgui.psl.socle.commun.exception.AbstractException */
62  	public SecuriteException(ExceptionId id, Throwable nestedException, Serializable... parametres) {
63  		super(id, nestedException, parametres);
64  	}
65  }