1 | package fr.sii.ogham.sms.sender.impl.cloudhopper.exception; | |
2 | ||
3 | import static fr.sii.ogham.core.CoreConstants.SERIAL_VERSION_UID; | |
4 | import com.cloudhopper.smpp.pdu.EnquireLink; | |
5 | ||
6 | import fr.sii.ogham.sms.sender.impl.cloudhopper.session.ErrorAnalyzer; | |
7 | ||
8 | /** | |
9 | * In order to avoid creating a new session for each message to send, Ogha | |
10 | * provides different strategies to handle the sessions. One of them is to | |
11 | * actively maintain the current session alive by sending {@link EnquireLink} | |
12 | * PDUs. | |
13 | * | |
14 | * This exception is dedicated to this strategy and indicates how many | |
15 | * {@link EnquireLink} have failed to be sent. This is used by | |
16 | * {@link ErrorAnalyzer} to determine if the current session has to be closed | |
17 | * and a new one is required or not. | |
18 | * | |
19 | * @author Aurélien Baudet | |
20 | * | |
21 | */ | |
22 | public class KeepAliveException extends SmppException { | |
23 | private static final long serialVersionUID = SERIAL_VERSION_UID; | |
24 | ||
25 | private final int consecutiveFailures; | |
26 | ||
27 | public KeepAliveException(String message, Throwable cause, int consecutiveFailures) { | |
28 | super(message, cause); | |
29 | this.consecutiveFailures = consecutiveFailures; | |
30 | } | |
31 | ||
32 | public int getConsecutiveFailures() { | |
33 |
2
1. getConsecutiveFailures : replaced int return with 0 for fr/sii/ogham/sms/sender/impl/cloudhopper/exception/KeepAliveException::getConsecutiveFailures → NO_COVERAGE 2. getConsecutiveFailures : replaced int return with 0 for fr/sii/ogham/sms/sender/impl/cloudhopper/exception/KeepAliveException::getConsecutiveFailures → TIMED_OUT |
return consecutiveFailures; |
34 | } | |
35 | ||
36 | } | |
Mutations | ||
33 |
1.1 2.2 |