• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DeviceListener类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setUp

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
@Before
public void setUp() {
    networkConfigListener = createMock(NetworkConfigListener.class);
    deviceService = new TestDeviceService();
    deviceListener = createMock(DeviceListener.class);

    interfaceListener = createMock(InterfaceListener.class);
    deviceService.addListener(deviceListener);
    setUpInterfaceService();
    interfaceService = new InternalInterfaceService();
    interfaceService.addListener(interfaceListener);
    networkConfigService = new TestNetworkConfigService();
    networkConfigService.addListener(networkConfigListener);
    flowObjectiveService = createMock(FlowObjectiveService.class);
    setUpFlowObjectiveService();
    controlPlaneRedirectManager.coreService = coreService;
    controlPlaneRedirectManager.flowObjectiveService = flowObjectiveService;
    controlPlaneRedirectManager.networkConfigService = networkConfigService;
    controlPlaneRedirectManager.interfaceService = interfaceService;
    controlPlaneRedirectManager.deviceService = deviceService;
    controlPlaneRedirectManager.hostService = createNiceMock(HostService.class);
    controlPlaneRedirectManager.mastershipService = mastershipService;
    controlPlaneRedirectManager.activate();
    verify(flowObjectiveService);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:ControlPlaneRedirectManagerTest.java


示例2: deviceEventTest

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
@Test
public void deviceEventTest() {
    // Make four router topology with SR-TE capabilities.
    build4RouterTopo(true, false, true, true, 0);

    // Add new L3 device
    DefaultAnnotations.Builder builderDev5 = DefaultAnnotations.builder();
    builderDev5.set(AnnotationKeys.TYPE, L3);
    builderDev5.set(LSRID, "5.5.5.5");

    Device dev5 = new MockDevice(DeviceId.deviceId("P005"), builderDev5.build());
    deviceService.addDevice(dev5);

    // Add capability
    DeviceCapability device5Cap = netConfigRegistry.addConfig(DeviceId.deviceId("5.5.5.5"), DeviceCapability.class);
    device5Cap.setLabelStackCap(true)
            .setLocalLabelCap(false)
            .setSrCap(true)
            .apply();

    // Get listener
    DeviceListener listener = deviceService.getListener();

    // Generate Remove events
    deviceService.removeDevice(dev5);
    DeviceEvent event = new DeviceEvent(DeviceEvent.Type.DEVICE_REMOVED, dev5);
    listener.event(event);

    assertThat(pceStore.getGlobalNodeLabel(dev5.id()), is(nullValue()));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:31,代码来源:PceManagerTest.java


示例3: removeListener

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
@Override
public void removeListener(DeviceListener listener) {
    DeviceListener wrappedListener = wrapped.remove(listener);
    if (wrappedListener != null) {
        super.removeListener(wrappedListener);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:8,代码来源:OpticalDeviceServiceView.java


示例4: deviceUpEvent

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
/**
 * Tests receipt of a device up event.
 *
 * @throws TestUtilsException if lookup of a field fails
 */
@Test
public void deviceUpEvent() throws TestUtilsException {
    TrafficSelector selector = DefaultTrafficSelector.emptySelector();
    TrafficTreatment treatment = DefaultTrafficTreatment.emptyTreatment();

    DeviceEvent event = new DeviceEvent(DeviceEvent.Type.DEVICE_ADDED, d2);
    DeviceListener listener = TestUtils.getField(manager, "deviceListener");
    assertThat(listener, notNullValue());

    listener.event(event);

    ForwardingObjective forward =
            DefaultForwardingObjective.builder()
                    .fromApp(NetTestTools.APP_ID)
                    .withFlag(ForwardingObjective.Flag.SPECIFIC)
                    .withSelector(selector)
                    .withTreatment(treatment)
                    .makePermanent()
                    .add();
    manager.forward(id2, forward);

    // new device should have an objective now
    TestTools.assertAfter(RETRY_MS, () ->
            assertThat(forwardingObjectives, hasSize(1)));

    assertThat(forwardingObjectives, hasItem("of:d2"));
    assertThat(filteringObjectives, hasSize(0));
    assertThat(nextObjectives, hasSize(0));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:35,代码来源:FlowObjectiveManagerTest.java


示例5: createTopology

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
/**
 * Creates a fake topology to feed into the ARP module.
 * <p>
 * The default topology is a unidirectional ring topology. Each switch has
 * 3 ports. Ports 2 and 3 have the links to neighbor switches, and port 1
 * is free (edge port).
 * The first half of the switches have IP addresses configured on their
 * free ports (port 1). The second half of the switches have no IP
 * addresses configured.
 */
private void createTopology() {
    deviceService = createMock(DeviceService.class);
    linkService = createMock(LinkService.class);

    deviceService.addListener(anyObject(DeviceListener.class));
    linkService.addListener(anyObject(LinkListener.class));

    createDevices(NUM_DEVICES, NUM_PORTS_PER_DEVICE);
    createLinks(NUM_DEVICES);
    addIntfConfig();
    popluateEdgePortService();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:23,代码来源:ProxyArpManagerTest.java


示例6: createTopology

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
/**
 * Creates a fake topology to feed into the ARP module.
 * <p/>
 * The default topology is a unidirectional ring topology. Each switch has
 * 3 ports. Ports 2 and 3 have the links to neighbor switches, and port 1
 * is free (edge port).
 * The first half of the switches have IP addresses configured on their
 * free ports (port 1). The second half of the switches have no IP
 * addresses configured.
 */
private void createTopology() {
    deviceService = createMock(DeviceService.class);
    linkService = createMock(LinkService.class);

    deviceService.addListener(anyObject(DeviceListener.class));
    linkService.addListener(anyObject(LinkListener.class));

    createDevices(NUM_DEVICES, NUM_PORTS_PER_DEVICE);
    createLinks(NUM_DEVICES);
    addAddressBindings();
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:22,代码来源:ProxyArpManagerTest.java


示例7: setUp

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
@Before
public void setUp() {
    networkConfigListener = createMock(NetworkConfigListener.class);
    deviceService = new TestDeviceService();
    deviceListener = createMock(DeviceListener.class);

    interfaceListener = createMock(InterfaceListener.class);
    deviceService.addListener(deviceListener);
    setUpInterfaceService();
    interfaceService = new InternalInterfaceService();
    interfaceService.addListener(interfaceListener);
    networkConfigService = new TestNetworkConfigService();
    networkConfigService.addListener(networkConfigListener);
    flowObjectiveService = createMock(FlowObjectiveService.class);
    applicationService = createNiceMock(ApplicationService.class);
    replay(applicationService);
    setUpFlowObjectiveService();
    controlPlaneRedirectManager.coreService = coreService;
    controlPlaneRedirectManager.flowObjectiveService = flowObjectiveService;
    controlPlaneRedirectManager.networkConfigService = networkConfigService;
    controlPlaneRedirectManager.interfaceService = interfaceService;
    controlPlaneRedirectManager.deviceService = deviceService;
    controlPlaneRedirectManager.hostService = createNiceMock(HostService.class);
    controlPlaneRedirectManager.mastershipService = mastershipService;
    controlPlaneRedirectManager.applicationService = applicationService;
    controlPlaneRedirectManager.activate(new ComponentContextAdapter());
    verify(flowObjectiveService);
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:29,代码来源:ControlPlaneRedirectManagerTest.java


示例8: addListener

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
@Override
public void addListener(DeviceListener listener) {
    this.listener = listener;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:OspfTopologyProviderTest.java


示例9: addListener

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
@Override
public void addListener(DeviceListener listener) {
    deviceListener = listener;

}
 
开发者ID:shlee89,项目名称:athena,代码行数:6,代码来源:LldpLinkProviderTest.java


示例10: addListener

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
@Override
public void addListener(DeviceListener listener) {
    deviceListener = listener;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:NetworkConfigLinksProviderTest.java


示例11: addListener

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
@Override
public void addListener(DeviceListener listener) {
    deviceListeners.add(listener);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:PollingAlarmProviderTest.java


示例12: removeListener

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
@Override
public void removeListener(DeviceListener listener) {
    deviceListeners.remove(listener);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:PollingAlarmProviderTest.java


示例13: addListener

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
@Override
public void addListener(DeviceListener listener) {
    SingleSwitchFibInstallerTest.this.deviceListener = listener;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:SingleSwitchFibInstallerTest.java


示例14: addListener

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
@Override
public void addListener(DeviceListener listener) {
    ControlPlaneRedirectManagerTest.this.deviceListener = listener;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:ControlPlaneRedirectManagerTest.java


示例15: getListener

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
/**
 * Get the listener.
 */
public DeviceListener getListener() {
    return listener;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:7,代码来源:MockDeviceService.java


示例16: addListener

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
@Override
public void addListener(DeviceListener listener) {
    delegate.addListener(listener);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:ForwardingDeviceService.java


示例17: removeListener

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
@Override
public void removeListener(DeviceListener listener) {
    delegate.removeListener(listener);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:ForwardingDeviceService.java


示例18: addListener

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
@Override
public void addListener(DeviceListener listener) {
    super.addListener(wrapped.computeIfAbsent(listener, OpticalDeviceListener::new));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:OpticalDeviceServiceView.java


示例19: OpticalDeviceListener

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
public OpticalDeviceListener(DeviceListener listener) {
    this.listener = listener;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:4,代码来源:OpticalDeviceServiceView.java


示例20: addListener

import org.onosproject.net.device.DeviceListener; //导入依赖的package包/类
@Override
public void addListener(DeviceListener listener) {
}
 
开发者ID:shlee89,项目名称:athena,代码行数:4,代码来源:HostMonitorTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EpollDomainSocketChannel类代码示例发布时间:2022-05-23
下一篇:
Java KeyTransRecipientId类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap