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


Java SwitchUpdateType类代码示例

本文整理汇总了Java中net.floodlightcontroller.core.internal.Controller.SwitchUpdateType的典型用法代码示例。如果您正苦于以下问题:Java SwitchUpdateType类的具体用法?Java SwitchUpdateType怎么用?Java SwitchUpdateType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SwitchUpdateType类属于net.floodlightcontroller.core.internal.Controller包,在下文中一共展示了SwitchUpdateType类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: verifyPortChangedUpdateInQueue

import net.floodlightcontroller.core.internal.Controller.SwitchUpdateType; //导入依赖的package包/类
public void verifyPortChangedUpdateInQueue(IOFSwitch sw) throws Exception {
    assertEquals(1, controller.updates.size());
    IUpdate update = controller.updates.take();
    assertEquals(true, update instanceof SwitchUpdate);
    SwitchUpdate swUpdate = (SwitchUpdate)update;
    assertEquals(sw, swUpdate.sw);
    assertEquals(SwitchUpdateType.PORTCHANGED, swUpdate.switchUpdateType);
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:9,代码来源:ControllerTest.java

示例2: doTestUpdateQueueWithUpdate

import net.floodlightcontroller.core.internal.Controller.SwitchUpdateType; //导入依赖的package包/类
private void doTestUpdateQueueWithUpdate(long dpid, SwitchUpdateType type,
        DummySwitchListener listener) throws InterruptedException {
    controller.updates.put(controller.new SwitchUpdate(dpid, type));
    synchronized (listener) {
        listener.wait(500);
    }
    // Test that the update was seen by the listener 1 time
    assertEquals(1, listener.getSwitchUpdateCount(type));
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:10,代码来源:ControllerTest.java

示例3: doTestUpdateQueueWithPortUpdate

import net.floodlightcontroller.core.internal.Controller.SwitchUpdateType; //导入依赖的package包/类
private void doTestUpdateQueueWithPortUpdate(long dpid, OFPortDesc port,
        PortChangeType type,
        DummySwitchListener listener) throws InterruptedException {
    controller.updates.put(controller.new SwitchUpdate(dpid,
            SwitchUpdateType.PORTCHANGED, port, type));
    synchronized (listener) {
        listener.wait(500);
    }
    // Test that the update was seen by the listener 1 time
    assertEquals(1, listener.getPortUpdateCount(type));
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:12,代码来源:ControllerTest.java

示例4: doTestNotifyPortChanged

import net.floodlightcontroller.core.internal.Controller.SwitchUpdateType; //导入依赖的package包/类
private void doTestNotifyPortChanged(long dpid, OFPortDesc port,
        PortChangeType changeType) throws InterruptedException {
    controller.notifyPortChanged(dpid, port, changeType);

    assertEquals(1, controller.updates.size());
    IUpdate update = controller.updates.take();
    assertEquals(true, update instanceof SwitchUpdate);
    SwitchUpdate swUpdate = (SwitchUpdate) update;
    assertEquals(dpid, swUpdate.getSwId());
    assertEquals(SwitchUpdateType.PORTCHANGED, swUpdate.getSwitchUpdateType());
    assertEquals(changeType, swUpdate.getPortChangeType());
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:13,代码来源:ControllerTest.java

示例5: switchActivatedMaster

import net.floodlightcontroller.core.internal.Controller.SwitchUpdateType; //导入依赖的package包/类
@Override
public synchronized void switchActivatedMaster(long swId) {
    updateCount.add(SwitchUpdateType.ACTIVATED_MASTER);
    notifyAll();
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:6,代码来源:ControllerTest.java

示例6: switchActivatedEqual

import net.floodlightcontroller.core.internal.Controller.SwitchUpdateType; //导入依赖的package包/类
@Override
public synchronized void switchActivatedEqual(long swId) {
    updateCount.add(SwitchUpdateType.ACTIVATED_EQUAL);
    notifyAll();
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:6,代码来源:ControllerTest.java

示例7: switchMasterToEqual

import net.floodlightcontroller.core.internal.Controller.SwitchUpdateType; //导入依赖的package包/类
@Override
public synchronized void switchMasterToEqual(long swId) {
    updateCount.add(SwitchUpdateType.MASTER_TO_EQUAL);
    notifyAll();
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:6,代码来源:ControllerTest.java

示例8: switchEqualToMaster

import net.floodlightcontroller.core.internal.Controller.SwitchUpdateType; //导入依赖的package包/类
@Override
public synchronized void switchEqualToMaster(long swId) {
    updateCount.add(SwitchUpdateType.EQUAL_TO_MASTER);
    notifyAll();
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:6,代码来源:ControllerTest.java

示例9: switchDisconnected

import net.floodlightcontroller.core.internal.Controller.SwitchUpdateType; //导入依赖的package包/类
@Override
public synchronized void switchDisconnected(long swId) {
    updateCount.add(SwitchUpdateType.DISCONNECTED);
    notifyAll();
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:6,代码来源:ControllerTest.java

示例10: testUpdateQueue

import net.floodlightcontroller.core.internal.Controller.SwitchUpdateType; //导入依赖的package包/类
/**
 * Tests that updates sent into the Controller updates queue are dispatched
 * to the listeners correctly.
 *
 * @throws InterruptedException
 */
@Test
public void testUpdateQueue() throws InterruptedException {
    // No difference between OpenFlow versions here
    OFVersion version = OFVersion.OF_10;
    OFPortDesc port = OFFactories.getFactory(version)
            .buildPortDesc().build();
    long dpid = 1L;

    DummySwitchListener switchListener = new DummySwitchListener();
    IOFSwitch sw = createMockSwitch(dpid, version);
    replay(sw);
    ControllerRunThread t = new ControllerRunThread();
    t.start();

    controller.addOFSwitchListener(switchListener);

    // Switch updates
    doTestUpdateQueueWithUpdate(dpid, SwitchUpdateType.ACTIVATED_MASTER,
            switchListener);
    doTestUpdateQueueWithUpdate(dpid, SwitchUpdateType.ACTIVATED_EQUAL,
            switchListener);
    doTestUpdateQueueWithUpdate(dpid, SwitchUpdateType.EQUAL_TO_MASTER,
            switchListener);
    doTestUpdateQueueWithUpdate(dpid, SwitchUpdateType.MASTER_TO_EQUAL,
            switchListener);
    doTestUpdateQueueWithUpdate(dpid, SwitchUpdateType.DISCONNECTED,
            switchListener);

    // Port updates
    doTestUpdateQueueWithPortUpdate(dpid, port, PortChangeType.ADD,
            switchListener);
    doTestUpdateQueueWithPortUpdate(dpid, port, PortChangeType.OTHER_UPDATE,
            switchListener);
    doTestUpdateQueueWithPortUpdate(dpid, port, PortChangeType.DELETE,
            switchListener);
    doTestUpdateQueueWithPortUpdate(dpid, port, PortChangeType.UP,
            switchListener);
    doTestUpdateQueueWithPortUpdate(dpid, port, PortChangeType.DOWN,
            switchListener);
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:47,代码来源:ControllerTest.java

示例11: getSwitchUpdateCount

import net.floodlightcontroller.core.internal.Controller.SwitchUpdateType; //导入依赖的package包/类
/**
 * Gets the number of times a switch update event of the specified type
 * has been received.
 *
 * @param type SwitchUpdateType to get the count for
 * @return number of times the event has been received
 */
public int getSwitchUpdateCount(SwitchUpdateType type) {
    return updateCount.count(type);
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:11,代码来源:ControllerTest.java


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