Package org.ametys.cms.alerts
Class AlertScheduler
- java.lang.Object
-
- java.util.TimerTask
-
- org.ametys.cms.alerts.AlertScheduler
-
- All Implemented Interfaces:
Runnable,Disposable,Initializable,Component,Configurable,Contextualizable,LogEnabled,Serviceable
- Direct Known Subclasses:
AlertScheduler,AlertScheduler
public class AlertScheduler extends TimerTask implements Initializable, LogEnabled, Serviceable, Disposable, Contextualizable, Configurable, Component
Alerts scheduler: launches a cron which sends the alerts each night.
-
-
Field Summary
Fields Modifier and Type Field Description protected Configuration_configurationThe component configuration.protected Context_contextThe avalon context.protected Logger_loggerThe logger.protected ServiceManager_managerThe service manager.protected Timer_timerThe timer.static StringROLEThe Avalon role
-
Constructor Summary
Constructors Constructor Description AlertScheduler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String_getRequestURI(Request request)Get the request URI.voidconfigure(Configuration configuration)voidcontextualize(Context context)voiddispose()voidenableLogging(Logger logger)voidinitialize()voidrun()voidsendInstantAlerts(List<String> contentIds, String message)Run the scheduler to send instant alerts on contentsvoidservice(ServiceManager manager)-
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
-
-
-
-
Field Detail
-
_manager
protected ServiceManager _manager
The service manager.
-
_configuration
protected Configuration _configuration
The component configuration.
-
-
Constructor Detail
-
AlertScheduler
public AlertScheduler()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
enableLogging
public void enableLogging(Logger logger)
- Specified by:
enableLoggingin interfaceLogEnabled
-
initialize
public void initialize() throws Exception
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
sendInstantAlerts
public void sendInstantAlerts(List<String> contentIds, String message)
Run the scheduler to send instant alerts on contents- Parameters:
contentIds- The ids of concerned contentsmessage- the message to send to authorized users
-
_getRequestURI
protected String _getRequestURI(Request request)
Get the request URI.- Parameters:
request- the request object.- Returns:
- the full request URI.
-
dispose
public void dispose()
- Specified by:
disposein interfaceDisposable
-
-