Search in sources :

Example 1 with NodeLookupException

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);
}
Also used : Logger(org.slf4j.Logger) AssemblyContext(org.palladiosimulator.pcm.core.composition.AssemblyContext) TraceMetadata(kieker.common.record.flow.trace.TraceMetadata) ResourceenvironmentPackage(org.palladiosimulator.pcm.resourceenvironment.ResourceenvironmentPackage) AssemblyConnector(org.palladiosimulator.pcm.core.composition.AssemblyConnector) LoggerFactory(org.slf4j.LoggerFactory) NodeLookupException(org.iobserve.model.persistence.neo4j.NodeLookupException) Connector(org.palladiosimulator.pcm.core.composition.Connector) ResourceEnvironment(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment) Collectors(java.util.stream.Collectors) Allocation(org.palladiosimulator.pcm.allocation.Allocation) DBException(org.iobserve.model.persistence.DBException) List(java.util.List) Neo4JModelResource(org.iobserve.model.persistence.neo4j.Neo4JModelResource) AbstractConsumerStage(teetime.framework.AbstractConsumerStage) LinkingResource(org.palladiosimulator.pcm.resourceenvironment.LinkingResource) Optional(java.util.Optional) System(org.palladiosimulator.pcm.system.System) AllocationPackage(org.palladiosimulator.pcm.allocation.AllocationPackage) SystemPackage(org.palladiosimulator.pcm.system.SystemPackage) ResourceContainer(org.palladiosimulator.pcm.resourceenvironment.ResourceContainer) ResourceEnvironment(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment) Allocation(org.palladiosimulator.pcm.allocation.Allocation) System(org.palladiosimulator.pcm.system.System)

Aggregations

List (java.util.List)1 Optional (java.util.Optional)1 Collectors (java.util.stream.Collectors)1 TraceMetadata (kieker.common.record.flow.trace.TraceMetadata)1 DBException (org.iobserve.model.persistence.DBException)1 Neo4JModelResource (org.iobserve.model.persistence.neo4j.Neo4JModelResource)1 NodeLookupException (org.iobserve.model.persistence.neo4j.NodeLookupException)1 Allocation (org.palladiosimulator.pcm.allocation.Allocation)1 AllocationPackage (org.palladiosimulator.pcm.allocation.AllocationPackage)1 AssemblyConnector (org.palladiosimulator.pcm.core.composition.AssemblyConnector)1 AssemblyContext (org.palladiosimulator.pcm.core.composition.AssemblyContext)1 Connector (org.palladiosimulator.pcm.core.composition.Connector)1 LinkingResource (org.palladiosimulator.pcm.resourceenvironment.LinkingResource)1 ResourceContainer (org.palladiosimulator.pcm.resourceenvironment.ResourceContainer)1 ResourceEnvironment (org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment)1 ResourceenvironmentPackage (org.palladiosimulator.pcm.resourceenvironment.ResourceenvironmentPackage)1 System (org.palladiosimulator.pcm.system.System)1 SystemPackage (org.palladiosimulator.pcm.system.SystemPackage)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1