/** * Given a set of dependencies, analyse a given topology and build a list of {@link AbstractEditorOperation} to apply to the topology to make it synch * with the dependencies present in the repository * * @param topology The topology we want to recover * @param updatedDependencies The updated dependencies within the topology * @return a list of {@link AbstractEditorOperation} representing the operations to perform on the topology for recovery */ public List<AbstractEditorOperation> buildRecoveryOperations(Topology topology, Set<CSARDependency> updatedDependencies) { List<AbstractEditorOperation> recoveryOperations = Lists.newArrayList(); if (!topology.isEmpty()) { for (CSARDependency updatedDependency : AlienUtils.safe(updatedDependencies)) { buildNodesRecoveryOperations(topology, updatedDependency, recoveryOperations); buildRelationshipsRecoveryOperations(topology, updatedDependency, recoveryOperations); } } return recoveryOperations; }
if (instance.isEmpty()) {
private void indexTopology(final ArchiveRoot archiveRoot, List<ParsingError> parsingErrors, String archiveName, String archiveVersion) { Topology topology = archiveRoot.getTopology(); if (topology == null || topology.isEmpty()) { return;
@Then("^the topology dto should contain an emty topology$") public void the_topology_dto_should_contain_an_emty_topology() throws Throwable { TopologyDTO dto = JsonUtil.read(Context.getInstance().getRestResponse(), TopologyDTO.class, Context.getJsonMapper()).getData(); Assert.assertTrue(dto.getTopology().isEmpty()); }
archiveRoot.getArchive().setHasTopology(archiveRoot.hasToscaTopologyTemplate() && !archiveRoot.getTopology().isEmpty()); archiveRoot.getArchive().setNodeTypesCount(archiveRoot.getNodeTypes().size());