Class GroupProvider
java.lang.Object
cern.nxcals.api.extraction.metadata.AbstractProvider<Group,GroupClient,cern.nxcals.api.extraction.metadata.queries.Groups>
cern.nxcals.api.extraction.metadata.GroupProvider
- All Implemented Interfaces:
AbstractGroupService<Group,,cern.nxcals.api.extraction.metadata.queries.Groups> GroupService,Queryable<Group,,cern.nxcals.api.extraction.metadata.queries.Groups> cern.nxcals.internal.extraction.metadata.InternalGroupService
public class GroupProvider
extends AbstractProvider<Group,GroupClient,cern.nxcals.api.extraction.metadata.queries.Groups>
implements cern.nxcals.internal.extraction.metadata.InternalGroupService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEntities(long groupId, Map<String, Set<Long>> entityIdsPerAssociation) Attaches the givenMapof entities to the given group, by adding the provided entities to the corresponding association.voidaddVariables(long groupId, Map<String, Set<Long>> variableIdsPerAssociation) Attaches the givenMapof associations to the given group, by adding the provided variables to the corresponding association.Creates group as in the parameter NOTE: this is a mutative method.voiddelete(long groupId) Deletes an existing groupfindById(long id) getEntities(long groupId) Returns the complete map of entities grouped by their association to a given groupgetVariables(long groupId) Returns the complete map of variables grouped by their association to a given groupvoidremoveEntities(long groupId, Map<String, Set<Long>> entityIdsPerAssociation) Detaches the givenMapof entities from the given group.voidremoveVariables(long groupId, Map<String, Set<Long>> variableIdsPerAssociation) Detaches the givenMapof variables from the given group.voidsetEntities(long groupId, Map<String, Set<Long>> entityIdsPerAssociation) Attaches the givenMapof entities to the given group, overwriting any existing associations.voidsetVariables(long groupId, Map<String, Set<Long>> variableIdsPerAssociation) Attaches the givenMapof variables to the given group, overwriting any existing associations.Updates an existing group to the new values as in the parameter NOTE: this is a mutative method.Methods inherited from class cern.nxcals.api.extraction.metadata.AbstractProvider
findAll, findOne, getCache, validate
-
Constructor Details
-
GroupProvider
-
-
Method Details
-
findById
-
create
Description copied from interface:AbstractGroupServiceCreates group as in the parameter NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Specified by:
createin interfaceAbstractGroupService<Group,cern.nxcals.api.extraction.metadata.queries.Groups> - Parameters:
group- to be created- Returns:
- Created group
-
update
Description copied from interface:AbstractGroupServiceUpdates an existing group 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- Specified by:
updatein interfaceAbstractGroupService<Group,cern.nxcals.api.extraction.metadata.queries.Groups> - Parameters:
group- to be updated- Returns:
- Updated group or null if the group does not exist
-
delete
public void delete(long groupId) Description copied from interface:AbstractGroupServiceDeletes an existing group- Specified by:
deletein interfaceAbstractGroupService<Group,cern.nxcals.api.extraction.metadata.queries.Groups> - Parameters:
groupId- the id of the group to be deleted
-
getVariables
Description copied from interface:AbstractGroupServiceReturns the complete map of variables grouped by their association to a given group- Specified by:
getVariablesin interfaceAbstractGroupService<Group,cern.nxcals.api.extraction.metadata.queries.Groups> - Parameters:
groupId- of the group to query- Returns:
Mapof variables grouped by their association type to the group
-
setVariables
Description copied from interface:AbstractGroupServiceAttaches the givenMapof variables to the given group, overwriting any existing associations. In case the association(s) do not exist, it creates and sets the variables as described by their ids. The group and the variables must exist. The map key should represent the association type of the enclosed variableSet. NOTE: this action replaces any existing associations. The resulted associations would reflect the provided context. NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Specified by:
setVariablesin interfaceAbstractGroupService<Group,cern.nxcals.api.extraction.metadata.queries.Groups> - Parameters:
groupId- group to attach variables tovariableIdsPerAssociation-Mapof variable ids to attach, grouped by the association type
-
addVariables
Description copied from interface:AbstractGroupServiceAttaches the givenMapof associations to the given group, by adding the provided variables to the corresponding association. In case the association(s) do not exist, it creates and adds the variables as described by their ids. The group and the variables to add must exist. The map key should represent the association type of the enclosed variableSet. NOTE: this action only adds to any existing attachedSet. Does not fail if variable already present. The resulted associations would reflect the merged product of the existing associations and the provided ones. NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Specified by:
addVariablesin interfaceAbstractGroupService<Group,cern.nxcals.api.extraction.metadata.queries.Groups> - Parameters:
groupId- group to attach variables tovariableIdsPerAssociation-Mapof variable ids to attach, grouped by the association type
-
removeVariables
Description copied from interface:AbstractGroupServiceDetaches the givenMapof variables from the given group. The map key should represent the association type of the enclosed variableSet. The group 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- Specified by:
removeVariablesin interfaceAbstractGroupService<Group,cern.nxcals.api.extraction.metadata.queries.Groups> - Parameters:
groupId- group to attach variables tovariableIdsPerAssociation-Mapof variable ids to detach, grouped by the association type
-
getEntities
Description copied from interface:AbstractGroupServiceReturns the complete map of entities grouped by their association to a given group- Specified by:
getEntitiesin interfaceAbstractGroupService<Group,cern.nxcals.api.extraction.metadata.queries.Groups> - Parameters:
groupId- of the group to query- Returns:
Mapof entities grouped by their association type to the group
-
setEntities
Description copied from interface:AbstractGroupServiceAttaches the givenMapof entities to the given group, overwriting any existing associations. In case the association(s) do not exist, it creates and sets the entities as described by their ids. The group and the entities must exist. The map key should represent the association type of the enclosed entitySet. NOTE: this action replaces any existing associations. The resulted associations would reflect the provided context. NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Specified by:
setEntitiesin interfaceAbstractGroupService<Group,cern.nxcals.api.extraction.metadata.queries.Groups> - Parameters:
groupId- id of the group to attach entities toentityIdsPerAssociation-Mapof entity ids to attach, grouped by the association type
-
addEntities
Description copied from interface:AbstractGroupServiceAttaches the givenMapof entities to the given group, by adding the provided entities to the corresponding association. In case the association(s) do not exist, it creates and adds the entities as described by their ids. The group and the entities to add must exist. The map key should represent the association type of the enclosed entitySet. NOTE: this action only adds to any existing attachedSet. Does not fail if entity already present. The resulted associations would reflect the merged product of the existing associations and the provided ones. NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Specified by:
addEntitiesin interfaceAbstractGroupService<Group,cern.nxcals.api.extraction.metadata.queries.Groups> - Parameters:
groupId- group to attach entities toentityIdsPerAssociation-Mapof entity ids to attach, grouped by the association type
-
removeEntities
Description copied from interface:AbstractGroupServiceDetaches the givenMapof entities from the given group. The map key should represent the association type of the enclosed entitySet. The group and the entities must exist. NOTE: it removes from any existing attachedSet. Does not fail if entity already absent. NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel- Specified by:
removeEntitiesin interfaceAbstractGroupService<Group,cern.nxcals.api.extraction.metadata.queries.Groups> - Parameters:
groupId- group to attach entities toentityIdsPerAssociation-Mapof entity ids to detach, grouped by the association type
-