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

Java NodeConnectorId类代码示例

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

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



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

示例1: getNodeconnectorIdFromInterface

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; //导入依赖的package包/类
@Override
public Future<RpcResult<GetNodeconnectorIdFromInterfaceOutput>>
    getNodeconnectorIdFromInterface(GetNodeconnectorIdFromInterfaceInput input)  {
    String ifName = input.getIntfName();

    // if the ifName is INTERFACE_NAME_NO_EXIST, then an empty response will be returned
    GetNodeconnectorIdFromInterfaceOutputBuilder builder = new GetNodeconnectorIdFromInterfaceOutputBuilder();
    if (ifName == GeniusProviderTestParams.INTERFACE_NAME) {
        builder.setNodeconnectorId(new NodeConnectorId(
                GeniusProviderTestParams.NODE_CONNECTOR_ID_PREFIX
                + GeniusProviderTestParams.INTERFACE_NAME));
    } else if (ifName == GeniusProviderTestParams.INTERFACE_NAME_INVALID) {
        return Futures.immediateFuture(RpcResultBuilder.<GetNodeconnectorIdFromInterfaceOutput>failed()
                .withError(ErrorType.APPLICATION, "Invalid data.").build());
    }

    return Futures.immediateFuture(RpcResultBuilder
            .<GetNodeconnectorIdFromInterfaceOutput>success(builder.build()).build());
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:20,代码来源:TestOdlInterfaceRpcService.java


示例2: remove

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; //导入依赖的package包/类
@Override
protected void remove(InstanceIdentifier<Interface> identifier, Interface del) {
    if (!L2vlan.class.equals(del.getType()) && !Tunnel.class.equals(del.getType())) {
        return;
    }
    List<String> ofportIds = del.getLowerLayerIf();
    if (ofportIds == null || ofportIds.isEmpty()) {
        return;
    }
    String interfaceName = del.getName();
    Port port = dhcpManager.getNeutronPort(interfaceName);
    if (NeutronConstants.IS_DHCP_PORT.test(port)) {
        return;
    }
    NodeConnectorId nodeConnectorId = new NodeConnectorId(ofportIds.get(0));
    BigInteger dpnId = BigInteger.valueOf(MDSALUtil.getDpnIdFromPortName(nodeConnectorId));
    DhcpInterfaceRemoveJob job = new DhcpInterfaceRemoveJob(dhcpManager, dhcpExternalTunnelManager,
            dataBroker, del, dpnId, interfaceManager, elanService);
    jobCoordinator.enqueueJob(DhcpServiceUtils.getJobKey(interfaceName), job, DhcpMConstants.RETRY_COUNT);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:21,代码来源:DhcpInterfaceEventListener.java


示例3: installNeutronPortEntries

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; //导入依赖的package包/类
private void installNeutronPortEntries(List<Uuid> portList) {
    LOG.trace("DhcpSubnetListener installNeutronPortEntries : portList: {}", portList);
    for (Uuid portIntf : portList) {
        NodeConnectorId nodeConnectorId = getNodeConnectorIdForPortIntf(portIntf);
        BigInteger dpId = BigInteger.valueOf(MDSALUtil.getDpnIdFromPortName(nodeConnectorId));
        String interfaceName = portIntf.getValue();
        Port port = dhcpManager.getNeutronPort(interfaceName);
        String vmMacAddress = port.getMacAddress().getValue();
        //check whether any changes have happened
        LOG.trace("DhcpSubnetListener installNeutronPortEntries dpId: {} vmMacAddress : {}", dpId, vmMacAddress);
        //Bind the dhcp service when enabled
        WriteTransaction bindTx = dataBroker.newWriteOnlyTransaction();
        DhcpServiceUtils.bindDhcpService(interfaceName, NwConstants.DHCP_TABLE, bindTx);
        DhcpServiceUtils.submitTransaction(bindTx);
        //install the entries
        WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
        dhcpManager.installDhcpEntries(dpId, vmMacAddress, tx);
        DhcpServiceUtils.submitTransaction(tx);
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:21,代码来源:DhcpSubnetListener.java


示例4: uninstallNeutronPortEntries

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; //导入依赖的package包/类
private void uninstallNeutronPortEntries(List<Uuid> portList) {
    LOG.trace("DhcpSubnetListener uninstallNeutronPortEntries : portList: {}", portList);
    for (Uuid portIntf : portList) {
        NodeConnectorId nodeConnectorId = getNodeConnectorIdForPortIntf(portIntf);
        BigInteger dpId = BigInteger.valueOf(MDSALUtil.getDpnIdFromPortName(nodeConnectorId));
        String interfaceName = portIntf.getValue();
        Port port = dhcpManager.getNeutronPort(interfaceName);
        String vmMacAddress = port.getMacAddress().getValue();
        //check whether any changes have happened
        LOG.trace("DhcpSubnetListener uninstallNeutronPortEntries dpId: {} vmMacAddress : {}",
                dpId, vmMacAddress);
        //Unbind the dhcp service when disabled
        WriteTransaction unbindTx = dataBroker.newWriteOnlyTransaction();
        DhcpServiceUtils.unbindDhcpService(interfaceName, unbindTx);
        DhcpServiceUtils.submitTransaction(unbindTx);
        //uninstall the entries
        WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
        dhcpManager.unInstallDhcpEntries(dpId, vmMacAddress, tx);
        DhcpServiceUtils.submitTransaction(tx);
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:22,代码来源:DhcpSubnetListener.java


示例5: updateInterfaceDpidOfPortInfo

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; //导入依赖的package包/类
public void updateInterfaceDpidOfPortInfo(Uuid portId) {
    LOG.debug("In updateInterfaceDpidOfPortInfo portId {}", portId);
    Interface interfaceState = ipv6ServiceUtils.getInterfaceStateFromOperDS(portId.getValue());
    if (interfaceState == null) {
        LOG.warn("In updateInterfaceDpidOfPortInfo, port info not found in Operational Store {}.", portId);
        return;
    }

    List<String> ofportIds = interfaceState.getLowerLayerIf();
    NodeConnectorId nodeConnectorId = new NodeConnectorId(ofportIds.get(0));
    BigInteger dpId = BigInteger.valueOf(MDSALUtil.getDpnIdFromPortName(nodeConnectorId));
    if (!dpId.equals(Ipv6Constants.INVALID_DPID)) {
        Long ofPort = MDSALUtil.getOfPortNumberFromPortName(nodeConnectorId);
        updateDpnInfo(portId, dpId, ofPort);
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:17,代码来源:IfMgr.java


示例6: getNodeConnectorCountersDirect

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


示例7: getNodeConnectorResult

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


示例8: setupHostService

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; //导入依赖的package包/类
/**
 * Sets up the host service with details of some hosts.
 */
private void setupHostService() {
	IpAddress host1Address = new IpAddress(Ipv4Address.getDefaultInstance("192.168.10.1"));
	long now = new Date().getTime();
	ConnectorAddress ipv4Address = new ConnectorAddressBuilder().setLastSeen(now).setFirstSeen(now)
			.setMac(new MacAddress("aa:bb:cc:dd:ee:ff")).setIp(host1Address).build();
	NodeConnector nc1 = new NodeConnectorBuilder().setKey(new NodeConnectorKey(new NodeConnectorId("1"))).build();
	Host host1 = new Host(ipv4Address, nc1);
	when(hostService.getHost(new HostId("192.168.10.1"))).thenReturn(host1);

	IpAddress host2Address = new IpAddress(Ipv6Address.getDefaultInstance("2000::1"));
	long time = new Date().getTime();
	ConnectorAddress ipv6Address = new ConnectorAddressBuilder().setLastSeen(time).setFirstSeen(time)
			.setMac(new MacAddress("aa:bb:cc:dd:ee:00")).setIp(host2Address).build();
	NodeConnector nc2 = new NodeConnectorBuilder().setKey(new NodeConnectorKey(new NodeConnectorId("2"))).build();
	Host host2 = new Host(ipv6Address, nc2);
	when(hostService.getHost(new HostId("2000::1"))).thenReturn(host2);
}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:21,代码来源:RibManagerTest.java


示例9: getNodeConnRef

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


示例10: testSendArpResponse

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


示例11: createEpAttachmentInput

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; //导入依赖的package包/类
public static EndpointAttachInfo createEpAttachmentInput(EndpointLocation epLocation, Subnet subnet, Port epPort) {
    EndpointAttachInfo info;

    Uuid epFaasUuid = epLocation.getUuid();

    org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId = epLocation.getNodeId();
    NodeConnectorId nodeConnectorId = epLocation.getNodeConnectorId();

    IpAddress gatewayIpAddr = subnet.getVirtualRouterIp();
    MacAddress macAddress = epPort.getMacAddress();
    IpAddress ipAddress = epPort.getPrivateIps().get(0).getIpAddress();

    info = new EndpointAttachInfo();
    info.setEpYangUuid(UlnUtil.convertToYangUuid(epFaasUuid));
    info.setMacAddress(convertToYang130715MacAddress(macAddress));
    info.setIpAddress(ipAddress);
    info.setGatewayIpAddr(gatewayIpAddr);
    info.setInventoryNodeIdStr(nodeId.getValue());
    info.setInventoryNodeConnectorIdStr(nodeConnectorId.getValue());

    return info;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:23,代码来源:UlnUtil.java


示例12: createSendToControllerInstructions

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; //导入依赖的package包/类
/**
 * Create Send to Controller Reserved Port Instruction (packet_in)
 *
 * @param nodeName Uri Prefix, containing nodeConnectorType and dpId (aka NodeId)
 * @param ib Map InstructionBuilder without any instructions
 * @return ib Map InstructionBuilder with instructions
 */
public static InstructionBuilder createSendToControllerInstructions(String nodeName, InstructionBuilder ib) {

    List<Action> actionList = new ArrayList<>();
    ActionBuilder ab = new ActionBuilder();

    OutputActionBuilder output = new OutputActionBuilder();
    output.setMaxLength(MAX_LENGTH);
    NodeId nodeId = new NodeId(nodeName);
    output.setOutputNodeConnector(new NodeConnectorId(nodeId.getValue() + ":"
            + OutputPortValues.CONTROLLER.toString()));
    ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
    ab.setOrder(0);
    ab.setKey(new ActionKey(0));
    actionList.add(ab.build());

    // Create an Apply Action
    ApplyActionsBuilder aab = new ApplyActionsBuilder();
    aab.setAction(actionList);

    // Wrap our Apply Action in an Instruction
    ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());

    return ib;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:32,代码来源:OfInstructionUtils.java


示例13: createNormalInstructions

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; //导入依赖的package包/类
/**
 * Create NORMAL Reserved Port Instruction (packet_in)
 *
 * @param nodeName Uri Prefix, containing nodeConnectorType and dpId (aka NodeId)
 * @param ib Map InstructionBuilder without any instructions
 * @return ib Map InstructionBuilder with instructions
 */

public static InstructionBuilder createNormalInstructions(String nodeName, InstructionBuilder ib) {

    List<Action> actionList = new ArrayList<>();
    ActionBuilder ab = new ActionBuilder();

    OutputActionBuilder output = new OutputActionBuilder();
    NodeId nodeId = new NodeId(nodeName);
    output.setOutputNodeConnector(new NodeConnectorId(nodeId.getValue() + ":"
            + OutputPortValues.NORMAL.toString()));
    ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
    ab.setOrder(0);
    ab.setKey(new ActionKey(0));
    actionList.add(ab.build());

    // Create an Apply Action
    ApplyActionsBuilder aab = new ApplyActionsBuilder();
    aab.setAction(actionList);

    // Wrap our Apply Action in an Instruction
    ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());

    return ib;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:32,代码来源:OfInstructionUtils.java


示例14: createLocalInstructions

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; //导入依赖的package包/类
/**
 * Create LOCAL Reserved Port Instruction
 *
 * @param ib Map InstructionBuilder without any instructions
 * @param dpidLong Long the datapath ID of a switch/node
 * @return ib Map InstructionBuilder with instructions
 */
public static InstructionBuilder createLocalInstructions(InstructionBuilder ib, long dpidLong) {
    List<Action> actionList = new ArrayList<>();
    ActionBuilder ab = new ActionBuilder();

    OutputActionBuilder output = new OutputActionBuilder();
    output.setOutputNodeConnector(new NodeConnectorId("openflow:" + dpidLong + ":"
            + OutputPortValues.LOCAL.toString()));
    ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
    ab.setOrder(0);
    ab.setKey(new ActionKey(0));
    actionList.add(ab.build());

    // Create an Apply Action
    ApplyActionsBuilder aab = new ApplyActionsBuilder();
    aab.setAction(actionList);

    // Wrap our Apply Action in an Instruction
    ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());

    return ib;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:29,代码来源:OfInstructionUtils.java


示例15: createOutputPortInstructions

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; //导入依赖的package包/类
/**
 * Create Output Port Instruction
 *
 * @param ib       Map InstructionBuilder without any instructions
 * @param dpidLong Long the datapath ID of a switch/node
 * @param port     Long representing a port on a switch/node
 * @return ib InstructionBuilder Map with instructions
 */
public static InstructionBuilder createOutputPortInstructions(InstructionBuilder ib, Long dpidLong, Long port) {

    NodeConnectorId ncid = new NodeConnectorId("openflow:" + dpidLong + ":" + port);
    LOG.debug("createOutputPortInstructions() Node Connector ID is - Type=openflow: DPID={} inPort={} ",
            dpidLong, port);

    List<Action> actionList = new ArrayList<>();
    ActionBuilder ab = new ActionBuilder();
    OutputActionBuilder oab = new OutputActionBuilder();
    oab.setOutputNodeConnector(ncid);

    ab.setAction(new OutputActionCaseBuilder().setOutputAction(oab.build()).build());
    ab.setOrder(0);
    ab.setKey(new ActionKey(0));
    actionList.add(ab.build());

    // Create an Apply Action
    ApplyActionsBuilder aab = new ApplyActionsBuilder();
    aab.setAction(actionList);
    ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());

    return ib;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:32,代码来源:OfInstructionUtils.java


示例16: onPacketReceived

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; //导入依赖的package包/类
@Override
public void onPacketReceived(PacketReceived notification) {
    NodeConnectorRef ingressNodeConnectorRef = notification.getIngress();
    NodeRef ingressNodeRef = InventoryUtils.getNodeRef(ingressNodeConnectorRef);
    // NodeConnectorId ingressNodeConnectorId = InventoryUtils.getNodeConnectorId(ingressNodeConnectorRef);
    NodeId ingressNodeId = InventoryUtils.getNodeId(ingressNodeConnectorRef);

    // Useful to create it beforehand
    NodeConnectorId floodNodeConnectorId = InventoryUtils.getNodeConnectorId(ingressNodeId, FLOOD_PORT_NUMBER);
    NodeConnectorRef floodNodeConnectorRef = InventoryUtils.getNodeConnectorRef(floodNodeConnectorId);

    //Ignore LLDP packets, or you will be in big trouble
    byte[] etherTypeRaw = PacketParsingUtils.extractEtherType(notification.getPayload());
    int etherType = (0x0000ffff & ByteBuffer.wrap(etherTypeRaw).getShort());
    if (etherType == 0x88cc) {
        return;
    }

    // Flood packet
    packetOut(ingressNodeRef, floodNodeConnectorRef, notification.getPayload());
}
 
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:22,代码来源:TutorialACL.java


示例17: createOutputPortInstructions

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; //导入依赖的package包/类
/**
 * Create Output Port Instruction
 *
 * @param ib       Map InstructionBuilder without any instructions
 * @param dpidLong Long the datapath ID of a switch/node
 * @param port     Long representing a port on a switch/node
 * @return ib InstructionBuilder Map with instructions
 */
public static InstructionBuilder createOutputPortInstructions(InstructionBuilder ib, Long dpidLong, Long port) {

    NodeConnectorId ncid = new NodeConnectorId("openflow:" + dpidLong + ":" + port);
    logger.debug("createOutputPortInstructions() Node Connector ID is - Type=openflow: DPID={} inPort={} ",
            dpidLong, port);

    List<Action> actionList = Lists.newArrayList();
    ActionBuilder ab = new ActionBuilder();
    OutputActionBuilder oab = new OutputActionBuilder();
    oab.setOutputNodeConnector(ncid);

    ab.setAction(new OutputActionCaseBuilder().setOutputAction(oab.build()).build());
    ab.setOrder(0);
    ab.setKey(new ActionKey(0));
    actionList.add(ab.build());

    // Create an Apply Action
    ApplyActionsBuilder aab = new ApplyActionsBuilder();
    aab.setAction(actionList);
    ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());

    return ib;
}
 
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:32,代码来源:InstructionUtils.java


示例18: getDpIdFromIterfaceState

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; //导入依赖的package包/类
public static BigInteger getDpIdFromIterfaceState(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf
        .interfaces.rev140508.interfaces.state.Interface interfaceState) {
    BigInteger dpId = null;
    List<String> ofportIds = interfaceState.getLowerLayerIf();
    if (ofportIds != null && !ofportIds.isEmpty()) {
        NodeConnectorId nodeConnectorId = new NodeConnectorId(ofportIds.get(0));
        dpId = BigInteger.valueOf(MDSALUtil.getDpnIdFromPortName(nodeConnectorId));
    }
    return dpId;
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:11,代码来源:AclServiceUtils.java


示例19: remove

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; //导入依赖的package包/类
@Override
protected void remove(InstanceIdentifier<Interface> identifier, Interface intrf) {
    if (L2vlan.class.equals(intrf.getType())) {
        final String interfaceName = intrf.getName();
        // Guava Optional asSet().forEach() emulates Java 8 Optional ifPresent()
        getNeutronPortForRemove(intrf).asSet().forEach(port -> {
            LOG.trace("Qos Service : Received interface {} PORT DOWN event ", interfaceName);

            String lowerLayerIf = intrf.getLowerLayerIf().get(0);
            LOG.trace("lowerLayerIf {}", lowerLayerIf);
            qosAlertManager.removeFromQosAlertCache(new NodeConnectorId(lowerLayerIf));
            QosPortExtension removeQos = port.getAugmentation(QosPortExtension.class);
            if (removeQos != null) {
                qosNeutronUtils.handleNeutronPortRemove(port, removeQos.getQosPolicyId(), intrf);
                qosNeutronUtils.removeFromQosPortsCache(removeQos.getQosPolicyId(), port);
            } else {
                Network network = neutronVpnManager.getNeutronNetwork(port.getNetworkId());
                if (network != null && network.getAugmentation(QosNetworkExtension.class) != null) {
                    Uuid networkQosUuid = network.getAugmentation(QosNetworkExtension.class).getQosPolicyId();
                    if (networkQosUuid != null) {
                        qosNeutronUtils.handleNeutronPortRemove(port, networkQosUuid, intrf);
                    }
                }
            }
        });
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:28,代码来源:QosInterfaceStateChangeListener.java


示例20: getDpnFromNodeConnectorId

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; //导入依赖的package包/类
public static String getDpnFromNodeConnectorId(NodeConnectorId portId) {
    /*
     * NodeConnectorId is of form 'openflow:dpnid:portnum'
     */
    String[] split = portId.getValue().split(OF_URI_SEPARATOR);
    if (split.length != 3) {
        LOG.error("getDpnFromNodeConnectorId : invalid portid : {}", portId.getValue());
        return null;
    }
    return split[1];
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:12,代码来源:NatUtil.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java DocumentSection类代码示例发布时间:2022-05-23
下一篇:
Java StringUtil类代码示例发布时间: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