KeepAliveOptions.java

1
package fr.sii.ogham.sms.sender.impl.cloudhopper;
2
3
import java.util.concurrent.ScheduledExecutorService;
4
import java.util.function.Supplier;
5
6
import com.cloudhopper.smpp.pdu.EnquireLink;
7
8
public class KeepAliveOptions {
9
	/**
10
	 * Enable or disable sending of {@link EnquireLink} messages to keep the
11
	 * session alive.
12
	 */
13
	private Boolean enable;
14
	/**
15
	 * The delay (in milliseconds) between two {@link EnquireLink} messages.
16
	 */
17
	private Long enquireLinkInterval;
18
	/**
19
	 * The maximum amount of time (in milliseconds) to wait for receiving a
20
	 * response from the server to an {@link EnquireLink} request.
21
	 */
22
	private Long enquireLinkTimeout;
23
	/**
24
	 * Connect to the server directly when the client is ready (if true).
25
	 * Otherwise, the connection is done when the first message is sent.
26
	 * 
27
	 * This may be useful to avoid a latency for the first message.
28
	 * 
29
	 * If connection fails at startup, then a new attempt is done when first
30
	 * message is sent.
31
	 */
32
	private Boolean connectAtStartup;
33
	/**
34
	 * Provide a factory that creates a {@link ScheduledExecutorService}. The
35
	 * created executor is then used to schedule the task that sends regularly
36
	 * {@link EnquireLink} requests.
37
	 */
38
	private Supplier<ScheduledExecutorService> executor;
39
	/**
40
	 * The maximum number of consecutive {@link EnquireLink} requests that end
41
	 * in timeout to consider that a new session is required.
42
	 */
43
	private Integer maxConsecutiveTimeouts;
44
45
	public KeepAliveOptions() {
46
		super();
47
	}
48
49
	public KeepAliveOptions(boolean enable) {
50
		super();
51
		this.enable = enable;
52
	}
53
54
	public Boolean getEnable() {
55 2 1. getEnable : replaced Boolean return with False for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getEnable → NO_COVERAGE
2. getEnable : replaced Boolean return with True for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getEnable → NO_COVERAGE
		return enable;
56
	}
57
58
	public void setEnable(Boolean enable) {
59
		this.enable = enable;
60
	}
61
62
	public boolean isEnable(boolean defaultValue) {
63 3 1. isEnable : negated conditional → RUN_ERROR
2. isEnable : replaced boolean return with false for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::isEnable → RUN_ERROR
3. isEnable : replaced boolean return with true for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::isEnable → RUN_ERROR
		return enable == null ? defaultValue : enable;
64
	}
65
66
	public Long getEnquireLinkInterval() {
67 1 1. getEnquireLinkInterval : replaced Long return value with 0L for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getEnquireLinkInterval → NO_COVERAGE
		return enquireLinkInterval;
68
	}
69
70
	public void setEnquireLinkInterval(Long enquireLinkInterval) {
71
		this.enquireLinkInterval = enquireLinkInterval;
72
	}
73
74
	public Long getEnquireLinkTimeout() {
75 1 1. getEnquireLinkTimeout : replaced Long return value with 0L for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getEnquireLinkTimeout → NO_COVERAGE
		return enquireLinkTimeout;
76
	}
77
78
	public void setEnquireLinkTimeout(Long enquireLinkTimeout) {
79
		this.enquireLinkTimeout = enquireLinkTimeout;
80
	}
81
82
	public Boolean getConnectAtStartup() {
83 2 1. getConnectAtStartup : replaced Boolean return with False for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getConnectAtStartup → NO_COVERAGE
2. getConnectAtStartup : replaced Boolean return with True for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getConnectAtStartup → NO_COVERAGE
		return connectAtStartup;
84
	}
85
86
	public void setConnectAtStartup(Boolean connectAtStartup) {
87
		this.connectAtStartup = connectAtStartup;
88
	}
89
90
	public boolean isConnectAtStartup(boolean defaultValue) {
91 3 1. isConnectAtStartup : replaced boolean return with false for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::isConnectAtStartup → NO_COVERAGE
2. isConnectAtStartup : replaced boolean return with true for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::isConnectAtStartup → NO_COVERAGE
3. isConnectAtStartup : negated conditional → NO_COVERAGE
		return connectAtStartup == null ? defaultValue : connectAtStartup;
92
	}
93
94
	public Supplier<ScheduledExecutorService> getExecutor() {
95 1 1. getExecutor : replaced return value with null for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getExecutor → NO_COVERAGE
		return executor;
96
	}
97
98
	public void setExecutor(Supplier<ScheduledExecutorService> executor) {
99
		this.executor = executor;
100
	}
101
102
	public Integer getMaxConsecutiveTimeouts() {
103 1 1. getMaxConsecutiveTimeouts : replaced Integer return value with 0 for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getMaxConsecutiveTimeouts → NO_COVERAGE
		return maxConsecutiveTimeouts;
104
	}
105
106
	public void setMaxConsecutiveTimeouts(Integer maximumConsecutiveTimeouts) {
107
		this.maxConsecutiveTimeouts = maximumConsecutiveTimeouts;
108
	}
109
110
}

Mutations

55

1.1
Location : getEnable
Killed by :
replaced Boolean return with False for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getEnable → NO_COVERAGE

2.2
Location : getEnable
Killed by :
replaced Boolean return with True for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getEnable → NO_COVERAGE

63

1.1
Location : isEnable
Killed by :
negated conditional → RUN_ERROR

2.2
Location : isEnable
Killed by :
replaced boolean return with false for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::isEnable → RUN_ERROR

3.3
Location : isEnable
Killed by :
replaced boolean return with true for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::isEnable → RUN_ERROR

67

1.1
Location : getEnquireLinkInterval
Killed by :
replaced Long return value with 0L for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getEnquireLinkInterval → NO_COVERAGE

75

1.1
Location : getEnquireLinkTimeout
Killed by :
replaced Long return value with 0L for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getEnquireLinkTimeout → NO_COVERAGE

83

1.1
Location : getConnectAtStartup
Killed by :
replaced Boolean return with False for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getConnectAtStartup → NO_COVERAGE

2.2
Location : getConnectAtStartup
Killed by :
replaced Boolean return with True for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getConnectAtStartup → NO_COVERAGE

91

1.1
Location : isConnectAtStartup
Killed by :
replaced boolean return with false for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::isConnectAtStartup → NO_COVERAGE

2.2
Location : isConnectAtStartup
Killed by :
replaced boolean return with true for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::isConnectAtStartup → NO_COVERAGE

3.3
Location : isConnectAtStartup
Killed by :
negated conditional → NO_COVERAGE

95

1.1
Location : getExecutor
Killed by :
replaced return value with null for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getExecutor → NO_COVERAGE

103

1.1
Location : getMaxConsecutiveTimeouts
Killed by :
replaced Integer return value with 0 for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getMaxConsecutiveTimeouts → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.13.1