public class

NodeAssociationStoreImpl

extends Object
implements NodeAssociationStore
java.lang.Object
   ↳ com.atlassian.jira.association.NodeAssociationStoreImpl

Summary

Public Constructors
NodeAssociationStoreImpl(OfBizDelegator ofBizDelegator)
Public Methods
GenericValue createAssociation(String sourceNodeEntity, Long sourceNodeId, String sinkNodeEntity, Long sinkNodeId, String associationType)
Create an association between two entities, given a particular association type.
GenericValue createAssociation(GenericValue source, GenericValue sink, String associationType)
Create an association between two entities, given a particular association type.
void createAssociation(NodeAssocationType type, Long sourceNodeId, Long sinkNodeId)
Create an association between two entities, given a particular association type.
GenericValue getAssociation(GenericValue source, GenericValue sink, String associationType)
List<Long> getSinkIdsFromSource(GenericValue source, String sinkEntityName, String associationType)
List<Long> getSinkIdsFromSource(NodeAssocationType nodeAssocationType, Long sourceNodeId)
List<GenericValue> getSinksFromSource(String sourceEntityName, Long sourceNodeId, String sinkEntityName, String associationType)
List<GenericValue> getSinksFromSource(GenericValue source, String sinkEntityName, String associationType)
Operates on NodeAssociations - gets MANY sinks from ONE source
List<Long> getSourceIdsFromSink(GenericValue sink, String sourceEntity, String associationType)
List<Long> getSourceIdsFromSink(NodeAssocationType nodeAssocationType, Long sinkNodeId)
List<GenericValue> getSourcesFromSink(GenericValue sink, String sourceName, String associationType)
Operates on NodeAssociations - gets MANY sources from ONE sink
void removeAllAssociationsFromSource(String entityName, Long sourceId)
Remove all entity<->entity associations, given the source.
void removeAssociation(NodeAssocationType type, Long sourceNodeId, Long sinkNodeId)
Removes the given association if it exists.
void removeAssociation(GenericValue source, GenericValue sink, String associationType)
void removeAssociationsFromSink(GenericValue sink)
Remove all entity<->entity associations, given the sink.
void removeAssociationsFromSource(NodeAssocationType nodeAssocationType, Long sourceNodeId)
Remove associations of the given type from the given source.
void removeAssociationsFromSource(GenericValue source)
Remove all entity<->entity associations, given the source.
void swapAssociation(List<GenericValue> entities, String associationType, GenericValue fromSink, GenericValue toSink)
Swaps all associations for a given list of entities (say move a list of unresolved issue entities to a new fix for version)
void swapAssociation(String sourceEntityName, String associationType, GenericValue fromSink, GenericValue toSink)
Swap all associations of a particular type from one sink to another.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.association.NodeAssociationStore

Public Constructors

public NodeAssociationStoreImpl (OfBizDelegator ofBizDelegator)

Public Methods

public GenericValue createAssociation (String sourceNodeEntity, Long sourceNodeId, String sinkNodeEntity, Long sinkNodeId, String associationType)

Create an association between two entities, given a particular association type.

If the association already exists - it will not be created.

NOTE: this is a convenience method that should only be used when you are certain of the related entity id's. This method does not verify the integrity of the links it creates.

Returns
  • The new association, or the existing association if it already existed.

public GenericValue createAssociation (GenericValue source, GenericValue sink, String associationType)

Create an association between two entities, given a particular association type.

If the association already exists - it will not be created.

Parameters
source the source
sink the sink
associationType the Association Type
Returns
  • The new association, or the existing association if it already existed.

public void createAssociation (NodeAssocationType type, Long sourceNodeId, Long sinkNodeId)

Create an association between two entities, given a particular association type.

If the association already exists - it will not be created.

public GenericValue getAssociation (GenericValue source, GenericValue sink, String associationType)

public List<Long> getSinkIdsFromSource (GenericValue source, String sinkEntityName, String associationType)

public List<Long> getSinkIdsFromSource (NodeAssocationType nodeAssocationType, Long sourceNodeId)

public List<GenericValue> getSinksFromSource (String sourceEntityName, Long sourceNodeId, String sinkEntityName, String associationType)

public List<GenericValue> getSinksFromSource (GenericValue source, String sinkEntityName, String associationType)

Operates on NodeAssociations - gets MANY sinks from ONE source

Parameters
source The source node to find all associated sink nodes for.
sinkEntityName The sink Entity type.
associationType the association type
Returns
  • List of Sinks for the given Source

public List<Long> getSourceIdsFromSink (GenericValue sink, String sourceEntity, String associationType)

public List<Long> getSourceIdsFromSink (NodeAssocationType nodeAssocationType, Long sinkNodeId)

public List<GenericValue> getSourcesFromSink (GenericValue sink, String sourceName, String associationType)

Operates on NodeAssociations - gets MANY sources from ONE sink

public void removeAllAssociationsFromSource (String entityName, Long sourceId)

Remove all entity<->entity associations, given the source.

Parameters
entityName the Source entity name
sourceId the Source ID

public void removeAssociation (NodeAssocationType type, Long sourceNodeId, Long sinkNodeId)

Removes the given association if it exists.

Parameters
type NodeAssocation Type
sourceNodeId The Source Node
sinkNodeId The Sink Node (destination node).

public void removeAssociation (GenericValue source, GenericValue sink, String associationType)

public void removeAssociationsFromSink (GenericValue sink)

Remove all entity<->entity associations, given the sink.

Parameters
sink the sink

public void removeAssociationsFromSource (NodeAssocationType nodeAssocationType, Long sourceNodeId)

Remove associations of the given type from the given source.

Parameters
nodeAssocationType the NodeAssocationType
sourceNodeId the ID of the source

public void removeAssociationsFromSource (GenericValue source)

Remove all entity<->entity associations, given the source.

Parameters
source the Source

public void swapAssociation (List<GenericValue> entities, String associationType, GenericValue fromSink, GenericValue toSink)

Swaps all associations for a given list of entities (say move a list of unresolved issue entities to a new fix for version)

Parameters
entities the entities
associationType the Association Type
fromSink the From sink
toSink the To sink

public void swapAssociation (String sourceEntityName, String associationType, GenericValue fromSink, GenericValue toSink)

Swap all associations of a particular type from one sink to another.

Used in ComponentDelete and VersionDelete.

Parameters
sourceEntityName the Source Entity Type
associationType the Association Type
fromSink the From sink
toSink the To sink