
public class Subsystem extends Agent
This object will register itself on the three buses (control, status, log). It broadcasts its status, and can receive Commands.
Agent.RunningCommandcommandExecutorLock, currentAction, currentQueries, currentSignals, heartbeatPublisher, innerStateLock, logBusHandler, runtimeInfoPublisher| Constructor and Description |
|---|
Subsystem(String name,
AgentInfo.AgentType type)
Constructs Subsystem instance.
|
Subsystem(String name,
AgentInfo.AgentType type,
ComponentLookup componentLookupService)
Constructs Subsystem instance.
|
Subsystem(String name,
AgentInfo.AgentType type,
ComponentLookup componentLookupService,
String tagName,
String[] startupConfig) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Command to abort operation.
|
void |
addClearAlertHandler(ClearAlertHandler handler)
Add a ClearAlertHandler to this Subsystem.
|
void |
change(String componentName,
String parameterName,
Object value)
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
void |
checkAllHardwareStarted()
Called to check if all hardware has been correctly started.
|
void |
checkAllHardwareStopped()
Called to check if all hardware has been correctly started.
|
void |
checkHardware()
Called before activating anything and again once problems are supposed to
have been addressed.
|
String[] |
clearAlerts(String... alertId)
Clear one or more Alerts by providing the alert id.
|
String[] |
clearAllAlerts()
Attempt to clear all the outstanding alerts.
|
void |
commitBulkChange()
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
void |
completeInitialization()
Command to complete initialization (if commands were issued to heal
hardware problems).
|
void |
completeInitialization(boolean checkHardwareOK)
Runs the last phase of the initialization, and transitions to OPERATIONAL
state.
|
void |
doShutdown()
Called upon subsystem shutdown.
|
void |
doStart()
Called upon subsystem start.
|
void |
dropAllChanges()
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
void |
dropAllSubmittedChanges()
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
void |
dropChangesForCategories(String... categories)
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
void |
dropSubmittedChangesForComponent(String name)
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
Set<String> |
findAvailableConfigurationsForCategory(String category)
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
void |
forceShutdown()
Command to force subsystem shutdown.
|
Map<String,Map<String,String>> |
getAllSubmittedChanges()
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
Set<String> |
getCategories()
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
ComponentConfigurationEnvironment |
getComponentConfigurationEnvironment(Object obj)
Get the ComponentConfigurationEnvironment object for a given Object.
|
ComponentConfigurationEnvironment |
getComponentConfigurationEnvironmentByName(String name)
Get the ComponentConfigurationEnvironment object for a given node name.
|
ComponentLookup |
getComponentLookup()
Get the ComponentLookup for this Subsystem.
|
ConfigurationInfo |
getConfigurationInfo()
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
Map<String,String> |
getCurrentValuesForComponent(String componentName,
Set<String> categorySet)
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
Logger |
getLogger()
Returns the current logger (use sparingly and prefer your own logger).
|
ComponentLookup |
getLookup()
Deprecated.
Use getComponentLookup instead
|
int |
getNumberCommandThreads()
Command that returns the number of currently running commands.
|
RaisedAlertSummary |
getRaisedAlertSummary()
Get the Subsystem's RaisedAlertSummary.
|
Map<String,String> |
getSubmittedChangesForComponent(String name)
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
SubsystemConfigurationEnvironment |
getSubsystemConfigurationEnvironment()
Provides programmatic access to the configuration API.
|
static Subsystem |
getSubsystemForObject(Object obj)
Get the Subsystem for a given object belonging to a ComponentLookup.
|
String |
getTag()
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
protected void |
internalShutdown()
Called by the framework on subsystem shutdown, before the Agent shutdown
sequence is executed.
|
protected boolean |
internalStart()
Called by the framework once the underlying
Agent functionality
is initialized. |
boolean |
isParameterConfigurable(String componentName,
String parameterName)
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
void |
loadCategories(String... taggedCategories)
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
void |
loadConfiguration(String... taggedCategories)
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
void |
ping()
Command to broadcast a message of presence on the status bus.
|
void |
postStart()
Called by the framework after subsystem has been started.
|
String |
printRunningCommands()
Command returning a String describing which commands are running.
|
void |
raiseAlert(Alert alert,
AlertState severity,
String cause)
Raise an Alert with a given AlertState.
|
void |
removeLogPanicState()
Command to try and reset the panic state of a the Log Bus Handler
(logging failed before).
|
void |
saveAllChanges()
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
void |
saveChangesForCategories(String... categories)
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
void |
saveChangesForCategoriesAs(String... taggedCategories)
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
void |
setBusLogHandlerLevel(String levelName)
Command to set the level at which the Log Bus Hander will start logging.
|
void |
setLogFormat(String format)
Command to set a format for the TextFormatter of LogBusHandler (see
logging.properties doc).
|
void |
setLogHandlerLevel(String handler,
String level)
Command to set a level for a given handler
|
void |
setLogLevel(String keyLogger,
String levelName)
Command to set the Level of a named Logger.
|
void |
setStackTraceDepth(int depth)
Will modify the depth of stackTrace printing for ALL handlers (including
the LogBusHandler)
|
void |
stop(long timeHint)
Command to stop operation.
|
void |
stopAndWait(long timeHint)
forwards a STOP signal to all components and then checks if all hardwares have been stopped within timeHint
|
void |
submitChange(String componentName,
String parameterName,
Object value)
Deprecated.
use the configuration API through the ConfigurationCommandSet object
accessible via getSubsystemConfigurationEnvironment()
|
boolean |
switchToEngineeringMode()
Command to switch to ENGINEERING mode.
|
void |
switchToNormalMode()
Command to switch to NORMAL mode.
|
addCommandSet, addCommandsFromObject, broadcastStatus, executeCommandRequest, getAgentInfo, getCCSVersions, getCommandCount, getCommandSet, getCommandTargets, getCurrentAction, getDictionaries, getDistributionInfo, getEnvironmentMessagingAccess, getMessagingAccess, getName, getScheduler, getState, getState, getStatusBroadcastPeriod, isInEngineeringMode, isInState, isInState, publishStateChange, publishSubsystemDataOnStatusBus, sendAck, sendNack, setAgentProperty, shutdown, start, updateAgentState, updateAgentState, updateHeartBeat, updateInternalState, waitForpublic Subsystem(String name, AgentInfo.AgentType type)
name - name of the subsystem : cannot be nulltype - Agent typepublic Subsystem(String name, AgentInfo.AgentType type, ComponentLookup componentLookupService)
name - name of the subsystem : cannot be nulltype - Agent typepublic Subsystem(String name, AgentInfo.AgentType type, ComponentLookup componentLookupService, String tagName, String[] startupConfig)
protected final boolean internalStart()
Agent functionality
is initialized.internalStart in class Agenttrue if subsystem initialization was successful.protected final void internalShutdown()
throws Exception
internalShutdown in class AgentException - if shutdown failspublic void completeInitialization(boolean checkHardwareOK)
throws HardwareException
checkHardwareOK - false if engineering fault was entered due to
checkHardware errorsHardwareException - if some hardware is still not startedpublic void postStart()
throws HardwareException
HardwareException - because some "homing" operations may be tried
by the hardwarepublic Logger getLogger()
public final ComponentLookup getComponentLookup()
@Deprecated public final ComponentLookup getLookup()
public void checkHardware()
throws HardwareException
HardwareException - "compound" exceptionpublic void checkAllHardwareStarted()
throws HardwareException
HardwareException - a compound exception that list the exceptions
fired by hardwares that are not started.public void checkAllHardwareStopped()
throws HardwareException
HardwareException - a compound exception that list the exceptions
fired by hardwares that are not stopped.public void doStart()
public void doShutdown()
@Command(description="completes initialization after hardware problems corrections", type=ACTION) public void completeInitialization() throws SystemStateException, HardwareException
@Command(description="forces blocked shutdown (not implemented yet!)", type=SIGNAL) public void forceShutdown()
@Command(description="abort subsystem", type=SIGNAL) public void abort()
@Command(description="stops hardware with expected max delay", type=ACTION) public void stop(@Argument(name="timeHint",defaultValue="-1") long timeHint) throws HardwareException
timeHint - time limit for executionHardwareException@Command(description="waits until all the hardware devices are actually stopped", type=ACTION) public void stopAndWait(long timeHint) throws HardwareException, InterruptedException
timeHint - HardwareException, - InterruptedExceptionHardwareExceptionInterruptedException@Command(description="switch to ENGINEERING mode", type=ACTION) public boolean switchToEngineeringMode()
true if the subsystem state has changed as a result of
execution@Command(description="Tries to get back to NORMAL mode", type=ACTION) public final void switchToNormalMode() throws SystemStateException
SystemStateException - if alarms are not cleared or signals are
still runningpublic final void addClearAlertHandler(ClearAlertHandler handler)
handler - The ClearAlertHandler class that will handle the
clearing of alerts.public final void raiseAlert(Alert alert, AlertState severity, String cause)
alert - The Alert instance to be raisedseverity - The AlertState of this Alert.cause - The reason the Alert was raised.@Command(description="Clear alerts", type=ACTION) public final String[] clearAlerts(String... alertId)
alertId - the Id of the Alerts to be cleared.@Command(description="Clear all alerts", type=ACTION) public final String[] clearAllAlerts()
@Command(description="Get the Raised Alert Summary", type=QUERY) public final RaisedAlertSummary getRaisedAlertSummary()
@Command(description="set the level of the BusLogHandler", type=QUERY) public void setBusLogHandlerLevel(String levelName)
levelName - name of JUL Level@Command(description="set the level of a Logger", type=QUERY) public void setLogLevel(String keyLogger, String levelName)
keyLogger - name of Logger (can be a package or a "concern" such as
"INIT", "CONFIG"levelName - the name of a JUL Level@Command(description="sets the the depth of stacktraces in Logger messages", type=QUERY) public void setStackTraceDepth(int depth)
depth - could be negative if we want all the stackTrace@Command(description="sets the format used by TextFormatter for LogEvent messages ", type=QUERY) public void setLogFormat(String format)
format - @Command(description="sets the handler (ConsoleHandler, FileHandler, LogBusHandler) log level", type=QUERY) public void setLogHandlerLevel(String handler, String level)
handler - can be ConsoleHandler, FileHandler, LogBusHandlerlevel - @Command(description="tries to stop the panic state of logmanagement", type=QUERY) public void removeLogPanicState()
@Command(description="gets the number of commands which are currently running (except the current one!)", type=QUERY) public int getNumberCommandThreads()
@Command(description="gets the name of commands which are currently running", type=QUERY) public String printRunningCommands()
@Command(description="broadcast on the status bus a message of presence", type=QUERY, category=SYSTEM) public void ping()
public final SubsystemConfigurationEnvironment getSubsystemConfigurationEnvironment()
@Deprecated public final void saveAllChanges() throws ConfigurationServiceException
ConfigurationServiceException - if configuration service unavailable@Deprecated public final void saveChangesForCategories(@Argument(name="taggedCategories",description="A list of categories") String... categories)
categories - a list of categoriesConfigurationServiceException - if configuration service
unavailable.@Deprecated public final void saveChangesForCategoriesAs(@Argument(name="taggedCategories",description="A list of pairs categoryName:configurationName") String... taggedCategories)
taggedCategories - a list of pairs categoryName:configurationNameConfigurationServiceException - if the configuration service is not available.@Deprecated public void dropAllChanges()
@Deprecated public void dropChangesForCategories(@Argument(name="categories",description="A list of categories") String... categories)
categories - A list of categories@Deprecated public void loadConfiguration(@Argument(name="taggedCategories",description="a list of pairs categoryName:configurationName") String... taggedCategories)
taggedCategories - a list of pairs categoryName:configurationNameConfigurationServiceExceptionTypeConversionException@Deprecated public void loadCategories(@Argument(name="taggedCategories",description="a list of pairs categoryName:configurationName") String... taggedCategories)
taggedCategories - a list of pairs categoryName:configurationNameConfigurationServiceException@Deprecated public void change(String componentName, String parameterName, Object value)
componentName - the name of the component the parameter belongs to.parameterName - the name of the parameter.value - the new value to affect to this parameter@Deprecated public void submitChange(String componentName, String parameterName, Object value)
componentName - parameterName - value - IllegalArgumentException - if componentName does not have
a configurable parameter named parameterName@Deprecated public void commitBulkChange()
@Deprecated public void dropAllSubmittedChanges()
@Deprecated public void dropSubmittedChangesForComponent(@Argument(description="the component name") String name)
@Deprecated public Map<String,String> getSubmittedChangesForComponent(@Argument(description="the component name") String name)
@Deprecated public Map<String,Map<String,String>> getAllSubmittedChanges()
@Deprecated public Set<String> getCategories()
@Deprecated public Set<String> findAvailableConfigurationsForCategory(String category)
category - @Deprecated public Map<String,String> getCurrentValuesForComponent(String componentName, Set<String> categorySet)
@Deprecated public boolean isParameterConfigurable(String componentName, String parameterName)
componentName - the component nameparameterName - the parameter name@Deprecated public ConfigurationInfo getConfigurationInfo()
@Deprecated public String getTag()
public static final Subsystem getSubsystemForObject(Object obj)
public ComponentConfigurationEnvironment getComponentConfigurationEnvironment(Object obj)
public ComponentConfigurationEnvironment getComponentConfigurationEnvironmentByName(String name)
Copyright © 2016 LSST. All rights reserved.