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

Java Node类代码示例

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

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



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

示例1: remove

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
@Override
protected void remove(InstanceIdentifier<FlowCapableNode> key, FlowCapableNode dataObjectModification) {
    NodeKey nodeKey = key.firstKeyOf(Node.class);
    BigInteger dpnId = MDSALUtil.getDpnIdFromNodeName(nodeKey.getId());
    if (!aclDataUtil.doesDpnHaveAclInterface(dpnId)) {
        // serialize ACL pool deletion per switch
        jobCoordinator.enqueueJob(String.valueOf(dpnId), () -> {
            this.aclServiceUtils.deleteAclIdPools(dpnId);
            return Collections.emptyList();
        });
        LOG.debug("On FlowCapableNode remove event, ACL pools for dpid: {} are deleted.", dpnId);
    } else {
        LOG.info("On FlowCapableNode remove event, ACL pools for dpid: {} are not deleted "
            + "because ACL ports are associated.", dpnId);
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:17,代码来源:AclNodeListener.java


示例2: removeTunnelTableEntry

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
private void removeTunnelTableEntry(BigInteger dpId, long label, WriteTransaction tx) {
    FlowEntity flowEntity;
    LOG.debug("remove terminatingServiceActions called with DpnId = {} and label = {}", dpId, label);
    List<MatchInfo> mkMatches = new ArrayList<>();
    // Matching metadata
    mkMatches.add(new MatchTunnelId(BigInteger.valueOf(label)));
    flowEntity = MDSALUtil.buildFlowEntity(dpId,
        NwConstants.INTERNAL_TUNNEL_TABLE,
        getTableMissFlowRef(dpId, NwConstants.INTERNAL_TUNNEL_TABLE, (int) label),
        5, String.format("%s:%d", "TST Flow Entry ", label), 0, 0,
        COOKIE_TUNNEL.add(BigInteger.valueOf(label)), mkMatches, null);
    Node nodeDpn = FibUtil.buildDpnNode(flowEntity.getDpnId());
    FlowKey flowKey = new FlowKey(new FlowId(flowEntity.getFlowId()));
    InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class)
        .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class)
        .child(Table.class, new TableKey(flowEntity.getTableId())).child(Flow.class, flowKey).build();

    tx.delete(LogicalDatastoreType.CONFIGURATION, flowInstanceId);
    LOG.debug("Terminating service Entry for dpID {} : label : {} removed successfully", dpId, label);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:21,代码来源:VrfEntryListener.java


示例3: getListOfDpns

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
public static List<BigInteger> getListOfDpns(DataBroker broker) {
    List<BigInteger> dpnsList = new LinkedList<>();
    InstanceIdentifier<Nodes> nodesInstanceIdentifier = InstanceIdentifier.builder(Nodes.class).build();
    Optional<Nodes> nodesOptional =
            MDSALUtil.read(broker, LogicalDatastoreType.OPERATIONAL, nodesInstanceIdentifier);
    if (!nodesOptional.isPresent()) {
        return dpnsList;
    }
    Nodes nodes = nodesOptional.get();
    List<Node> nodeList = nodes.getNode();
    for (Node node : nodeList) {
        NodeId nodeId = node.getId();
        if (nodeId == null) {
            continue;
        }
        BigInteger dpnId = MDSALUtil.getDpnIdFromNodeName(nodeId);
        dpnsList.add(dpnId);
    }
    return dpnsList;
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:21,代码来源:DhcpServiceUtils.java


示例4: transmitRtrAdvertisement

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
public boolean transmitRtrAdvertisement(Ipv6RtrAdvertType raType, VirtualPort routerPort,
                                        List<NodeConnectorRef> outportList, RouterSolicitationPacket rsPdu) {
    RouterAdvertisementPacketBuilder raPacket = new RouterAdvertisementPacketBuilder();
    updateRAResponse(raType, rsPdu, raPacket, routerPort);
    // Serialize the response packet
    byte[] txPayload = fillRouterAdvertisementPacket(raPacket.build());
    for (NodeConnectorRef outport: outportList) {
        InstanceIdentifier<Node> outNode = outport.getValue().firstIdentifierOf(Node.class);
        TransmitPacketInput input = new TransmitPacketInputBuilder().setPayload(txPayload)
                .setNode(new NodeRef(outNode))
                .setEgress(outport).build();
        LOG.debug("Transmitting the Router Advt packet out {}", outport);
        JdkFutures.addErrorLogging(packetService.transmitPacket(input), LOG, "transmitPacket");
    }
    return true;
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:17,代码来源:Ipv6RouterAdvt.java


示例5: getNodeResult

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
private boolean getNodeResult(List<CounterResult> counters, BigInteger dpId) {
    InstanceIdentifier<Node> nodeInstanceIdentifier = InstanceIdentifier.builder(Nodes.class)
            .child(Node.class, new NodeKey(new NodeId(CountersUtils.getNodeId(dpId)))).build();
    Optional<Node> nodeOptional = MDSALUtil.read(db, LogicalDatastoreType.OPERATIONAL, nodeInstanceIdentifier);
    if (!nodeOptional.isPresent()) {
        return false;
    }

    Node node = nodeOptional.get();
    CounterResultDataStructure counterResultDS = counterRetriever.getNodeCountersDirect(node);
    if (counterResultDS == null) {
        return false;
    }

    createCounterResults(counters, counterResultDS);

    return !counters.isEmpty();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:19,代码来源:StatisticsImpl.java


示例6: getNodeAggregatedResult

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
private boolean getNodeAggregatedResult(List<CounterResult> aggregatedCounters, BigInteger dpId) {
    InstanceIdentifier<Node> nodeInstanceIdentifier = InstanceIdentifier.builder(Nodes.class)
            .child(Node.class, new NodeKey(new NodeId(CountersUtils.getNodeId(dpId)))).build();
    Optional<Node> nodeOptional = MDSALUtil.read(db, LogicalDatastoreType.OPERATIONAL, nodeInstanceIdentifier);
    if (!nodeOptional.isPresent()) {
        return false;
    }

    Node node = nodeOptional.get();
    CounterResultDataStructure counters = counterRetriever.getNodeCountersDirect(node);
    if (counters == null || counters.isEmpty()) {
        return false;
    }

    CounterResultDataStructure aggregatedResultsDS =
            CountersUtils.aggregateCounters(counters, CountersUtils.getNodeId(dpId));
    createCounterResults(aggregatedCounters, aggregatedResultsDS);
    return !aggregatedCounters.isEmpty();

}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:21,代码来源:StatisticsImpl.java


示例7: sendPacketOut

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
private void sendPacketOut(byte[] payload, NodeConnectorRef egress) {
	if (egress == null) {
		LOG.info("Egress is null");
		return;
	}

	InstanceIdentifier<Node> egressNodePath = getNodePath(egress.getValue());

	TransmitPacketInput input = new TransmitPacketInputBuilder() //
			.setPayload(payload) //
			.setNode(new NodeRef(egressNodePath)) //
			.setEgress(egress) //
			.build();

	Future<RpcResult<Void>> future = packetService.transmitPacket(input);
	JdkFutureAdapters.listenInPoolThread(future);
}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:18,代码来源:TunnellingConnectivityManager.java


示例8: deleteFibEntry

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
/**
 * Delete fib entry.
 *
 * @param withdraws
 *            the withdraws
 */
private synchronized void deleteFibEntry(Collection<AtriumFibUpdate> withdraws) {

	for (AtriumFibUpdate update : withdraws) {
		AtriumFibEntry entry = update.entry();
		NodeRef nodeRef = new NodeRef(
				InstanceIdentifier.builder(Nodes.class).child(Node.class, new NodeKey(deviceId)).build());

		ForwardingObjectiveBuilder forwardingObjBuilder = generateRibForwardingObj(entry.prefix(), null);
		if (forwardingObjBuilder != null) {
			ForwardInputBuilder inputBuilder = new ForwardInputBuilder();
			forwardingObjBuilder.setOperation(Operation.Remove);
			inputBuilder.setNode(nodeRef);
			inputBuilder.setForwardingObjective(forwardingObjBuilder.build());
			LOG.info("Invoking forward objective in DIDM for fibEntry delete");
			LOG.info("FIB Entry: " + forwardingObjBuilder.build());
			flowObjectivesService.forward(inputBuilder.build());
			FibDataModelWriter.deleteFib(update, dataBroker);

		} else {
			continue;
		}
	}

}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:31,代码来源:Bgprouter.java


示例9: addArpFlowToController

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
public void addArpFlowToController(NodeId dpnId) {

		NodeRef nodeRef = new NodeRef(
				InstanceIdentifier.builder(Nodes.class).child(Node.class, new NodeKey(dpnId)).build());

		ForwardingObjectiveBuilder fwdObjBuilder = new ForwardingObjectiveBuilder();
		fwdObjBuilder.setOperation(Operation.Add);
		fwdObjBuilder.setFlag(Flag.Versatile);
		MatchBuilder matchBuilder = new MatchBuilder();
		EthernetMatch etherMatch = AtriumUtils.getEtherMatch(Bgprouter.ARP_ETH_TYPE);
		matchBuilder.setEthernetMatch(etherMatch);

		ActionData puntAction = new ActionData(ActionUtils.punt_to_controller, new String[] { null });

		fwdObjBuilder.setMatch(matchBuilder.build());
		List<Action> actions = new ArrayList<>();
		actions.add(puntAction.buildAction());
		fwdObjBuilder.setAction(actions);

		ForwardInputBuilder forwardInputBuilderSrc = new ForwardInputBuilder();
		forwardInputBuilderSrc.setNode(nodeRef);
		forwardInputBuilderSrc.setForwardingObjective(fwdObjBuilder.build());
		flowObjectivesService.forward(forwardInputBuilderSrc.build());

	}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:26,代码来源:Bgprouter.java


示例10: isNodeAvailable

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
/**
 * Checks if is node available.
 *
 * @param broker
 *            the broker
 * @param deviceId
 *            the device id
 * @return true, if is node available
 */
public static boolean isNodeAvailable(DataBroker broker, NodeId deviceId) {
	List<Node> nodes = AtriumUtils.getNodes(broker);
	if (nodes == null) {
		return false;
	}

	for (Node node : nodes) {
		if (node.getId().equals(deviceId)) {
			return true;
		}
	}

	return false;

}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:25,代码来源:AtriumUtils.java


示例11: getNodeConnRef

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
/**
 * Gets the node conn ref.
 *
 * @param nodeId
 *            the node id
 * @param port
 *            the port
 * @return the node conn ref
 */
public static NodeConnectorRef getNodeConnRef(final NodeId nodeId, final Long port) {
	StringBuilder _stringBuilder = new StringBuilder(nodeId.getValue());
	StringBuilder _append = _stringBuilder.append(":");
	StringBuilder sBuild = _append.append(port);
	String _string = sBuild.toString();
	NodeConnectorId _nodeConnectorId = new NodeConnectorId(_string);
	NodeConnectorKey _nodeConnectorKey = new NodeConnectorKey(_nodeConnectorId);
	NodeConnectorKey nConKey = _nodeConnectorKey;
	InstanceIdentifierBuilder<Nodes> _builder = InstanceIdentifier.<Nodes> builder(Nodes.class);
	NodeId _nodeId = new NodeId(nodeId);
	NodeKey _nodeKey = new NodeKey(_nodeId);
	InstanceIdentifierBuilder<Node> _child = _builder.<Node, NodeKey> child(Node.class, _nodeKey);
	InstanceIdentifierBuilder<NodeConnector> _child_1 = _child
			.<NodeConnector, NodeConnectorKey> child(NodeConnector.class, nConKey);
	NodeConnectorRef _nodeConnectorRef = new NodeConnectorRef(_child_1.build());
	return _nodeConnectorRef;
}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:27,代码来源:AtriumUtils.java


示例12: sendArpResponse

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
public ListenableFuture<RpcResult<Void>> sendArpResponse(ArpMessageAddress senderAddress,
		ArpMessageAddress receiverAddress, InstanceIdentifier<NodeConnector> egressNc, Header8021q vlan) {
	checkNotNull(senderAddress);
	checkNotNull(receiverAddress);
	checkNotNull(egressNc);
	final Ethernet arpFrame = createArpFrame(senderAddress, receiverAddress, vlan);
	byte[] arpFrameAsBytes;
	try {
		arpFrameAsBytes = arpFrame.serialize();
	} catch (PacketException e) {
		LOG.warn("Serializition of ARP packet is not successful.", e);
		if (LOG.isDebugEnabled()) {
			LOG.debug("ARP packet: {}", ArpUtils.getArpFrameToStringFormat(arpFrame));
		}
		return Futures.immediateFailedFuture(e);
	}
	// Generate packet with destination switch and port
	LOG.debug("Egress for ARP packetOut: " + new NodeConnectorRef(egressNc).toString());
	TransmitPacketInput packet = new TransmitPacketInputBuilder().setEgress(new NodeConnectorRef(egressNc))
			.setNode(new NodeRef(egressNc.firstIdentifierOf(Node.class))).setPayload(arpFrameAsBytes).build();
	if (LOG.isTraceEnabled()) {
		LOG.trace("Sending ARP RESPONSE \n{}", ArpUtils.getArpFrameToStringFormat(arpFrame));
	}
	Future<RpcResult<Void>> futureTransmitPacketResult = packetProcessingService.transmitPacket(packet);
	return JdkFutureAdapters.listenInPoolThread(futureTransmitPacketResult);
}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:27,代码来源:ArpSender.java


示例13: testFloodArp

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
@Test
public void testFloodArp() {
	Ipv4Address srcIpv4Address = Ipv4Address.getDefaultInstance("192.168.10.1");
	Ipv4Address dstIpv4Address = Ipv4Address.getDefaultInstance("192.168.20.1");
	MacAddress macAddress = new MacAddress("aa:bb:cc:dd:ee:ff");
	ArpMessageAddress senderAddress = new ArpMessageAddress(macAddress, srcIpv4Address);
	InstanceIdentifier<Node> instanceId = InstanceIdentifier.builder(Nodes.class)
			.child(Node.class, new NodeKey(new NodeId("node_001"))).toInstance();

	Future<RpcResult<Void>> futureTransmitPacketResult = mock(Future.class);

	when(packetProcessingService.transmitPacket(any(TransmitPacketInput.class)))
			.thenReturn(futureTransmitPacketResult);

	arpSender.floodArp(senderAddress, dstIpv4Address, instanceId);

	verify(packetProcessingService, times(1)).transmitPacket(any(TransmitPacketInput.class));
}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:19,代码来源:ArpSenderTest.java


示例14: testSendArpResponse

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
@Test
public void testSendArpResponse() {
	Ipv4Address srcIpv4Address = Ipv4Address.getDefaultInstance("192.168.20.1");
	Ipv4Address dstIpv4Address = Ipv4Address.getDefaultInstance("192.168.10.1");
	MacAddress srcMacAddress = new MacAddress("aa:bb:cc:dd:ee:00");
	MacAddress dstMacAddress = new MacAddress("aa:bb:cc:dd:ee:ff");

	ArpMessageAddress senderAddress = new ArpMessageAddress(srcMacAddress, srcIpv4Address);
	ArpMessageAddress receiverAddress = new ArpMessageAddress(dstMacAddress, dstIpv4Address);

	InstanceIdentifier<Node> instanceId = InstanceIdentifier.builder(Nodes.class)
			.child(Node.class, new NodeKey(new NodeId("node_001"))).toInstance();
	NodeConnectorKey nodeConnectorKey = new NodeConnectorKey(new NodeConnectorId("node_001:0xfffffffc"));
	InstanceIdentifier<NodeConnector> egressNc = instanceId.child(NodeConnector.class, nodeConnectorKey);

	Future<RpcResult<Void>> futureTransmitPacketResult = mock(Future.class);

	when(packetProcessingService.transmitPacket(any(TransmitPacketInput.class)))
			.thenReturn(futureTransmitPacketResult);

	arpSender.sendArpResponse(senderAddress, receiverAddress, egressNc, null);

	verify(packetProcessingService, times(1)).transmitPacket(any(TransmitPacketInput.class));
}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:25,代码来源:ArpSenderTest.java


示例15: getNodes

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
/**
 * Retrieve all the {@link Node} along with a list of their
 * associated {@link NodeConnector}.
 * @return nodes A map with {@link Node} as the key and a {@link List} of {@link NodeConnector}.
 */
public static Map<Node, List<NodeConnector>> getNodes(final DataBroker dataBroker) {
    Map<Node, List<NodeConnector>> nodeMap = new HashMap<Node, List<NodeConnector>>();
    Nodes nodeList = new NodesBuilder().build();
    ReadTransaction tx = dataBroker.newReadOnlyTransaction();
    try {
        final InstanceIdentifier<Nodes> nodesIdentifier = InstanceIdentifier.create(Nodes.class);
        final CheckedFuture<Optional<Nodes>, ReadFailedException> txCheckedFuture = tx.read(LogicalDatastoreType
                .OPERATIONAL, nodesIdentifier);
        nodeList = txCheckedFuture.checkedGet().get();

        for (Node node : nodeList.getNode()) {
            LOG.info("Node ID : {}", node.getId());
            List<NodeConnector> nodeConnector = node.getNodeConnector();
            nodeMap.put(node, nodeConnector);
        }
    } catch (ReadFailedException e) {
        //TODO: Perform fail over
        LOG.error("Error reading Nodes from MD-SAL", e);
    }
    return nodeMap;
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:27,代码来源:TopologyUtils.java


示例16: execute

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
@Override
public void execute(final Intent intent, final FlowAction flowAction) throws IntentInvalidException {
    if(intent == null) {
        throw new IntentInvalidException(INTENT_NULL_MESSAGE);
    }
    final List<String> endPointGroups = IntentUtils.extractEndPointGroup(intent);
    Action actionContainer = IntentUtils.getAction(intent);

    intentFlowManager.setEndPointGroups(endPointGroups);
    intentFlowManager.setAction(actionContainer);
    intentFlowManager.setIntent(intent);
    //Get all node Id's
    final Map<Node, List<NodeConnector>> nodeMap = TopologyUtils.getNodes(dataBroker);
    for (Map.Entry<Node, List<NodeConnector>> entry : nodeMap.entrySet()) {
        //Push flow to every node for now
        intentFlowManager.pushFlow(entry.getKey().getId(), flowAction);
    }
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:19,代码来源:DefaultExecutor.java


示例17: setUp

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
@Before
public void setUp() throws IntentInvalidException, ReadFailedException {
    PowerMockito.mockStatic(IntentUtils.class);
    PowerMockito.mockStatic(TopologyUtils.class);
    PowerMockito.mockStatic(InstanceIdentifier.class);

    final List<Actions> actions = Arrays.asList(actionsMock);
    final List<NodeConnector> nodeConnectors = Arrays.asList(nodeConnectorMock);
    final Map<Node, List<NodeConnector>> nodeConnectorsByNode = new HashMap<>();
    nodeConnectorsByNode.put(nodeMock, nodeConnectors);

    Mockito.when(intentMock.getActions()).thenReturn(actions);
    Mockito.when(actionsMock.getAction()).thenReturn(actionMock);
    Mockito.when(intentMock.getId()).thenReturn(Uuid.getDefaultInstance(UUID.randomUUID().toString()));
    Mockito.when(TopologyUtils.getNodes(dataBrokerMock)).thenReturn(nodeConnectorsByNode);
    Mockito.when(dataBrokerMock.newReadOnlyTransaction()).thenReturn(readOnlyTransactionMock);
    Mockito.when(InstanceIdentifier.create(Nodes.class)).thenReturn(instanceIdentifierMock);
    Mockito.when(readOnlyTransactionMock.read(LogicalDatastoreType.OPERATIONAL, instanceIdentifierMock)).thenReturn(checkedFutureMock);
    Mockito.when(checkedFutureMock.checkedGet()).thenReturn(nodesOptionalMock);
    Mockito.when(nodesOptionalMock.get()).thenReturn(nodeListMock);

    defaultExecutorMock = new DefaultExecutor(intentFlowManagerMock, dataBrokerMock);
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:24,代码来源:DefaultExecutorTest.java


示例18: removeTap

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
private void removeTap(Tap tap) {
    NodeId nodeId = tap.getNode();
    String tapId = tap.getId();
    String flowIdStr = "Tap_" + tapId + "SrcPort_"; // TODO: Concat srcNodeConnector to each flow;
    FlowId flowId = new FlowId(flowIdStr);
    FlowBuilder flowBuilder = new FlowBuilder()
            .setKey(new FlowKey(flowId))
            .setId(flowId)
            .setTableId((short)0);
    InstanceIdentifier<Flow> flowIID = InstanceIdentifier.builder(Nodes.class)
            .child(Node.class, new NodeKey(nodeId))
            .augmentation(FlowCapableNode.class)
            .child(Table.class, new TableKey(flowBuilder.getTableId()))
            .child(Flow.class, flowBuilder.getKey())
            .build();
    GenericTransactionUtils.writeData(dataBroker, LogicalDatastoreType.CONFIGURATION, flowIID, flowBuilder.build(), false);
}
 
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:18,代码来源:TutorialTapProvider.java


示例19: nodeAdded

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
public NodeUpdated nodeAdded(ConnectionAdapter connectionAdapter) {
    NodeUpdatedBuilder builder = new NodeUpdatedBuilder();
    BigInteger datapathId = this.connectionRegistry.getDatapathID(connectionAdapter);
    builder.setId(nodeIdFromDatapathId(datapathId));
    InstanceIdentifier<Node> identifier = identifierFromDatapathId(datapathId);
    builder.setNodeRef(new NodeRef(identifier));

    FlowCapableNodeUpdatedBuilder builder2 = new FlowCapableNodeUpdatedBuilder();
    try {
        builder2.setIpAddress(getIpAddressOf(connectionAdapter));
    } catch (Exception e) {
        LOG.warn("IP address of the node cannot be obtained.");
    }
    GetFeaturesOutput features = this.connectionRegistry.getFeaturesOutput(connectionAdapter);

    builder2.setSwitchFeatures(swFeaturesUtil.buildSwitchFeatures(features));
    builder.addAugmentation(FlowCapableNodeUpdated.class, builder2.build());

    return builder.build();
}
 
开发者ID:fp7-netide,项目名称:Engine,代码行数:21,代码来源:ShimSwitchConnectionHandlerImpl.java


示例20: add

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; //导入依赖的package包/类
@Override
protected void add(InstanceIdentifier<FlowCapableNode> key, FlowCapableNode dataObjectModification) {
    LOG.trace("FlowCapableNode Added: key: {}", key);
    NodeKey nodeKey = key.firstKeyOf(Node.class);
    BigInteger dpnId = MDSALUtil.getDpnIdFromNodeName(nodeKey.getId());
    createTableDefaultEntries(dpnId);
    // serialize ACL pool creation per switch
    jobCoordinator.enqueueJob(String.valueOf(dpnId), () -> {
        this.aclServiceUtils.createAclIdPools(dpnId);
        return Collections.emptyList();
    });
    LOG.trace("FlowCapableNode (dpid: {}) add event is processed.", dpnId);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:14,代码来源:AclNodeListener.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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