Class IRExtractionService

java.lang.Object
edu.university.ecs.lab.intermediate.create.services.IRExtractionService

public class IRExtractionService extends Object
Top-level service for extracting intermediate representation from remote repositories. Methods are allowed to exit the program with an error code if an error occurs.
  • Constructor Details

    • IRExtractionService

      public IRExtractionService(String configPath)
      Parameters:
      configPath - path to configuration file
    • IRExtractionService

      public IRExtractionService(Config config)
  • Method Details

    • generateIR

      public void generateIR(String fileName)
      Intermediate extraction runner, generates IR from remote repository and writes to file.
    • cloneAndScanServices

      public Set<Microservice> cloneAndScanServices()
      Clone remote repositories and scan through each local repo and extract endpoints/calls
      Returns:
      a map of services and their endpoints
    • recursivelyScanFiles

      public Microservice recursivelyScanFiles(String rootMicroservicePath)
      Recursively scan the files in the given repository path and extract the endpoints and dependencies for a single microservice.
      Returns:
      model of a single service containing the extracted endpoints and dependencies
    • scanDirectory

      public void scanDirectory(File directory, Set<JClass> controllers, Set<JClass> services, Set<JClass> repositories, Set<JClass> entities)
      Recursively scan the given directory for files and extract the endpoints and dependencies.
      Parameters:
      directory - the directory to scan
    • scanFile

      public void scanFile(File file, Set<JClass> controllers, Set<JClass> services, Set<JClass> repositories, Set<JClass> entities)
      Scan the given file for endpoints and calls to other services.
      Parameters:
      file - the file to scan