/
SigningLTSException.java
57 lines (49 loc) · 2.45 KB
/
SigningLTSException.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* Copyright (C) 2022 [Gobierno de Espana]
* This file is part of "Cliente @Firma".
* "Cliente @Firma" is free software; you can redistribute it and/or modify it under the terms of:
* - the GNU General Public License as published by the Free Software Foundation;
* either version 2 of the License, or (at your option) any later version.
* - or The European Software License; either version 1.1 or (at your option) any later version.
* You may contact the copyright holder at: soporte.afirma@seap.minhap.es
*/
package es.gob.afirma.core;
/**
* Excepción que denota que no se puede cofirmar o contrafirmar
* una firma porque alguna firma previa contiene información de
* archivo que quedaría invalidada.
*/
public class SigningLTSException extends RuntimeConfigNeededException {
/** Serial Id. */
private static final long serialVersionUID = 995443738935981665L;
public static final String REQUESTOR_MSG_CODE = "signingLts"; //$NON-NLS-1$
public static final String REQUESTOR_POSSIBLE_MSG_CODE = "signingLtsPossible"; //$NON-NLS-1$
private static final String EXTRA_PARAM_NEEDED = "allowSignLTSignature"; //$NON-NLS-1$
/**
* Crear la excepción motivada por lo indicado en el mensaje.
* @param message Mensaje descriptivo del problema.
*/
public SigningLTSException(final String message) {
super(message, RuntimeConfigNeededException.RequestType.CONFIRM, REQUESTOR_MSG_CODE, EXTRA_PARAM_NEEDED);
}
/**
* Crear la excepción motivada por lo indicado en el mensaje.
* @param message Mensaje descriptivo del problema.
* @param possible {@code true} indica que esto es un posible problema, {@code false} indica que
* hay certeza de ello.
*/
public SigningLTSException(final String message, final boolean possible) {
super(message, RuntimeConfigNeededException.RequestType.CONFIRM,
possible ? REQUESTOR_POSSIBLE_MSG_CODE : REQUESTOR_MSG_CODE , EXTRA_PARAM_NEEDED);
}
/**
* Crear la excepción motivada por lo indicado en el mensaje.
* @param message Mensaje descriptivo del problema.
* @param cause Origen del problema.
* @param possible {@code true} indica que esto es un posible problema, {@code false} indica que
* hay certeza de ello.
*/
public SigningLTSException(final String message, final Throwable cause, final boolean possible) {
super(message, RuntimeConfigNeededException.RequestType.CONFIRM,
possible ? REQUESTOR_POSSIBLE_MSG_CODE : REQUESTOR_MSG_CODE, EXTRA_PARAM_NEEDED, cause);
}
}