java.lang.Object
com.inductiveautomation.ignition.common.auth.security.level.SecurityLevelConfig
All Implemented Interfaces:
Serializable

public class SecurityLevelConfig extends Object implements Serializable
A SecurityLevelConfig is a node on a security level tree which encapsulates the node's name, its description, and its children.
See Also:
  • Field Details

    • GSON

      public static final com.inductiveautomation.ignition.common.gson.Gson GSON
  • Constructor Details

    • SecurityLevelConfig

      public SecurityLevelConfig(String name)
    • SecurityLevelConfig

      public SecurityLevelConfig(String name, String description, com.google.common.collect.ImmutableCollection<SecurityLevelConfig> children)
  • Method Details

    • getName

      public String getName()
    • getDescription

      public String getDescription()
    • getChildren

      public com.google.common.collect.ImmutableSet<SecurityLevelConfig> getChildren()
    • find

      public static Optional<SecurityLevelConfig> find(com.google.common.collect.ImmutableCollection<SecurityLevelConfig> children, String... path)
    • find

      public Optional<SecurityLevelConfig> find(String... path)
    • hashCode

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

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

      public String toString()
      Overrides:
      toString in class Object
    • fromJson

      public static SecurityLevelConfig fromJson(String s)
    • fromJsonTree

      public static SecurityLevelConfig fromJsonTree(com.inductiveautomation.ignition.common.gson.JsonElement jsonElement)
    • toJson

      public String toJson()
    • toJsonTree

      public com.inductiveautomation.ignition.common.gson.JsonElement toJsonTree()
    • merge

      public static com.google.common.collect.ImmutableSet<SecurityLevelConfig> merge(SecurityLevelConfig... configs)
      Given n number of SecurityLevelConfigs, merges them together such that for each duplicate security level (identified based on the security level name), the duplicates are merged so the resulting security level has the duplicate name, the description of the last duplicate security level in the given array, and children resulting from recursively merging them together using this method. All null SecurityLevelConfigs are ignored.
      Parameters:
      configs - the SecurityLevelConfigs to merge
      Returns:
      the merged ImmutableSet of SecurityLevelConfigs
    • fromPaths

      public static com.google.common.collect.ImmutableSet<SecurityLevelConfig> fromPaths(String[]... paths)

      Merges an arbitrary number of security level paths into a security level tree according to the merging behavior specified by merge(SecurityLevelConfig...).

      Each security level path is represented as a String array where the element at position n represents the name of the node at level n + 1 of a security level sub-tree under the root public node containing only the nodes specified in the path.

      The resultant security level tree is represented as an ImmutableSet of SecurityLevelConfigs where each member of the collection is:

      1. A direct child of the implied root Public security level
      2. Itself the root of a security level sub-tree

      Any null paths or paths with no elements are ignored.

      Parameters:
      paths - the security levels paths to merge
      Returns:
      the security level tree
      See Also:
    • toPaths

      public String[][] toPaths()
      Returns:
      a flattened array of security level paths from the root node of this security level config tree to the leaf nodes