Interface IConfigurationPropertyStoreService


public interface IConfigurationPropertyStoreService

Used to gain access to properties in the Configuration Property Store

The framework will be configured with a single Configuration Property Store where all the global properties are kept. However, for test runs, an override property store will also be used to provide run specific properties.

etcd3 is the preferred property store for Galasa

An IConfigurationPropertyStore can be obtained from IFramework.getCertificateStoreService().

Author:
Michael Baylis, Matthew Chivers
  • Method Details

    • getProperty

      @Null @Null String getProperty(@NotNull @NotNull String prefix, @NotNull @NotNull String suffix, String... infixes) throws ConfigurationPropertyStoreException

      Retrieves a string property from the Configuration Property Store within the namespace for this object.

      getProperty will search the Override Configuration Store first per property iteration and then the standard Configuration Property Store.

      As an example, if we called getProperty("image", "credentialid", "PLEXMA", "MVMA") within the zos namespace, then the following properties will be searched for:-
      zos.image.PLEXMA.MVMA.credentialid in the OCPS
      zos.image.PLEXMA.MVMA.credentialid in the CPS
      zos.image.PLEXMA.credentialid in the OCPS
      zos.image.PLEXMA.credentialid in the CPS
      zos.image.credentialid in the OCPS
      zos.image.credentialid in the CPS

      If a property is not found, null will be returned.

      Retrieved properties and their values will be saved in the Result Archive for diagnostic purposes to understand how the properties should be configured for Managers

      Parameters:
      prefix - The prefix of the property name within the namespace.
      suffix - The suffix of the property name.
      infixes - Any optional infixes of the property name.
      Returns:
      Throws:
      ConfigurationPropertyStoreException
    • getPrefixedProperties

      @NotNull @NotNull Map<String,String> getPrefixedProperties(@NotNull @NotNull String prefix) throws ConfigurationPropertyStoreException
      Retrieves the properties for the namespace using the supplied prefix. getProperty will search the Override Configuration Store first.
      Parameters:
      prefix - - the prefix to use
      Returns:
      A map of the properties and the values
      Throws:
      ConfigurationPropertyStoreException - - If there is a problem with the fetch
    • setProperty

      @Null void setProperty(@NotNull @NotNull String name, @NotNull @NotNull String value) throws ConfigurationPropertyStoreException

      Sets a string property from the Configuration Property Store within the namespace for this object.

      setProperty will set the property in the standard Configuration Property Store.

      As an example, if we called setProperty("image.PLEXMA.credentialid", "PLEXMACREDS") within the zos namespace, then the following property will be set:-
      zos.image.PLEXMA.credentialid=PLEXMACREDS

      If a property is not set, a ConfigurationPropertyStoreException is thrown .

      Set properties and their values will be saved in the Result Archive for diagnostic purposes to understand how the properties should be configured for Managers

      Parameters:
      name - The property name within the namespace.
      value - The value of the property.
      Throws:
      ConfigurationPropertyStoreException
    • deleteProperty

      void deleteProperty(@NotNull @NotNull String name) throws ConfigurationPropertyStoreException

      Removes a string property from the Configuration Property Store within the namespace for this object.

      deleteProperty will delete the property from the standard Configuration Property Store.

      As an example, if we called deleteProperty("image.PLEXMA.credentialid") within the zos namespace, then the following property will be deleted:-
      zos.image.PLEXMA.credentialid=VALUE

      If a property could not be deleted, a ConfigurationPropertyStoreException is thrown.

      Parameters:
      name - The property name within the namespace.
      Throws:
      ConfigurationPropertyStoreException
    • getAllProperties

      Map<String,String> getAllProperties()

      Retrieves all possible different properties set from a namespace

      Returns:
      Map of names and values of all properties
    • reportPropertyVariants

      String[] reportPropertyVariants(@NotNull @NotNull String prefix, @NotNull @NotNull String suffix, String... infixes)

      Retrieves all possible different property variations that would be searched, in the search order.

      If a manager cant get a property, it can report all the properties you could set to get a resolve the problem

      Parameters:
      prefix - - The prefix of the property name within the namespace.
      suffix - - The suffix of the property name.
      infixes - - Any optional infixes of the property name.
      Returns:
      array of property names
    • reportPropertyVariantsString

      String reportPropertyVariantsString(@NotNull @NotNull String prefix, @NotNull @NotNull String suffix, String... infixes)

      Retrieves all possible different property variations that would be searched, in the search order.

      If a manager cant get a property, it can report all the properties you could set to get a resolve the problem

      Parameters:
      prefix - - The prefix of the property name within the namespace.
      suffix - - The suffix of the property name.
      infixes - - Any optional infixes of the property name.
      Returns:
      comma separated property names
    • getCPSNamespaces

      List<String> getCPSNamespaces()

      Return all namespaces which have properties set

      Returns:
      List all namespaces with properties set