Class CyclicDependencyMSLevelService
java.lang.Object
edu.university.ecs.lab.detection.antipatterns.services.CyclicDependencyMSLevelService
Service class for detecting cyclic dependencies in a microservice network graph.
-
Field Summary
Modifier and TypeFieldDescriptionprivate ServiceDependencyGraph
private Map<Microservice,
Microservice> private Set<Microservice>
private Set<Microservice>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
findCycles
(Microservice currentNode) Checks if there is a cycle starting from the current node.Finds all cyclic dependencies in the given network graph.reconstructCyclePath
(Microservice startNode, Microservice currentNode) Reconstructs the cycle path from startNode to currentNode using the parentMap.
-
Field Details
-
allCycles
-
visited
-
recStack
-
parentMap
-
graph
-
-
Constructor Details
-
CyclicDependencyMSLevelService
public CyclicDependencyMSLevelService()
-
-
Method Details
-
findCyclicDependencies
Finds all cyclic dependencies in the given network graph.- Parameters:
graph
- the network graph to analyze- Returns:
- a CyclicDependency object representing all detected cycles
-
findCycles
Checks if there is a cycle starting from the current node.- Parameters:
currentNode
- the current node to check
-
reconstructCyclePath
Reconstructs the cycle path from startNode to currentNode using the parentMap.- Parameters:
startNode
- the start node of the cyclecurrentNode
- the current node to reconstruct path to- Returns:
- the list of nodes representing the cycle path
-