@Override public void rightOnly(T right) { // Remove changes.linkDelete(fromDnsPointer, linkType, right); } });
protected void removeManagedLinkAndDeleteIfNotManagedByAnyoneElse(IPResourceService resourceService, ChangesContext changes, IPResource managedResource, IPResource... removeLinksFrom) { List<? extends IPResource> fromResources = resourceService.linkFindAllByLinkTypeAndToResource(LinkTypeConstants.MANAGES, managedResource); logger.debug("Resource {} is managed by {} other resources", managedResource, fromResources.size()); // Remove the managed links int removedLinks = 0; List<Long> removeLinksFromIds = Arrays.asList(removeLinksFrom).stream().map(IPResource::getInternalId).collect(Collectors.toList()); for (IPResource fromResource : fromResources) { if (removeLinksFromIds.contains(fromResource.getInternalId())) { ++removedLinks; changes.linkDelete(fromResource, LinkTypeConstants.MANAGES, managedResource); } } logger.debug("Resource {} is now managed by {} other resources", managedResource, fromResources.size() - removedLinks); // All managed links removed and not manually edited-> Delete the resource if (fromResources.size() - removedLinks == 0 && managedResource.getResourceEditorName() == null) { changes.resourceDelete(managedResource.getInternalId()); } }
changesContext.linkDelete(fromResource, linkType, resourceToToRemove);
changesContext.linkDelete(resourceFromToRemove, linkType, toResource);
changesContext.linkDelete(editedResource, linkType, it); }); changesContext.linkDelete(editedResource, linkType, it); });
changesContext.linkDelete(it, linkType, editedResource); }); changesContext.linkDelete(it, linkType, editedResource); });
changesContext.linkDelete(it, linkType, editedResource); }); changesContext.linkDelete(it, linkType, editedResource); });
changesContext.linkDelete(editedResource, linkType, it); }); changesContext.linkDelete(editedResource, linkType, it); });
changes.linkDelete(desiredManagedResource, linkType, previous); }); changes.linkDelete(previous, linkType, desiredManagedResource); });
ctx.getChangesContext().linkDelete(it, linkType, editedResource); }); ctx.getChangesContext().linkDelete(it, linkType, editedResource); });
ctx.getChangesContext().linkDelete(editedResource, linkType, it); }); ctx.getChangesContext().linkDelete(editedResource, linkType, it); });
ctx.getChangesContext().linkDelete(editedResource, linkType, it); }); ctx.getChangesContext().linkDelete(editedResource, linkType, it); });
ctx.getChangesContext().linkDelete(it, linkType, editedResource); }); ctx.getChangesContext().linkDelete(it, linkType, editedResource); });
changes.linkDelete(slaveResource, link.getA(), link.getB());
changes.linkDelete(a2, LinkTypeConstants.RUN_AS, uu2); changes.linkAdd(a2, LinkTypeConstants.INSTALLED_ON, m1); changes.linkDelete(a2, LinkTypeConstants.INSTALLED_ON, m2); changes.linkDelete(a2, LinkTypeConstants.INSTALLED_ON, m3); getInternalServicesContext().getInternalChangeService().changesExecute(changes); changes.linkDelete(a1, LinkTypeConstants.RUN_AS, uu1); changes.linkDelete(a1, LinkTypeConstants.INSTALLED_ON, m1); getInternalServicesContext().getInternalChangeService().changesExecute(changes);
changes.resourceUpdate(website.getInternalId(), website); getInternalServicesContext().getInternalChangeService().changesExecute(changes); changes.linkDelete(website, LinkTypeConstants.USES, wc1); JunitsHelper.assertState(getCommonServicesContext(), getInternalServicesContext(), "WebsiteTest-state-5.json", AbstractIPResourceServiceTest.class);
changes.linkDelete(dp, LinkTypeConstants.POINTS_TO, m2); getInternalServicesContext().getInternalChangeService().changesExecute(changes);