Search in sources :

Example 6 with RefinementCandidate

use of org.eclipse.winery.model.adaptation.substitution.refinement.RefinementCandidate in project winery by eclipse.

the class PatternRefinementTest method redirectStayMappings.

// endregion
// region ********** redirectStayMappings **********
@Test
void redirectStayMappings() {
    setUp();
    /*
        input:
        #######   (1)  #######
        # (1) # <----- # (2) #
        #######        #######
                          | (2)
                         \/
                       #######
                       # (4) #
                       #######

        expected output:
        #######   (1)  ########        ########
        # (1) # <----- # (10) #        # (11) #
        #######        ########        ########
                           | (2)          | (2)
                           +-------|------+
                                  \/
                                #######
                                # (4) #
                                #######
         */
    // region *** add stay mapping to PRM ***
    TTopologyTemplate refinementTopology = candidateForTopology.getRefinementModel().getRefinementTopology();
    TTopologyTemplate detector = candidateForTopology.getRefinementModel().getDetector();
    refinementTopology.getNodeTemplateOrRelationshipTemplate().removeIf(template -> template.getId().equals("13") || template.getId().equals("1213"));
    TNodeTemplate nt12 = refinementTopology.getNodeTemplate("12");
    assertNotNull(nt12);
    nt12.setType("{http://ex.org}nodeType_4");
    TNodeTemplate nt4 = detector.getNodeTemplate("8");
    OTStayMapping nt4staysAsNt12 = new OTStayMapping.Builder("stay1").setDetectorElement(nt4).setRefinementElement(nt12).build();
    ((OTPatternRefinementModel) candidateForTopology.getRefinementModel()).setStayMappings(Collections.singletonList(nt4staysAsNt12));
    // endregion
    // recreate the candidate
    ToscaGraph topologyGraph = ToscaTransformer.createTOSCAGraph(topology2);
    ToscaGraph detectorGraph = ToscaTransformer.createTOSCAGraph(detector);
    GraphMapping<ToscaNode, ToscaEdge> mapping = new ToscaIsomorphismMatcher().findMatches(detectorGraph, topologyGraph, new ToscaTypeMatcher()).next();
    candidateForTopology = new RefinementCandidate(candidateForTopology.getRefinementModel(), mapping, detectorGraph, 1);
    PatternRefinement patternRefinement = new PatternRefinement();
    patternRefinement.applyRefinement(candidateForTopology, topology2);
    // region *** assertions ***
    assertNotNull(topology2.getNodeTemplate("4"));
    TRelationshipTemplate relation1012 = topology2.getRelationshipTemplate("1012");
    assertNotNull(relation1012);
    assertEquals("4", relation1012.getTargetElement().getRef().getId());
    assertEquals("10", relation1012.getSourceElement().getRef().getId());
    TRelationshipTemplate relation1112 = topology2.getRelationshipTemplate("1112");
    assertNotNull(relation1112);
    assertEquals("4", relation1112.getTargetElement().getRef().getId());
    assertEquals("11", relation1112.getSourceElement().getRef().getId());
    TRelationshipTemplate relation21 = topology2.getRelationshipTemplate("21");
    assertNotNull(relation21);
    assertEquals("1", relation21.getTargetElement().getRef().getId());
    assertEquals("10", relation21.getSourceElement().getRef().getId());
// endregion
}
Also used : ToscaGraph(org.eclipse.winery.topologygraph.model.ToscaGraph) ToscaIsomorphismMatcher(org.eclipse.winery.topologygraph.matching.ToscaIsomorphismMatcher) RefinementCandidate(org.eclipse.winery.model.adaptation.substitution.refinement.RefinementCandidate) TTopologyTemplate(org.eclipse.winery.model.tosca.TTopologyTemplate) OTStayMapping(org.eclipse.winery.model.tosca.extensions.OTStayMapping) ToscaNode(org.eclipse.winery.topologygraph.model.ToscaNode) TRelationshipTemplate(org.eclipse.winery.model.tosca.TRelationshipTemplate) ToscaEdge(org.eclipse.winery.topologygraph.model.ToscaEdge) TNodeTemplate(org.eclipse.winery.model.tosca.TNodeTemplate) OTPatternRefinementModel(org.eclipse.winery.model.tosca.extensions.OTPatternRefinementModel) ToscaTypeMatcher(org.eclipse.winery.topologygraph.matching.ToscaTypeMatcher) AbstractRefinementTest(org.eclipse.winery.model.adaptation.substitution.refinement.AbstractRefinementTest) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 7 with RefinementCandidate

use of org.eclipse.winery.model.adaptation.substitution.refinement.RefinementCandidate in project winery by eclipse.

the class BehaviorPatternDetectionTest method removeIncompatibleBehaviorPatterns.

@Test
public void removeIncompatibleBehaviorPatterns() {
    List<TPolicy> behaviorPatterns = new ArrayList<>();
    behaviorPatterns.add(new TPolicy(new TPolicy.Builder(QName.valueOf("noProp")).setName("noProp")));
    behaviorPatterns.add(new TPolicy(new TPolicy.Builder(QName.valueOf("oneProp")).setName("oneProp")));
    behaviorPatterns.add(new TPolicy(new TPolicy.Builder(QName.valueOf("multiProps")).setName("multiProps")));
    TNodeTemplate detectorElement = new TNodeTemplate(new TNodeTemplate.Builder("detectorElement", QName.valueOf("{ns}patternType")).setPolicies(behaviorPatterns).setX("1").setY("1"));
    TNodeTemplate refinementElement = new TNodeTemplate(new TNodeTemplate.Builder("refinementElement", QName.valueOf("{ns}concreteType")).setX("1").setY("1"));
    LinkedHashMap<String, String> refinementProps = new LinkedHashMap<>();
    refinementProps.put("oneProp", "true");
    refinementProps.put("multiPropsProp1", "true");
    refinementProps.put("multiPropsProp2", "true");
    refinementProps.put("multiPropsProp3", "*");
    refinementProps.put("multiPropsProp4", "");
    refinementProps.put("multiPropsProp5", null);
    ModelUtilities.setPropertiesKV(refinementElement, refinementProps);
    TNodeTemplate candidateElement = new TNodeTemplate(new TNodeTemplate.Builder("candidateElement", QName.valueOf("{ns}concreteType")).setX("1").setY("1"));
    LinkedHashMap<String, String> candidateProps = new LinkedHashMap<>();
    candidateProps.put("oneProp", "false");
    candidateProps.put("multiPropsProp1", "false");
    candidateProps.put("multiPropsProp2", "false");
    candidateProps.put("multiPropsProp3", "");
    candidateProps.put("multiPropsProp4", null);
    candidateProps.put("multiPropsProp5", "");
    ModelUtilities.setPropertiesKV(candidateElement, candidateProps);
    List<OTBehaviorPatternMapping> behaviorPatternMappings = new ArrayList<>();
    behaviorPatternMappings.add(new OTBehaviorPatternMapping(new OTBehaviorPatternMapping.Builder("behaviorPatternMap0").setDetectorElement(detectorElement).setRefinementElement(refinementElement).setBehaviorPattern("oneProp").setProperty(new OTPropertyKV("oneProp", "true"))));
    behaviorPatternMappings.add(new OTBehaviorPatternMapping(new OTBehaviorPatternMapping.Builder("behaviorPatternMap1").setDetectorElement(detectorElement).setRefinementElement(refinementElement).setBehaviorPattern("multiProps").setProperty(new OTPropertyKV("multiPropsProp1", "true"))));
    behaviorPatternMappings.add(new OTBehaviorPatternMapping(new OTBehaviorPatternMapping.Builder("behaviorPatternMap2").setDetectorElement(detectorElement).setRefinementElement(refinementElement).setBehaviorPattern("multiProps").setProperty(new OTPropertyKV("multiPropsProp2", "true"))));
    behaviorPatternMappings.add(new OTBehaviorPatternMapping(new OTBehaviorPatternMapping.Builder("behaviorPatternMap3").setDetectorElement(detectorElement).setRefinementElement(refinementElement).setBehaviorPattern("multiProps").setProperty(new OTPropertyKV("multiPropsProp3", "*"))));
    behaviorPatternMappings.add(new OTBehaviorPatternMapping(new OTBehaviorPatternMapping.Builder("behaviorPatternMap4").setDetectorElement(detectorElement).setRefinementElement(refinementElement).setBehaviorPattern("multiProps").setProperty(new OTPropertyKV("multiPropsProp4", ""))));
    behaviorPatternMappings.add(new OTBehaviorPatternMapping(new OTBehaviorPatternMapping.Builder("behaviorPatternMap5").setDetectorElement(detectorElement).setRefinementElement(refinementElement).setBehaviorPattern("multiProps").setProperty(new OTPropertyKV("multiPropsProp5", null))));
    TTopologyTemplate detector = new TTopologyTemplate();
    detector.addNodeTemplate(detectorElement);
    TTopologyTemplate refinementStructure = new TTopologyTemplate();
    refinementStructure.addNodeTemplate(refinementElement);
    OTPatternRefinementModel prm = new OTPatternRefinementModel(new OTPatternRefinementModel.Builder().setDetector(detector).setRefinementStructure(refinementStructure).setBehaviorPatternMappings(behaviorPatternMappings));
    // needs to be swapped manually as only PRMs retrieved from repo are swapped automatically
    PatternDetectionUtils.swapDetectorWithRefinement(prm);
    TTopologyTemplate topology = new TTopologyTemplate();
    topology.addNodeTemplate(candidateElement);
    ToscaGraph topologyGraph = ToscaTransformer.createTOSCAGraph(topology);
    ToscaGraph detectorGraph = ToscaTransformer.createTOSCAGraph(prm.getDetector());
    IToscaMatcher matcher = new ToscaBehaviorPatternMatcher(prm, null);
    ToscaIsomorphismMatcher isomorphismMatcher = new ToscaIsomorphismMatcher();
    Iterator<GraphMapping<ToscaNode, ToscaEdge>> matches = isomorphismMatcher.findMatches(detectorGraph, topologyGraph, matcher);
    RefinementCandidate refinementCandidate = new RefinementCandidate(prm, matches.next(), detectorGraph, 1);
    // 'noProp' is applicable independent of properties as no behavior pattern mappings are specified
    BehaviorPatternDetection behaviorPatternDetection = new BehaviorPatternDetection(new DefaultRefinementChooser());
    behaviorPatternDetection.applyRefinement(refinementCandidate, topology);
    assertEquals(topology.getNodeTemplateOrRelationshipTemplate().size(), 1);
    List<TPolicy> policies = topology.getNodeTemplates().get(0).getPolicies();
    assertEquals(policies.size(), 1);
    assertEquals(policies.get(0).getName(), "noProp");
    // 'noProp' still applicable, 'oneProp' now applicable as well because property is set
    candidateProps.put("oneProp", "true");
    topology.getNodeTemplateOrRelationshipTemplate().clear();
    topology.addNodeTemplate(candidateElement);
    behaviorPatternDetection.applyRefinement(refinementCandidate, topology);
    assertEquals(topology.getNodeTemplateOrRelationshipTemplate().size(), 1);
    policies = topology.getNodeTemplates().get(0).getPolicies();
    assertEquals(policies.size(), 2);
    assertTrue(policies.stream().anyMatch(policy -> policy.getName().equals("noProp")));
    assertTrue(policies.stream().anyMatch(policy -> policy.getName().equals("oneProp")));
    // 'noProp' & 'oneProp' still applicable, 'multiProps' not applicable because not all properties are set
    candidateProps.put("multiPropsProp1", "true");
    topology.getNodeTemplateOrRelationshipTemplate().clear();
    topology.addNodeTemplate(candidateElement);
    behaviorPatternDetection.applyRefinement(refinementCandidate, topology);
    assertEquals(topology.getNodeTemplateOrRelationshipTemplate().size(), 1);
    policies = topology.getNodeTemplates().get(0).getPolicies();
    assertEquals(policies.size(), 2);
    assertTrue(policies.stream().anyMatch(policy -> policy.getName().equals("noProp")));
    assertTrue(policies.stream().anyMatch(policy -> policy.getName().equals("oneProp")));
    // 'noProp' & 'oneProp' still applicable, 'multiProps' not applicable because not all properties are set
    candidateProps.put("multiPropsProp2", "true");
    topology.getNodeTemplateOrRelationshipTemplate().clear();
    topology.addNodeTemplate(candidateElement);
    behaviorPatternDetection.applyRefinement(refinementCandidate, topology);
    assertEquals(topology.getNodeTemplateOrRelationshipTemplate().size(), 1);
    policies = topology.getNodeTemplates().get(0).getPolicies();
    assertEquals(policies.size(), 2);
    assertTrue(policies.stream().anyMatch(policy -> policy.getName().equals("noProp")));
    assertTrue(policies.stream().anyMatch(policy -> policy.getName().equals("oneProp")));
    // 'noProp' & 'oneProp' & 'multiProps' applicable
    candidateProps.put("multiPropsProp3", "non-null and non-empty");
    topology.getNodeTemplateOrRelationshipTemplate().clear();
    topology.addNodeTemplate(candidateElement);
    behaviorPatternDetection.applyRefinement(refinementCandidate, topology);
    assertEquals(topology.getNodeTemplateOrRelationshipTemplate().size(), 1);
    policies = topology.getNodeTemplates().get(0).getPolicies();
    assertEquals(policies.size(), 3);
    assertTrue(policies.stream().anyMatch(policy -> policy.getName().equals("noProp")));
    assertTrue(policies.stream().anyMatch(policy -> policy.getName().equals("oneProp")));
    assertTrue(policies.stream().anyMatch(policy -> policy.getName().equals("multiProps")));
}
Also used : TPolicy(org.eclipse.winery.model.tosca.TPolicy) PatternDetectionUtils(org.eclipse.winery.topologygraph.matching.patterndetection.PatternDetectionUtils) GraphMapping(org.jgrapht.GraphMapping) IToscaMatcher(org.eclipse.winery.topologygraph.matching.IToscaMatcher) ToscaEdge(org.eclipse.winery.topologygraph.model.ToscaEdge) TTopologyTemplate(org.eclipse.winery.model.tosca.TTopologyTemplate) NamespaceProperties(org.eclipse.winery.repository.backend.filebased.NamespaceProperties) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) OTPatternRefinementModel(org.eclipse.winery.model.tosca.extensions.OTPatternRefinementModel) OTBehaviorPatternMapping(org.eclipse.winery.model.tosca.extensions.OTBehaviorPatternMapping) ToscaIsomorphismMatcher(org.eclipse.winery.topologygraph.matching.ToscaIsomorphismMatcher) Nullable(org.eclipse.jdt.annotation.Nullable) Map(java.util.Map) ToscaBehaviorPatternMatcher(org.eclipse.winery.topologygraph.matching.patterndetection.ToscaBehaviorPatternMatcher) TNodeTemplate(org.eclipse.winery.model.tosca.TNodeTemplate) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) OTStayMapping(org.eclipse.winery.model.tosca.extensions.OTStayMapping) Iterator(java.util.Iterator) DefaultRefinementChooser(org.eclipse.winery.model.adaptation.substitution.refinement.DefaultRefinementChooser) Collection(java.util.Collection) Test(org.junit.jupiter.api.Test) List(java.util.List) ToscaNode(org.eclipse.winery.topologygraph.model.ToscaNode) NamespaceManager(org.eclipse.winery.repository.backend.NamespaceManager) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) ModelUtilities(org.eclipse.winery.model.tosca.utils.ModelUtilities) ToscaGraph(org.eclipse.winery.topologygraph.model.ToscaGraph) QName(javax.xml.namespace.QName) OTPropertyKV(org.eclipse.winery.model.tosca.extensions.kvproperties.OTPropertyKV) Collections(java.util.Collections) RefinementCandidate(org.eclipse.winery.model.adaptation.substitution.refinement.RefinementCandidate) ToscaTransformer(org.eclipse.winery.topologygraph.transformation.ToscaTransformer) NonNull(org.eclipse.jdt.annotation.NonNull) ToscaGraph(org.eclipse.winery.topologygraph.model.ToscaGraph) RefinementCandidate(org.eclipse.winery.model.adaptation.substitution.refinement.RefinementCandidate) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) TTopologyTemplate(org.eclipse.winery.model.tosca.TTopologyTemplate) TNodeTemplate(org.eclipse.winery.model.tosca.TNodeTemplate) ToscaIsomorphismMatcher(org.eclipse.winery.topologygraph.matching.ToscaIsomorphismMatcher) ToscaBehaviorPatternMatcher(org.eclipse.winery.topologygraph.matching.patterndetection.ToscaBehaviorPatternMatcher) IToscaMatcher(org.eclipse.winery.topologygraph.matching.IToscaMatcher) DefaultRefinementChooser(org.eclipse.winery.model.adaptation.substitution.refinement.DefaultRefinementChooser) TPolicy(org.eclipse.winery.model.tosca.TPolicy) OTPropertyKV(org.eclipse.winery.model.tosca.extensions.kvproperties.OTPropertyKV) OTBehaviorPatternMapping(org.eclipse.winery.model.tosca.extensions.OTBehaviorPatternMapping) OTPatternRefinementModel(org.eclipse.winery.model.tosca.extensions.OTPatternRefinementModel) GraphMapping(org.jgrapht.GraphMapping) Test(org.junit.jupiter.api.Test)

Example 8 with RefinementCandidate

use of org.eclipse.winery.model.adaptation.substitution.refinement.RefinementCandidate in project winery by eclipse.

the class ComponentPatternDetection method isApplicable.

@Override
public boolean isApplicable(RefinementCandidate candidate, TTopologyTemplate topology) {
    RefinementCandidate adaptedPrm = adaptPrm(candidate);
    adaptedPrms.put(candidate, adaptedPrm);
    return super.isApplicable(adaptedPrm, topology);
}
Also used : RefinementCandidate(org.eclipse.winery.model.adaptation.substitution.refinement.RefinementCandidate)

Example 9 with RefinementCandidate

use of org.eclipse.winery.model.adaptation.substitution.refinement.RefinementCandidate in project winery by eclipse.

the class ComponentPatternDetection method applyRefinement.

@Override
public Map<String, String> applyRefinement(RefinementCandidate refinement, TTopologyTemplate topology) {
    RefinementCandidate adaptedPrm = adaptedPrms.get(refinement);
    componentPatternCandidates.clear();
    adaptedPrms.clear();
    return super.applyRefinement(adaptedPrm, topology);
}
Also used : RefinementCandidate(org.eclipse.winery.model.adaptation.substitution.refinement.RefinementCandidate)

Example 10 with RefinementCandidate

use of org.eclipse.winery.model.adaptation.substitution.refinement.RefinementCandidate in project winery by eclipse.

the class TopologyFragmentRefinement method applyRefinement.

@Override
public Map<String, String> applyRefinement(RefinementCandidate refinement, TTopologyTemplate topology) {
    if (!(refinement.getRefinementModel() instanceof OTTopologyFragmentRefinementModel)) {
        throw new UnsupportedOperationException("The refinement candidate is not a PRM!");
    }
    // determine the elements that are staying
    OTTopologyFragmentRefinementModel prm = (OTTopologyFragmentRefinementModel) refinement.getRefinementModel();
    List<String> stayingRefinementElementIds = RefinementUtils.getStayingRefinementElements(prm).stream().map(HasId::getId).collect(Collectors.toList());
    // import the refinement structure
    Map<String, String> idMapping = BackendUtils.mergeTopologyTemplateAinTopologyTemplateB(refinement.getRefinementModel().getRefinementTopology(), topology, stayingRefinementElementIds);
    // only for UI: position the imported nodes next to the nodes to be refined
    Map<String, Map<String, Integer>> coordinates = calculateNewPositions(refinement.getDetectorGraph(), refinement.getGraphMapping(), refinement.getRefinementModel().getRefinementTopology());
    refinement.getRefinementModel().getRefinementTopology().getNodeTemplates().stream().filter(element -> !stayingRefinementElementIds.contains(element.getId())).forEach(node -> {
        Map<String, Integer> newCoordinates = coordinates.get(node.getId());
        TNodeTemplate nodeTemplate = topology.getNodeTemplate(idMapping.get(node.getId()));
        if (nodeTemplate != null) {
            nodeTemplate.setX(newCoordinates.get("x").toString());
            nodeTemplate.setY(newCoordinates.get("y").toString());
        }
    });
    // iterate over the detector nodes
    refinement.getDetectorGraph().vertexSet().forEach(vertex -> {
        // get the matching node in the topology
        TNodeTemplate matchingNode = refinement.getGraphMapping().getVertexCorrespondence(vertex, false).getTemplate();
        this.redirectInternalRelations(prm, vertex.getTemplate(), matchingNode, topology);
        this.redirectExternalRelations(refinement, vertex.getTemplate(), matchingNode, topology, idMapping);
        this.applyPropertyMappings(refinement, vertex.getId(), matchingNode, topology, idMapping);
        this.applyDeploymentArtifactMapping(refinement, vertex.getTemplate(), matchingNode, topology, idMapping);
        if (!getStayMappingsOfCurrentElement(prm, vertex.getTemplate()).findFirst().isPresent()) {
            topology.getNodeTemplateOrRelationshipTemplate().remove(matchingNode);
        } else if (shouldRemoveBehaviorPatterns(vertex.getTemplate(), matchingNode)) {
            if (vertex.getTemplate().getPolicies() != null && matchingNode.getPolicies() != null)
                vertex.getTemplate().getPolicies().forEach(detectorPolicy -> matchingNode.getPolicies().removeIf(matchingPolicy -> matchingPolicy.getPolicyType().equals(detectorPolicy.getPolicyType())));
        }
    });
    refinement.getDetectorGraph().edgeSet().forEach(edge -> {
        TRelationshipTemplate relationshipTemplate = refinement.getGraphMapping().getEdgeCorrespondence(edge, false).getTemplate();
        this.applyPropertyMappings(refinement, edge.getId(), relationshipTemplate, topology, idMapping);
        if (!getStayMappingsOfCurrentElement(prm, edge.getTemplate()).findFirst().isPresent()) {
            topology.getNodeTemplateOrRelationshipTemplate().remove(relationshipTemplate);
        }
    });
    return idMapping;
}
Also used : OTDeploymentArtifactMapping(org.eclipse.winery.model.tosca.extensions.OTDeploymentArtifactMapping) OTAttributeMapping(org.eclipse.winery.model.tosca.extensions.OTAttributeMapping) TopologyFragmentRefinementModelId(org.eclipse.winery.model.ids.extensions.TopologyFragmentRefinementModelId) GraphMapping(org.jgrapht.GraphMapping) LoggerFactory(org.slf4j.LoggerFactory) RefinementChooser(org.eclipse.winery.model.adaptation.substitution.refinement.RefinementChooser) TEntityTemplate(org.eclipse.winery.model.tosca.TEntityTemplate) HashMap(java.util.HashMap) IToscaMatcher(org.eclipse.winery.topologygraph.matching.IToscaMatcher) ToscaEdge(org.eclipse.winery.topologygraph.model.ToscaEdge) TTopologyTemplate(org.eclipse.winery.model.tosca.TTopologyTemplate) OTTopologyFragmentRefinementModel(org.eclipse.winery.model.tosca.extensions.OTTopologyFragmentRefinementModel) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) BackendUtils(org.eclipse.winery.repository.backend.BackendUtils) Map(java.util.Map) ToscaPrmPropertyMatcher(org.eclipse.winery.topologygraph.matching.ToscaPrmPropertyMatcher) OTRefinementModel(org.eclipse.winery.model.tosca.extensions.OTRefinementModel) TNodeTemplate(org.eclipse.winery.model.tosca.TNodeTemplate) OTAttributeMappingType(org.eclipse.winery.model.tosca.extensions.OTAttributeMappingType) ArtifactTypeId(org.eclipse.winery.model.ids.definitions.ArtifactTypeId) TArtifactType(org.eclipse.winery.model.tosca.TArtifactType) OTStayMapping(org.eclipse.winery.model.tosca.extensions.OTStayMapping) Logger(org.slf4j.Logger) DefaultRefinementChooser(org.eclipse.winery.model.adaptation.substitution.refinement.DefaultRefinementChooser) RefinementUtils.redirectRelation(org.eclipse.winery.model.adaptation.substitution.refinement.RefinementUtils.redirectRelation) AbstractRefinement(org.eclipse.winery.model.adaptation.substitution.refinement.AbstractRefinement) UUID(java.util.UUID) RefinementId(org.eclipse.winery.model.ids.extensions.RefinementId) Collectors(java.util.stream.Collectors) RefinementUtils(org.eclipse.winery.model.adaptation.substitution.refinement.RefinementUtils) HasId(org.eclipse.winery.model.tosca.HasId) Objects(java.util.Objects) List(java.util.List) Stream(java.util.stream.Stream) ToscaNode(org.eclipse.winery.topologygraph.model.ToscaNode) TDeploymentArtifact(org.eclipse.winery.model.tosca.TDeploymentArtifact) TRelationshipTemplate(org.eclipse.winery.model.tosca.TRelationshipTemplate) ModelUtilities(org.eclipse.winery.model.tosca.utils.ModelUtilities) ToscaGraph(org.eclipse.winery.topologygraph.model.ToscaGraph) QName(javax.xml.namespace.QName) RefinementCandidate(org.eclipse.winery.model.adaptation.substitution.refinement.RefinementCandidate) OTTopologyFragmentRefinementModel(org.eclipse.winery.model.tosca.extensions.OTTopologyFragmentRefinementModel) TRelationshipTemplate(org.eclipse.winery.model.tosca.TRelationshipTemplate) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) TNodeTemplate(org.eclipse.winery.model.tosca.TNodeTemplate)

Aggregations

RefinementCandidate (org.eclipse.winery.model.adaptation.substitution.refinement.RefinementCandidate)15 ArrayList (java.util.ArrayList)10 TTopologyTemplate (org.eclipse.winery.model.tosca.TTopologyTemplate)9 TNodeTemplate (org.eclipse.winery.model.tosca.TNodeTemplate)8 List (java.util.List)7 Map (java.util.Map)7 IToscaMatcher (org.eclipse.winery.topologygraph.matching.IToscaMatcher)7 ToscaNode (org.eclipse.winery.topologygraph.model.ToscaNode)7 Test (org.junit.jupiter.api.Test)7 ModelUtilities (org.eclipse.winery.model.tosca.utils.ModelUtilities)6 ToscaEdge (org.eclipse.winery.topologygraph.model.ToscaEdge)6 ToscaGraph (org.eclipse.winery.topologygraph.model.ToscaGraph)6 DefaultRefinementChooser (org.eclipse.winery.model.adaptation.substitution.refinement.DefaultRefinementChooser)5 RefinementChooser (org.eclipse.winery.model.adaptation.substitution.refinement.RefinementChooser)5 TRelationshipTemplate (org.eclipse.winery.model.tosca.TRelationshipTemplate)5 OTRefinementModel (org.eclipse.winery.model.tosca.extensions.OTRefinementModel)5 OTStayMapping (org.eclipse.winery.model.tosca.extensions.OTStayMapping)5 LinkedHashMap (java.util.LinkedHashMap)4 QName (javax.xml.namespace.QName)4 TEntityTemplate (org.eclipse.winery.model.tosca.TEntityTemplate)4