本文整理汇总了Java中org.onosproject.ovsdb.controller.OvsdbTableStore类的典型用法代码示例。如果您正苦于以下问题:Java OvsdbTableStore类的具体用法?Java OvsdbTableStore怎么用?Java OvsdbTableStore使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OvsdbTableStore类属于org.onosproject.ovsdb.controller包,在下文中一共展示了OvsdbTableStore类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBridges
import org.onosproject.ovsdb.controller.OvsdbTableStore; //导入依赖的package包/类
@Override
public Set<OvsdbBridge> getBridges() {
Set<OvsdbBridge> ovsdbBridges = new HashSet<OvsdbBridge>();
OvsdbTableStore tableStore = getTableStore(OvsdbConstant.DATABASENAME);
if (tableStore == null) {
return null;
}
OvsdbRowStore rowStore = tableStore.getRows(OvsdbConstant.BRIDGE);
if (rowStore == null) {
return null;
}
ConcurrentMap<String, Row> rows = rowStore.getRowStore();
for (String uuid : rows.keySet()) {
Row row = getRow(OvsdbConstant.DATABASENAME, OvsdbConstant.BRIDGE,
uuid);
OvsdbBridge ovsdbBridge = getOvsdbBridge(row);
if (ovsdbBridge != null) {
ovsdbBridges.add(ovsdbBridge);
}
}
return ovsdbBridges;
}
示例2: getPorts
import org.onosproject.ovsdb.controller.OvsdbTableStore; //导入依赖的package包/类
@Override
public Set<OvsdbPort> getPorts() {
Set<OvsdbPort> ovsdbPorts = new HashSet<OvsdbPort>();
OvsdbTableStore tableStore = getTableStore(OvsdbConstant.DATABASENAME);
if (tableStore == null) {
return null;
}
OvsdbRowStore rowStore = tableStore.getRows(OvsdbConstant.INTERFACE);
if (rowStore == null) {
return null;
}
ConcurrentMap<String, Row> rows = rowStore.getRowStore();
for (String uuid : rows.keySet()) {
Row row = getRow(OvsdbConstant.DATABASENAME,
OvsdbConstant.INTERFACE, uuid);
OvsdbPort ovsdbPort = getOvsdbPort(row);
if (ovsdbPort != null) {
ovsdbPorts.add(ovsdbPort);
}
}
return ovsdbPorts;
}
示例3: getBridges
import org.onosproject.ovsdb.controller.OvsdbTableStore; //导入依赖的package包/类
@Override
public Set<OvsdbBridge> getBridges() {
Set<OvsdbBridge> ovsdbBridges = new HashSet<>();
OvsdbTableStore tableStore = getTableStore(DATABASENAME);
if (tableStore == null) {
return ovsdbBridges;
}
OvsdbRowStore rowStore = tableStore.getRows(BRIDGE);
if (rowStore == null) {
return ovsdbBridges;
}
ConcurrentMap<String, Row> rows = rowStore.getRowStore();
for (String uuid : rows.keySet()) {
Row bridgeRow = getRow(DATABASENAME, BRIDGE, uuid);
OvsdbBridge ovsdbBridge = getOvsdbBridge(bridgeRow, Uuid.uuid(uuid));
if (ovsdbBridge != null) {
ovsdbBridges.add(ovsdbBridge);
}
}
return ovsdbBridges;
}
示例4: getPorts
import org.onosproject.ovsdb.controller.OvsdbTableStore; //导入依赖的package包/类
@Override
public Set<OvsdbPort> getPorts() {
Set<OvsdbPort> ovsdbPorts = new HashSet<>();
OvsdbTableStore tableStore = getTableStore(DATABASENAME);
if (tableStore == null) {
return null;
}
OvsdbRowStore rowStore = tableStore.getRows(INTERFACE);
if (rowStore == null) {
return null;
}
ConcurrentMap<String, Row> rows = rowStore.getRowStore();
for (String uuid : rows.keySet()) {
Row row = getRow(DATABASENAME, INTERFACE, uuid);
OvsdbPort ovsdbPort = getOvsdbPort(row);
if (ovsdbPort != null) {
ovsdbPorts.add(ovsdbPort);
}
}
return ovsdbPorts;
}
示例5: getTableStore
import org.onosproject.ovsdb.controller.OvsdbTableStore; //导入依赖的package包/类
/**
* Gets the ovsdb table store.
*
* @param dbName the ovsdb database name
* @return ovsTableStore, empty if table store is find
*/
private OvsdbTableStore getTableStore(String dbName) {
if (ovsdbStore == null) {
return null;
}
return ovsdbStore.getOvsdbTableStore(dbName);
}
示例6: getRow
import org.onosproject.ovsdb.controller.OvsdbTableStore; //导入依赖的package包/类
/**
* Gets the ovsdb row.
*
* @param dbName the ovsdb database name
* @param tableName the ovsdb table name
* @param uuid the key of the row
* @return row, empty if row is find
*/
@Override
public Row getRow(String dbName, String tableName, String uuid) {
OvsdbTableStore tableStore = getTableStore(dbName);
if (tableStore == null) {
return null;
}
OvsdbRowStore rowStore = tableStore.getRows(tableName);
if (rowStore == null) {
return null;
}
return rowStore.getRow(uuid);
}
示例7: removeRow
import org.onosproject.ovsdb.controller.OvsdbTableStore; //导入依赖的package包/类
@Override
public void removeRow(String dbName, String tableName, String uuid) {
OvsdbTableStore tableStore = getTableStore(dbName);
if (tableStore == null) {
return;
}
OvsdbRowStore rowStore = tableStore.getRows(tableName);
if (rowStore == null) {
return;
}
rowStore.deleteRow(uuid);
}
示例8: getLocalPorts
import org.onosproject.ovsdb.controller.OvsdbTableStore; //导入依赖的package包/类
@Override
public Set<OvsdbPort> getLocalPorts(Iterable<String> ifaceids) {
Set<OvsdbPort> ovsdbPorts = new HashSet<OvsdbPort>();
OvsdbTableStore tableStore = getTableStore(OvsdbConstant.DATABASENAME);
if (tableStore == null) {
return null;
}
OvsdbRowStore rowStore = tableStore.getRows(OvsdbConstant.INTERFACE);
if (rowStore == null) {
return null;
}
ConcurrentMap<String, Row> rows = rowStore.getRowStore();
for (String uuid : rows.keySet()) {
Row row = getRow(OvsdbConstant.DATABASENAME,
OvsdbConstant.INTERFACE, uuid);
DatabaseSchema dbSchema = getDatabaseSchema(OvsdbConstant.DATABASENAME);
Interface intf = (Interface) TableGenerator
.getTable(dbSchema, row, OvsdbTable.INTERFACE);
if (intf == null || getIfaceid(intf) == null) {
continue;
}
String portName = intf.getName();
Set<String> ifaceidSet = Sets.newHashSet(ifaceids);
if (portName.startsWith("vxlan")
|| !ifaceidSet.contains(getIfaceid(intf))) {
continue;
}
long ofPort = getOfPort(intf);
if ((ofPort < 0) || (portName == null)) {
continue;
}
OvsdbPort ovsdbPort = new OvsdbPort(new OvsdbPortNumber(ofPort),
new OvsdbPortName(portName));
if (ovsdbPort != null) {
ovsdbPorts.add(ovsdbPort);
}
}
return ovsdbPorts;
}
示例9: getLocalPorts
import org.onosproject.ovsdb.controller.OvsdbTableStore; //导入依赖的package包/类
@Override
public Set<OvsdbPort> getLocalPorts(Iterable<String> ifaceids) {
Set<OvsdbPort> ovsdbPorts = new HashSet<>();
OvsdbTableStore tableStore = getTableStore(DATABASENAME);
if (tableStore == null) {
return null;
}
OvsdbRowStore rowStore = tableStore.getRows(INTERFACE);
if (rowStore == null) {
return null;
}
ConcurrentMap<String, Row> rows = rowStore.getRowStore();
for (String uuid : rows.keySet()) {
Row row = getRow(DATABASENAME, INTERFACE, uuid);
DatabaseSchema dbSchema = getDatabaseSchema(DATABASENAME);
Interface intf = (Interface) TableGenerator
.getTable(dbSchema, row, OvsdbTable.INTERFACE);
if (intf == null || getIfaceid(intf) == null) {
continue;
}
String portName = intf.getName();
if (portName == null) {
continue;
}
Set<String> ifaceidSet = Sets.newHashSet(ifaceids);
if (portName.startsWith(TYPEVXLAN) || !ifaceidSet.contains(getIfaceid(intf))) {
continue;
}
long ofPort = getOfPort(intf);
if (ofPort < 0) {
continue;
}
ovsdbPorts.add(new OvsdbPort(new OvsdbPortNumber(ofPort),
new OvsdbPortName(portName)));
}
return ovsdbPorts;
}