Class TestSenderClient
- java.lang.Object
-
- com.github.mikesafonov.smpp.core.sender.TestSenderClient
-
- All Implemented Interfaces:
SenderClient
public class TestSenderClient extends java.lang.Object implements SenderClient
Implementation ofSenderClientwhich should be used for testing purpose. This client may provide real smpp connection via incoming implementation ofSenderClient. Every incoming request will be redirected to realsenderClientonly if list of allowed phone numbersallowedPhonescontains message destination phone. OtherwiseMessageResponse/CancelMessageResponsewill be generated viaSmppResultGenerator
-
-
Constructor Summary
Constructors Constructor Description TestSenderClient(@NotNull SenderClient senderClient, @NotNull java.util.List<java.lang.String> allowedPhones, @NotNull SmppResultGenerator smppResultGenerator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull CancelMessageResponsecancel(@NotNull CancelMessage cancelMessage)Cancel sms messagejava.util.List<java.lang.String>getAllowedPhones()java.util.Optional<ConnectionManager>getConnectionManager()Get Connection Manager@NotNull java.lang.StringgetId()MessageResponsesend(Message message)Send message via smpp protocolvoidsetup()Connect to SMSC via SMPP protocol
-
-
-
Constructor Detail
-
TestSenderClient
public TestSenderClient(@NotNull @NotNull SenderClient senderClient, @NotNull @NotNull java.util.List<java.lang.String> allowedPhones, @NotNull @NotNull SmppResultGenerator smppResultGenerator)
-
-
Method Detail
-
getId
@NotNull public @NotNull java.lang.String getId()
- Specified by:
getIdin interfaceSenderClient- Returns:
- Identifier of response client
-
setup
public void setup()
Description copied from interface:SenderClientConnect to SMSC via SMPP protocol- Specified by:
setupin interfaceSenderClient
-
send
public MessageResponse send(Message message)
Description copied from interface:SenderClientSend message via smpp protocol- Specified by:
sendin interfaceSenderClient- Parameters:
message- sms- Returns:
- message response
-
cancel
@NotNull public @NotNull CancelMessageResponse cancel(@NotNull @NotNull CancelMessage cancelMessage)
Description copied from interface:SenderClientCancel sms message- Specified by:
cancelin interfaceSenderClient- Parameters:
cancelMessage- message to cancel- Returns:
- cancel response
-
getConnectionManager
public java.util.Optional<ConnectionManager> getConnectionManager()
Description copied from interface:SenderClientGet Connection Manager- Specified by:
getConnectionManagerin interfaceSenderClient- Returns:
ConnectionManager
-
getAllowedPhones
public java.util.List<java.lang.String> getAllowedPhones()
-
-