java.lang.Object
edu.university.ecs.lab.detection.architecture.models.AbstractAR
edu.university.ecs.lab.detection.architecture.models.AR4
All Implemented Interfaces:
JsonSerializable

public class AR4 extends AbstractAR
Architectural Rule 4 Class: Floating endpoint
  • Field Details

  • Constructor Details

    • AR4

      public AR4()
  • Method Details

    • getName

      public String getName()
      Description copied from class: AbstractAR
      Get the name of the Architectural Rule
      Specified by:
      getName in class AbstractAR
      Returns:
      string name of the Architectural Rule
    • getDescription

      public String getDescription()
      Description copied from class: AbstractAR
      Get the description of the Architectural Rule
      Specified by:
      getDescription in class AbstractAR
      Returns:
      string description of the Architectural Rule
    • getWeight

      public double getWeight()
      Description copied from class: AbstractAR
      Get the weight of the Architectural Rule
      Specified by:
      getWeight in class AbstractAR
      Returns:
      double weight of the Architectural Rule
    • getMetaData

      public com.google.gson.JsonObject getMetaData()
      Description copied from class: AbstractAR
      Get the meta data of the Architectural Rule
      Specified by:
      getMetaData in class AbstractAR
      Returns:
      JSON object meta data of the Architectural Rule
    • scan

      public static List<AR4> scan(Delta delta, MicroserviceSystem oldSystem, MicroserviceSystem newSystem)
      Scan and compare old microservice system and new microservice system to identify last call removal
      Parameters:
      delta - change between old commit and new microservice systems
      oldSystem - old commit of microservice system
      newSystem - new commit of microservice system
      Returns:
      list of endpoints that were once called but are no longer called
    • getRemovedRestCalls

      private static List<RestCall> getRemovedRestCalls(Delta delta, JClass oldClass)
      This method collects rest calls that were modified and are no longer present in the new system.
      Parameters:
      delta - delta change associated
      oldClass - the delta changed class from the oldSystem
      Returns:
      a set of rest calls
    • getEndpointsWithNoCalls

      private static Set<Endpoint> getEndpointsWithNoCalls(MicroserviceSystem newSystem)
      This method generates a list of endpoints that have no rest calls
      Parameters:
      newSystem - the new system to check for endpoints
      Returns:
      a list of endpoints
    • getType

      public String getType()
      Description copied from class: AbstractAR
      Get the new commitID
      Specified by:
      getType in class AbstractAR
      Returns:
      string new commitID
    • scan2

      public static List<AR4> scan2(MicroserviceSystem oldSystem, MicroserviceSystem newSystem)
      Scan and compare old microservice system and new microservice system to identify last call removal
      Parameters:
      oldSystem - old commit of microservice system
      newSystem - new commit of microservice system
      Returns:
      list of endpoints that have no calls in new commit
    • findMatch

      private static boolean findMatch(Endpoint endpoint, MicroserviceSystem newSystem)
      Check for modified/deleted endpoint in new system
      Parameters:
      endpoint - to find in new system
      newSystem - commit to search in for endpoint
      Returns:
      true if a REST call is found to match the endpoint, false otherwise