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


Java OvsdbTerminationPointAugmentation.getOfport方法代码示例

本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation.getOfport方法的典型用法代码示例。如果您正苦于以下问题:Java OvsdbTerminationPointAugmentation.getOfport方法的具体用法?Java OvsdbTerminationPointAugmentation.getOfport怎么用?Java OvsdbTerminationPointAugmentation.getOfport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation的用法示例。


在下文中一共展示了OvsdbTerminationPointAugmentation.getOfport方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOFPort

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入方法依赖的package包/类
public static Long getOFPort(OvsdbTerminationPointAugmentation port) {
    Long ofPort = null;
    if (port.getOfport() != null) {
        ofPort = port.getOfport();
    }
    return ofPort;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:8,代码来源:OvsSouthboundUtils.java

示例2: getOfPort

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入方法依赖的package包/类
public static Long getOfPort(InstanceIdentifier<Node> nodeIid, TpId tpid, DataBroker databroker) {
    Long ofPort = null;
    InstanceIdentifier<TerminationPoint> tpIid = nodeIid.child(TerminationPoint.class,
            new TerminationPointKey(tpid));
    TerminationPoint teminationPoint = MdsalUtils.read(LogicalDatastoreType.OPERATIONAL, tpIid, databroker);
    if (teminationPoint != null) {
        OvsdbTerminationPointAugmentation port = teminationPoint
                .getAugmentation(OvsdbTerminationPointAugmentation.class);

        if (port != null) {
            ofPort = port.getOfport();
        }
    }
    return ofPort;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:16,代码来源:OvsSouthboundUtils.java

示例3: createOfPort

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入方法依赖的package包/类
private void createOfPort(
        final OvsdbTerminationPointAugmentation terminationPoint,
        final Interface ovsInterface) {

    Long ofPort = terminationPoint.getOfport();
    if (ofPort != null) {
        ovsInterface.setOpenFlowPort(Collections.singleton(ofPort));
    }
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:10,代码来源:TerminationPointCreateCommand.java

示例4: updateOfPort

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入方法依赖的package包/类
private void updateOfPort(
        final OvsdbTerminationPointAugmentation terminationPoint,
        final Interface ovsInterface) {

    Long ofPort = terminationPoint.getOfport();
    if (ofPort != null) {
        ovsInterface.setOpenFlowPort(Collections.singleton(ofPort));
    }
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:10,代码来源:TerminationPointUpdateCommand.java

示例5: testCRDTerminationPointOfPort

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入方法依赖的package包/类
@Test
public void testCRDTerminationPointOfPort() throws InterruptedException {
    final Long OFPORT_EXPECTED = 45002L;

    ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portNumber);

    // CREATE
    try (TestBridge testBridge = new TestBridge(connectionInfo, SouthboundITConstants.BRIDGE_NAME)) {
        OvsdbBridgeAugmentation bridge = getBridge(connectionInfo);
        Assert.assertNotNull(bridge);
        LOG.info("bridge: {}", bridge);
        NodeId nodeId = SouthboundMapper.createManagedNodeId(SouthboundUtils.createInstanceIdentifier(
                connectionInfo, bridge.getBridgeName()));
        OvsdbTerminationPointAugmentationBuilder ovsdbTerminationBuilder =
                createGenericOvsdbTerminationPointAugmentationBuilder();
        String portName = "testOfPort";
        ovsdbTerminationBuilder.setName(portName);

        ovsdbTerminationBuilder.setOfport(OFPORT_EXPECTED);
        Assert.assertTrue(addTerminationPoint(nodeId, portName, ovsdbTerminationBuilder));
        InstanceIdentifier<Node> terminationPointIid = getTpIid(connectionInfo, bridge);
        Node terminationPointNode = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, terminationPointIid);
        Assert.assertNotNull(terminationPointNode);

        // READ
        List<TerminationPoint> terminationPoints = terminationPointNode.getTerminationPoint();
        for (TerminationPoint terminationPoint : terminationPoints) {
            OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
                    terminationPoint.getAugmentation(OvsdbTerminationPointAugmentation.class);
            if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
                Long ofPort = ovsdbTerminationPointAugmentation.getOfport();
                // if ephemeral port 45002 is in use, ofPort is set to 1
                Assert.assertTrue(ofPort.equals(OFPORT_EXPECTED) || ofPort.equals(1L));
                LOG.info("ofPort: {}", ofPort);
            }
        }

        // UPDATE- Not Applicable.  From the OpenVSwitch Documentation:
        //   "A client should ideally set this column’s value in the same database transaction that it uses to create
        //   the interface."

        // DELETE handled by TestBridge
    }
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:45,代码来源:SouthboundIT.java

示例6: testCRDTerminationPointOfPortRequest

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入方法依赖的package包/类
@Test
public void testCRDTerminationPointOfPortRequest() throws InterruptedException {
    final Long OFPORT_EXPECTED = 45008L;
    final Long OFPORT_INPUT = 45008L;

    ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portNumber);

    // CREATE
    try (TestBridge testBridge = new TestBridge(connectionInfo, SouthboundITConstants.BRIDGE_NAME)) {
        OvsdbBridgeAugmentation bridge = getBridge(connectionInfo);
        Assert.assertNotNull(bridge);
        NodeId nodeId = SouthboundUtils.createManagedNodeId(SouthboundUtils.createInstanceIdentifier(
                connectionInfo, bridge.getBridgeName()));
        OvsdbTerminationPointAugmentationBuilder ovsdbTerminationBuilder =
                createGenericOvsdbTerminationPointAugmentationBuilder();
        String portName = "testOfPortRequest";
        ovsdbTerminationBuilder.setName(portName);
        Integer ofPortRequestExpected = OFPORT_EXPECTED.intValue();
        ovsdbTerminationBuilder.setOfport(OFPORT_INPUT);
        ovsdbTerminationBuilder.setOfportRequest(ofPortRequestExpected);
        Assert.assertTrue(addTerminationPoint(nodeId, portName, ovsdbTerminationBuilder));
        InstanceIdentifier<Node> terminationPointIid = getTpIid(connectionInfo, bridge);
        Node terminationPointNode = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, terminationPointIid);
        Assert.assertNotNull(terminationPointNode);

        // READ
        List<TerminationPoint> terminationPoints = terminationPointNode.getTerminationPoint();
        for (TerminationPoint terminationPoint : terminationPoints) {
            OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
                    terminationPoint.getAugmentation(OvsdbTerminationPointAugmentation.class);
            if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
                Long ofPort = ovsdbTerminationPointAugmentation.getOfport();
                // if ephemeral port 45008 is in use, ofPort is set to 1
                Assert.assertTrue(ofPort.equals(OFPORT_EXPECTED) || ofPort.equals(1L));
                LOG.info("ofPort: {}", ofPort);

                Integer ofPortRequest = ovsdbTerminationPointAugmentation.getOfportRequest();
                Assert.assertTrue(ofPortRequest.equals(ofPortRequestExpected));
                LOG.info("ofPortRequest: {}", ofPortRequest);
            }
        }

        // UPDATE- Not Applicable.  From the OpenVSwitch documentation:
        //   "A client should ideally set this column’s value in the same database transaction that it uses to
        //   create the interface. "

        // DELETE handled by TestBridge
    }
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:50,代码来源:SouthboundIT.java


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