Interface EntityManager
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.
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionFind a top-level entity of the given name.default MutableEntity
List<org.apache.commons.lang3.tuple.Pair<StringPath,
Entity>> getEntitiesForSection
(Set<String> sectionLabels, int depth) default MutableEntity
Register a top-level entity with this manager.register
(String name, Consumer<EntityBuilder> builderConsumer)
-
Field Details
-
CONFIGURATION_ENTITY
- See Also:
-
STATUS_ENTITY
- See Also:
-
-
Method Details
-
register
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, seeEntity.getChildren()
-
register
-
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, usingMutableEntity.addChild(Entity)
-
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
Find a top-level entity of the given name.- Parameters:
name
- The name to look for (case-insensitive)
-
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 anEntity
of the top-level entities registered with this manager that are in the given section. - See Also:
-