Package org.ametys.plugins.sms.broker
Class LoggerBroker
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.plugins.sms.broker.LoggerBroker
-
- All Implemented Interfaces:
Broker,LogEnabled,Serviceable
- Direct Known Subclasses:
EtoileDieseBroker
public class LoggerBroker extends AbstractLogEnabled implements Broker, Serviceable
Log informations (message, receivers and sender)
-
-
Field Summary
Fields Modifier and Type Field Description protected AmetysObjectResolver_ametysObjectResolverAvalon component resolving ametys objectsprotected CurrentUserProvider_currentUserProviderThe user provider
-
Constructor Summary
Constructors Constructor Description LoggerBroker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetCategory(String listId)Computes the name of the subscribers' list node corresponding to the list id passed as a parameterStringgetPhoneNumberFromStopRequest()When a stop request is arriving from broker, the implementation extract the phone number associatedvoidsend(Set<String> phoneNumbers, String message, String listId)Send the message from the sender to all the phones in the listvoidservice(ServiceManager manager)-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
The user provider
-
_ametysObjectResolver
protected AmetysObjectResolver _ametysObjectResolver
Avalon component resolving ametys objects
-
-
Constructor Detail
-
LoggerBroker
public LoggerBroker()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
send
public void send(Set<String> phoneNumbers, String message, String listId) throws Exception
Description copied from interface:BrokerSend the message from the sender to all the phones in the list
-
getPhoneNumberFromStopRequest
public String getPhoneNumberFromStopRequest() throws Exception
Description copied from interface:BrokerWhen a stop request is arriving from broker, the implementation extract the phone number associated- Specified by:
getPhoneNumberFromStopRequestin interfaceBroker- Returns:
- the phone number from the 'stop' sender at format +{countryCode}{number} (ex: +33612345678), it can be null if the phone number cannot be extracted from the stop request
- Throws:
Exception- if the phone number was not provided within the stop request
-
getCategory
protected String getCategory(String listId)
Computes the name of the subscribers' list node corresponding to the list id passed as a parameter- Parameters:
listId- the id of the jcr node of the subscribers list- Returns:
- the name of the category
-
-