Package com.storedobject.whatsapp
Class Server
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
This method is invoked when this job is executed for the first time, and it will be invoked only once.boolean
isActive()
Check if the Job is still active or not.protected int
sendMessage
(WhatsAppMessage message) Send a message.Methods inherited from class com.storedobject.job.MessageSender
canSend, execute, getBatchSize, getCreditBalance, getDeliveryCost, getSelectCondition, kick, monitorDeliveryCost, recover, sendMessages, shutdown, terminate
-
Constructor Details
-
Server
-
-
Method Details
-
initialize
protected void initialize()Description copied from class:MessageSender
This method is invoked when this job is executed for the first time, and it will be invoked only once. You may set up the sender here.- Overrides:
initialize
in classMessageSender<WhatsAppMessage>
-
isActive
public boolean isActive()Description copied from class:DaemonJob
Check if the Job is still active or not. (The default implementation always returnstrue
). If this method returnsfalse
, the Job Scheduler will invoke theJob.execute()
method again when it is due for the next run. -
sendMessage
Description copied from class:MessageSender
Send a message. The method should just send the message and should not update any status.- Specified by:
sendMessage
in classMessageSender<WhatsAppMessage>
- Parameters:
message
- Message to send.- Returns:
- The error code to indicate the status. 0: Successful, 1: Retry later, 2: Insufficient balance. Anything
above 2 indicates an error condition that doesn't allow this message to be sent (for example, invalid mobile
number in case of an
SMSMessage
).
-