Class DummySmsClient
java.lang.Object
ch.tocco.nice2.optional.sms.api.services.DummySmsClient
- All Implemented Interfaces:
SmsClient
A dummy client that simply creates response objects without
involving networking or other resources.
To use this client, adopt the application.properties to contain
`sms.provider=dummy`.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.optional.sms.api.services.SmsClient
SmsClient.Sms, SmsClient.SmsRecipient, SmsClient.SmsResponse
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkSmsRecipient
(Entity smsRecipient) Checks whether the given entity is a valid sms recipient for this SmsClient or notboolean
checkSmsResponse
(SmsClient.SmsResponse smsResponse) Checks whether the given response was created by this client and is a successful response.getName()
sendSms
(SmsClient.Sms sms, boolean simulateSms) Creates a response for any given sms.
-
Constructor Details
-
DummySmsClient
public DummySmsClient()
-
-
Method Details
-
getName
-
sendSms
Creates a response for any given sms. The `simulateSms` flag is ignored. The sms message can contain trailing property lines like in git commit messages that can contain properties to control some behavior: - `Error:true` makes the client return a failed message - `Sleep:200` makes the client thread sleep for the specified amount of milliseconds These properties must be one at a line and the whole block must be separated by an empty line to the previous text. Keys are case insensitive. -
checkSmsResponse
Checks whether the given response was created by this client and is a successful response.- Specified by:
checkSmsResponse
in interfaceSmsClient
- Returns:
- true if the sms has been sent correctly.
-
checkSmsRecipient
Description copied from interface:SmsClient
Checks whether the given entity is a valid sms recipient for this SmsClient or not- Specified by:
checkSmsRecipient
in interfaceSmsClient
- Returns:
- true if the given entity is a valid sms recipient
-