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

Helper class to handle anything InterfaceSpecification derivation related When used to update / delete nodes, also handles updating/deleting of the following kinds of nodes.

Parameters

updateContext

the NodeBatchUpdater to use for updating/deleting nodes

Constructors

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

Types

Link copied to clipboard
inner class CircularDerivationChecker(val interfaceDefinition: InterfaceDefinition)

Helper to validate if the interfaceDefinition is still visible/invisible derived As InterfaceSpecificationVersion can be derived in a circle, this helper maintains a set of already visited nodes to identify circles A InterfaceSpecificationVersion is only derived if a path the origial source is identified

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

Helper for updating aggregated issues

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
private suspend fun addForUpdatedComponentVersion(componentVersion: ComponentVersion, updatedDefinitions: Set<InterfaceDefinition>)

derives InterfaceSpecificationVersion for a specified ComponentVersion derives via all incoming Relation Performs a transitive graph update

Link copied to clipboard
private suspend fun addForUpdatedRelation(relation: Relation, endDefinitions: Set<InterfaceDefinition>? = null): Set<InterfaceDefinition>

Updates the InterfaceSpecificationVersion derivation for a single Relation Does NOT perform a graph update Only derives additional InterfaceSpecificationVersion, but does not ensure that all already existing InterfaceDefinition on the end of the relation are still derived

Link copied to clipboard
private suspend fun addForUpdatedRelationTransitive(relation: Relation)

Handles the graph update (InterfaceSpecificationVersion derivation) after a Relation has been created / updated Does NOT validate if the Relation can still exist Only ensures derivation of additional InterfaceSpecificationVersion, but does not validate that no longer derived InterfaceSpecificationVersion are updated/removed

suspend fun addInterfaceSpecificationVersionToComponentVersion(interfaceSpecificationVersion: InterfaceSpecificationVersion, componentVersion: ComponentVersion, visible: Boolean, invisible: Boolean)

Adds an InterfaceSpecificationVersion to a ComponentVersion Updates the InterfaceDefinition and creates it if necessary

Link copied to clipboard
private suspend fun createInterface(definition: InterfaceDefinition)

Creates an Interface for an InterfaceDefinition, which has become visible

Link copied to clipboard
suspend fun createRelation(relation: Relation)

Called after a Relation has been created Handles the derivation of InterfaceSpecificationVersions

Link copied to clipboard
suspend fun deleteComponent(component: Component)

Deletes a Component

Link copied to clipboard
suspend fun deleteComponentVersion(componentVersion: ComponentVersion)
Link copied to clipboard
private suspend fun deleteInterface(node: Interface)

Deletes an Interface Handles deletion of associated IntraComponentDependencyParticipants and, if necessary, IntraComponentDependencySpecifications

Link copied to clipboard
private suspend fun deleteInterfaceDefinition(definition: InterfaceDefinition)
Link copied to clipboard
suspend fun deleteInterfaceSpecification(interfaceSpecification: InterfaceSpecification)
Link copied to clipboard
suspend fun deleteRelation(relation: Relation)

Deletes a Relation

Link copied to clipboard
private suspend fun deriveInterfaceSpecificationVersion(condition: InterfaceSpecificationDerivationCondition, canBeVisible: Boolean, canBeInvisible: Boolean, componentVersion: ComponentVersion, interfaceSpecificationVersion: InterfaceSpecificationVersion, relation: Relation): Set<InterfaceDefinition>

Derives an interfaceSpecificationVersion via a relation to a componentVersion Does not perform a graph update

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 getOrCreateInterfaceDefinition(componentVersion: ComponentVersion, interfaceSpecificationVersion: InterfaceSpecificationVersion): InterfaceDefinition

Gets or creates if non-existing a InterfaceDefinition for a ComponentVersion and an InterfaceSpecificationVersion If created, adds it to the updated nodes

Link copied to clipboard
private suspend fun handleUpdatedInterfaceDefinition(definition: InterfaceDefinition)

Handles the update of an InterfaceDefinition. Creates / deletes the associated Interface if necessary Deletes the provided InterfaceDefinition if necessary

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

Locks all incoming and outgoing RelationPartners of a RelationPartner

suspend fun removeInterfaceSpecificationVersionFromComponentVersion(interfaceSpecificationVersion: InterfaceSpecificationVersion, componentVersion: ComponentVersion, visible: Boolean, invisible: Boolean)

Removes an InterfaceSpecificationVersion from a ComponentVersion Updates the InterfaceDefinition and deletes it if necessary

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
suspend fun updateComponentTemplate(component: Component)

Called after the template of a Component has been updated Validates InterfaceDefinitions and Relations Does NOT handle updating SubTemplates

Link copied to clipboard

Called after the template of an InterfaceSpecification Validates InterfaceDefinitions and Relations oes NOT handle updating SubTemplates

Link copied to clipboard
suspend fun updateRelationTemplate(relation: Relation)

Called after a template of a Relation has been updated Updates the derivation of InterfaceSpecificationVersions Does not validate if the Relation can still exist

Link copied to clipboard
private suspend fun validateComponentVersion(componentVersion: ComponentVersion, endInterfaceSpecificationVersions: Set<InterfaceSpecificationVersion>? = null)

Validates InterfaceDefinitions on componentVersion Removes / updates those if InterfaceSpecificationVersions are no longer derived Performs a graph update

Called after the template of a Component or an InterfaceSpecification was updated Validates that interfaceDefinition can still be present on the associated ComponentVersion, and if not, removes it (maybe partially) Does NOT perform any validation of the graph

private suspend fun validateInterfaceDefinitionsOnComponentVersion(componentVersion: ComponentVersion, endDefinitions: Set<InterfaceDefinition>? = null)

Validates InterfaceDefinitions on a ComponentVersion Removes / updates those if InterfaceSpecificationVersions are no longer derived Uses CircularDerivationChecker to remove despite circular derivation Performs a graph update

Link copied to clipboard
private suspend fun validateRelatedComponentVersions(componentVersion: ComponentVersion, endInterfaceSpecificationVersions: Set<InterfaceSpecificationVersion>? = null)

Validates InterfaceDefinitions on ComponentVersions incoming-related to the provided componentVersion Removes / updates those if InterfaceSpecificationVersions are no longer derived Performs a graph update

Link copied to clipboard
private suspend fun validateRelation(relation: Relation, startTemplate: RelationPartnerTemplate<*, *>, endTemplate: RelationPartnerTemplate<*, *>)

Validates if a Relation an still exist after the template of either its start or end has been updated If not, deletes the relation and handles the resulting graph update

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

Validates both incoming and outgoing relations of a RelationPartner after the template of said RelationPartner has been updated Deletes Relations if necessary, and handles updates to InterfaceSpecificationVersion derivation Does NOT validate InterfaceSpecificationVersion derivation independent of Relation deletion