Package org.lsst.ccs

Class ComponentConfigurationEnvironment

java.lang.Object
org.lsst.ccs.ComponentConfigurationEnvironment

public class ComponentConfigurationEnvironment extends Object
Utility class to provide access to the Configuration API for a given component. It provides the same configuration API as ConfigurationService but dedicated to the component it extends.
  • Method Details

    • change

      @Command(description="engineering mode change of parameter value", type=CONFIGURATION, category=CORE, level=1) public void change(@Argument(name="parameterName",description="Configuration parameter name") String parameterName, @Argument(name="value",description="Configuration parameter value") Object value)
      Single change of parameter that belongs to this component.
      The value is validated and the parameter is immediately set to this value, without interfering with the current set of submitted changes. If the change is effective, the configuration state goes to DIRTY.
      Parameters:
      parameterName - the name of the parameter.
      value - the new value to affect to this parameter
      Throws:
      ConfigurationServiceException - if the change has not been registered to the configuration service.
      BulkValidationException - if setting the parameters fails at the validation step. The configuration state remains unchanged.
      BulkSettingException - if setting the parameter fails at the setting step, or if a suspicious change is detected at the validation step, or if the final values of the parameters is not consistent with the performed change. Existing submitted changes are dropped and an alert is raised.
      IllegalStateException - if the subsystem is not in engineering mode.
    • submitChange

      @Command(description="submit a potential change for a parameter", type=CONFIGURATION, category=CORE, level=1) public void submitChange(@Argument(name="parameterName",description="Configuration parameter name") String parameterName, @Argument(name="value",description="Configuration parameter value") Object value)
      Submits a change.
      The change will be effective once commitBulkChange is invoked and successful. This does not affect the subsystem configuration state.
      Parameters:
      parameterName - a parameter that belongs to this component
      value - the new value to submit for this component.
      Throws:
      IllegalArgumentException - if componentName does not have a configurable parameter named parameterName
      IllegalStateException - if the subsystem is not in engineering mode.
    • submitChanges

      @Command(description="submit potential changes for parameters", type=CONFIGURATION, category=CORE, level=1) public void submitChanges(Map<String,Object> values)
      Submit a collection of changes. If one submission fails all preceding submissions are dropped. The changes will be validated and set when issuing ConfigurableSubsystem#commitBulkChange()
      Parameters:
      values - a map of parameter name and the new value to submit for this parameter
    • printComponentConfigurationParameters

      @Command(description="displays the current values of the parameters that belong to the given categories", type=QUERY, category=CORE, level=0) @Option(name="dirtyOnly",description="Only print information about dirty configuration parameters") @Option(name="originTag",description="Show in which tag the parameter is defined") public String printComponentConfigurationParameters(Options options, String... categories)
      Returns the current values of the configuration parameters that belong to this component and to the specified categories. If no categories are provided we print configuration parameters for all categories.
      Parameters:
      options - The provided command options
      categories - The categories to print. If empty or null, all categories are displayed.
      Returns:
      A String with a printout of the component configuration parameters for the provided categories.
    • getSubmittedChanges

      @Command(description="prints the current state of the submitted changes", type=CONFIGURATION, category=CORE, level=1) public Map<String,String> getSubmittedChanges()
      Gets the submitted changes for the specified component
      Returns:
      a map of parameter names to their submitted value
      Throws:
      IllegalArgumentException - if there is no component named name
    • dropSubmittedChanges

      @Command(name="cancelSubmittedChanges", description="drops the submitted changes for this component", type=CONFIGURATION, category=CORE, level=1) public void dropSubmittedChanges()
    • commitSubmittedChangesForComponent

      @Command(name="applySubmittedChangesForComponent", description="commit the submitted changes for this component", type=CONFIGURATION, category=CORE, level=1) public void commitSubmittedChangesForComponent()