Class DataTreeConfiguration

java.lang.Object
org.opendaylight.yangtools.yang.data.tree.api.DataTreeConfiguration
All Implemented Interfaces:
Immutable

@Beta public final class DataTreeConfiguration extends Object implements Immutable
DataTree configuration class.

TreeConfig supports currently the following options:

  • treeType
  • enable/disable unique indexes and unique constraint validation
  • enable/disable mandatory nodes validation

TreeConfig can be easily extended in order to support further data tree configuration options, like following:

  • enable/disable case exclusion validation
  • enable/disable other indexes
  • other schema aware validation options

This can be useful when strict validation is not required or useful for some reasons.

  • Field Details

    • DEFAULT_CONFIGURATION

      public static final @NonNull DataTreeConfiguration DEFAULT_CONFIGURATION
      Default configuration for a data tree storing config true data nodes. It has the following characteristics:
      • mandatory node presence is enforced
      • unique constraints are not enforced
      • version information is not tracked
      • recursive validation of written structures is performed
    • DEFAULT_OPERATIONAL

      public static final @NonNull DataTreeConfiguration DEFAULT_OPERATIONAL
      Default configuration for a data tree storing config false data nodes. It has the following characteristics:
      • mandatory node presence is enforced
      • unique constraints are not enforced
      • version information is not tracked
      • recursive validation of written structures is not performed
  • Method Details

    • getDefault

      public static @NonNull DataTreeConfiguration getDefault(TreeType treeType)
      Returns the default configuration for a TreeType.
      Parameters:
      treeType - the TreeType
      Returns:
      the default configuration
    • builder

      public static @NonNull DataTreeConfiguration.Builder builder(TreeType treeType)
      Returns a new DataTreeConfiguration.Builder initialized for a TreeType.
      Parameters:
      treeType - the TreeType
      Returns:
      a new DataTreeConfiguration.Builder
    • copyBuilder

      @Deprecated(since="14.0.14", forRemoval=true) public @NonNull DataTreeConfiguration.Builder copyBuilder()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • toBuilder

      public @NonNull DataTreeConfiguration.Builder toBuilder()
      Returns a new DataTreeConfiguration.Builder initialized to produce an equivalent configuration to this one.
      Returns:
      a new DataTreeConfiguration.Builder
    • getRootPath

      public @NonNull YangInstanceIdentifier getRootPath()
      Returns the path prefix from the conceptual YANG data store root to the root node of this data tree. Empty indicates the data store root.
      Returns:
      the path prefix
    • getTreeType

      public @NonNull TreeType getTreeType()
      Returns the TreeType of this data tree.
      Returns:
      the TreeType
    • isMandatoryNodesValidationEnabled

      public boolean isMandatoryNodesValidationEnabled()
      Returns true if the presence of mandatory nodes should be enforced. This option is expected to have a minor performance impact.
      Returns:
      true if the presence of mandatory nodes should be enforced
    • isUniqueIndexEnabled

      public boolean isUniqueIndexEnabled()
      Returns true if unique constraints should be enforced. Reference implementation is known to not scale well with this option enabled.
      Returns:
      true if unique constraints should be enforced
    • isVersionInfoTrackingEnabled

      public boolean isVersionInfoTrackingEnabled()
      Returns true if requests to store additional versioning information should be honored. This option is expected to have increase heap metadata usage by 0 (typical JVM configuration) to 50%. This does not includes the overhead of actually stored data, as that is controlled by the user.
      Returns:
      true if requests to store additional versioning information should be honored
    • isRecursiveWriteValidationEnabled

      public boolean isRecursiveWriteValidationEnabled()
      Returns true if written DataContainerNodes should be recursively verified to not contain incorrect data. This option can have significant impact on CPU usage, depending on access patterns.
      Returns:
      true if written DataContainerNodes should be recursively verified
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object