Interface HierarchyService
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddEntities(long hierarchyId, Set<Long> entityIds) Attaches the givenSetof entities to the given hierarchy id.voidaddVariables(long hierarchyId, Set<Long> variableIds) Attaches the givenSetof variables to the given hierarchy id.Creates hierarchy as in the parameter NOTE: this is a mutative method.Creates hierarchies as in the parameter NOTE: this is a mutative method.voiddeleteAllLeaves(Set<Hierarchy> hierarchies) Deletes leaf hierarchies NOTE: this is a mutative method.voiddeleteLeaf(Hierarchy hierarchy) Deletes a leaf hierarchy NOTE: this is a mutative method.getChainTo(Hierarchy hierarchy) Returns a full chain of hierarchies from the given parameter to the rootgetEntities(long hierarchyId) Returns theSetof entities attached to a given hierarchy nodegetHierarchiesForVariable(long variableId) Returns aSetof hierarchies where the given variable, as referenced by the provided id.getHierarchiesForVariables(Set<Long> variableIds) Returns aSetof hierarchies grouped by the given variables as referenced by their ids.getHierarchyIdsForVariables(Set<Long> variableIds) Returns aSetof hierarchy ids grouped by the given variables ids.getTopLevel(SystemSpec system) Returns all the top level hierarchies in a given systemgetVariables(long hierarchyId) Returns theSetof variables attached to a given hierarchy nodevoidremoveEntities(long hierarchyId, Set<Long> entityIds) Detaches the givenSetof entities to the given hierarchy id.voidremoveVariables(long hierarchyId, Set<Long> variableIds) Detaches the givenSetof variables to the given hierarchy id.voidsetEntities(long hierarchyId, Collection<Entity> entities) Deprecated.this method will be removed in a future release.voidsetEntities(long hierarchyId, Set<Long> entityIds) Attaches the givenSetof entities to the given hierarchy id.voidsetVariables(long hierarchyId, Collection<Variable> variables) Deprecated.this method will be removed in a future release.voidsetVariables(long hierarchyId, Set<Long> variableIds) Attaches the givenSetof variables to the given hierarchy id.Updates an existing hierarchy to the new values as in the parameter NOTE: this is a mutative method.Updates existing hierarchies to the new values as in the providedSetof parameters NOTE: this is a mutative method.
-
Method Details
-
create
Creates hierarchy as in the parameter NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Parameters:
hierarchy- to be created- Returns:
- Created hierarchy
-
update
Updates an existing hierarchy to the new values as in the parameter NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Parameters:
hierarchy- to be updated- Returns:
- Updated hierarchy or null if the hierarchy does not exist
-
deleteLeaf
Deletes a leaf hierarchy NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Parameters:
hierarchy- to be deleted
-
createAll
Creates hierarchies as in the parameter NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Parameters:
hierarchies- to be created- Returns:
- Created hierarchies
-
updateAll
Updates existing hierarchies to the new values as in the providedSetof parameters NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Parameters:
hierarchies- to be updated- Returns:
- Updated hierarchies
-
deleteAllLeaves
Deletes leaf hierarchies NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Parameters:
hierarchies- to be deleted
-
getTopLevel
Returns all the top level hierarchies in a given system- Parameters:
system- to find top level- Returns:
- set of top level hierarchies
-
getChainTo
Returns a full chain of hierarchies from the given parameter to the root- Parameters:
hierarchy- end-of-chain hierarchy- Returns:
- Optional with value or empty.
-
setVariables
Deprecated.this method will be removed in a future release. Please use setVariables(long hierarchyId, Set<Long> variableIds);Attaches the givenCollectionof variables to the given hierarchy id. The hierarchy id and the variables must exist. NOTE: it replaces any existing attachedSet. NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Parameters:
hierarchyId- hierarchy to attach variables tovariables-Collectionof variables to attach
-
setVariables
Attaches the givenSetof variables to the given hierarchy id. The hierarchy id and the variables must exist. NOTE: it replaces any existing attachedSet. NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Parameters:
hierarchyId- hierarchy to attach variables tovariableIds-Setof variable ids to attach
-
addVariables
Attaches the givenSetof variables to the given hierarchy id. The hierarchy id and the variables must exist. NOTE: it adds to any existing attachedSet. Does not fail if variable already present. NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Parameters:
hierarchyId- hierarchy to attach variables tovariableIds-Setof variable ids to attach
-
removeVariables
Detaches the givenSetof variables to the given hierarchy id. The hierarchy id and the variables must exist. NOTE: it removes from any existing attachedSet. Does not fail if variable already absent. NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Parameters:
hierarchyId- hierarchy to attach variables tovariableIds-Setof variable ids to detach
-
getVariables
Returns theSetof variables attached to a given hierarchy node- Parameters:
hierarchyId- of the hierarchy to query- Returns:
Setof variables attached
-
setEntities
Deprecated.this method will be removed in a future release. Please use setEntities(long hierarchyId, Set<Long> entityIds);Attaches the givenCollectionof entities to the given hierarchy id. The hierarchy id and the entities must exist. NOTE: it replaces any existing attachedSet. NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Parameters:
hierarchyId- hierarchy to attach variables toentities-Collectionof entities to attach
-
setEntities
Attaches the givenSetof entities to the given hierarchy id. The hierarchy id and the entities must exist. NOTE: it replaces any existing attachedSet. NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Parameters:
hierarchyId- hierarchy to attach variables toentityIds-Setof entity ids to attach
-
removeEntities
Detaches the givenSetof entities to the given hierarchy id. The hierarchy id and the entities must exist. NOTE: it removes from any existing attachedSet. Does not fail if entities already absent. NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Parameters:
hierarchyId- hierarchy to attach variables toentityIds-Setof entity ids to detach
-
addEntities
Attaches the givenSetof entities to the given hierarchy id. The hierarchy id and the entities must exist. NOTE: it adds any existing attachedSet. Does not fail if entity already present. NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Parameters:
hierarchyId- hierarchy to attach variables toentityIds-Setof entity ids to attach
-
getEntities
Returns theSetof entities attached to a given hierarchy node- Parameters:
hierarchyId- of the hierarchy to query- Returns:
Setof entities attached
-
getHierarchiesForVariable
Returns aSetof hierarchies where the given variable, as referenced by the provided id. -
getHierarchiesForVariables
Returns aSetof hierarchies grouped by the given variables as referenced by their ids.- Parameters:
variableIds- aSetofVariableids that are attached to hierarchies- Returns:
SetofVariableHierarchiesrepresenting associated hierarchies grouped by variable id
-
getHierarchyIdsForVariables
Returns aSetof hierarchy ids grouped by the given variables ids.- Parameters:
variableIds- aSetofVariableids that are attached to hierarchies- Returns:
SetofVariableHierarchyIdsrepresenting associatedHierarchyids grouped by variable id
-