Interface InheritedConfiguration

  • All Known Subinterfaces:
    InheritedActivityConfiguration

    public interface InheritedConfiguration
    This interface resembles a ChangeableConfiguration by the means for inheritance. This allows to build hierarchies of configurations that inherit and override parent configurations. The inheritance of configurations is based on the inheritance of the corresponding entities of the activity model, for instance ActivityTemplateDefinitions and Operations. Since an InheritedConfiguration has a slightly different semantic due to the inheritance and is only used in the activity model, it is separated from the Configuration-class-hierarchy.
    Inheritance on configurations means, a configuration may either provide a value explicitly which overrides the corresponding value of a parent configuration, or it does not provide a value and the value of the parent configuration (or further ancestors) are used. Therefore a null value in a single configuration may either mean to inherit the configuration value from a parent configuration or an undefined value. Check hasOwnValue(String) for this.

    If the conversion for type-safe accesses fails due to an invalid string representation and the parent configuration provides a value this will be used. This excludes getString(String) which returns the string representation of which failed to be parsed.

    Configurations are coupled to configuration descriptions, therefore hierarchical configurations are coupled to the hierarchical configuration descriptions. However not every configuration entry declared as mandatory in a configuration descriptions need to have a value on the same hierarchy level. Such a value may be provided by some child configuration.

    Author:
    Ulrich Kreher
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Set<String> getAllEntries()
      Gets all entry names that have a value different from null in this configuration.
      Boolean getBoolean​(String entryName)
      Gets the boolean configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a boolean value.
      String getConfigurationID​(String entryName)
      Gets the ID of the configuration object, the designated entry name stems from.
      Date getDate​(String entryName)
      Gets the Date configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a Date value.
      Double getFloat​(String entryName)
      Gets the float configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a double value.
      Long getInteger​(String entryName)
      Gets the integer configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a long value.
      String getString​(String entryName)
      Gets the configuration value provided under the designated entry name as string which will always work even if the designated entry has another type.
      byte[] getUDT​(String entryName)
      Gets the UDTValue configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a byte[] value.
      URI getURI​(String entryName)
      Gets the URI configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a URI value.
      boolean hasOwnValue​(String entryName)
      Gets whether the value for the entry with the designated name has an own value within this configuration, that is, the value is not being inherited from the parent configuration.
      boolean isFixed​(String entryName)
      Gets whether the configuration value provided under the designated entry name can not be changed either be explicitly setting the value or overriding it.
      boolean isFixedForChildren​(String entryName)
      Gets whether the designated entry is fixed for child configurations.
      boolean isFixedForChildrenInherited​(String entryName)
      Gets whether the fixed-property for the entry with the designated name is inherited from the parent configuration.
      boolean isOverriding​(String entryName)
      Gets whether the value for the entry with the designated name is actually overriding the value from a parent configuration.
      void remove​(String entryName)
      Removes the value for the entry with the designated name from this configuration that overrides a configuration value from a parent entity.
      void removeFixedForChildren​(String entryName)
      Removes the fixed-property for the entry with the designated name from this configuration that overrides the property from the parent configuration.
      void removeInheritedValue​(String entryName)
      Removes the value with the designated name for the child entities, that is, the value of the entry is overridden and set to null.
      void setBoolean​(String entryName, boolean value)
      Sets the boolean configuration value provided under the designated entry name.
      void setDate​(String entryName, Date value)
      Sets the Date configuration value provided under the designated entry name.
      void setFixedForChildren​(String entryName)
      Sets the configuration value provided under the designated entry name to fixed, that is it must not be overridden in child configurations.
      void setFloat​(String entryName, double value)
      Sets the float configuration value provided under the designated entry name.
      void setInteger​(String entryName, long value)
      Sets the integer configuration value provided under the designated entry name.
      void setString​(String entryName, String value)
      Sets the configuration value provided under the designated entry name as string which will always work even if the designated entry is of another type.
      void setUDT​(String entryName, byte[] value)
      Sets the UDTValue configuration value provided under the designated entry name.
      void setURI​(String entryName, URI value)
      Sets the URI configuration value provided under the designated entry name.
    • Method Detail

      • getBoolean

        Boolean getBoolean​(String entryName)
        Gets the boolean configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a boolean value.
        Parameters:
        entryName - The name of the entry for which to retrieve the boolean value of.
        Returns:
        A boolean configuration value for the designated entry or null in case the value is not present or cannot be parsed to a boolean value.
      • getInteger

        Long getInteger​(String entryName)
        Gets the integer configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a long value.
        Parameters:
        entryName - The name of the entry for which to retrieve the long value of.
        Returns:
        A long configuration value for the designated entry or null in case the value is not present or cannot be parsed to a long value.
      • getFloat

        Double getFloat​(String entryName)
        Gets the float configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a double value.
        Parameters:
        entryName - The name of the entry for which to retrieve the double value of.
        Returns:
        A double configuration value for the designated entry or null in case the value is not present or cannot be parsed to a double value.
      • getString

        String getString​(String entryName)
        Gets the configuration value provided under the designated entry name as string which will always work even if the designated entry has another type. If the value is not present, null will be returned. The value may also be the empty string which will be interpreted as null in type-safe access methods.
        Parameters:
        entryName - The name of the entry for which to retrieve the string representation of the configuration value of.
        Returns:
        A (string representation of the) configuration value for the designated entry or null in case the value is not present.
      • getURI

        URI getURI​(String entryName)
        Gets the URI configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a URI value.
        Parameters:
        entryName - The name of the entry for which to retrieve the URI value of.
        Returns:
        A URI configuration value for the designated entry or null in case the value is not present or cannot be parsed to a URI value.
      • getDate

        Date getDate​(String entryName)
        Gets the Date configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a Date value.
        Parameters:
        entryName - The name of the entry for which to retrieve the Date value of.
        Returns:
        A Date configuration value for the designated entry or null in case the value is not present or cannot be parsed to a Date value.
      • getUDT

        byte[] getUDT​(String entryName)
        Gets the UDTValue configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a byte[] value.
        Parameters:
        entryName - The name for the entry for which to retrieve the byte[] value of.
        Returns:
        A byte[] configuration value for the designated entry or null in case the value is not present or cannot be parsed to a byte[] value.
      • isFixed

        boolean isFixed​(String entryName)
        Gets whether the configuration value provided under the designated entry name can not be changed either be explicitly setting the value or overriding it.
        Parameters:
        entryName - The name for the entry for which to retrieve whether the configuration value must not be changed.
        Returns:
        Whether the configuration value for the designated entry must not be changed.
      • getAllEntries

        Set<String> getAllEntries()
        Gets all entry names that have a value different from null in this configuration.
        Returns:
        All entry names that have a value different from null in this configuration.
      • getConfigurationID

        String getConfigurationID​(String entryName)
        Gets the ID of the configuration object, the designated entry name stems from. This is useful for inherited/merged configurations when checking for invalid configuration values. This allows to provide a reasonable message indicating the problem, for instance "ActivityTemplateDefinition" in case of an overriding configuration of an ActivityTemplateDefinition containing an invalid value.
        Parameters:
        entryName - The name of the entry of which to retrieve the ID of its configuration.
        Returns:
        The ID of the configuration providing a value for the designated entry.
        See Also:
        Configuration.ConfigurationIDs
      • setBoolean

        void setBoolean​(String entryName,
                        boolean value)
        Sets the boolean configuration value provided under the designated entry name. Please check in advance whether this key refers to a boolean configuration value.
        This configuration value applies to this configuration and its children.
        Parameters:
        entryName - The name of the entry for which to set the boolean value of.
        value - A boolean configuration value for the designated entry name.
      • setInteger

        void setInteger​(String entryName,
                        long value)
        Sets the integer configuration value provided under the designated entry name. Please check in advance whether this key refers to an integer configuration value.
        This configuration value applies to this configuration and its children.
        Parameters:
        entryName - The name of the entry for which to set the integer value of.
        value - An integer configuration value for the designated entry name.
      • setFloat

        void setFloat​(String entryName,
                      double value)
        Sets the float configuration value provided under the designated entry name. Please check in advance whether this key refers to a float configuration value.
        This configuration value applies to this configuration and its children.
        Parameters:
        entryName - The name of the entry for which to set the float value of.
        value - A float configuration value for the designated entry name.
      • setString

        void setString​(String entryName,
                       String value)
        Sets the configuration value provided under the designated entry name as string which will always work even if the designated entry is of another type. Please check the type in advance and use the appropriate string conversion for the corresponding type. Otherwise a null value may be returned when using type-safe access due to a failing conversion.
        The value must not be null. Note that the empty string is not a valid typed value and therefore it will be interpreted as null when accessing it with a type-safe method.
        This configuration value applies to this configuration and its children.
        Parameters:
        entryName - The name of the entry for which to set the (string representation of the) configuration value of.
        value - A (string representation of the) configuration value for the designated entry name.
      • setURI

        void setURI​(String entryName,
                    URI value)
        Sets the URI configuration value provided under the designated entry name. Use null if the value should be unset. Please check in advance whether this key refers to a URI configuration value.
        This configuration value applies to this configuration and its children.
        Parameters:
        entryName - The name of the entry for which to set the URI value of.
        value - A URI configuration value for the designated entry name or null in case the value is unset.
      • setDate

        void setDate​(String entryName,
                     Date value)
        Sets the Date configuration value provided under the designated entry name. This must not be null. Please check in advance whether this entry refers to a Date configuration value.
        This configuration value applies to this configuration and its children.
        Parameters:
        entryName - The name of the entry for which to set the Date value of.
        value - A Date configuration value for the designated entry name. This must not be null.
      • setUDT

        void setUDT​(String entryName,
                    byte[] value)
        Sets the UDTValue configuration value provided under the designated entry name. This must not be null. Please check in advance whether this entry refers to a UDTValue configuration value.
        This configuration value applies to this configuration and its children.
        Parameters:
        entryName - The name of the entry for which to set the UDTValue value of.
        value - A UDTValue configuration value for the designated entry name. This must not be null.
      • remove

        void remove​(String entryName)
        Removes the value for the entry with the designated name from this configuration that overrides a configuration value from a parent entity. Afterwards the value is inherited again.
        This configuration value applies to this configuration and its children.
        Calling this method will have no effects if the value of the designated entry is already inherited or unknown.
        Parameters:
        entryName - The name of the configuration entry to remove from this configuration and to inherit from a parent entity again. This must neither be null nor the empty string.
      • isFixedForChildren

        boolean isFixedForChildren​(String entryName)
        Gets whether the designated entry is fixed for child configurations. While isFixed(String) returns whether an entry is fixed for this configuration, this method returns whether the entry is fixed for child configurations. If no (own) value is provided by this configuration, the inherited value of the parent configuration will be returned (which equals isFixed(String)).
        Parameters:
        entryName - The name of the configuration entry for which to retrieve the fixed-property that applies to child configurations of this configuration.
        Returns:
        Whether the designated configuration entry is fixed in child configurations of this configuration.
      • isFixedForChildrenInherited

        boolean isFixedForChildrenInherited​(String entryName)
        Gets whether the fixed-property for the entry with the designated name is inherited from the parent configuration.
        Parameters:
        entryName - The name of the configuration entry which to retrieve whether is fixed-property is inherited from the parent configuration.
        Returns:
        Whether the fixed-property for the entry with the designated name is inherited from the parent configuration.
      • setFixedForChildren

        void setFixedForChildren​(String entryName)
        Sets the configuration value provided under the designated entry name to fixed, that is it must not be overridden in child configurations. It is still allowed to change it in this configuration (and also in the test configuration, see ConfigurationSet and ActivityTemplate).

        Before setting a non-optional configuration value to fixed, it has to be ensured that the value is either provided by this or a parent configuration or at runtime from an input parameter or the process configuration. It must be prevented to set a mandatory parameter to fixed without having a value (at runtime)!

        When setting a configuration value to fixed be sure to remove all overriding values (especially retrieval from a parameter or the process configuration) in child configurations.

        Parameters:
        entryName - The name of the entry for which to prevent changing of the value in child configurations.
      • removeFixedForChildren

        void removeFixedForChildren​(String entryName)
        Removes the fixed-property for the entry with the designated name from this configuration that overrides the property from the parent configuration. Afterwards the property is inherited again.
        Calling this method will have no effects if the property of the designated entry is already inherited.
        Parameters:
        entryName - The name of the configuration entry to remove the fixed-property from this configuration and to inherit from a parent entity again. This must neither be null nor the empty string.
      • hasOwnValue

        boolean hasOwnValue​(String entryName)
        Gets whether the value for the entry with the designated name has an own value within this configuration, that is, the value is not being inherited from the parent configuration.
        Parameters:
        entryName - The name of the configuration entry to check whether it has an own value. This must neither be null nor the empty string.
        Returns:
        Whether the configuration entry with the designated name has an own value within this configuration.
      • isOverriding

        boolean isOverriding​(String entryName)
        Gets whether the value for the entry with the designated name is actually overriding the value from a parent configuration. This is only the case when a value for the entry is present both in this configuration and in any parent configuration. I.e. this method is not simply negating the return value of hasOwnValue(String).
        Parameters:
        entryName - The name of the configuration entry to check whether it is overridden by this configuration. This must neither be null nor the empty string.
        Returns:
        Whether the configuration entry with the designated name is overriding the value from a parent entity.
      • removeInheritedValue

        void removeInheritedValue​(String entryName)
        Removes the value with the designated name for the child entities, that is, the value of the entry is overridden and set to null. The corresponding entry has to exist in the parent configuration description and it must not be fixed.
        Parameters:
        entryName - The name of the configuration entry to remove for the child entities. The entry must exist in a parent configuration description and it must not be fixed.