本文整理汇总了Java中org.onosproject.ovsdb.controller.OvsdbEventListener类的典型用法代码示例。如果您正苦于以下问题:Java OvsdbEventListener类的具体用法?Java OvsdbEventListener怎么用?Java OvsdbEventListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OvsdbEventListener类属于org.onosproject.ovsdb.controller包,在下文中一共展示了OvsdbEventListener类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dispatchInterfaceEvent
import org.onosproject.ovsdb.controller.OvsdbEventListener; //导入依赖的package包/类
/**
* Dispatches event to the north.
*
* @param clientService OvsdbClientService instance
* @param newRow a new row
* @param oldRow an old row
* @param eventType type of event
* @param dbSchema ovsdb database schema
*/
private void dispatchInterfaceEvent(OvsdbClientService clientService,
Row row,
Type eventType,
DatabaseSchema dbSchema) {
long dpid = getDataPathid(clientService, dbSchema);
Interface intf = (Interface) TableGenerator
.getTable(dbSchema, row, OvsdbTable.INTERFACE);
if (intf == null) {
return;
}
String portType = (String) intf.getTypeColumn().data();
long localPort = getOfPort(intf);
if (localPort < 0) {
return;
}
String[] macAndIfaceId = getMacAndIfaceid(intf);
if (macAndIfaceId == null) {
return;
}
EventSubject eventSubject = new DefaultEventSubject(MacAddress.valueOf(
macAndIfaceId[0]),
new HashSet<IpAddress>(),
new OvsdbPortName(intf
.getName()),
new OvsdbPortNumber(localPort),
new OvsdbDatapathId(Long
.toString(dpid)),
new OvsdbPortType(portType),
new OvsdbIfaceId(macAndIfaceId[1]));
for (OvsdbEventListener listener : ovsdbEventListener) {
listener.handle(new OvsdbEvent<EventSubject>(eventType,
eventSubject));
}
}
示例2: addOvsdbEventListener
import org.onosproject.ovsdb.controller.OvsdbEventListener; //导入依赖的package包/类
@Override
public void addOvsdbEventListener(OvsdbEventListener listener) {
if (!ovsdbEventListener.contains(listener)) {
this.ovsdbEventListener.add(listener);
}
}
示例3: removeOvsdbEventListener
import org.onosproject.ovsdb.controller.OvsdbEventListener; //导入依赖的package包/类
@Override
public void removeOvsdbEventListener(OvsdbEventListener listener) {
this.ovsdbEventListener.remove(listener);
}
示例4: addOvsdbEventListener
import org.onosproject.ovsdb.controller.OvsdbEventListener; //导入依赖的package包/类
@Override
public void addOvsdbEventListener(OvsdbEventListener listener) {
ovsdbEventListener = listener;
}
示例5: removeOvsdbEventListener
import org.onosproject.ovsdb.controller.OvsdbEventListener; //导入依赖的package包/类
@Override
public void removeOvsdbEventListener(OvsdbEventListener listener) {
ovsdbEventListener = null;
}
示例6: addOvsdbEventListener
import org.onosproject.ovsdb.controller.OvsdbEventListener; //导入依赖的package包/类
@Override
public void addOvsdbEventListener(OvsdbEventListener listener) {
}
示例7: removeOvsdbEventListener
import org.onosproject.ovsdb.controller.OvsdbEventListener; //导入依赖的package包/类
@Override
public void removeOvsdbEventListener(OvsdbEventListener listener) {
}