use of org.eclipse.winery.repository.backend.IRepository in project winery by eclipse.
the class Ec2AmiRefinementPlugin method getDetectorGraphs.
@Override
protected List<TTopologyTemplate> getDetectorGraphs() {
IRepository repository = RepositoryFactory.getRepository();
TNodeType computeType = repository.getElement(new NodeTypeId(COMPUTE_QNAME));
TNodeTemplate compute = ModelUtilities.instantiateNodeTemplate(computeType);
LinkedHashMap<String, String> computeKvProperties = new LinkedHashMap<>();
String detectorPropertyRegex = typeByAmi.keySet().stream().collect(Collectors.joining("|", "(", ")"));
computeKvProperties.put(PROPERTY_EC2_AMI, detectorPropertyRegex);
TEntityTemplate.WineryKVProperties computeProperties = new TEntityTemplate.WineryKVProperties();
computeProperties.setKVProperties(computeKvProperties);
compute.setProperties(computeProperties);
return Collections.singletonList(new TTopologyTemplate.Builder().addNodeTemplate(compute).build());
}
use of org.eclipse.winery.repository.backend.IRepository in project winery by eclipse.
the class MySqlDbRefinementPlugin method getDetectorGraphs.
@Override
protected List<TTopologyTemplate> getDetectorGraphs() {
IRepository repository = RepositoryFactory.getRepository();
TNodeType mySQLType = repository.getElement(new NodeTypeId(mySqlDbQName));
TNodeTemplate mySQL_DBMS = ModelUtilities.instantiateNodeTemplate(mySQLType);
return Collections.singletonList(new TTopologyTemplate.Builder().addNodeTemplate(mySQL_DBMS).build());
}
use of org.eclipse.winery.repository.backend.IRepository in project winery by eclipse.
the class MySqlDbmsRefinementPlugin method getDetectorGraphs.
@Override
protected List<TTopologyTemplate> getDetectorGraphs() {
IRepository repository = RepositoryFactory.getRepository();
TNodeType mySQLType = repository.getElement(new NodeTypeId(mySqlName));
TNodeTemplate mySQL_DBMS = ModelUtilities.instantiateNodeTemplate(mySQLType);
return Collections.singletonList(new TTopologyTemplate.Builder().addNodeTemplate(mySQL_DBMS).build());
}
use of org.eclipse.winery.repository.backend.IRepository in project winery by eclipse.
the class WeaveCartsHandler method handleNode.
@Override
public Set<String> handleNode(TNodeTemplate dockerContainer, TTopologyTemplate topologyTemplate, String imageId) {
Set<String> discoveredNodeIds = new HashSet<>();
IRepository repository = RepositoryFactory.getRepository();
dockerContainer.setType(QNAME_ALPINE_CONTAINER);
TNodeType javaType = repository.getElement(new NodeTypeId(QNAME_JAVA8));
TNodeTemplate java = ModelUtilities.instantiateNodeTemplate(javaType);
topologyTemplate.addNodeTemplate(java);
ModelUtilities.createRelationshipTemplateAndAddToTopology(java, dockerContainer, ToscaBaseTypes.hostedOnRelationshipType, topologyTemplate);
TNodeType springType = repository.getElement(new NodeTypeId(QNAME_SPRING_WEB));
TNodeTemplate spring = ModelUtilities.instantiateNodeTemplate(springType);
spring.setName(dockerContainer.getName());
topologyTemplate.addNodeTemplate(spring);
ModelUtilities.createRelationshipTemplateAndAddToTopology(spring, java, ToscaBaseTypes.hostedOnRelationshipType, topologyTemplate);
discoveredNodeIds.add(dockerContainer.getId());
discoveredNodeIds.add(java.getId());
discoveredNodeIds.add(spring.getId());
return discoveredNodeIds;
}
use of org.eclipse.winery.repository.backend.IRepository in project winery by eclipse.
the class WeaveFrontEndHandler method handleNode.
@Override
public Set<String> handleNode(TNodeTemplate dockerContainer, TTopologyTemplate topologyTemplate, String imageId) {
Set<String> discoveredNodeIds = new HashSet<>();
IRepository repository = RepositoryFactory.getRepository();
dockerContainer.setType(QNAME_ALPINE_CONTAINER);
TNodeType nodeJsType = repository.getElement(new NodeTypeId(QNAME_NODEJS_10));
TNodeTemplate nodeJs = ModelUtilities.instantiateNodeTemplate(nodeJsType);
topologyTemplate.addNodeTemplate(nodeJs);
ModelUtilities.createRelationshipTemplateAndAddToTopology(nodeJs, dockerContainer, ToscaBaseTypes.hostedOnRelationshipType, topologyTemplate);
TNodeType nodeAppType = repository.getElement(new NodeTypeId(QNAME_NODE_APP));
TNodeTemplate nodeApp = ModelUtilities.instantiateNodeTemplate(nodeAppType);
nodeApp.setName(dockerContainer.getName());
topologyTemplate.addNodeTemplate(nodeApp);
ModelUtilities.createRelationshipTemplateAndAddToTopology(nodeApp, nodeJs, ToscaBaseTypes.hostedOnRelationshipType, topologyTemplate);
discoveredNodeIds.add(dockerContainer.getId());
discoveredNodeIds.add(nodeJs.getId());
discoveredNodeIds.add(nodeApp.getId());
return discoveredNodeIds;
}
Aggregations