Class CyclicDependencyMSLevelService

java.lang.Object
edu.university.ecs.lab.detection.antipatterns.services.CyclicDependencyMSLevelService

public class CyclicDependencyMSLevelService extends Object
Service class for detecting cyclic dependencies in a microservice network graph.
  • Field Details

  • Constructor Details

    • CyclicDependencyMSLevelService

      public CyclicDependencyMSLevelService()
  • Method Details

    • findCyclicDependencies

      public CyclicDependency findCyclicDependencies(ServiceDependencyGraph graph)
      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

      private void findCycles(Microservice currentNode)
      Checks if there is a cycle starting from the current node.
      Parameters:
      currentNode - the current node to check
    • reconstructCyclePath

      private List<String> reconstructCyclePath(Microservice startNode, Microservice currentNode)
      Reconstructs the cycle path from startNode to currentNode using the parentMap.
      Parameters:
      startNode - the start node of the cycle
      currentNode - the current node to reconstruct path to
      Returns:
      the list of nodes representing the cycle path