public interface EntityManager
The EntityManager is responsible for managing the registration and retrieval of registered Entities. An Entity is an abstraction that can represent a configuration item, a status item, or any other item that the Ignition Gateway or a module wishes to expose to the user. Entities can have children, which are other entities, creating a hierarchical structure.

The top level of the entity tree are statically registered entities, which can be registered using register(Entity). However, it is uncommon for systems to register top-level Entities. Instead, there are two well-known top-level entities that are automatically created and managed by the EntityManager:

  • CONFIGURATION_ENTITY - Represents all configuration items that the user can configure on the gateway.
  • STATUS_ENTITY - Represents all status items that are not directly configurable on the gateway. These are often items that are part of projects that are running on the gateway and configured in the designer.
These two special entities are MutableEntity instances, which means that they can have children added to them using MutableEntity.addChild(Entity). See getConfigurationEntity() and getStatusEntity().

NOTE: the entity system is automatically aware of the configuration Resource system. Any resources that have a ResourceTypeMeta registered will automatically be included in the configuration entity.

  • Field Details

  • Method Details

    • register

      EntityManager register(Entity entity)
      Register a top-level entity with this manager. Note that this entity can have a dynamic set of child entities that do not need to be specifically registered, see Entity.getChildren()
    • register

      EntityManager register(String name, Consumer<EntityBuilder> builderConsumer)
    • getConfigurationEntity

      default MutableEntity getConfigurationEntity()
      Returns:
      The well-known top-level entity representing all "configuration" items. These are items that the user can configure on the gateway. This entity will automatically include all resources which have a ResourceTypeMeta registered. Other configurable entities may be registered as well, using MutableEntity.addChild(Entity)
    • getStatusEntity

      default MutableEntity getStatusEntity()
      Returns:
      The well-known top-level entity representing "status" items. These are items which are not directly configurable on the gateway, often because they are part of projects that are running on the gateway and configured in the designer. Entities may be registered using MutableEntity.addChild(Entity)
    • find

      Optional<Entity> find(String name)
      Find a top-level entity of the given name.
      Parameters:
      name - The name to look for (case-insensitive)
    • getEntities

      List<Entity> getEntities()
      Returns:
      A list of all top-level entities registered with this manager.
    • getEntitiesForSection

      List<org.apache.commons.lang3.tuple.Pair<StringPath,Entity>> getEntitiesForSection(Set<String> sectionLabels, int depth)
      Parameters:
      sectionLabels - A list of the labels of the sections to get entities for.
      Returns:
      A List of Pairs containing a StringPath and an Entity of the top-level entities registered with this manager that are in the given section.
      See Also: