com.atlassian.jira.association
Class UserAssociationStoreImpl

java.lang.Object
  extended by com.atlassian.jira.association.UserAssociationStoreImpl
All Implemented Interfaces:
UserAssociationStore

public class UserAssociationStoreImpl
extends Object
implements UserAssociationStore

Since:
v4.3

Constructor Summary
UserAssociationStoreImpl(OfBizDelegator ofBizDelegator, UserManager userManager)
           
 
Method Summary
 boolean associationExists(String associationType, ApplicationUser user, String sinkNodeEntity, Long sinkNodeId)
          Tests if the given association exists.
 boolean associationExists(String associationType, com.atlassian.crowd.embedded.api.User user, String sinkNodeEntity, Long sinkNodeId)
          Tests if the given association exists.
 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, ApplicationUser user, Issue sink)
          Creates an association between a user and a sink node.
 void createAssociation(String associationType, String userName, 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.
 Collection<String> getUserkeysFromIssue(String associationType, Long issueId)
           
 Collection<String> getUserkeysFromSink(String associationType, String sinkNodeEntity, Long sinkNodeId)
          Finds and returns a list of userkeys associated with a given sink.
 List<String> getUsernamesFromSink(String associationType, org.ofbiz.core.entity.GenericValue sink)
          Finds and returns a list of usernames associated with a given sink.
 List<ApplicationUser> 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 Sink
 void removeUserAssociationsFromUser(String associationType, ApplicationUser user, String sinkNodeEntity)
          Removes all User Associations for this User of the given associationType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserAssociationStoreImpl

public UserAssociationStoreImpl(OfBizDelegator ofBizDelegator,
                                UserManager userManager)
Method Detail

createAssociation

public void createAssociation(String associationType,
                              ApplicationUser user,
                              org.ofbiz.core.entity.GenericValue sink)
Description copied from interface: UserAssociationStore
Creates an association between a user and a sink node.

Specified by:
createAssociation in interface UserAssociationStore
Parameters:
associationType - the Association type
user - the user to associate with the sink node.
sink - the sink node

createAssociation

public void createAssociation(String associationType,
                              ApplicationUser user,
                              Issue sink)
Description copied from interface: UserAssociationStore
Creates an association between a user and a sink node.

Specified by:
createAssociation in interface UserAssociationStore
Parameters:
associationType - the Association type
user - the user to associate with the sink node.
sink - the sink node

createAssociation

public void createAssociation(String associationType,
                              String userName,
                              String sinkNodeEntity,
                              Long sinkNodeId)
Description copied from interface: UserAssociationStore
Creates an association between a user and a sink node.

Specified by:
createAssociation in interface UserAssociationStore
Parameters:
associationType - the Association type
userName - the user name to associate with the sink node.
sinkNodeEntity - the entity name of the sink node
sinkNodeId - the id of the sink node entity

removeAssociation

public void removeAssociation(String associationType,
                              String userkey,
                              String sinkNodeEntity,
                              Long sinkNodeId)
Description copied from interface: UserAssociationStore
Removes an association between a user and a sink node.

Specified by:
removeAssociation in interface UserAssociationStore
Parameters:
associationType - the Association type
userkey - the user to associate with the sink node.
sinkNodeEntity - the entity name of the sink node
sinkNodeId - the id of the sink node entity

removeAssociation

public void removeAssociation(String associationType,
                              ApplicationUser user,
                              Issue sink)
Description copied from interface: UserAssociationStore
Removes an association between a user and a sink node.

Specified by:
removeAssociation in interface UserAssociationStore
Parameters:
associationType - the Association type
user - the user to associate with the sink node.
sink - the sink node

removeUserAssociationsFromUser

public void removeUserAssociationsFromUser(String associationType,
                                           ApplicationUser user,
                                           String sinkNodeEntity)
Description copied from interface: UserAssociationStore
Removes all User Associations for this User of the given associationType

Specified by:
removeUserAssociationsFromUser in interface UserAssociationStore
Parameters:
associationType - the Association type
user - the User
sinkNodeEntity - The entity name of the sink node (eg "Issue").

removeUserAssociationsFromSink

public void removeUserAssociationsFromSink(String sinkNodeEntity,
                                           Long sinkNodeId)
Description copied from interface: UserAssociationStore
Removes all User Associations for this Sink

Specified by:
removeUserAssociationsFromSink in interface UserAssociationStore
Parameters:
sinkNodeEntity - The entity name of the sink node (eg "Issue").
sinkNodeId - the id of the sink node entity

associationExists

public boolean associationExists(String associationType,
                                 com.atlassian.crowd.embedded.api.User user,
                                 String sinkNodeEntity,
                                 Long sinkNodeId)
Description copied from interface: UserAssociationStore
Tests if the given association exists.

Specified by:
associationExists in interface UserAssociationStore
Parameters:
associationType - the Association type
user - the User
sinkNodeEntity - The entity name of the sink node (eg "Issue").
sinkNodeId - The id of the sink node.
Returns:
true if the given association exists.

associationExists

public boolean associationExists(String associationType,
                                 ApplicationUser user,
                                 String sinkNodeEntity,
                                 Long sinkNodeId)
Description copied from interface: UserAssociationStore
Tests if the given association exists.

Specified by:
associationExists in interface UserAssociationStore
Parameters:
associationType - the Association type
user - the User
sinkNodeEntity - The entity name of the sink node (eg "Issue").
sinkNodeId - The id of the sink node.
Returns:
true if the given association exists.

getUsersFromSink

public List<ApplicationUser> getUsersFromSink(String associationType,
                                              org.ofbiz.core.entity.GenericValue sink)
Description copied from interface: UserAssociationStore
Finds and returns a list of Users associated with a given sink.

Specified by:
getUsersFromSink in interface UserAssociationStore
Parameters:
associationType - the Association type
sink - the sink node
Returns:
a list of associated Users (never null)

getUsernamesFromSink

public List<String> getUsernamesFromSink(String associationType,
                                         org.ofbiz.core.entity.GenericValue sink)
Description copied from interface: UserAssociationStore
Finds and returns a list of usernames associated with a given sink.

Specified by:
getUsernamesFromSink in interface UserAssociationStore
Parameters:
associationType - the Association type
sink - the sink node
Returns:
a list of associated usernames (never null)

getUserkeysFromSink

public Collection<String> getUserkeysFromSink(String associationType,
                                              String sinkNodeEntity,
                                              Long sinkNodeId)
Description copied from interface: UserAssociationStore
Finds and returns a list of userkeys associated with a given sink.

Specified by:
getUserkeysFromSink in interface UserAssociationStore
Parameters:
associationType - the Association type
sinkNodeEntity - 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

public Collection<String> getUserkeysFromIssue(String associationType,
                                               Long issueId)
Specified by:
getUserkeysFromIssue in interface UserAssociationStore

getSinksFromUser

public List<org.ofbiz.core.entity.GenericValue> getSinksFromUser(String associationType,
                                                                 ApplicationUser user,
                                                                 String sinkNodeEntity)
Description copied from interface: UserAssociationStore
Returns all the sinks that are associated with the given User.

Specified by:
getSinksFromUser in interface UserAssociationStore
Parameters:
associationType - the Association type
user - the User
sinkNodeEntity - The entity name of the sink node (eg "Issue").
Returns:
all the sinks that are associated with the given User.


Copyright © 2002-2014 Atlassian. All Rights Reserved.