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
FieldsModifier and TypeFieldDescriptionprotected Configuration
The component configuration.protected Context
The avalon context.protected Logger
The logger.protected ServiceManager
The service manager.protected Timer
The timer.static final String
The Avalon role -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
_getRequestURI
(Request request) Get the request URI.void
configure
(Configuration configuration) void
contextualize
(Context context) void
dispose()
void
enableLogging
(Logger logger) void
void
run()
void
sendInstantAlerts
(List<String> contentIds, String message) Run the scheduler to send instant alerts on contentsvoid
service
(ServiceManager manager) Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
-
Field Details
-
ROLE
The Avalon role -
_manager
The service manager. -
_configuration
The component configuration. -
_context
The avalon context. -
_logger
The logger. -
_timer
The timer.
-
-
Constructor Details
-
AlertScheduler
public AlertScheduler()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
enableLogging
- Specified by:
enableLogging
in interfaceLogEnabled
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
run
-
sendInstantAlerts
Run the scheduler to send instant alerts on contents- Parameters:
contentIds
- The ids of concerned contentsmessage
- the message to send to authorized users
-
_getRequestURI
Get the request URI.- Parameters:
request
- the request object.- Returns:
- the full request URI.
-
dispose
- Specified by:
dispose
in interfaceDisposable
-