• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Link类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link的典型用法代码示例。如果您正苦于以下问题:Java Link类的具体用法?Java Link怎么用?Java Link使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Link类属于org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology包,在下文中一共展示了Link类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: findGWLink

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
private Link findGWLink(ReadWriteTransaction trans, FabricId fabricid, TpId tpid, NodeId routerid) {

        InstanceIdentifier<Link> linkIId = InstanceIdentifier.create(NetworkTopology.class)
                .child(Topology.class, new TopologyKey(new TopologyId(fabricid)))
                .child(Link.class, new LinkKey(this.createGatewayLink(routerid, tpid)));

        CheckedFuture<Optional<Link>,ReadFailedException> readFuture =  trans.read(LogicalDatastoreType.OPERATIONAL,
                linkIId);

        try {
            Optional<Link> optional = readFuture.get();
            Link link = optional.get();

            return link;

        } catch (InterruptedException | ExecutionException e) {
            LOG.error("", e);
        }
        return null;
    }
 
开发者ID:opendaylight,项目名称:faas,代码行数:21,代码来源:FabricServiceAPIProvider.java


示例2: createLogicLink

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
private void createLogicLink(FabricId fabricid, NodeId routeId, NodeId swId, WriteTransaction trans, TpId tpid1,
        TpId tpid2, LinkId lid) {
    final LinkId linkid = lid == null ? new LinkId(UUID.randomUUID().toString()) : lid;
    LinkBuilder linkBuilder = new LinkBuilder();
    linkBuilder.setLinkId(linkid);
    linkBuilder.setKey(new LinkKey(linkid));

    SourceBuilder srcBuilder = new SourceBuilder();
    srcBuilder.setSourceNode(routeId);
    srcBuilder.setSourceTp(tpid1);
    linkBuilder.setSource(srcBuilder.build());

    DestinationBuilder destBuilder = new DestinationBuilder();
    destBuilder.setDestNode(swId);
    destBuilder.setDestTp(tpid2);
    linkBuilder.setDestination(destBuilder.build());

    InstanceIdentifier<Link> linkIId = MdSalUtils.createLinkIId(fabricid, linkid);
    trans.put(LogicalDatastoreType.OPERATIONAL,linkIId, linkBuilder.build());
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:21,代码来源:FabricServiceAPIProvider.java


示例3: fabricCreated

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
@Override
public void fabricCreated(FabricNode fabric) {

    List<DeviceLinks> links = fabric.getFabricAttribute().getDeviceLinks();
    if (links != null) {
        for (DeviceLinks link : links) {
            @SuppressWarnings("unchecked")
            InstanceIdentifier<Link> linkIId = (InstanceIdentifier<Link>) link.getLinkRef().getValue();
        }
    }

    List<DeviceNodes> devices = fabric.getFabricAttribute().getDeviceNodes();
    if (devices != null) {
        for (DeviceNodes deviceNode : devices) {
            @SuppressWarnings("unchecked")
            InstanceIdentifier<Node> deviceIId = (InstanceIdentifier<Node>) deviceNode.getDeviceRef().getValue();
            DeviceRole role = deviceNode.getRole();
            deviceAdded(deviceIId, role);
        }
    }

    ResourceManager.initResourceManager(fabricid);
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:24,代码来源:VlanFabricListener.java


示例4: createBasicVcLink

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
public static Link createBasicVcLink(Node ldNode, Node netNode) {
    LinkId linkId = new LinkId(VC_LINK_NAME);
    LinkKey linkKey = new LinkKey(linkId);
    LinkBuilder linkBuilder = new LinkBuilder();

    linkBuilder.setLinkId(linkId);
    linkBuilder.setKey(linkKey);

    DestinationBuilder destBuilder = new DestinationBuilder();
    NodeId ldNodeId = ldNode.getNodeId();
    destBuilder.setDestNode(ldNodeId);
    TpId sourceTpId = new TpId(VC_NODE_TP_WEST);
    destBuilder.setDestTp(sourceTpId);
    linkBuilder.setDestination(destBuilder.build());

    SourceBuilder sourceBuilder = new SourceBuilder();
    NodeId netNodeId = netNode.getNodeId();
    sourceBuilder.setSourceNode(netNodeId);
    TpId destTpId = new TpId(VC_NODE_TP_EAST);
    sourceBuilder.setSourceTp(destTpId);
    linkBuilder.setSource(sourceBuilder.build());

    return linkBuilder.build();
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:25,代码来源:FabMgrYangDataUtil.java


示例5: getBorderInfo

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
/**
 * To get the border Fabric and its port connects to the External network
 * for now we only only return the first one.
 * @return
 */
private Entry<FabricId, TpId> getBorderInfo()
{
    Topology fabricTopo = this.getFabricTopology();
    if (fabricTopo == null) {
        LOG.error("Fabric Topology is NULL!");
        return null;
    }
    for (Link l : fabricTopo.getLink()) {
        if ("external".equalsIgnoreCase(l.getSource().getSourceNode().getValue())) {
            return new AbstractMap.SimpleEntry(l.getDestination().getDestNode(), l.getDestination().getDestTp());
        }
        if ("external".equalsIgnoreCase(l.getDestination().getDestNode().getValue())) {
            return new AbstractMap.SimpleEntry(l.getSource().getSourceNode(), l.getSource().getSourceTp());
        }
    }

    LOG.error("No Fabric Topology found!");
    return null;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:25,代码来源:FabricMgrProvider.java


示例6: calcShortestPathOnFabricTopo

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
private List<Link> calcShortestPathOnFabricTopo(NodeId fabrics, NodeId fabricd)
{
    UndirectedSparseGraph<NodeId, Link> g = new UndirectedSparseGraph<>();
    Topology topo = this.getFabricTopology();
    if (topo == null) {
        LOG.error("Failed to get fabric topology!");
        return Collections.emptyList();
    }

    for (Node node : topo.getNode()) {
        g.addVertex(node.getNodeId());
    }

    if (topo.getLink() != null) {
        for (Link link : topo.getLink())
        {
            g.addEdge(link, link.getSource().getSourceNode(), link.getDestination().getDestNode());
        }
    }

    return calcShortestPath(fabrics, fabricd, g);
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:23,代码来源:FabricMgrProvider.java


示例7: invokeOperation

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
@Override
protected ListenableFuture<OperationResult> invokeOperation() {
    final InstanceIdentifier<Topology> tii = TopologyProgrammingUtil.topologyForInput(this.updateTunnelInput);
    final InstanceIdentifier<Link> lii = TunnelProgrammingUtil.linkIdentifier(tii, this.updateTunnelInput);
    try (ReadOnlyTransaction t = this.dataProvider.newReadOnlyTransaction()) {
        final Link link;
        final Node node;
        try {
            // The link has to exist
            link = t.read(LogicalDatastoreType.OPERATIONAL, lii).checkedGet().get();
            // The source node has to exist
            node = TunelProgrammingUtil.sourceNode(t, tii, link).get();
        } catch (IllegalStateException | ReadFailedException e) {
            LOG.debug("Link or node does not exist.", e);
            return TunelProgrammingUtil.RESULT;
        }
        return Futures.transform(
                (ListenableFuture<RpcResult<UpdateLspOutput>>) this.topologyService
                        .updateLsp(buildUpdateInput(link, node)),
                RpcResult::getResult, MoreExecutors.directExecutor());
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:23,代码来源:UpdateTunnelInstructionExecutor.java


示例8: buildUpdateInput

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
private UpdateLspInput buildUpdateInput(final Link link, final Node node) {
    final UpdateLspInputBuilder ab = new UpdateLspInputBuilder();
    ab.setName(link.getAugmentation(Link1.class).getSymbolicPathName());
    ab.setNode(requireNonNull(TunelProgrammingUtil.supportingNode(node)));

    final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.update.lsp
            .args.ArgumentsBuilder args = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
            .yang.topology.pcep.rev171025.update.lsp.args.ArgumentsBuilder();
    args.setBandwidth(new BandwidthBuilder().setBandwidth(this.updateTunnelInput.getBandwidth()).build());
    args.setClassType(new ClassTypeBuilder().setClassType(this.updateTunnelInput.getClassType()).build());
    args.setEro(TunelProgrammingUtil.buildEro(this.updateTunnelInput.getExplicitHops()));
    args.setLspa(new LspaBuilder(this.updateTunnelInput).build());

    final AdministrativeStatus adminStatus = this.updateTunnelInput.getAugmentation(PcepUpdateTunnelInput1.class)
            .getAdministrativeStatus();
    if (adminStatus != null) {
        args.addAugmentation(Arguments3.class, new Arguments3Builder().setLsp(new LspBuilder()
                .setAdministrative(adminStatus == AdministrativeStatus.Active).build()).build());
    }
    ab.setArguments(args.build());
    return ab.build();
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:23,代码来源:UpdateTunnelInstructionExecutor.java


示例9: invokeOperation

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
@Override
protected ListenableFuture<OperationResult> invokeOperation() {
    final InstanceIdentifier<Topology> tii = TopologyProgrammingUtil.topologyForInput(this.pcepDestroyTunnelInput);
    final InstanceIdentifier<Link> lii = TunnelProgrammingUtil.linkIdentifier(tii, this.pcepDestroyTunnelInput);
    try (ReadOnlyTransaction t = this.dataProvider.newReadOnlyTransaction()) {
        final Node node;
        final Link link;
        try {
            // The link has to exist
            link = t.read(LogicalDatastoreType.OPERATIONAL, lii).checkedGet().get();
            // The source node has to exist
            node = TunelProgrammingUtil.sourceNode(t, tii, link).get();
        } catch (IllegalStateException | ReadFailedException e) {
            LOG.debug("Link or node does not exist.", e);
            return TunelProgrammingUtil.RESULT;
        }
        final RemoveLspInputBuilder ab = new RemoveLspInputBuilder();
        ab.setName(link.getAugmentation(Link1.class).getSymbolicPathName());
        ab.setNode(node.getSupportingNode().get(0).getKey().getNodeRef());
        return Futures.transform(
            (ListenableFuture<RpcResult<RemoveLspOutput>>) this.topologyService.removeLsp(ab.build()),
            RpcResult::getResult, MoreExecutors.directExecutor());
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:25,代码来源:DestroyTunnelInstructionExecutor.java


示例10: createInstance

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
@Override
public java.lang.AutoCloseable createInstance() {
    DataBroker dataBrokerService = getDataBrokerDependency();
    RpcProviderRegistry rpcProviderRegistry = getRpcRegistryDependency();
    NotificationProviderService notificationService = getNotificationServiceDependency();
    MonitoringProvider provider = new MonitoringProvider(dataBrokerService, rpcProviderRegistry, notificationService);

    InstanceIdentifier<Link> linkInstance = InstanceIdentifier.builder(NetworkTopology.class)
            .child(Topology.class, new TopologyKey(new TopologyId("flow:1"))).child(Link.class).build();
    dataBrokerService.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL, linkInstance,
            new TopologyListener(dataBrokerService, notificationService),
            AsyncDataBroker.DataChangeScope.BASE);

    return provider;
}
 
开发者ID:geopet85,项目名称:virtuwind-example,代码行数:16,代码来源:MonitoringModule.java


示例11: init

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
public void init () {
    LOG.info("Initializing network graph!");
    clearGraph();
    List<Link> links = getLinksFromTopology();
    if(links == null || links.isEmpty()) {
        return;
    }
    addLinks(links);
}
 
开发者ID:geopet85,项目名称:odlexample,代码行数:10,代码来源:NetworkGraphImpl.java


示例12: getLinksFromTopology

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
private List<Link> getLinksFromTopology() {
    InstanceIdentifier<Topology> topologyInstanceIdentifier = InstanceIdentifier.builder(NetworkTopology.class)
            .child(Topology.class, new TopologyKey(new TopologyId("flow:1")))
            .build();
    Topology topology = null;
    ReadOnlyTransaction readOnlyTransaction = db.newReadOnlyTransaction();
    try {
        Optional<Topology> topologyOptional = readOnlyTransaction.read(LogicalDatastoreType.OPERATIONAL, topologyInstanceIdentifier).get();
        if(topologyOptional.isPresent()) {
            topology = topologyOptional.get();
        }
    } catch(Exception e) {
        LOG.error("Error reading topology {}", topologyInstanceIdentifier);
        readOnlyTransaction.close();
        throw new RuntimeException("Error reading from operational store, topology : " + topologyInstanceIdentifier, e);
    }
    readOnlyTransaction.close();
    if(topology == null) {
        return null;
    }
    List<Link> links = topology.getLink();
    if(links == null || links.isEmpty()) {
        return null;
    }
    List<Link> internalLinks = new ArrayList<>();
    for(Link link : links) {
        if(!(link.getLinkId().getValue().contains("host"))) {
            internalLinks.add(link);
        }
    }

    return internalLinks;
}
 
开发者ID:geopet85,项目名称:odlexample,代码行数:34,代码来源:NetworkGraphImpl.java


示例13: addLinks

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
public synchronized void addLinks(List<Link> links) {
    if(links == null || links.isEmpty()) {
        LOG.debug("In addLinks: No link added as links is null or empty.");
        return;
    }

    if(networkGraph == null) {
        networkGraph = new SparseMultigraph<>();
    }

    for(Link link : links) {
        if(linkAlreadyAdded(link)) {
            continue;
        }
        NodeId sourceNodeId = link.getSource().getSourceNode();
        NodeId destinationNodeId = link.getDestination().getDestNode();
        networkGraph.addVertex(sourceNodeId);
        networkGraph.addVertex(destinationNodeId);
        networkGraph.addEdge(link, sourceNodeId, destinationNodeId, EdgeType.UNDIRECTED);
    }

    LOG.info("Created topology graph {} ", networkGraph);

    if(shortestPath == null) {
        shortestPath = new DijkstraShortestPath<>(networkGraph);
    } else {
        shortestPath.reset();
    }
    LOG.info("Shortest paths {} ", shortestPath);
}
 
开发者ID:geopet85,项目名称:odlexample,代码行数:31,代码来源:NetworkGraphImpl.java


示例14: linkAlreadyAdded

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
private boolean linkAlreadyAdded(Link link) {
    String linkAddedKey = null;
    if(link.getDestination().getDestTp().hashCode() > link.getSource().getSourceTp().hashCode()) {
        linkAddedKey = link.getSource().getSourceTp().getValue() + link.getDestination().getDestTp().getValue();
    } else {
        linkAddedKey = link.getDestination().getDestTp().getValue() + link.getSource().getSourceTp().getValue();
    }
    if(linkAdded.contains(linkAddedKey)) {
        return true;
    } else {
        linkAdded.add(linkAddedKey);
        return false;
    }
}
 
开发者ID:geopet85,项目名称:odlexample,代码行数:15,代码来源:NetworkGraphImpl.java


示例15: isNodeConnectorInternal

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
private boolean isNodeConnectorInternal(NodeConnector nodeConnector) {
	TpId tpId = new TpId(nodeConnector.getKey().getId().getValue());
	InstanceIdentifier<NetworkTopology> ntII = InstanceIdentifier.builder(NetworkTopology.class).build();
	ListenableFuture<Optional<NetworkTopology>> lfONT;
	try (ReadOnlyTransaction rot = dataService.newReadOnlyTransaction()) {
		lfONT = rot.read(LogicalDatastoreType.OPERATIONAL, ntII);
		rot.close();
	}
	Optional<NetworkTopology> oNT;
	try {
		oNT = lfONT.get();
	} catch (InterruptedException | ExecutionException ex) {
		LOG.warn(ex.getLocalizedMessage());
		return false;
	}
	if (oNT != null && oNT.isPresent()) {
		NetworkTopology networkTopo = oNT.get();
		for (Topology t : networkTopo.getTopology()) {
			if (t.getLink() != null) {
				for (Link l : t.getLink()) {
					if ((l.getSource().getSourceTp().equals(tpId)
							&& !l.getDestination().getDestTp().getValue().startsWith(Host.NODE_PREFIX))
							|| (l.getDestination().getDestTp().equals(tpId)
									&& !l.getSource().getSourceTp().getValue().startsWith(Host.NODE_PREFIX))) {
						return true;
					}
				}
			}
		}
	}
	return false;
}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:33,代码来源:HostMonitor.java


示例16: addFabricLink

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
@Override
public Future<RpcResult<AddFabricLinkOutput>> addFabricLink(AddFabricLinkInput input) {

    FabricId fabric1 = input.getSourceFabric();
    FabricId fabric2 = input.getDestFabric();
    TpId tp1 = input.getSourceFabricPort();
    TpId tp2 = input.getDestFabricPort();

    final LinkId lnkId = new LinkId(UUID.randomUUID().toString());

    InstanceIdentifier<Link> path = MdSalUtils.createInterFabricLinkIId(lnkId);
    Link data = new LinkBuilder()
            .setSource(
                    new SourceBuilder().setSourceNode(fabric1).setSourceTp(tp1).build())
            .setDestination(
                    new DestinationBuilder().setDestNode(fabric2).setDestTp(tp2).build())
            .setLinkId(lnkId)
            .build();

    WriteTransaction wt = dataBroker.newWriteOnlyTransaction();
    wt.put(LogicalDatastoreType.CONFIGURATION, path, data);
    wt.put(LogicalDatastoreType.OPERATIONAL, path, data);

    CheckedFuture<Void,TransactionCommitFailedException> future = wt.submit();

    return Futures.transformAsync(future, submitResult -> {
        RpcResultBuilder<AddFabricLinkOutput> resultBuilder = RpcResultBuilder.<AddFabricLinkOutput>success();
        AddFabricLinkOutput output = new AddFabricLinkOutputBuilder().setLinkId(lnkId).build();
        return Futures.immediateFuture(resultBuilder.withResult(output).build());
    });
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:32,代码来源:FabricResourceAPIProvider.java


示例17: linkPath

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
public static InstanceIdentifier<Link> linkPath(InstanceIdentifier<Topology> topoPath, String linkIdStr) {
    LinkId linkId = new LinkId(linkIdStr);
    LinkKey linkKey = new LinkKey(linkId);
    InstanceIdentifierBuilder<Topology> topoPathBuilder = topoPath.builder();
    InstanceIdentifierBuilder<Link> linkPathBuilder = topoPathBuilder.child(Link.class, linkKey);
    return linkPathBuilder.build();
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:8,代码来源:FabMgrYangDataUtil.java


示例18: createVcontainer

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
private void createVcontainer(InstanceIdentifier<Topology> topoPath, VcontainerConfig vcConfig) {
    InstanceIdentifier<Node> ldNodePath = FabMgrYangDataUtil.vcLdNodePath(topoPath);
    Node ldNode = FabMgrYangDataUtil.createBasicVcLdNode();
    ldNode = FabMgrYangDataUtil.updateVcLdNode(ldNode, vcConfig);

    InstanceIdentifier<Node> netNodePath = FabMgrYangDataUtil.vcNetNodePath(topoPath);
    Node netNode = FabMgrYangDataUtil.createBasicVcNetNode();

    InstanceIdentifier<Link> linkPath = FabMgrYangDataUtil.vcLinkPath(topoPath);
    Link link = FabMgrYangDataUtil.createBasicVcLink(ldNode, netNode);

    fabMgrDatastoreUtil.putData(OPERATIONAL, ldNodePath, ldNode);
    fabMgrDatastoreUtil.putData(OPERATIONAL, netNodePath, netNode);
    fabMgrDatastoreUtil.putData(OPERATIONAL, linkPath, link);
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:16,代码来源:VContainerMgr.java


示例19: calcMinimumSpanningTree

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
/**
 * Calculate and return the minimum spanning free of the Graph top.
 * @param topo - the graph.
 * @return the "pruned" minimal spanning tree.
 */
private Graph<String, Link> calcMinimumSpanningTree(List<String> fabrics)
{
    Topology topo = this.getFabricTopology();
    if (topo == null) {
        LOG.error("Failed to read Fabric Topology!");
        return null;
    }

    UndirectedSparseGraph<String, Link> graph = new UndirectedSparseGraph<>();
    for (Node node : topo.getNode()) {
        graph.addVertex(node.getNodeId().getValue());
    }

    if (topo.getLink() != null) {
        for (Link link : topo.getLink())
        {
            graph.addEdge(link, link.getSource().getSourceNode().getValue(), link.getDestination().getDestNode().getValue());
        }
    }

    PrimMinimumSpanningTree<String, Link> alg =
            new PrimMinimumSpanningTree<>(UndirectedSparseGraph.<String, Link>getFactory());

    Graph<String, Link> miniTree = alg.transform(graph);

    return pruneTree(miniTree, fabrics);
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:33,代码来源:FabricMgrProvider.java


示例20: bridgeTwoSegmentsOverALink

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; //导入依赖的package包/类
/**
 * Bridge two adjacent layer 2 segments into one
 * @param tenantId - tenant identifier.
 * @param tag - global tag shared by two access ports
 * @param link - the link between two fabrics
 * @param sseg - source l2 segment
 * @param dseg - destination l2 segment
 */
private RenderedLayer2Link bridgeTwoSegmentsOverALink(Uuid tenantId, int tag,
        Link link, RenderedSwitch sseg, RenderedSwitch dseg)
{

    TpId sltp = this.netNodeServiceProvider.createLogicalPortOnLsw(
            link.getSource().getSourceNode(),
            sseg.getSwitchID(),
            AccessType.Vlan,
            tag);

    TpId sftp = link.getSource().getSourceTp();
    this.netNodeServiceProvider.portBindingLogicalToFabric(
            new FabricId(link.getSource().getSourceNode()),
            sftp,
            sseg.getSwitchID(),
            sltp);


    TpId dltp = this.netNodeServiceProvider.createLogicalPortOnLsw(
            link.getDestination().getDestNode(),
            dseg.getSwitchID(),
            AccessType.Vlan,
            tag);
    TpId dftp = link.getDestination().getDestTp();
    this.netNodeServiceProvider.portBindingLogicalToFabric(
            new FabricId(link.getDestination().getDestNode()),
            dftp,
            dseg.getSwitchID(),
            dltp);

    return new RenderedLayer2Link(sseg, dseg, tag, sftp, sltp, dftp, dltp);
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:41,代码来源:FabricMgrProvider.java



注:本文中的org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PreProcessor类代码示例发布时间:2022-05-23
下一篇:
Java REngineException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap