Class Microservice

java.lang.Object
edu.university.ecs.lab.common.models.ir.Microservice
All Implemented Interfaces:
JsonSerializable

public class Microservice extends Object implements JsonSerializable
Represents the overarching structure of a microservice system. It is composed of classes which hold all information in that class.
  • Field Details

    • name

      private String name
      The name of the service (ex: "ts-assurance-service")
    • path

      private String path
      The path to the folder that represents the microservice
    • controllers

      private final Set<JClass> controllers
      Controller classes belonging to the microservice.
    • services

      private final Set<JClass> services
      Service classes to the microservice.
    • repositories

      private final Set<JClass> repositories
      Repository classes belonging to the microservice.
    • entities

      private final Set<JClass> entities
      Entity classes belonging to the microservice.
    • feignClients

      private final Set<JClass> feignClients
      Feign client classes belonging to the microservice.
    • files

      private final Set<ConfigFile> files
      Static files belonging to the microservice.
  • Constructor Details

    • Microservice

      public Microservice(String name, String path)
  • Method Details

    • toJsonObject

      public com.google.gson.JsonObject toJsonObject()
      Specified by:
      toJsonObject in interface JsonSerializable
      Returns:
      a JsonObject representing this
    • toJsonArray

      private static com.google.gson.JsonArray toJsonArray(Iterable<com.google.gson.JsonObject> list)
      Returns:
    • addJClass

      public void addJClass(JClass jClass)
      Update's the microservice name of the JClass and add's it to the appropriate Set
      Parameters:
      jClass - the JClass to add
    • removeJClass

      public void removeJClass(String path)
      This method removes a JClass from the microservice by looking up it's path
      Parameters:
      path - the path to search for removal
    • removeProjectFile

      public void removeProjectFile(String filePath)
      This method removes a ProjectFile from the microservice by looking up it's path
      Parameters:
      filePath - the path to search for
    • getClasses

      public Set<JClass> getClasses()
      This method returns all classes of the microservice in a new set
      Returns:
      the set of all JClasses
    • getAllFiles

      public Set<ProjectFile> getAllFiles()
      This method returns all files of a microservice, it is the aggregate of getClasses() and getFiles()
      Returns:
      the set of all classes and files
    • getRestCalls

      public List<RestCall> getRestCalls()
      This method returns all rest calls of a microservice
      Returns:
      the list of all rest calls
    • getEndpoints

      public Set<Endpoint> getEndpoints()
      This method returns all endpoints of a microservice
      Returns:
      the set of all endpoints
    • getMethodCalls

      public Set<MethodCall> getMethodCalls()
      This method returns all method calls of a microservice
      Returns:
      the set of all method calls
    • getMethods

      public Set<Method> getMethods()
      This method returns all methods of a microservice
      Returns:
      the set of all methods