Interface HierarchyService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addEntities(long hierarchyId, java.util.Set<java.lang.Long> entityIds)
Attaches the givenSet
of entities to the given hierarchy id.void
addVariables(long hierarchyId, java.util.Set<java.lang.Long> variableIds)
Attaches the givenSet
of variables to the given hierarchy id.Hierarchy
create(Hierarchy hierarchy)
Creates hierarchy as in the parameter NOTE: this is a mutative method.java.util.Set<Hierarchy>
createAll(java.util.Set<Hierarchy> hierarchies)
Creates hierarchies as in the parameter NOTE: this is a mutative method.void
deleteAllLeaves(java.util.Set<Hierarchy> hierarchies)
Deletes leaf hierarchies NOTE: this is a mutative method.void
deleteLeaf(Hierarchy hierarchy)
Deletes a leaf hierarchy NOTE: this is a mutative method.java.util.List<Hierarchy>
getChainTo(Hierarchy hierarchy)
Returns a full chain of hierarchies from the given parameter to the rootjava.util.Set<Entity>
getEntities(long hierarchyId)
Returns theSet
of entities attached to a given hierarchy nodejava.util.Set<Hierarchy>
getHierarchiesForVariable(long variableId)
Returns aSet
of hierarchies where the given variable, as referenced by the provided id.java.util.Set<VariableHierarchies>
getHierarchiesForVariables(java.util.Set<java.lang.Long> variableIds)
Returns aSet
of hierarchies grouped by the given variables as referenced by their ids.java.util.Set<VariableHierarchyIds>
getHierarchyIdsForVariables(java.util.Set<java.lang.Long> variableIds)
Returns aSet
of hierarchy ids grouped by the given variables ids.java.util.Set<Hierarchy>
getTopLevel(SystemSpec system)
Returns all the top level hierarchies in a given systemjava.util.Set<Variable>
getVariables(long hierarchyId)
Returns theSet
of variables attached to a given hierarchy nodevoid
removeEntities(long hierarchyId, java.util.Set<java.lang.Long> entityIds)
Detaches the givenSet
of entities to the given hierarchy id.void
removeVariables(long hierarchyId, java.util.Set<java.lang.Long> variableIds)
Detaches the givenSet
of variables to the given hierarchy id.void
setEntities(long hierarchyId, java.util.Collection<Entity> entities)
Deprecated.this method will be removed in a future release.void
setEntities(long hierarchyId, java.util.Set<java.lang.Long> entityIds)
Attaches the givenSet
of entities to the given hierarchy id.void
setVariables(long hierarchyId, java.util.Collection<Variable> variables)
Deprecated.this method will be removed in a future release.void
setVariables(long hierarchyId, java.util.Set<java.lang.Long> variableIds)
Attaches the givenSet
of variables to the given hierarchy id.Hierarchy
update(Hierarchy hierarchy)
Updates an existing hierarchy to the new values as in the parameter NOTE: this is a mutative method.java.util.Set<Hierarchy>
updateAll(java.util.Set<Hierarchy> hierarchies)
Updates existing hierarchies to the new values as in the providedSet
of parameters NOTE: this is a mutative method.
-
-
-
Method Detail
-
create
Hierarchy create(Hierarchy hierarchy)
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
Hierarchy update(Hierarchy hierarchy)
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
void deleteLeaf(Hierarchy hierarchy)
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
java.util.Set<Hierarchy> createAll(java.util.Set<Hierarchy> hierarchies)
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
java.util.Set<Hierarchy> updateAll(java.util.Set<Hierarchy> hierarchies)
Updates existing hierarchies to the new values as in the providedSet
of 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
void deleteAllLeaves(java.util.Set<Hierarchy> hierarchies)
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
java.util.Set<Hierarchy> getTopLevel(SystemSpec system)
Returns all the top level hierarchies in a given system- Parameters:
system
- to find top level- Returns:
- set of top level hierarchies
-
getChainTo
java.util.List<Hierarchy> getChainTo(Hierarchy hierarchy)
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 void setVariables(long hierarchyId, java.util.Collection<Variable> variables)
Deprecated.this method will be removed in a future release. Please use setVariables(long hierarchyId, Set<Long> variableIds);Attaches the givenCollection
of 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
-Collection
of variables to attach
-
setVariables
void setVariables(long hierarchyId, java.util.Set<java.lang.Long> variableIds)
Attaches the givenSet
of 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
-Set
of variable ids to attach
-
addVariables
void addVariables(long hierarchyId, java.util.Set<java.lang.Long> variableIds)
Attaches the givenSet
of 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
-Set
of variable ids to attach
-
removeVariables
void removeVariables(long hierarchyId, java.util.Set<java.lang.Long> variableIds)
Detaches the givenSet
of 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
-Set
of variable ids to detach
-
getVariables
java.util.Set<Variable> getVariables(long hierarchyId)
Returns theSet
of variables attached to a given hierarchy node- Parameters:
hierarchyId
- of the hierarchy to query- Returns:
Set
of variables attached
-
setEntities
@Deprecated void setEntities(long hierarchyId, java.util.Collection<Entity> entities)
Deprecated.this method will be removed in a future release. Please use setEntities(long hierarchyId, Set<Long> entityIds);Attaches the givenCollection
of 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
-Collection
of entities to attach
-
setEntities
void setEntities(long hierarchyId, java.util.Set<java.lang.Long> entityIds)
Attaches the givenSet
of 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
-Set
of entity ids to attach
-
removeEntities
void removeEntities(long hierarchyId, java.util.Set<java.lang.Long> entityIds)
Detaches the givenSet
of 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
-Set
of entity ids to detach
-
addEntities
void addEntities(long hierarchyId, java.util.Set<java.lang.Long> entityIds)
Attaches the givenSet
of 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
-Set
of entity ids to attach
-
getEntities
java.util.Set<Entity> getEntities(long hierarchyId)
Returns theSet
of entities attached to a given hierarchy node- Parameters:
hierarchyId
- of the hierarchy to query- Returns:
Set
of entities attached
-
getHierarchiesForVariable
java.util.Set<Hierarchy> getHierarchiesForVariable(long variableId)
Returns aSet
of hierarchies where the given variable, as referenced by the provided id.- Parameters:
variableId
- the identification number of the targetVariable
- Returns:
Set
of associated hierarchies
-
getHierarchiesForVariables
java.util.Set<VariableHierarchies> getHierarchiesForVariables(java.util.Set<java.lang.Long> variableIds)
Returns aSet
of hierarchies grouped by the given variables as referenced by their ids.- Parameters:
variableIds
- aSet
ofVariable
ids that are attached to hierarchies- Returns:
Set
ofVariableHierarchies
representing associated hierarchies grouped by variable id
-
getHierarchyIdsForVariables
java.util.Set<VariableHierarchyIds> getHierarchyIdsForVariables(java.util.Set<java.lang.Long> variableIds)
Returns aSet
of hierarchy ids grouped by the given variables ids.- Parameters:
variableIds
- aSet
ofVariable
ids that are attached to hierarchies- Returns:
Set
ofVariableHierarchyIds
representing associatedHierarchy
ids grouped by variable id
-
-