Package com.atlassian.jira.association
Interface UserAssociationStore
- All Known Implementing Classes:
UserAssociationStoreImpl
public interface UserAssociationStore
This Store is used to work with relationships between Users and other objects.
- Since:
- v4.3
-
Method Summary
Modifier and TypeMethodDescriptionboolean
associationExists
(String associationType, ApplicationUser user, String sinkNodeEntity, Long sinkNodeId) Tests if the given association exists.void
createAssociation
(String associationType, ApplicationUser user, Issue sink) Creates an association between a user and a sink node.void
createAssociation
(String associationType, ApplicationUser user, org.ofbiz.core.entity.GenericValue sink) Creates an association between a user and a sink node.void
createAssociation
(String associationType, String userkey, String sinkNodeEntity, Long sinkNodeId) Creates an association between a user and a sink node.List<org.ofbiz.core.entity.GenericValue>
getSinksFromUser
(String associationType, ApplicationUser user, String sinkNodeEntity) Returns all the sinks that are associated with the given User.getUserkeysFromIssue
(String associationType, Long issueId) getUserkeysFromSink
(String associationType, String sinkNodeEntity, Long sinkNodeId) Finds and returns a list of userkeys associated with a given sink.getUsernamesFromSink
(String associationType, org.ofbiz.core.entity.GenericValue sink) Finds and returns a list of usernames associated with a given sink.getUsersFromSink
(String associationType, org.ofbiz.core.entity.GenericValue sink) Finds and returns a list of Users associated with a given sink.void
removeAssociation
(String associationType, ApplicationUser user, Issue sink) Removes an association between a user and a sink node.void
removeAssociation
(String associationType, String userkey, String sinkNodeEntity, Long sinkNodeId) Removes an association between a user and a sink node.void
removeUserAssociationsFromSink
(String sinkNodeEntity, Long sinkNodeId) Removes all User Associations for this Sinkvoid
removeUserAssociationsFromUser
(String associationType, ApplicationUser user, String sinkNodeEntity) Removes all User Associations for this User of the given associationType
-
Method Details
-
associationExists
boolean associationExists(String associationType, ApplicationUser user, String sinkNodeEntity, Long sinkNodeId) Tests if the given association exists.- Parameters:
associationType
- the Association typeuser
- the UsersinkNodeEntity
- The entity name of the sink node (eg "Issue").sinkNodeId
- The id of the sink node.- Returns:
- true if the given association exists.
-
getUsernamesFromSink
Finds and returns a list of usernames associated with a given sink.- Parameters:
associationType
- the Association typesink
- the sink node- Returns:
- a list of associated usernames (never null)
-
getUserkeysFromSink
Collection<String> getUserkeysFromSink(String associationType, String sinkNodeEntity, Long sinkNodeId) Finds and returns a list of userkeys associated with a given sink.- Parameters:
associationType
- the Association typesinkNodeEntity
- The entity name of the sink node (eg "Issue").sinkNodeId
- The id of the sink node.- Returns:
- a list of associated usernames (never null)
-
getUserkeysFromIssue
-
getSinksFromUser
List<org.ofbiz.core.entity.GenericValue> getSinksFromUser(String associationType, ApplicationUser user, String sinkNodeEntity) Returns all the sinks that are associated with the given User.- Parameters:
associationType
- the Association typeuser
- the UsersinkNodeEntity
- The entity name of the sink node (eg "Issue").- Returns:
- all the sinks that are associated with the given User.
-
getUsersFromSink
List<ApplicationUser> getUsersFromSink(String associationType, org.ofbiz.core.entity.GenericValue sink) Finds and returns a list of Users associated with a given sink.- Parameters:
associationType
- the Association typesink
- the sink node- Returns:
- a list of associated Users (never null)
-
createAssociation
void createAssociation(String associationType, ApplicationUser user, org.ofbiz.core.entity.GenericValue sink) Creates an association between a user and a sink node.- Parameters:
associationType
- the Association typeuser
- the user to associate with the sink node.sink
- the sink node
-
createAssociation
Creates an association between a user and a sink node.- Parameters:
associationType
- the Association typeuser
- the user to associate with the sink node.sink
- the sink node
-
createAssociation
void createAssociation(String associationType, String userkey, String sinkNodeEntity, Long sinkNodeId) Creates an association between a user and a sink node.- Parameters:
associationType
- the Association typeuserkey
- the user name to associate with the sink node.sinkNodeEntity
- the entity name of the sink nodesinkNodeId
- the id of the sink node entity
-
removeAssociation
void removeAssociation(String associationType, String userkey, String sinkNodeEntity, Long sinkNodeId) Removes an association between a user and a sink node.- Parameters:
associationType
- the Association typeuserkey
- the user to associate with the sink node.sinkNodeEntity
- the entity name of the sink nodesinkNodeId
- the id of the sink node entity
-
removeAssociation
Removes an association between a user and a sink node.- Parameters:
associationType
- the Association typeuser
- the user to associate with the sink node.sink
- the sink node
-
removeUserAssociationsFromUser
void removeUserAssociationsFromUser(String associationType, ApplicationUser user, String sinkNodeEntity) Removes all User Associations for this User of the given associationType- Parameters:
associationType
- the Association typeuser
- the UsersinkNodeEntity
- The entity name of the sink node (eg "Issue").
-
removeUserAssociationsFromSink
Removes all User Associations for this Sink- Parameters:
sinkNodeEntity
- The entity name of the sink node (eg "Issue").sinkNodeId
- the id of the sink node entity
-