public abstract class ConfigurableSubsystem extends Subsystem
Agent.RunningCommand| Modifier and Type | Field and Description |
|---|---|
protected ConfigurationProxy |
configurationProxy
Provides access to the configuration service.
|
protected Map<String,ParameterSetter> |
parameterSetterDictionary
The dictionary of config changer methods for each component.
|
commandExecutorLock, currentAction, currentQueries, currentSignals, heartbeatPublisher, innerStateLock, logBusHandler, runtimeInfoPublisher| Constructor and Description |
|---|
ConfigurableSubsystem(String name,
ConfigurationProxy configProxy,
org.lsst.ccs.bus.states.ConfigurationState initialState,
Map<String,ParameterSetter> parameterSetterDictionary) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Set<ParameterPath> |
bulkChange()
Processes the set of submitted changes as a group.
|
void |
change(String componentName,
String parameterName,
Object value)
Single change of parameter.
|
void |
commitBulkChange()
Changes that have been submitted are processed as a group.
|
void |
doStart() |
void |
dropAllChanges()
All unsaved changes are dropped, each parameter goes back to the value specified
by the current configuration for this category.
|
void |
dropAllSubmittedChanges() |
void |
dropBulkChange()
Deprecated.
use dropSubmittedChanges instead
|
void |
dropChangesForCategories(String... categories)
Changes occurring for one of the mentioned categories in categories are dropped,
other categories are left untouched.
|
void |
dropSubmittedChangesForComponent(String name) |
Set<String> |
findAvailableConfigurationsForCategory(String category)
Returns the available configuration names for the given category.
|
Map<String,Map<String,String>> |
getAllSubmittedChanges()
Returns the current submitted changes for each component.
|
Set<String> |
getCategories()
Returns the set of categories the subsystem's configurable parameters are
split into.
|
org.lsst.ccs.bus.data.ConfigurationInfo |
getConfigurationInfo() |
ConfigurationProxy |
getConfigurationProxy() |
Map<String,String> |
getSubmittedChangesForComponent(String name) |
String |
getTag() |
void |
loadCategories(String... taggedCategories)
Loads the configuration specified for each category, parameters that belong
to other categories are left unchanged.
|
void |
loadConfiguration(String... taggedCategories)
Loads the configuration specified for each category specified in configName
and loads the default configuration for the other categories.
|
void |
saveAllChanges()
Saves all changes in their current configuration.
|
void |
saveChangesForCategories(String... categories)
Changes made in the specified categories are saved under the current configuration
for this category, changes on parameters that belong to other categories
are left unchanged.
|
void |
saveChangesForCategoriesAs(String... taggedCategories)
Changes made in the specified categories are saved under the newly specified
name for this category, changes on parameters that belong to other categories
are left unchanged.
|
protected void |
setConfigurationProxy(ConfigurationProxy configurationProxy)
this method should not be used once the proxy is delegated to all components
so it should not be public!
|
void |
submitChange(String componentName,
String parameterName,
Object value)
Stores a change parameter to be validated later.
|
protected void |
updateStateAndSendStatusConfigurationInfo(String message,
Set<ParameterPath> recentChanges)
Updates the state of the subsystem and sends a StatusConfigurationInfo status message
|
protected abstract void |
validateBulkChanges()
Validates the set of submitted changes as a group.
|
abort, abort, addClearAlertHandler, checkAllHardwareStarted, checkAllHardwareStopped, checkHardware, clearAlerts, clearAllAlerts, completeInitialization, completeInitialization, doShutdown, forceShutdown, getLogger, getNumberCommandThreads, getRaisedAlertSummary, internalShutdown, internalStart, ping, postStart, printRunningCommands, raiseAlert, raiseAlert, removeLogPanicState, setBusLogHandlerLevel, setLogFormat, setLogHandlerLevel, setLogLevel, setStackTraceDepth, stop, switchToEngineeringMode, switchToNormalModeaddCommandSet, 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, updateHeartBeat, updateInternalState, waitForprotected ConfigurationProxy configurationProxy
protected final Map<String,ParameterSetter> parameterSetterDictionary
public ConfigurableSubsystem(String name, ConfigurationProxy configProxy, org.lsst.ccs.bus.states.ConfigurationState initialState, Map<String,ParameterSetter> parameterSetterDictionary)
public String getTag()
public ConfigurationProxy getConfigurationProxy()
protected void setConfigurationProxy(ConfigurationProxy configurationProxy)
configurationProxy - @Command(description="Saves all changes in the current configurations", type=CONFIGURATION) public final void saveAllChanges() throws ConfigurationServiceException
ConfigurationServiceException - if configuration service unavailable@Command(description="Saves the specified categories with a name", type=CONFIGURATION) public final void saveChangesForCategories(@Argument(name="taggedCategories",description="A list of categories") String... categories)
categories - a list of categoriesConfigurationServiceException - if configuration service
unavailable.@Command(description="Saves the specified categories with a name", type=CONFIGURATION) 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.@Command(description="drop all unsaved changes", type=CONFIGURATION) public void dropAllChanges()
@Command(description="drop unsaved changes for the specified categories", type=CONFIGURATION) public void dropChangesForCategories(@Argument(name="categories",description="A list of categories") String... categories)
categories - A list of categories@Command(description="loads a new configuration", type=CONFIGURATION) public void loadConfiguration(@Argument(name="taggedCategories",description="a list of pairs categoryName:configurationName") String... taggedCategories)
taggedCategories - a list of pairs categoryName:configurationNameConfigurationServiceExceptionorg.lsst.ccs.utilities.conv.TypeConversionException@Command(description="loads the configuration for the specified categories", type=CONFIGURATION) public void loadCategories(@Argument(name="taggedCategories",description="a list of pairs categoryName:configurationName") String... taggedCategories)
taggedCategories - a list of pairs categoryName:configurationNameConfigurationServiceException@Command(description="return a ConfigurationInfo object", type=CONFIGURATION) public org.lsst.ccs.bus.data.ConfigurationInfo getConfigurationInfo()
@Command(description="Submits a single change to be processed immediately", type=CONFIGURATION) 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@Command(description="Submits a change of parameter to be validated later", type=CONFIGURATION) public void submitChange(String componentName, String parameterName, Object value)
componentName - parameterName - value - IllegalArgumentException - if componentName does not have
a configurable parameter named parameterName@Command(description="processes the bulk change", type=CONFIGURATION) public void commitBulkChange()
protected abstract void validateBulkChanges()
protected abstract Set<ParameterPath> bulkChange()
@Deprecated @Command(description="Drops the submitted changes", type=CONFIGURATION) public void dropBulkChange()
@Command(description="Drops the submitted changes for all components", type=CONFIGURATION) public void dropAllSubmittedChanges()
@Command(description="Drops the submitted changes for the given component", type=CONFIGURATION) public void dropSubmittedChangesForComponent(@Argument(description="the component name") String name)
protected void updateStateAndSendStatusConfigurationInfo(String message, Set<ParameterPath> recentChanges)
message - recentChanges - @Command(description="Returns the current submitted changes for the given component", type=CONFIGURATION) public Map<String,String> getSubmittedChangesForComponent(@Argument(description="the component name") String name)
@Command(description="Returns the current submitted changes for each component", type=CONFIGURATION) public Map<String,Map<String,String>> getAllSubmittedChanges()
@Command(description="returns the categories of this subsystem") public Set<String> getCategories()
@Command(description="returns the available configurations for the given category") public Set<String> findAvailableConfigurationsForCategory(String category)
category - Copyright © 2016 LSST. All rights reserved.