当前位置: 首页>>代码示例>>Java>>正文


Java NodeId类代码示例

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


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

示例1: createIngressClassifierSfcTunnelTrafficCaptureFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; //导入依赖的package包/类
public Flow createIngressClassifierSfcTunnelTrafficCaptureFlow(NodeId nodeId) {
    MatchBuilder match = new MatchBuilder();
    OpenFlow13Utils.addMatchTunId(match, SFC_TUNNEL_ID);
    OpenFlow13Utils.addMatchEthNsh(match);

    List<Action> actionList = new ArrayList<>();
    actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.INGRESS_SFC_CLASSIFIER_FILTER_TABLE,
            actionList.size()));

    InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
    String flowIdStr = INGRESS_CLASSIFIER_CAPTURE_SFC_TUNNEL_TRAFFIC_FLOW_NAME + nodeId.getValue();


    return OpenFlow13Utils.createFlowBuilder(NwConstants.INTERNAL_TUNNEL_TABLE,
            INGRESS_CLASSIFIER_CAPTURE_SFC_TUNNEL_TRAFFIC_PRIORITY,
            INGRESS_CLASSIFIER_CAPTURE_SFC_TUNNEL_TRAFFIC_COOKIE,
            INGRESS_CLASSIFIER_CAPTURE_SFC_TUNNEL_TRAFFIC_FLOW_NAME, flowIdStr, match, isb).build();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:19,代码来源:OpenFlow13Provider.java

示例2: createIngressClassifierFilterEthNshFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; //导入依赖的package包/类
public Flow createIngressClassifierFilterEthNshFlow(NodeId nodeId) {
    MatchBuilder match = new MatchBuilder();
    OpenFlow13Utils.addMatchEthNsh(match);
    OpenFlow13Utils.addMatchTunDstIp(match, NULL_IP);

    List<Action> actionList = new ArrayList<>();
    actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.LPORT_DISPATCHER_TABLE,
        actionList.size()));

    InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
    String flowIdStr = INGRESS_CLASSIFIER_FILTER_ETHNSH_FLOW_NAME + nodeId.getValue();

    return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_FILTER_TABLE,
            INGRESS_CLASSIFIER_FILTER_ETH_NSH_PRIORITY, INGRESS_CLASSIFIER_FILTER_COOKIE,
        INGRESS_CLASSIFIER_FILTER_ETHNSH_FLOW_NAME, flowIdStr, match, isb).build();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:17,代码来源:OpenFlow13Provider.java

示例3: createIngressClassifierFilterChainEgressFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; //导入依赖的package包/类
public Flow createIngressClassifierFilterChainEgressFlow(NodeId nodeId, long nsp, short egressNsi) {

        MatchBuilder match = new MatchBuilder();
        OpenFlow13Utils.addMatchNsp(match, nsp);
        OpenFlow13Utils.addMatchNsi(match, egressNsi);

        List<Action> actionList = new ArrayList<>();
        actionList.add(OpenFlow13Utils.createActionNxMoveNsc4ToReg6Register(actionList.size()));
        actionList.add(OpenFlow13Utils.createActionNxPopNsh(actionList.size()));
        actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.EGRESS_LPORT_DISPATCHER_TABLE,
                actionList.size()));

        InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
        String flowIdStr = INGRESS_CLASSIFIER_FILTER_NSH_CHAIN_EGRESS_FLOW_NAME + nodeId.getValue() + "_" + nsp;

        return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_FILTER_TABLE,
                INGRESS_CLASSIFIER_FILTER_CHAIN_EGRESS_PRIORITY, INGRESS_CLASSIFIER_FILTER_COOKIE,
                INGRESS_CLASSIFIER_FILTER_NSH_CHAIN_EGRESS_FLOW_NAME, flowIdStr, match, isb).build();
    }
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:20,代码来源:OpenFlow13Provider.java

示例4: createIngressClassifierAclFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; //导入依赖的package包/类
public Flow createIngressClassifierAclFlow(NodeId nodeId, MatchBuilder match, Long port, long nsp, short nsi) {
    OpenFlow13Utils.addMatchInPort(match, nodeId, port);

    List<Action> actionList = new ArrayList<>();
    actionList.add(OpenFlow13Utils.createActionNxPushNsh(actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxLoadNshMdtype(NSH_MDTYPE_ONE, actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxLoadNp(NSH_NP_ETH, actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxLoadNsp((int) nsp, actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxLoadNsi(nsi, actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxLoadNshc1(ACL_FLAG_CONTEXT_VALUE, actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxLoadNshc2(DEFAULT_NSH_CONTEXT_VALUE, actionList.size()));
    actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.LPORT_DISPATCHER_TABLE,
        actionList.size()));

    InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);

    // The flowIdStr needs to be unique, so the best way to make it unique is to use the match
    String flowIdStr = INGRESS_CLASSIFIER_ACL_FLOW_NAME + "_" + nodeId.getValue() + match.build().toString();

    return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_ACL_TABLE,
        INGRESS_CLASSIFIER_ACL_PRIORITY, INGRESS_CLASSIFIER_ACL_COOKIE, INGRESS_CLASSIFIER_ACL_FLOW_NAME,
        flowIdStr, match, isb).build();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:24,代码来源:OpenFlow13Provider.java

示例5: createIngressClassifierAclNoMatchFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; //导入依赖的package包/类
public Flow createIngressClassifierAclNoMatchFlow(NodeId nodeId) {
    // This is a MatchAny flow
    MatchBuilder match = new MatchBuilder();

    List<Action> actionList = new ArrayList<>();
    actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.LPORT_DISPATCHER_TABLE,
            actionList.size()));

    InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);

    String flowIdStr = INGRESS_CLASSIFIER_ACL_FLOW_NAME + "_" + nodeId.getValue();

    return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_ACL_TABLE,
            INGRESS_CLASSIFIER_ACL_NOMATCH_PRIORITY, INGRESS_CLASSIFIER_ACL_COOKIE,
            INGRESS_CLASSIFIER_ACL_FLOW_NAME, flowIdStr, match, isb).build();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:17,代码来源:OpenFlow13Provider.java

示例6: createEgressClassifierNextHopNoC1C2Flow

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; //导入依赖的package包/类
public Flow createEgressClassifierNextHopNoC1C2Flow(NodeId nodeId) {
    MatchBuilder match = new MatchBuilder();
    OpenFlow13Utils.addMatchNshNsc1(match, DEFAULT_NSH_CONTEXT_VALUE);
    OpenFlow13Utils.addMatchNshNsc2(match, DEFAULT_NSH_CONTEXT_VALUE);

    List<Action> actionList = new ArrayList<>();
    actionList.add(OpenFlow13Utils.createActionNxMoveReg0ToNsc1Register(actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxMoveTunIdToNsc2Register(actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxMoveReg6ToNsc4Register(actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxLoadTunId(SFC_TUNNEL_ID, actionList.size()));

    InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
    OpenFlow13Utils.appendGotoTableInstruction(isb, NwConstants.EGRESS_SFC_CLASSIFIER_EGRESS_TABLE);
    String flowIdStr = EGRESS_CLASSIFIER_NEXTHOP_NOC1C2_FLOW_NAME + nodeId.getValue();

    return OpenFlow13Utils.createFlowBuilder(NwConstants.EGRESS_SFC_CLASSIFIER_NEXTHOP_TABLE,
        EGRESS_CLASSIFIER_NEXTHOP_NOC1C2_PRIORITY, EGRESS_CLASSIFIER_NEXTHOP_COOKIE,
        EGRESS_CLASSIFIER_NEXTHOP_NOC1C2_FLOW_NAME, flowIdStr, match, isb).build();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:20,代码来源:OpenFlow13Provider.java

示例7: createEgressClassifierTransportEgressRemoteFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; //导入依赖的package包/类
public Flow createEgressClassifierTransportEgressRemoteFlow(NodeId nodeId, long nsp, long outport,
                                                            String firstHopIp) {
    MatchBuilder match = OpenFlow13Utils.getNspMatch(nsp);

    Long ipl = InetAddresses.coerceToInteger(InetAddresses.forString(firstHopIp)) & 0xffffffffL;
    List<Action> actionList = new ArrayList<>();
    actionList.add(OpenFlow13Utils.createActionNxLoadTunIpv4Dst(ipl, actionList.size()));
    actionList.add(OpenFlow13Utils.createActionOutPort("output:" + outport, actionList.size()));

    InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
    String flowIdStr = EGRESS_CLASSIFIER_TPORTEGRESS_FLOW_NAME + nodeId.getValue() + "_" + nsp;

    return OpenFlow13Utils.createFlowBuilder(NwConstants.EGRESS_SFC_CLASSIFIER_EGRESS_TABLE,
        EGRESS_CLASSIFIER_EGRESS_REMOTE_PRIORITY, EGRESS_CLASSIFIER_TPORTEGRESS_COOKIE,
        EGRESS_CLASSIFIER_TPORTEGRESS_FLOW_NAME, flowIdStr, match, isb).build();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:17,代码来源:OpenFlow13Provider.java

示例8: getInterfacesFromNode

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; //导入依赖的package包/类
public List<String> getInterfacesFromNode(NodeId nodeId) {
    // getPortsOnBridge() only returns Tunnel ports, so instead using getDpnInterfaceList.
    GetDpnInterfaceListInputBuilder inputBuilder = new GetDpnInterfaceListInputBuilder();
    inputBuilder.setDpid(BigInteger.valueOf(Long.parseLong(nodeId.getValue().split(":")[1])));
    GetDpnInterfaceListInput input = inputBuilder.build();

    try {
        LOG.debug("getInterfacesFromNode: invoking rpc");
        RpcResult<GetDpnInterfaceListOutput> output =
                interfaceManagerRpcService.getDpnInterfaceList(input).get();
        if (!output.isSuccessful()) {
            LOG.error("getInterfacesFromNode({}) failed: {}", input, output);
            return Collections.emptyList();
        }
        LOG.debug("getInterfacesFromNode({}) succeeded: {}", input, output);
        return output.getResult().getInterfacesList();
    } catch (InterruptedException | ExecutionException e) {
        LOG.error("getInterfacesFromNode failed to retrieve target interface name: ", e);
    }

    return Collections.emptyList();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:23,代码来源:GeniusProvider.java

示例9: renderNode

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; //导入依赖的package包/类
@Override
// FindBugs reports "Useless object stored in variable flows" however it doesn't recognize the usage of forEach.
@SuppressFBWarnings("UC_USELESS_OBJECT")
public void renderNode(NodeId nodeId) {
    List<Flow> flows = new ArrayList<>();
    flows.add(this.openFlow13Provider.createIngressClassifierFilterVxgpeNshFlow(nodeId));
    flows.add(this.openFlow13Provider.createIngressClassifierFilterEthNshFlow(nodeId));
    flows.add(this.openFlow13Provider.createIngressClassifierFilterNoNshFlow(nodeId));
    flows.add(this.openFlow13Provider.createIngressClassifierAclNoMatchFlow(nodeId));

    flows.add(this.openFlow13Provider.createIngressClassifierSfcTunnelTrafficCaptureFlow(nodeId));

    flows.add(this.openFlow13Provider.createEgressClassifierFilterNshFlow(nodeId));
    flows.add(this.openFlow13Provider.createEgressClassifierFilterNoNshFlow(nodeId));

    flows.add(this.openFlow13Provider.createEgressClassifierNextHopC1C2Flow(nodeId));
    flows.add(this.openFlow13Provider.createEgressClassifierNextHopNoC1C2Flow(nodeId));

    WriteTransaction tx = this.dataBroker.newWriteOnlyTransaction();
    flows.forEach(flow -> this.openFlow13Provider.appendFlowForCreate(nodeId, flow, tx));
    tx.submit();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:23,代码来源:OpenflowRenderer.java

示例10: suppressNode

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; //导入依赖的package包/类
@Override
// FindBugs reports "Useless object stored in variable flows" however it doesn't recognize the usage of forEach.
@SuppressFBWarnings("UC_USELESS_OBJECT")
public void suppressNode(NodeId nodeId) {
    List<Flow> flows = new ArrayList<>();
    flows.add(this.openFlow13Provider.createIngressClassifierFilterVxgpeNshFlow(nodeId));
    flows.add(this.openFlow13Provider.createIngressClassifierFilterEthNshFlow(nodeId));
    flows.add(this.openFlow13Provider.createIngressClassifierFilterNoNshFlow(nodeId));

    flows.add(this.openFlow13Provider.createEgressClassifierFilterNshFlow(nodeId));
    flows.add(this.openFlow13Provider.createEgressClassifierFilterNoNshFlow(nodeId));

    flows.add(this.openFlow13Provider.createEgressClassifierNextHopC1C2Flow(nodeId));
    flows.add(this.openFlow13Provider.createEgressClassifierNextHopNoC1C2Flow(nodeId));

    WriteTransaction tx = this.dataBroker.newWriteOnlyTransaction();
    flows.forEach(flow -> this.openFlow13Provider.appendFlowForDelete(nodeId, flow, tx));
    tx.submit();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:20,代码来源:OpenflowRenderer.java

示例11: getNodeIdFromLogicalInterface

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; //导入依赖的package包/类
@Test
public void getNodeIdFromLogicalInterface() {
    //Optional<NodeId> getNodeIdFromLogicalInterface(String logicalInterface)
    // Test that it correctly handles the case when the ifName doesnt exist
    Optional<NodeId> nodeId = this.geniusProvider.getNodeIdFromLogicalInterface(
            GeniusProviderTestParams.INTERFACE_NAME_NO_EXIST);
    assertFalse(nodeId.isPresent());

    // Test that it correctly handles RPC errors
    nodeId = this.geniusProvider.getNodeIdFromLogicalInterface(
            GeniusProviderTestParams.INTERFACE_NAME_INVALID);
    assertFalse(nodeId.isPresent());

    // Test that it correctly returns the DpnId when everything is correct
    nodeId = this.geniusProvider.getNodeIdFromLogicalInterface(
            GeniusProviderTestParams.INTERFACE_NAME);
    assertTrue(nodeId.isPresent());
    assertEquals(nodeId.get().getValue(), GeniusProviderTestParams.NODE_ID);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:20,代码来源:GeniusProviderTest.java

示例12: getListOfDpns

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; //导入依赖的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

示例13: getNodeConnectorCountersDirect

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; //导入依赖的package包/类
public CounterResultDataStructure getNodeConnectorCountersDirect(NodeId nodeId, NodeConnectorId nodeConnectorId) {
    GetNodeConnectorStatisticsInput gncsi = getNodeConnectorStatisticsInputBuilder(nodeId, nodeConnectorId);

    Future<RpcResult<GetNodeConnectorStatisticsOutput>> rpcResultFuture =
            odlDirectStatsService.getNodeConnectorStatistics(gncsi);
    RpcResult<GetNodeConnectorStatisticsOutput> rpcResult = null;
    try {
        rpcResult = rpcResultFuture.get();
    } catch (InterruptedException | ExecutionException e) {
        counters.failedGettingNodeConnectorCounters.inc();
        LOG.warn("Unable to retrieve node connector counters for port {}", nodeConnectorId);
        return null;
    }

    if (rpcResult != null && rpcResult.isSuccessful() && rpcResult.getResult() != null) {
        GetNodeConnectorStatisticsOutput nodeConnectorStatsOutput = rpcResult.getResult();
        return createNodeConnectorResultMapDirect(nodeConnectorStatsOutput, nodeConnectorId);
    } else {
        counters.failedGettingRpcResultForNodeConnectorCounters.inc();
        LOG.warn("Unable to retrieve node connector counters for port {}", nodeConnectorId);
        return null;
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:24,代码来源:CounterRetriever.java

示例14: getNodeConnectorResult

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; //导入依赖的package包/类
private boolean getNodeConnectorResult(List<CounterResult> counters, BigInteger dpId, String portNumber) {
    CounterResultDataStructure counterResultDS =
            counterRetriever.getNodeConnectorCountersDirect(new NodeId(CountersUtils.getNodeId(dpId)),
                    new NodeConnectorId(CountersUtils.getNodeConnectorId(dpId, portNumber)));
    if (counterResultDS == null) {
        return false;
    }

    CounterResultBuilder crb = new CounterResultBuilder();
    String resultId = CountersUtils.getNodeConnectorId(dpId, portNumber);
    crb.setId(resultId);

    createGroups(counters, counterResultDS, crb, resultId);

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

示例15: getNodeResult

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; //导入依赖的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


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