Class AR21
java.lang.Object
edu.university.ecs.lab.detection.architecture.models.AbstractAR
edu.university.ecs.lab.detection.architecture.models.AR21
- All Implemented Interfaces:
JsonSerializable
Architectural Rule 21 Class: Wrongcuts Service
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDetects all clusters of wrongly interconnected services in the given network graph.private static voiddfs(Microservice currentNode, Map<Microservice, Set<Microservice>> adjacencyList, Set<Microservice> visited, Set<String> cluster) Performs Depth-First Search (DFS) to traverse and collect all nodes in the current cluster of wrong cuts.Get the description of the Architectural Rulecom.google.gson.JsonObjectGet the meta data of the Architectural RulegetName()Get the name of the Architectural RulegetType()Get the new commitIDdoubleGet the weight of the Architectural Rulescan(MicroserviceSystem oldSystem, MicroserviceSystem newSystem) Scan and compare old microservice system and new microservice system to identify wrongly interconnected servicesMethods inherited from class edu.university.ecs.lab.detection.architecture.models.AbstractAR
getNewCommitID, getOldCommitID, toJsonObject
-
Field Details
-
TYPE
Architectural rule 21 details- See Also:
-
NAME
- See Also:
-
DESC
- See Also:
-
oldCommitID
-
newCommitID
-
metaData
protected com.google.gson.JsonObject metaData
-
-
Constructor Details
-
AR21
public AR21()
-
-
Method Details
-
getName
Description copied from class:AbstractARGet the name of the Architectural Rule- Specified by:
getNamein classAbstractAR- Returns:
- string name of the Architectural Rule
-
getDescription
Description copied from class:AbstractARGet the description of the Architectural Rule- Specified by:
getDescriptionin classAbstractAR- Returns:
- string description of the Architectural Rule
-
getWeight
public double getWeight()Description copied from class:AbstractARGet the weight of the Architectural Rule- Specified by:
getWeightin classAbstractAR- Returns:
- double weight of the Architectural Rule
-
getType
Description copied from class:AbstractARGet the new commitID- Specified by:
getTypein classAbstractAR- Returns:
- string new commitID
-
getMetaData
public com.google.gson.JsonObject getMetaData()Description copied from class:AbstractARGet the meta data of the Architectural Rule- Specified by:
getMetaDatain classAbstractAR- Returns:
- JSON object meta data of the Architectural Rule
-
scan
Scan and compare old microservice system and new microservice system to identify wrongly interconnected services- Parameters:
oldSystem- old commit of microservice systemnewSystem- new commit of microservice system- Returns:
- list of wrongly interconnected service clusters
-
detectWrongCuts
Detects all clusters of wrongly interconnected services in the given network graph.- Parameters:
graph- The network graph representing microservices and their dependencies.- Returns:
- A list of sets, each containing services that are wrongly interconnected (forming a cluster).
-
dfs
private static void dfs(Microservice currentNode, Map<Microservice, Set<Microservice>> adjacencyList, Set<Microservice> visited, Set<String> cluster) Performs Depth-First Search (DFS) to traverse and collect all nodes in the current cluster of wrong cuts.- Parameters:
currentNode- The current node being visited.adjacencyList- The adjacency list representing the network graph.visited- Set of visited nodes to avoid revisiting.cluster- Set to collect all nodes belonging to the current cluster of wrong cuts.
-