Class IRExtractionService
java.lang.Object
edu.university.ecs.lab.intermediate.create.services.IRExtractionService
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionClone remote repositories and scan through each local repo and extract endpoints/callsvoid
generateIR
(String fileName) Intermediate extraction runner, generates IR from remote repository and writes to file.recursivelyScanFiles
(String rootMicroservicePath) Recursively scan the files in the given repository path and extract the endpoints and dependencies for a single microservice.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.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.
-
Constructor Details
-
IRExtractionService
- Parameters:
configPath
- path to configuration file
-
IRExtractionService
-
-
Method Details
-
generateIR
Intermediate extraction runner, generates IR from remote repository and writes to file. -
cloneAndScanServices
Clone remote repositories and scan through each local repo and extract endpoints/calls- Returns:
- a map of services and their endpoints
-
recursivelyScanFiles
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
-