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


Java OvsdbTerminationPointAugmentation类代码示例

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


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

示例1: copyBridgeToConfig

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入依赖的package包/类
private void copyBridgeToConfig(Node brIntNode) {
    NodeBuilder bridgeNodeBuilder = new NodeBuilder(brIntNode);

    //termination points need to be masssaged to remove the ifindex field
    //which are not allowed in the config data store
    List<TerminationPoint> terminationPoints = brIntNode.getTerminationPoint();
    if (terminationPoints != null) {
        List<TerminationPoint> newTerminationPoints = new ArrayList<>();
        for (TerminationPoint tp : terminationPoints) {
            OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
                                                    tp.getAugmentation(OvsdbTerminationPointAugmentation.class);
            TerminationPointBuilder tpBuilder = new TerminationPointBuilder(tp);
            if (ovsdbTerminationPointAugmentation != null) {
                OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder =
                            new OvsdbTerminationPointAugmentationBuilder(ovsdbTerminationPointAugmentation);
                tpAugmentationBuilder.setIfindex(null);
                tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
            }
            newTerminationPoints.add(tpBuilder.build());
        }
        bridgeNodeBuilder.setTerminationPoint(newTerminationPoints);
    }

    InstanceIdentifier<Node> brNodeIid = SouthboundUtils.createInstanceIdentifier(brIntNode.getNodeId());
    this.mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, brNodeIid, bridgeNodeBuilder.build());
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:27,代码来源:ElanBridgeManager.java

示例2: addTerminationPoint

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入依赖的package包/类
private static Boolean addTerminationPoint(Node bridgeNode, String bridgeName, String portName, String type,
        Map<String, String> options, DataBroker databroker) {
    InstanceIdentifier<TerminationPoint> tpIid = MdsalUtils.createTerminationPointInstanceIdentifier(bridgeNode,
            portName);
    OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder = new OvsdbTerminationPointAugmentationBuilder();

    tpAugmentationBuilder.setName(portName);
    if (type != null) {
        tpAugmentationBuilder.setInterfaceType(MdsalUtils.OVSDB_INTERFACE_TYPE_MAP.get(type));
    }

    List<Options> optionsList = new ArrayList<>();
    for (Map.Entry<String, String> entry : options.entrySet()) {
        OptionsBuilder optionsBuilder = new OptionsBuilder();
        optionsBuilder.setKey(new OptionsKey(entry.getKey()));
        optionsBuilder.setOption(entry.getKey());
        optionsBuilder.setValue(entry.getValue());
        optionsList.add(optionsBuilder.build());
    }
    tpAugmentationBuilder.setOptions(optionsList);

    TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
    tpBuilder.setKey(InstanceIdentifier.keyOf(tpIid));
    tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
    return MdsalUtils.put(LogicalDatastoreType.CONFIGURATION, tpIid, tpBuilder.build(), databroker);
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:27,代码来源:OvsSouthboundUtils.java

示例3: extractTerminationPointAugmentations

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入依赖的package包/类
public List<OvsdbTerminationPointAugmentation> extractTerminationPointAugmentations( Node node ) {
    List<OvsdbTerminationPointAugmentation> tpAugmentations = new ArrayList<>();
    if (node == null) {
        LOG.error("extractTerminationPointAugmentations: Node value is null");
        return Collections.emptyList();
    }
    List<TerminationPoint> terminationPoints = node.getTerminationPoint();
    if(terminationPoints != null && !terminationPoints.isEmpty()){
        for(TerminationPoint tp : terminationPoints){
            OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
                    tp.getAugmentation(OvsdbTerminationPointAugmentation.class);
            if (ovsdbTerminationPointAugmentation != null) {
                tpAugmentations.add(ovsdbTerminationPointAugmentation);
            }
        }
    }
    return tpAugmentations;
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:19,代码来源:SouthboundUtils.java

示例4: extractTerminationPointConfigurationChanges

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入依赖的package包/类
public static Map<InstanceIdentifier<?>, DataObject> extractTerminationPointConfigurationChanges(
        final Node bridgeNode) {
    Map<InstanceIdentifier<?>, DataObject> changes = new HashMap<>();
    final InstanceIdentifier<Node> bridgeNodeIid =
            SouthboundMapper.createInstanceIdentifier(bridgeNode.getNodeId());
    changes.put(bridgeNodeIid, bridgeNode);

    List<TerminationPoint> terminationPoints = bridgeNode.getTerminationPoint();
    if (terminationPoints != null && !terminationPoints.isEmpty()) {
        for (TerminationPoint tp : terminationPoints) {
            OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
                    tp.getAugmentation(OvsdbTerminationPointAugmentation.class);
            if (ovsdbTerminationPointAugmentation != null) {
                final InstanceIdentifier<OvsdbTerminationPointAugmentation> tpIid =
                        bridgeNodeIid
                                .child(TerminationPoint.class, new TerminationPointKey(tp.getTpId()))
                                .builder()
                                .augmentation(OvsdbTerminationPointAugmentation.class)
                                .build();
                changes.put(tpIid, ovsdbTerminationPointAugmentation);
            }
        }
    }
    return changes;
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:26,代码来源:SouthboundMapper.java

示例5: createInterfaceOtherConfig

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

    List<InterfaceOtherConfigs> interfaceOtherConfigs =
            terminationPoint.getInterfaceOtherConfigs();
    if (interfaceOtherConfigs != null && !interfaceOtherConfigs.isEmpty()) {
        Map<String, String> otherConfigsMap = new HashMap<>();
        for (InterfaceOtherConfigs interfaceOtherConfig : interfaceOtherConfigs) {
            otherConfigsMap.put(interfaceOtherConfig.getOtherConfigKey(),
                    interfaceOtherConfig.getOtherConfigValue());
        }
        try {
            ovsInterface.setOtherConfig(otherConfigsMap);
        } catch (NullPointerException e) {
            LOG.warn("Incomplete OVSDB interface other_config", e);
        }
    }
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:20,代码来源:TerminationPointCreateCommand.java

示例6: updateInterfaceOtherConfig

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

    List<InterfaceOtherConfigs> interfaceOtherConfigs =
            terminationPoint.getInterfaceOtherConfigs();
    if (interfaceOtherConfigs != null && !interfaceOtherConfigs.isEmpty()) {
        Map<String, String> otherConfigsMap = new HashMap<>();
        for (InterfaceOtherConfigs interfaceOtherConfig : interfaceOtherConfigs) {
            otherConfigsMap.put(interfaceOtherConfig.getOtherConfigKey(),
                    interfaceOtherConfig.getOtherConfigValue());
        }
        try {
            ovsInterface.setOtherConfig(otherConfigsMap);
        } catch (NullPointerException e) {
            LOG.warn("Incomplete OVSDB interface other_config", e);
        }
    }
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:20,代码来源:TerminationPointUpdateCommand.java

示例7: filter

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入依赖的package包/类
private Map<InstanceIdentifier<?>, DataObject> filter(Map<InstanceIdentifier<?>,
        DataObject> data) {
    Map<InstanceIdentifier<?>, DataObject> result
        = new HashMap<>();
    for (Entry<InstanceIdentifier<?>, DataObject> entry: data.entrySet()) {
        if (isManagedBy(entry.getKey())) {
            result.put(entry.getKey(),entry.getValue());
        } else {
            Class<?> type = entry.getKey().getTargetType();
            if (type.equals(OvsdbNodeAugmentation.class)
                    || type.equals(OvsdbTerminationPointAugmentation.class)
                    || type.equals(Node.class)) {
                result.put(entry.getKey(), entry.getValue());
            }
        }
    }
    return result;
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:19,代码来源:DataChangesManagedByOvsdbNodeEvent.java

示例8: testGetOvsdbTerminationPointAugmentation

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入依赖的package包/类
@Test
public void testGetOvsdbTerminationPointAugmentation() {
    Optional<OvsdbTerminationPointAugmentation> optOvsdbTermPoint = briOperationState
            .getOvsdbTerminationPointAugmentation(iid);
    assertNotNull(optOvsdbTermPoint);
    verify(briOperationState, times(1)).getBridgeTerminationPoint(any(InstanceIdentifier.class));
    verify(briOperationState, times(1)).getBridgeNode(any(InstanceIdentifier.class));
    assertTrue(optOvsdbTermPoint.equals(Optional.absent()));

    PowerMockito.suppress(MemberMatcher.method(BridgeOperationalState.class, "getBridgeTerminationPoint",
            InstanceIdentifier.class));
    TerminationPoint termPoint = mock(TerminationPoint.class);
    Optional<TerminationPoint> termPntOptional = Optional.of(termPoint);
    when(briOperationState.getBridgeTerminationPoint(any(InstanceIdentifier.class))).thenReturn(termPntOptional);
    OvsdbTerminationPointAugmentation ovsdbTermPntAug = mock(OvsdbTerminationPointAugmentation.class);
    when(termPoint.getAugmentation(OvsdbTerminationPointAugmentation.class)).thenReturn(ovsdbTermPntAug);
    Optional<OvsdbTerminationPointAugmentation> ovsdbTermPointOpt = briOperationState
            .getOvsdbTerminationPointAugmentation(iid);
    assertNotNull(ovsdbTermPointOpt);
    assertTrue(ovsdbTermPointOpt.get() instanceof OvsdbTerminationPointAugmentation);
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:22,代码来源:BridgeOperationalStateTest.java

示例9: addTerminationPoint

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入依赖的package包/类
private boolean addTerminationPoint(final NodeId bridgeNodeId, final String portName,
                                    final OvsdbTerminationPointAugmentationBuilder
                                            ovsdbTerminationPointAugmentationBuilder)
        throws InterruptedException {

    InstanceIdentifier<Node> portIid = SouthboundMapper.createInstanceIdentifier(bridgeNodeId);
    NodeBuilder portNodeBuilder = new NodeBuilder();
    NodeId portNodeId = SouthboundMapper.createManagedNodeId(portIid);
    portNodeBuilder.setNodeId(portNodeId);
    TerminationPointBuilder entry = new TerminationPointBuilder();
    entry.setKey(new TerminationPointKey(new TpId(portName)));
    entry.addAugmentation(
            OvsdbTerminationPointAugmentation.class,
            ovsdbTerminationPointAugmentationBuilder.build());
    portNodeBuilder.setTerminationPoint(Collections.singletonList(entry.build()));
    boolean result = mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION,
            portIid, portNodeBuilder.build());
    Thread.sleep(OVSDB_UPDATE_TIMEOUT);
    return result;
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:21,代码来源:SouthboundIT.java

示例10: getEgressVxlanPortForNode

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入依赖的package包/类
public Optional<Long> getEgressVxlanPortForNode(BigInteger dpnId) {
    List<OvsdbTerminationPointAugmentation> tpList = interfaceMgr.getTunnelPortsOnBridge(dpnId);
    if (tpList == null) {
        // Most likely the bridge doesnt exist for this dpnId
        LOG.warn("getEgressVxlanPortForNode Tunnel Port TerminationPoint list not available for dpnId [{}]",
                dpnId);
        return Optional.empty();
    }

    for (OvsdbTerminationPointAugmentation tp : tpList) {
        if (tp == null) {
            // Technically we should never have a list with NULL entries, but
            // in a preliminary version of interfaceMgr.getTunnelPortsOnBridge()
            // we were getting a list where all termination point entries were
            // null. Leaving this check for now for protection.
            LOG.error("getEgressVxlanPortForNode received a NULL termination point from tpList on dpnId [{}]",
                    dpnId);
            continue;
        }

        Class<? extends InterfaceTypeBase> ifType = tp.getInterfaceType();
        if (ifType.equals(InterfaceTypeVxlan.class)) {
            List<Options> tpOptions = tp.getOptions();
            for (Options tpOption : tpOptions) {
                // From the VXLAN Tunnels, we want the one with the GPE option set
                if (tpOption.getKey().getOption().equals(OPTION_KEY_EXTS)) {
                    if (tpOption.getValue().equals(OPTION_VALUE_EXTS_GPE)) {
                        return Optional.ofNullable(tp.getOfport());
                    }
                }
            }
        }
    }

    LOG.warn("getEgressVxlanPortForNode no Vxgpe tunnel ports available for dpnId [{}]", dpnId);

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

示例11: getTunnelPortsOnBridge

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入依赖的package包/类
@Override
public List<OvsdbTerminationPointAugmentation> getTunnelPortsOnBridge(BigInteger dpnId) {
    if (dpnId == GeniusProviderTestParams.DPN_ID_NO_EXIST) {
        // Unfortunately, the getTunnelPortsOnBridge() method may return null
        return null;
    }

    if (dpnId == GeniusProviderTestParams.DPN_ID_NO_PORTS) {
        return Collections.emptyList();
    }

    OvsdbTerminationPointAugmentationBuilder tpAug = new OvsdbTerminationPointAugmentationBuilder();
    tpAug.setOfport(GeniusProviderTestParams.OF_PORT);

    if (dpnId == GeniusProviderTestParams.DPN_ID_NO_VXGPE_PORTS) {
        // Tunnel Termination Point that is NOT of type VXGPE
        tpAug.setInterfaceType(InterfaceTypeGre.class);
    } else {
        // Tunnel Termination Point that IS of type VXGPE
        tpAug.setInterfaceType(InterfaceTypeVxlan.class);
    }

    List<Options> opsList = new ArrayList<>();
    if (dpnId != GeniusProviderTestParams.DPN_ID_NO_OPTIONS) {
        OptionsBuilder opsBuilder = new OptionsBuilder();
        opsBuilder.setKey(new OptionsKey(GeniusProvider.OPTION_KEY_EXTS));
        opsBuilder.setValue(GeniusProvider.OPTION_VALUE_EXTS_GPE);
        opsList.add(opsBuilder.build());
    }
    tpAug.setOptions(opsList);

    List<OvsdbTerminationPointAugmentation> tpAugList = new ArrayList<>();
    tpAugList.add(tpAug.build());

    return tpAugList;
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:37,代码来源:TestInterfaceManager.java

示例12: extractTerminationPointAugmentations

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入依赖的package包/类
private static List<OvsdbTerminationPointAugmentation> extractTerminationPointAugmentations(Node node) {
    List<OvsdbTerminationPointAugmentation> tpAugmentations = new ArrayList<>();
    List<TerminationPoint> terminationPoints = node.getTerminationPoint();
    if (terminationPoints != null && !terminationPoints.isEmpty()) {
        for (TerminationPoint tp : terminationPoints) {
            OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation = tp
                    .getAugmentation(OvsdbTerminationPointAugmentation.class);
            if (ovsdbTerminationPointAugmentation != null) {
                tpAugmentations.add(ovsdbTerminationPointAugmentation);
            }
        }
    }
    return tpAugmentations;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:15,代码来源:OvsSouthboundUtils.java

示例13: extractTerminationPointAugmentation

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入依赖的package包/类
private static OvsdbTerminationPointAugmentation extractTerminationPointAugmentation(Node bridgeNode,
        String portName) {
    if (bridgeNode.getAugmentation(OvsdbBridgeAugmentation.class) != null) {
        List<OvsdbTerminationPointAugmentation> tpAugmentations = extractTerminationPointAugmentations(bridgeNode);
        for (OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation : tpAugmentations) {
            if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
                return ovsdbTerminationPointAugmentation;
            }
        }
    }
    return null;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:13,代码来源:OvsSouthboundUtils.java

示例14: getOfPort

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; //导入依赖的package包/类
public static Long getOfPort(Node node, TpId tpid) {
    List<TerminationPoint> terminationPoints = extractTerminationPoints(node);
    Long ofPort = null;

    for (TerminationPoint terminationPoint : terminationPoints) {
        if (terminationPoint.getTpId() == tpid) {
            ofPort = terminationPoint.getAugmentation(OvsdbTerminationPointAugmentation.class).getOfport();
            return ofPort;
        }
    }

    return ofPort;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:14,代码来源:OvsSouthboundUtils.java

示例15: 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


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