本文整理匯總了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeVxlan類的典型用法代碼示例。如果您正苦於以下問題:Java InterfaceTypeVxlan類的具體用法?Java InterfaceTypeVxlan怎麽用?Java InterfaceTypeVxlan使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
InterfaceTypeVxlan類屬於org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105包,在下文中一共展示了InterfaceTypeVxlan類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getEgressVxlanPortForNode
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeVxlan; //導入依賴的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();
}
示例2: getTunnelPortsOnBridge
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeVxlan; //導入依賴的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;
}
示例3: testCreateInterfaceType
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeVxlan; //導入依賴的package包/類
@Test
public void testCreateInterfaceType() {
assertEquals(InterfaceTypeInternal.class, SouthboundMapper.createInterfaceType("internal"));
assertEquals(InterfaceTypeVxlan.class, SouthboundMapper.createInterfaceType("vxlan"));
}
示例4: testCreateOvsdbInterfaceType
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeVxlan; //導入依賴的package包/類
@Test
public void testCreateOvsdbInterfaceType() {
assertEquals("internal", SouthboundMapper.createOvsdbInterfaceType(InterfaceTypeInternal.class));
assertEquals("vxlan", SouthboundMapper.createOvsdbInterfaceType(InterfaceTypeVxlan.class));
}