Class FlowUtils
java.lang.Object
edu.university.ecs.lab.common.utils.FlowUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuildFlows
(MicroserviceSystem microserviceSystem) Method for generating all possibilities of Flowsprivate static List<MethodCall>
This method find's all method calls from the serviceMethod of a flowfindAllRepositorys
(Flow flow) This method finds any jClass affiliated with the repositoryField of a flow.private static List<MethodCall>
This method find's all method calls from the controllerMethod of a flowfindAllServices
(Flow flow) This method finds any jClass affiliated with the serviceField of a flow.private static Field
findRepositoryField
(Flow flow) This method find's the repository field affiliated with a methodCall of a flowprivate static Method
findRepositoryMethod
(Flow flow) This method finds the method affiliated with the repositoryMethodCall of a flowprivate static Field
findServiceField
(Flow flow) This method find's the service field affiliated with a methodCall of a flowprivate static Method
findServiceMethod
(Flow flow) This method finds the method affiliated with the serviceMethodCall of a flowgenerateNewFlows
(Microservice microservice, List<JClass> controllers) generateNewFlows
(Map<Microservice, Set<JClass>> controllerMap) This method generates the base flowsprivate static Map<Microservice,
Set<JClass>> getAllMicroserviceControllers
(MicroserviceSystem microserviceSystem) This method returns a map of microservices to their controller classes
-
Constructor Details
-
FlowUtils
public FlowUtils()
-
-
Method Details
-
buildFlows
Method for generating all possibilities of Flows- Parameters:
microserviceSystem
- the microservice system to scan for flows- Returns:
- the list of all possible flows
-
getAllMicroserviceControllers
private static Map<Microservice,Set<JClass>> getAllMicroserviceControllers(MicroserviceSystem microserviceSystem) This method returns a map of microservices to their controller classes- Parameters:
microserviceSystem
- the microservice system to convert- Returns:
- the map of microservice to JClass controllers
-
generateNewFlows
This method generates the base flows- Parameters:
controllerMap
- the controller map- Returns:
- the base flows
-
generateNewFlows
-
findAllServiceMethodCalls
This method find's all method calls from the controllerMethod of a flow- Parameters:
flow
- the flow- Returns:
- the list of MethodCalls from the controllerMethod of the flow
-
findServiceField
This method find's the service field affiliated with a methodCall of a flow- Parameters:
flow
- the flow- Returns:
- the field called from this flow's serviceMethodCall
-
findAllServices
This method finds any jClass affiliated with the serviceField of a flow. Due to polymorphism the type is not guaranteed to match one class so all possibilities will be considered. Note: This is a source of approximation -- Runtime types- Parameters:
flow
- the flow- Returns:
- the jClass affiliated with the serviceField
-
findServiceMethod
This method finds the method affiliated with the serviceMethodCall of a flow- Parameters:
flow
- the flow- Returns:
- the method affiliated with the serviceMethodCall
-
findAllRepositoryMethodCalls
This method find's all method calls from the serviceMethod of a flow- Parameters:
flow
- the flow- Returns:
- the list of MethodCalls from the serviceMethod of the flow
-
findRepositoryField
This method find's the repository field affiliated with a methodCall of a flow- Parameters:
flow
- the flow- Returns:
- the field called from this flow's repositoryMethodCall
-
findAllRepositorys
This method finds any jClass affiliated with the repositoryField of a flow. Due to polymorphism the type is not guaranteed to match one class so all possibilities will be considered. Note: This is a source of approximation -- Runtime types- Parameters:
flow
- the flow- Returns:
- the jClass affiliated with the repositoryField
-
findRepositoryMethod
This method finds the method affiliated with the repositoryMethodCall of a flow- Parameters:
flow
- the flow- Returns:
- the method affiliated with the repositoryMethodCall
-