本文整理汇总了Java中org.onosproject.ovsdb.controller.EventSubject类的典型用法代码示例。如果您正苦于以下问题:Java EventSubject类的具体用法?Java EventSubject怎么用?Java EventSubject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EventSubject类属于org.onosproject.ovsdb.controller包,在下文中一共展示了EventSubject类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: portAdded
import org.onosproject.ovsdb.controller.EventSubject; //导入依赖的package包/类
@Test
public void portAdded() {
DefaultEventSubject eventSubject = new DefaultEventSubject(MAC, null,
new OvsdbPortName("portName"),
new OvsdbPortNumber(0L),
new OvsdbDatapathId("10002"),
new OvsdbPortType("vxlan"),
new OvsdbIfaceId("102345"));
controller.ovsdbEventListener
.handle(new OvsdbEvent<EventSubject>(
OvsdbEvent.Type.PORT_ADDED,
eventSubject));
assertNotNull("never went throught the provider service",
providerService.added);
}
示例2: dispatchInterfaceEvent
import org.onosproject.ovsdb.controller.EventSubject; //导入依赖的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));
}
}
示例3: portRemoved
import org.onosproject.ovsdb.controller.EventSubject; //导入依赖的package包/类
@Test
public void portRemoved() {
DefaultEventSubject eventSubject = new DefaultEventSubject(MAC, null,
new OvsdbPortName("portName"),
new OvsdbPortNumber(0L),
new OvsdbDatapathId("10002"),
new OvsdbPortType("vxlan"),
new OvsdbIfaceId("102345"));
controller.ovsdbEventListener
.handle(new OvsdbEvent<EventSubject>(
OvsdbEvent.Type.PORT_REMOVED,
eventSubject));
assertEquals("port status unhandled", 1, providerService.removeCount);
}