class IssueAggregationUpdater(updateContext: NodeBatchUpdater = NodeBatchUpdateContext()) : GraphUpdater

Helper class to handle anything AggregatedIssue related. After using, nodes from deletedNodes must be deleted, and nodes from updatedNodes must be saved

Constructors

Link copied to clipboard
constructor(updateContext: NodeBatchUpdater = NodeBatchUpdateContext())

Properties

Link copied to clipboard
open override val cache: NodeCache

Cache used to ensure that only one instance of each Node is loaded by the algorithm

Link copied to clipboard
open override val deletedNodes: MutableSet<Node>

Nodes which should be deleted

Link copied to clipboard
open override val internalUpdatedNodes: MutableSet<Node>

Nodes which are updated and need to be saved This may contain nodes also present in deletedNodes

Link copied to clipboard
open override val updatedNodes: Set<Node>

Nodes which are updated and need to be saved Does not include any deleted nodes

Functions

Link copied to clipboard
suspend fun addedAffectedEntity(issue: Issue, affectedEntity: AffectedByIssue)

Should be called when an Issue affects an additional entity. Must be called AFTER the affected entity was added to the issue.

Link copied to clipboard
private suspend fun addedAffectedInterfaceRelatedEntity(issue: Issue, interfaces: Collection<Interface>)

Handles the case of an Issue affecting Interfaces, directly or indirectly.

private suspend fun addedAffectedInterfaceRelatedEntity(issue: Issue, interfaceSpecificationVersions: Set<InterfaceSpecificationVersion>)

Handles the case of an Issue affecting an interface related entity (InterfacePart, InterfaceSpecificationVersion, InterfaceSpecification). All relevant InterfaceSpecificationVersions must be provided, each related Interface will be updated. Relevance depends on the type of affected entity.

Link copied to clipboard
suspend fun addedIssueToTrackable(issue: Issue, trackable: Trackable)

Should be called when an Issue is added to a Trackable. Must be called AFTER the issue was added to the trackable.

Link copied to clipboard
private suspend fun aggregateIssueOnComponentIfNecessary(issue: Issue, component: Component)

Aggregates an Issue on a Component if necessary. It is necessary only if the issue is on the Component and does not affect an entity related to said Component.

Link copied to clipboard
suspend fun changedIssueStateOrType(issue: Issue, oldState: IssueState, oldType: IssueType)

Should be called when the state or type of an issue was changed. Musts be called AFTER the change was applied to the issue.

Link copied to clipboard
private suspend fun componentRelatedEntities(component: Component): Set<AffectedByIssue>

Gets all entities related to a Component. This includes

Link copied to clipboard
suspend fun createdComponentVersion(componentVersion: ComponentVersion)

Should be called when a ComponentVersion is created.

Link copied to clipboard
suspend fun createdInterface(createdInterface: Interface)

Should be called when an Interface is created

Link copied to clipboard
suspend fun createdIssueRelation(issueRelation: IssueRelation)

Should be called when an IssueRelation is created. Must be called AFTER the relation was created.

Link copied to clipboard
private suspend fun createOrUpdateAggregatedIssue(relationPartner: RelationPartner, issue: Issue)

Aggregates an Issue on a RelationPartner. Handles the case of an Issue already being aggregated on the RelationPartner.

Link copied to clipboard

Creates or updates an AggregatedIssueRelation between two AggregatedIssues. Handles the case of an IssueRelation already being aggregated on the AggregatedIssueRelation.

Link copied to clipboard
private suspend fun deleteAggregatedIssue(aggregatedIssue: AggregatedIssue)

Deletes an AggregatedIssue and all relations.

Link copied to clipboard
suspend fun deletedComponentVersion(componentVersion: ComponentVersion)

Should be called when a ComponentVersion is deleted. Must be called BEFORE the component version is deleted from the database.

Link copied to clipboard
suspend fun deletedInterface(deletedInterface: Interface)

Should be called when an Interface is deleted Must be called BEFORE the interface is deleted from the database.

Link copied to clipboard
suspend fun deletedInterfacePart(interfacePart: InterfacePart)

Should be called when an InterfacePart is deleted Must be called BEFORE the interface part is deleted from the database.

Link copied to clipboard
suspend fun deletedIssue(issue: Issue)

Should be called when an Issue was deleted. Must be called BEFORE the issue is deleted from the database.

Link copied to clipboard
suspend fun deletedIssueRelation(issueRelation: IssueRelation)

Should be called when an IssueRelation is deleted.

Link copied to clipboard
private suspend fun doesIssueAffectComponentRelatedEntity(issue: Issue, component: Component): Boolean

Checks if an Issue affects an entity related to a Component.

Link copied to clipboard
private suspend fun expandRelationPartner(relationPartner: RelationPartner, stack: ArrayDeque<RelationPartner>)

Helper to

Link copied to clipboard
private suspend fun findIncomingRelationPartners(relationPartner: RelationPartner): Set<RelationPartner>

Finds all RelationPartners that are connected to a RelationPartner via incoming Relations. Also considers Interfaces of ComponentVersions.

Link copied to clipboard
private suspend fun findOutgoingRelationPartners(relationPartner: RelationPartner): Set<RelationPartner>

Finds all RelationPartners that are connected to a RelationPartner via outgoing Relations. Also considers Interfaces of ComponentVersions.

Link copied to clipboard
private suspend fun isIssueStillAggregatedByInterface(issue: Issue, inter: Interface): Boolean

Checks if an Issue is still aggregated by an Interface.

Link copied to clipboard
protected suspend fun lockIncomingAndOutgoingRelationPartners(relationPartner: RelationPartner)

Locks all incoming and outgoing RelationPartners of a RelationPartner

Link copied to clipboard
private suspend fun relationPartnerDeleted(relationPartner: RelationPartner)

Handles the deletion of an Interface or ComponentVersion Deletes all associated AggregatedIssues and relations.

Link copied to clipboard
suspend fun removedAffectedEntity(issue: Issue, affectedEntity: AffectedByIssue)

Should be called when an Issue does not affect an entity anymore. Must be called AFTER the affected entity was removed from the issue.

Link copied to clipboard
private suspend fun removedAffectedInterfaceRelatedEntity(issue: Issue, interfaces: Collection<Interface>)

Handles the case of an Issue no longer affecting Interfaces, directly or indirectly. Handles the case that the Issue still affects the Interfaces.

private suspend fun removedAffectedInterfaceRelatedEntity(issue: Issue, interfaceSpecificationVersions: Set<InterfaceSpecificationVersion>)

Handles the case of an Issue no longer affecting an interface related entity (InterfacePart, InterfaceSpecificationVersion, InterfaceSpecification). All relevant InterfaceSpecificationVersions must be provided, each related Interface will be updated. Relevance depends on the type of affected entity.

Link copied to clipboard
suspend fun removedIssueFromTrackable(issue: Issue, trackable: Trackable)

Should be called when an Issue is removed from a Trackable. Must be called AFTER the issue is removed from the trackable.

Link copied to clipboard
private suspend fun removeIssueFromAggregatedIssue(issue: Issue, aggregatedIssue: AggregatedIssue)

Removes an Issue from an AggregatedIssue. Handles the case of the Issue not being aggregated on the AggregatedIssue.

private suspend fun removeIssueFromAggregatedIssueOnRelationPartner(issue: Issue, relationPartner: RelationPartner)

Removes an issue from an AggregatedIssue on a RelationPartner. Handles the case of the Issue not being aggregated on the RelationPartner.

private suspend fun removeIssueRelationFromAggregatedIssueRelation(issueRelation: IssueRelation, aggregatedIssueRelation: AggregatedIssueRelation)

Removes an IssueRelation from an AggregatedIssueRelation. Deletes the AggregatedIssueRelation if it is no longer required.

Link copied to clipboard
open suspend override fun save(nodeRepository: NodeRepository)
open suspend override fun <T : Node> save(node: T, nodeRepository: NodeRepository): T

Deletes all deletedNodes and saves all updatedNodes to the database

Link copied to clipboard
private suspend fun unaggregateIssueOnComponentIfNecessary(issue: Issue, component: Component)

Unaggregates an Issue from a ComponentVersion if necessary. It is necessary only if the issue is on the Component and affects an entity related to said Component. It is only unaggregated on ComponentVersions where the issue does not affect the Component or ComponentVersion itself.