public class EtoileDieseBroker extends LoggerBroker implements Configurable, Contextualizable
| Modifier and Type | Field and Description |
|---|---|
private static SimpleDateFormat |
__DATE_FORMAT |
private Context |
_context
The Avalon context
|
private String |
_etoileDieseBulkWSUrl
Url of Etoile diese's send sms web service in bulk mode (the recipients are listed in a CSV file)
|
private UserManager |
_userManager
The users manager
|
_ametysObjectResolver, _currentUserProvider| Constructor and Description |
|---|
EtoileDieseBroker() |
| Modifier and Type | Method and Description |
|---|---|
private InputStream |
_getCSVFile(Set<String> phoneNumbersList,
String message)
Creates and return a CSV file from a list of numbers and a message
|
void |
configure(Configuration configuration) |
void |
contextualize(Context context) |
String |
getPhoneNumberFromStopRequest()
When a stop request is arriving from broker, the implementation extract the phone number associated
|
void |
send(Set<String> phoneNumbersList,
String message,
String listId)
Send the message from the sender to all the phones in the list
|
void |
service(ServiceManager manager) |
getCategoryenableLogging, getLogger, setupLogger, setupLogger, setupLoggerprivate static SimpleDateFormat __DATE_FORMAT
private String _etoileDieseBulkWSUrl
private UserManager _userManager
public EtoileDieseBroker()
public void configure(Configuration configuration) throws ConfigurationException
configure in interface ConfigurableConfigurationExceptionpublic void contextualize(Context context) throws ContextException
contextualize in interface ContextualizableContextExceptionpublic void service(ServiceManager manager) throws ServiceException
service in interface Serviceableservice in class LoggerBrokerServiceExceptionpublic void send(Set<String> phoneNumbersList, String message, String listId) throws Exception
Brokersend in interface Brokersend in class LoggerBrokerphoneNumbersList - the list of phone numbersmessage - the message to sendlistId - the jcr id of the list to send mail toException - If the message was not sent correctlypublic String getPhoneNumberFromStopRequest() throws Exception
BrokergetPhoneNumberFromStopRequest in interface BrokergetPhoneNumberFromStopRequest in class LoggerBrokerException - if the phone number was not provided within the stop requestprivate InputStream _getCSVFile(Set<String> phoneNumbersList, String message) throws IOException
phoneNumbersList - the list of phone numbers to send a SMS tomessage - the message to sendIOException - if an error occurs while converting the list of phone numbers to an input stream