| 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 |
8
1. isEnable : replaced boolean return with false for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::isEnable → SURVIVED 2. isEnable : replaced boolean return with true for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::isEnable → SURVIVED 3. isEnable : negated conditional → SURVIVED 4. isEnable : replaced boolean return with false for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::isEnable → TIMED_OUT 5. isEnable : replaced boolean return with true for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::isEnable → TIMED_OUT 6. isEnable : negated conditional → TIMED_OUT 7. isEnable : replaced boolean return with true for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::isEnable → KILLED 8. isEnable : negated conditional → KILLED |
return enable == null ? defaultValue : enable; |
| 64 | } | |
| 65 | ||
| 66 | public Long getEnquireLinkInterval() { | |
| 67 |
2
1. getEnquireLinkInterval : replaced Long return value with 0L for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getEnquireLinkInterval → NO_COVERAGE 2. getEnquireLinkInterval : replaced Long return value with 0L for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getEnquireLinkInterval → KILLED |
return enquireLinkInterval; |
| 68 | } | |
| 69 | ||
| 70 | public void setEnquireLinkInterval(Long enquireLinkInterval) { | |
| 71 | this.enquireLinkInterval = enquireLinkInterval; | |
| 72 | } | |
| 73 | ||
| 74 | public Long getEnquireLinkTimeout() { | |
| 75 |
2
1. getEnquireLinkTimeout : replaced Long return value with 0L for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getEnquireLinkTimeout → NO_COVERAGE 2. getEnquireLinkTimeout : replaced Long return value with 0L for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getEnquireLinkTimeout → KILLED |
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 |
6
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 → SURVIVED 3. isConnectAtStartup : replaced boolean return with true for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::isConnectAtStartup → NO_COVERAGE 4. isConnectAtStartup : negated conditional → NO_COVERAGE 5. isConnectAtStartup : replaced boolean return with false for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::isConnectAtStartup → KILLED 6. isConnectAtStartup : negated conditional → KILLED |
return connectAtStartup == null ? defaultValue : connectAtStartup; |
| 92 | } | |
| 93 | ||
| 94 | public Supplier<ScheduledExecutorService> getExecutor() { | |
| 95 |
2
1. getExecutor : replaced return value with null for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getExecutor → NO_COVERAGE 2. getExecutor : replaced return value with null for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getExecutor → KILLED |
return executor; |
| 96 | } | |
| 97 | ||
| 98 | public void setExecutor(Supplier<ScheduledExecutorService> executor) { | |
| 99 | this.executor = executor; | |
| 100 | } | |
| 101 | ||
| 102 | public Integer getMaxConsecutiveTimeouts() { | |
| 103 |
2
1. getMaxConsecutiveTimeouts : replaced Integer return value with 0 for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getMaxConsecutiveTimeouts → NO_COVERAGE 2. getMaxConsecutiveTimeouts : replaced Integer return value with 0 for fr/sii/ogham/sms/sender/impl/cloudhopper/KeepAliveOptions::getMaxConsecutiveTimeouts → SURVIVED |
return maxConsecutiveTimeouts; |
| 104 | } | |
| 105 | ||
| 106 | public void setMaxConsecutiveTimeouts(Integer maximumConsecutiveTimeouts) { | |
| 107 | this.maxConsecutiveTimeouts = maximumConsecutiveTimeouts; | |
| 108 | } | |
| 109 | ||
| 110 | } | |
Mutations | ||
| 55 |
1.1 2.2 |
|
| 63 |
1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 |
|
| 67 |
1.1 2.2 |
|
| 75 |
1.1 2.2 |
|
| 83 |
1.1 2.2 |
|
| 91 |
1.1 2.2 3.3 4.4 5.5 6.6 |
|
| 95 |
1.1 2.2 |
|
| 103 |
1.1 2.2 |