public class DemoSubsystem extends Object implements org.lsst.ccs.framework.HasLifecycle
| Modifier and Type | Class and Description |
|---|---|
static class |
DemoSubsystem.AState |
static class |
DemoSubsystem.DemoState |
static class |
DemoSubsystem.OtherState |
| Modifier and Type | Field and Description |
|---|---|
protected org.lsst.ccs.utilities.scheduler.PeriodicTask |
dataPublisher
Scheduler task that publishes heartbeat status messages.
|
protected org.lsst.ccs.services.AgentPeriodicTaskService |
periodicTaskService |
protected org.lsst.ccs.Subsystem |
subsys |
| Constructor and Description |
|---|
DemoSubsystem() |
| Modifier and Type | Method and Description |
|---|---|
void |
build() |
Object[] |
getSampleArrayData() |
DemoData |
getSampleData() |
void |
init() |
void |
postInit() |
void |
postStart()
Initializes the subsystem.
|
void |
raiseCustomAlert(String alertId,
org.lsst.ccs.bus.states.AlertState severity,
String cause) |
void |
runTracerTest(boolean enable) |
void |
setSampleDataSize(int size) |
Object |
testCommand(boolean accept,
int delayBeforeAck,
int delayAfterAck,
int timeout,
boolean returnException) |
Object |
testCommandArguments(boolean b1,
int varName,
String nick,
List<Integer> intList,
List<String> stringList,
String returnType) |
List<String> |
testCommandArgumentsReturnTypeValues() |
void |
testSystemQuery0() |
void |
testSystemQuery1() |
String |
testTimeout(int sleepSeconds) |
void |
testUserAction0() |
void |
testUserQuery0() |
void |
testUserQuery1() |
void |
throwAnException() |
void |
updateLimits(String low,
String high) |
void |
updateState(String componentName,
DemoSubsystem.DemoState state) |
protected org.lsst.ccs.utilities.scheduler.PeriodicTask dataPublisher
@LookupField(strategy=TREE) protected org.lsst.ccs.services.AgentPeriodicTaskService periodicTaskService
@LookupField(strategy=TOP) protected org.lsst.ccs.Subsystem subsys
public void postStart()
postStart in interface org.lsst.ccs.framework.HasLifecyclepublic void postInit()
postInit in interface org.lsst.ccs.framework.HasLifecyclepublic void build()
build in interface org.lsst.ccs.framework.HasLifecyclepublic void init()
init in interface org.lsst.ccs.framework.HasLifecycle@Command(type=ACTION,
description="update limits")
public void updateLimits(String low,
String high)
@Command(type=QUERY,
description="raise custom alert")
public void raiseCustomAlert(String alertId,
org.lsst.ccs.bus.states.AlertState severity,
String cause)
@Command(type=QUERY,
description="Get Subsystem Data Sample")
public DemoData getSampleData()
@Command(type=QUERY,
description="Set Subsystem Data Sample")
public void setSampleDataSize(int size)
@Command(type=QUERY,
description="Get Subsystem Array Sample")
public Object[] getSampleArrayData()
@Command(type=QUERY,
description="Throw an Exception")
public void throwAnException()
@Command(type=ACTION,
description="Enable/Disable Publishing Tracer Test Messages")
public void runTracerTest(boolean enable)
@Command(type=ACTION,
description="Time out (action command)")
public String testTimeout(int sleepSeconds)
@Command(type=QUERY,
level=0,
category=USER,
description="Empty level 0 category USER type QUERY command")
public void testUserQuery0()
@Command(type=ACTION,
level=0,
category=USER,
description="Empty level 0 category USER type QUERY command")
public void testUserAction0()
@Command(type=QUERY,
level=1,
category=USER,
description="Empty level 0 category USER type QUERY command")
public void testUserQuery1()
@Command(type=QUERY,
level=0,
category=SYSTEM,
description="Empty level 0 category USER type QUERY command")
public void testSystemQuery0()
@Command(type=QUERY,
level=1,
category=SYSTEM,
description="Empty level 0 category USER type QUERY command")
public void testSystemQuery1()
@Command(type=QUERY,
level=0,
description="Test sending ACK/NACK. Delays are in seconds.",
autoAck=false)
public Object testCommand(@Argument(description="If false, command is rejected with a NACK.")
boolean accept,
@Argument(defaultValue="0")
int delayBeforeAck,
@Argument(description="Delay between ACK and the result.",defaultValue="0")
int delayAfterAck,
@Argument(defaultValue="0")
int timeout,
@Argument(defaultValue="false")
boolean returnException)
@Command(type=QUERY,
level=0,
description="Test various types of command arguments and return types.")
public Object testCommandArguments(@Argument(name="namedBool",description="boolean argument with name but no default")
boolean b1,
@Argument(defaultValue="0",description="unnamed int argument with default 0")
int varName,
@Argument(defaultValue="Che",description="String argument: nickname",name="nickname")
String nick,
@Argument(description="List of integers")
List<Integer> intList,
@Argument(description="List of strings")
List<String> stringList,
@Argument(description="Kind of object to return",allowedValueProvider="testCommandArgumentsReturnTypeValues")
String returnType)
@Command(type=ACTION) public void updateState(String componentName, DemoSubsystem.DemoState state)
Copyright © 2020 LSST. All rights reserved.