use of org.iobserve.model.persistence.neo4j.NodeLookupException in project iobserve-analysis by research-iobserve.
the class NetworkLink method execute.
/**
* Execute this filter.
*
* @param event
* event to use
* @throws NodeLookupException
* @throws DBException
* on db errors
*/
@Override
protected void execute(final TraceMetadata event) throws NodeLookupException, DBException {
final ResourceEnvironment resourceEnvironment = this.resourceEnvironmentModelResource.getAndLockModelRootNode(ResourceEnvironment.class, ResourceenvironmentPackage.Literals.RESOURCE_ENVIRONMENT);
final System system = this.systemModelResource.getModelRootNode(System.class, SystemPackage.Literals.SYSTEM);
final Allocation allocation = this.allocationModelResource.getModelRootNode(Allocation.class, AllocationPackage.Literals.ALLOCATION);
NetworkLink.collectUnLinkedResourceContainer(resourceEnvironment).stream().forEach(unLinkedResCont -> {
NetworkLink.getAsmContextDeployedOnContainer(allocation, unLinkedResCont).stream().map(asmCtx -> NetworkLink.getConnectedAsmCtx(system, asmCtx)).map(listAsmCtxToConnect -> NetworkLink.collectResourceContainer(allocation, listAsmCtxToConnect)).map(listResContToConnectTo -> NetworkLink.getLinkingResources(resourceEnvironment, listResContToConnectTo)).flatMap(l -> l.stream()).collect(Collectors.toList()).stream().forEach(link -> link.getConnectedResourceContainers_LinkingResource().add(unLinkedResCont));
});
this.resourceEnvironmentModelResource.updatePartition(resourceEnvironment);
}
Aggregations