
public interface Configurable
private Configurable.Environment environment ;
public void setEnvironment(Environment env) {
this.environment = env ;
}
public Environment getEnvironment() {
return this.environment ;
}
Since Java 8: many methods are now default methods and so do not need to be implemented
using the Environment object.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Configurable.Environment
instances of this class are created by the subsystem startup.
|
| Modifier and Type | Method and Description |
|---|---|
default void |
change(String parameterName,
Object value)
Implementation of this method
should be annotated as
|
default void |
dropSubmittedChanges() |
default ViewValue |
getCheckedValueFromConfiguration(String parameterName,
Object value)
Deprecated.
use isParameterConfigurable(String parameterName) instead.
|
default <T> LinkedHashMap<String,T> |
getChildren(Class<T> clazz)
return a map of children that are "assignable to" the argument class.
|
default Object |
getComponentByName(String name)
Request for a component that bears the specified name.
|
Configurable.Environment |
getEnvironment() |
default String |
getName() |
default Map.Entry<String,Object> |
getParent()
Returns name and value of the parent object.
|
default Object |
getParentObject() |
default Map<String,String> |
getSubmittedChanges() |
default Subsystem |
getSubsystem() |
default void |
init()
This method is called from the enclosing subsystem constructor.
|
default Boolean |
isParameterConfigurable(String parameterName) |
default void |
notifyChange(String parameterName,
String value)
to be used by "facade" commands that may set a value
the calling must have made a preliminary check with the configuration service. |
default void |
notifyChangeWithoutPreliminaryChecks(String parameterName,
Object value)
to be used by "facade" commands that may set a value then notify the
configuration without going through the preliminary check of the
configuration service.
|
default void |
postStart()
once all hardware components have been started this method is invoked.
|
default Map<String,String> |
printConfigurableParameters(String... categories) |
default Map<String,Object> |
setBulkParameter(Map<String,Object> parametersView)
Override with by hand setting of the parameters in parametersView
|
void |
setEnvironment(Configurable.Environment environment)
sets the current Environment Object for the Component.
|
default void |
shutdownNow()
requires the component to perform end of life operation.
|
default void |
start()
The component is ready to respond.
|
default void |
submitChange(String parameterName,
Object value)
Submit a change for a parameter.
|
default void |
submitChanges(Map<String,Object> values)
Submit a collection of changes.
|
default void |
validateBulkChange(Map<String,Object> parametersView)
Override with more advanced parameter validation checking.
|
void setEnvironment(Configurable.Environment environment)
environment - Configurable.Environment getEnvironment()
default Subsystem getSubsystem()
default void init()
default void start()
default void postStart()
throws HardwareException
HardwareExceptiondefault void shutdownNow()
default String getName()
Configurabledefault Object getComponentByName(String name)
name - default <T> LinkedHashMap<String,T> getChildren(Class<T> clazz)
T - clazz - could be an interface (or even Object.class)default Object getParentObject()
default Map.Entry<String,Object> getParent()
@Command(description="engineering mode change of parameter value", type=CONFIGURATION) default void change(@Argument(name="parameterName",description="Configuration parameter name") String parameterName, @Argument(name="value",description="Configuration parameter value") Object value)
@Command(description = "engineering mode change of parameter value", type = CommandType.CONFIGURATION)
parameterName - the name of the parameter to changevalue - the value to affect to this parameter@Command(description="submit a potential change for a parameter", type=CONFIGURATION) default void submitChange(@Argument(name="parameterName",description="Configuration parameter name") String parameterName, @Argument(name="value",description="Configuration parameter value") Object value)
parameterName - the name of the parametervalue - the new value to submit for this parameter@Command(description="submit potential changes for parameters", type=CONFIGURATION) default void submitChanges(Map<String,Object> values)
ConfigurableSubsystem#commitBulkChange()values - a map of parameter name and the new value to submit for this parameter@Command(description="displays the current values of the parameters that belong to the given categories", type=CONFIGURATION) default Map<String,String> printConfigurableParameters(String... categories)
@Command(description="prints the current state of the submitted changes", type=CONFIGURATION) default Map<String,String> getSubmittedChanges()
@Command(description="drops the submitted changes for this component", type=CONFIGURATION) default void dropSubmittedChanges()
default void validateBulkChange(Map<String,Object> parametersView)
parametersView - the whole set of parameters with their value to be validateddefault Map<String,Object> setBulkParameter(Map<String,Object> parametersView)
parametersView - a map of parameter names with the new value for this
parameter@Deprecated default ViewValue getCheckedValueFromConfiguration(String parameterName, Object value) throws Exception
parameterName - value - Exception - if the configuration service is unreachable or the
parsing fails or additional constraints added by the configuration
faildefault void notifyChangeWithoutPreliminaryChecks(String parameterName, Object value)
parameterName - value - A string representing the value to be changed (use
String.valueOf(Object) if necessary)Copyright © 2016 LSST. All rights reserved.