
public final class AgentPeriodicTaskService extends Object implements ServiceLifecycle, HasLifecycle, AgentMonitor, ClearAlertHandler, AgentService
ClearAlertHandler.ClearAlertCode| Constructor and Description |
|---|
AgentPeriodicTaskService() |
| Modifier and Type | Method and Description |
|---|---|
ClearAlertHandler.ClearAlertCode |
canClearAlert(Alert alert,
AlertState state)
Callback to clear an
Alert instance. |
void |
createScheduler(String name,
int nThreads)
Create a scheduler by name and the default number of threads.
|
String |
getAgentMonitorDescription()
Get the description for this AgentMonitor.
|
String |
getAgentMonitorStatus(boolean useCcsBuses)
This method should return the string "OK" if everything is working as
expected.
|
List<String> |
getAgentPeriodicTaskNames()
Get the list of names of the scheduled tasks.
|
String |
getAgentServiceName()
Get the name of this service.
|
Duration |
getPeriodicTaskPeriod(String taskName)
Get the period of a PeriodicTaks.
|
List<org.lsst.ccs.services.PeriodicTaskComponent.PeriodicTaskWithScheduler> |
getPeriodicTasks() |
void |
preBuild() |
void |
preInit() |
void |
scheduleAgentPeriodicTask(AgentPeriodicTask task)
Schedule a PeriodicTask.
|
void |
scheduleAgentPeriodicTask(AgentPeriodicTask task,
String schedulerName) |
void |
setPeriodicTaskPeriod(String taskName,
Duration period)
Change the period of a PeriodicTask.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafterInit, afterStart, preShutdown, preStartbuild, init, postBuild, postInit, postShutdown, postStart, shutdown, startstartForAgentpublic String getAgentServiceName()
AgentServicegetAgentServiceName in interface AgentServicepublic void preBuild()
preBuild in interface ServiceLifecyclepublic void preInit()
preInit in interface ServiceLifecyclepublic void createScheduler(String name, int nThreads)
name - nThreads - public void scheduleAgentPeriodicTask(AgentPeriodicTask task)
task - The PeriodicTask to schedulepublic void scheduleAgentPeriodicTask(AgentPeriodicTask task, String schedulerName)
public Duration getPeriodicTaskPeriod(String taskName)
taskName - The name of the taskpublic void setPeriodicTaskPeriod(String taskName, Duration period)
taskName - The name of the taskperiod - The period Duration@Command(name="getAgentPeriodicTaskNames", description="Get the list of the names of the scheduled tasks", type=QUERY, category=SYSTEM) public List<String> getAgentPeriodicTaskNames()
public List<org.lsst.ccs.services.PeriodicTaskComponent.PeriodicTaskWithScheduler> getPeriodicTasks()
public String getAgentMonitorStatus(boolean useCcsBuses)
AgentMonitorgetAgentMonitorStatus in interface AgentMonitoruseCcsBuses - a boolean to tell if the CCS buses should be used: for
example to raise an Alert. This is true when the method is invoked from
the periodic task. If it's invoked form JMX its value is false.public String getAgentMonitorDescription()
AgentMonitorgetAgentMonitorDescription in interface AgentMonitorpublic ClearAlertHandler.ClearAlertCode canClearAlert(Alert alert, AlertState state)
ClearAlertHandlerAlert instance.
Return a ClearAlertCode for the provided Alert.canClearAlert in interface ClearAlertHandleralert - The Alert instance to clear.state - The AlertState for the provided Alert.Copyright © 2019 LSST. All rights reserved.