Interface PropertyActions

All Known Subinterfaces:
ConfigActions

public interface PropertyActions
This code is experimental. While this interface is functional and tested, it may change or be removed in a future version of the library.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.codice.ddf.admin.configurator.Operation<Void>
    create(Path configFile, Map<String,String> configs)
    Creates a handler for persisting property file changes to a new property file.
    org.codice.ddf.admin.configurator.Operation<Void>
    delete(Path configFile)
    Creates a handler for deleting a property file.
    getProperties(Path propFile)
    Gets the current key:value pairs set in the given property file.
    org.codice.ddf.admin.configurator.Operation<Void>
    update(Path configFile, Map<String,String> configs, boolean keepIfNotPresent)
    Creates a handler for persisting property file changes to an existing property file.
  • Method Details

    • create

      org.codice.ddf.admin.configurator.Operation<Void> create(Path configFile, Map<String,String> configs) throws org.codice.ddf.admin.configurator.ConfiguratorException
      Creates a handler for persisting property file changes to a new property file.
      Parameters:
      configFile - the property file to be created
      configs - map of key:value pairs to be written to the property file
      Returns:
      instance of this class
      Throws:
      org.codice.ddf.admin.configurator.ConfiguratorException - if an error occurs creating the operator
    • delete

      org.codice.ddf.admin.configurator.Operation<Void> delete(Path configFile) throws org.codice.ddf.admin.configurator.ConfiguratorException
      Creates a handler for deleting a property file.
      Parameters:
      configFile - the property file to be deleted
      Returns:
      instance of this class
      Throws:
      org.codice.ddf.admin.configurator.ConfiguratorException - if an error occurs creating the operator
    • update

      org.codice.ddf.admin.configurator.Operation<Void> update(Path configFile, Map<String,String> configs, boolean keepIfNotPresent) throws org.codice.ddf.admin.configurator.ConfiguratorException
      Creates a handler for persisting property file changes to an existing property file.
      Parameters:
      configFile - the property file to be updated
      configs - map of key:value pairs to be written to the property file
      keepIfNotPresent - if true, any keys in the current property file that are not in the configs map will be left with their initial values; if false, they will be removed from the file
      Returns:
      instance of this class
      Throws:
      org.codice.ddf.admin.configurator.ConfiguratorException - if an error occurs creating the operator
    • getProperties

      Map<String,String> getProperties(Path propFile) throws org.codice.ddf.admin.configurator.ConfiguratorException
      Gets the current key:value pairs set in the given property file.
      Parameters:
      propFile - the property file to query
      Returns:
      the current set of key:value pairs
      Throws:
      org.codice.ddf.admin.configurator.ConfiguratorException - if there is an error reading the state