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

Java ITopologyService类代码示例

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

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



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

示例1: getModuleDependencies

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
@Override
public Collection<Class<? extends IFloodlightService>>
        getModuleDependencies() {
    Collection<Class<? extends IFloodlightService>> l = 
            new ArrayList<Class<? extends IFloodlightService>>();
    l.add(IFloodlightProviderService.class);
    l.add(IRestApiService.class);
    l.add(IOFSwitchService.class);
    l.add(IDeviceService.class);
    l.add(IDebugCounterService.class);
    l.add(ITopologyService.class);
    l.add(IRoutingService.class);
    l.add(IStaticFlowEntryPusherService.class);

    return l;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:17,代码来源:LoadBalancer.java


示例2: init

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
                                             throws FloodlightModuleException {
    floodlightProviderService = context.getServiceImpl(IFloodlightProviderService.class);
    restApiService = context.getServiceImpl(IRestApiService.class);
    debugCounterService = context.getServiceImpl(IDebugCounterService.class);
    deviceManagerService = context.getServiceImpl(IDeviceService.class);
    routingEngineService = context.getServiceImpl(IRoutingService.class);
    topologyService = context.getServiceImpl(ITopologyService.class);
    sfpService = context.getServiceImpl(IStaticFlowEntryPusherService.class);
    switchService = context.getServiceImpl(IOFSwitchService.class);
    
    vips = new HashMap<String, LBVip>();
    pools = new HashMap<String, LBPool>();
    members = new HashMap<String, LBMember>();
    vipIpToId = new HashMap<Integer, String>();
    vipIpToMac = new HashMap<Integer, MacAddress>();
    memberIpToId = new HashMap<Integer, String>();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:20,代码来源:LoadBalancer.java


示例3: mockTopologyForPacketInTests

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
private static void
mockTopologyForPacketInTests(ITopologyService mockTopology) {
	expect(mockTopology.isAttachmentPointPort(DatapathId.of(anyLong()),
			OFPort.of(anyShort()))).
			andReturn(true).
			anyTimes();
	expect(mockTopology.isConsistent(DatapathId.of(EasyMock.anyLong()),
			OFPort.of(EasyMock.anyShort()),
			DatapathId.of(EasyMock.anyLong()),
			OFPort.of(EasyMock.anyShort()))).andReturn(false).
			anyTimes();
	expect(mockTopology.isBroadcastDomainPort(DatapathId.of(EasyMock.anyLong()),
			OFPort.of(EasyMock.anyShort())))
			.andReturn(false)
			.anyTimes();
	expect(mockTopology.getOpenflowDomainId(DatapathId.of(anyLong()))).andReturn(DatapathId.of(1L)).anyTimes();
	expect(mockTopology.isInSameBroadcastDomain(DatapathId.of(anyLong()),
			OFPort.of(anyShort()),
			DatapathId.of(anyLong()),
			OFPort.of(anyShort())))
			.andReturn(false).anyTimes();

}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:24,代码来源:DeviceManagerImplTest.java


示例4: testDeviceIndex

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
@Test
public void testDeviceIndex() throws Exception {
	EnumSet<IDeviceService.DeviceField> indexFields =
			EnumSet.noneOf(IDeviceService.DeviceField.class);
	indexFields.add(IDeviceService.DeviceField.IPv4);
	indexFields.add(IDeviceService.DeviceField.VLAN);
	deviceManager.addIndex(false, indexFields);

	indexFields = EnumSet.noneOf(IDeviceService.DeviceField.class);
	deviceManager.addIndex(false, indexFields);

	ITopologyService mockTopology = createMock(ITopologyService.class);
	deviceManager.topology = mockTopology;
	expect(mockTopology.isAttachmentPointPort(DatapathId.of(anyLong()),
			OFPort.of(anyShort()))).
			andReturn(true).anyTimes();
	expect(mockTopology.getOpenflowDomainId(DatapathId.of(EasyMock.anyLong()))).andReturn(DatapathId.of(1L)).anyTimes();
	replay(mockTopology);
	doTestDeviceQuery();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:21,代码来源:DeviceManagerImplTest.java


示例5: testDeviceClassIndex

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
@Test
public void testDeviceClassIndex() throws Exception {
	EnumSet<IDeviceService.DeviceField> indexFields =
			EnumSet.noneOf(IDeviceService.DeviceField.class);
	indexFields.add(IDeviceService.DeviceField.IPv4);
	indexFields.add(IDeviceService.DeviceField.VLAN);
	deviceManager.addIndex(true, indexFields);

	ITopologyService mockTopology = createMock(ITopologyService.class);
	deviceManager.topology = mockTopology;
	expect(mockTopology.isAttachmentPointPort(DatapathId.of(anyLong()),
			OFPort.of(anyShort()))).
			andReturn(true).anyTimes();
	expect(mockTopology.getOpenflowDomainId(DatapathId.of(EasyMock.anyLong()))).andReturn(DatapathId.of(1L)).anyTimes();
	replay(mockTopology);

	doTestDeviceClassQuery();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:19,代码来源:DeviceManagerImplTest.java


示例6: getDuplicateAttachmentPoints

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
/**
 * Get a list of duplicate attachment points, given a list of old attachment
 * points and one attachment point per L2 domain. Given a true attachment
 * point in the L2 domain, say trueAP, another attachment point in the
 * same L2 domain, say ap, is duplicate if:
 * 1. ap is inconsistent with trueAP, and
 * 2. active time of ap is after that of trueAP; and
 * 3. last seen time of ap is within the last INACTIVITY_INTERVAL
 * @param oldAPList
 * @param apMap
 * @return
 */
List<AttachmentPoint> getDuplicateAttachmentPoints(List<AttachmentPoint>oldAPList, Map<DatapathId, AttachmentPoint>apMap) {
    ITopologyService topology = deviceManager.topology;
    List<AttachmentPoint> dupAPs = new ArrayList<AttachmentPoint>();
    long timeThreshold = System.currentTimeMillis() - AttachmentPoint.INACTIVITY_INTERVAL;

    if (oldAPList == null || apMap == null)
        return dupAPs;

    for(AttachmentPoint ap : oldAPList) {
        DatapathId id = topology.getL2DomainId(ap.getSw());
        AttachmentPoint trueAP = apMap.get(id);

        if (trueAP == null) continue;
        boolean c = (topology.isConsistent(trueAP.getSw(), trueAP.getPort(),
                                          ap.getSw(), ap.getPort()));
        boolean active = (ap.getActiveSince().after(trueAP.getActiveSince()));
        boolean last = ap.getLastSeen().getTime() > timeThreshold;
        if (!c && active && last) {
            dupAPs.add(ap);
        }
    }

    return dupAPs;
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:37,代码来源:Device.java


示例7: mockTopologyForPacketInTests

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
private static void
mockTopologyForPacketInTests(ITopologyService mockTopology) {
	expect(mockTopology.isAttachmentPointPort(DatapathId.of(anyLong()),
			OFPort.of(anyShort()))).
			andReturn(true).
			anyTimes();
	expect(mockTopology.isConsistent(DatapathId.of(EasyMock.anyLong()),
			OFPort.of(EasyMock.anyShort()),
			DatapathId.of(EasyMock.anyLong()),
			OFPort.of(EasyMock.anyShort()))).andReturn(false).
			anyTimes();
	expect(mockTopology.isBroadcastDomainPort(DatapathId.of(EasyMock.anyLong()),
			OFPort.of(EasyMock.anyShort())))
			.andReturn(false)
			.anyTimes();
	expect(mockTopology.getL2DomainId(DatapathId.of(anyLong()))).andReturn(DatapathId.of(1L)).anyTimes();
	expect(mockTopology.isInSameBroadcastDomain(DatapathId.of(anyLong()),
			OFPort.of(anyShort()),
			DatapathId.of(anyLong()),
			OFPort.of(anyShort())))
			.andReturn(false).anyTimes();

}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:24,代码来源:DeviceManagerImplTest.java


示例8: testDeviceIndex

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
@Test
public void testDeviceIndex() throws Exception {
	EnumSet<IDeviceService.DeviceField> indexFields =
			EnumSet.noneOf(IDeviceService.DeviceField.class);
	indexFields.add(IDeviceService.DeviceField.IPV4);
	indexFields.add(IDeviceService.DeviceField.VLAN);
	deviceManager.addIndex(false, indexFields);

	indexFields = EnumSet.noneOf(IDeviceService.DeviceField.class);
	deviceManager.addIndex(false, indexFields);

	ITopologyService mockTopology = createMock(ITopologyService.class);
	deviceManager.topology = mockTopology;
	expect(mockTopology.isAttachmentPointPort(DatapathId.of(anyLong()),
			OFPort.of(anyShort()))).
			andReturn(true).anyTimes();
	expect(mockTopology.getL2DomainId(DatapathId.of(EasyMock.anyLong()))).andReturn(DatapathId.of(1L)).anyTimes();
	replay(mockTopology);
	doTestDeviceQuery();
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:21,代码来源:DeviceManagerImplTest.java


示例9: testDeviceClassIndex

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
@Test
public void testDeviceClassIndex() throws Exception {
	EnumSet<IDeviceService.DeviceField> indexFields =
			EnumSet.noneOf(IDeviceService.DeviceField.class);
	indexFields.add(IDeviceService.DeviceField.IPV4);
	indexFields.add(IDeviceService.DeviceField.VLAN);
	deviceManager.addIndex(true, indexFields);

	ITopologyService mockTopology = createMock(ITopologyService.class);
	deviceManager.topology = mockTopology;
	expect(mockTopology.isAttachmentPointPort(DatapathId.of(anyLong()),
			OFPort.of(anyShort()))).
			andReturn(true).anyTimes();
	expect(mockTopology.getL2DomainId(DatapathId.of(EasyMock.anyLong()))).andReturn(DatapathId.of(1L)).anyTimes();
	replay(mockTopology);

	doTestDeviceClassQuery();
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:19,代码来源:DeviceManagerImplTest.java


示例10: getModuleDependencies

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
@Override
public Collection<Class<? extends IFloodlightService>>
        getModuleDependencies() {
    Collection<Class<? extends IFloodlightService>> l =
            new ArrayList<Class<? extends IFloodlightService>>();
    l.add(IFloodlightProviderService.class);
    l.add(IRestApiService.class);
    l.add(IOFSwitchService.class);
    l.add(IDeviceService.class);
    l.add(IDebugCounterService.class);
    l.add(ITopologyService.class);
    l.add(IRoutingService.class);
    l.add(IStaticFlowEntryPusherService.class);

    return l;
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:17,代码来源:LoadBalancer.java


示例11: init

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
                                             throws FloodlightModuleException {
    floodlightProviderService = context.getServiceImpl(IFloodlightProviderService.class);
    restApiService = context.getServiceImpl(IRestApiService.class);
    debugCounterService = context.getServiceImpl(IDebugCounterService.class);
    deviceManagerService = context.getServiceImpl(IDeviceService.class);
    routingEngineService = context.getServiceImpl(IRoutingService.class);
    topologyService = context.getServiceImpl(ITopologyService.class);
    sfpService = context.getServiceImpl(IStaticFlowEntryPusherService.class);
    switchService = context.getServiceImpl(IOFSwitchService.class);

    vips = new HashMap<String, LBVip>();
    pools = new HashMap<String, LBPool>();
    members = new HashMap<String, LBMember>();
    vipIpToId = new HashMap<Integer, String>();
    vipIpToMac = new HashMap<Integer, MacAddress>();
    memberIpToId = new HashMap<Integer, String>();
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:20,代码来源:LoadBalancer.java


示例12: mockTopologyForPacketInTests

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
private static void
        mockTopologyForPacketInTests(ITopologyService mockTopology) {
    expect(mockTopology.isAttachmentPointPort(anyLong(),
            anyShort())).
            andReturn(true).
            anyTimes();
    expect(mockTopology.isConsistent(EasyMock.anyLong(),
            EasyMock.anyShort(),
            EasyMock.anyLong(),
            EasyMock.anyShort())).andReturn(false).
            anyTimes();
    expect(mockTopology.isBroadcastDomainPort(EasyMock.anyLong(),
            EasyMock.anyShort()))
            .andReturn(false)
            .anyTimes();
    expect(mockTopology.getL2DomainId(anyLong())).andReturn(1L).anyTimes();
    expect(mockTopology.isInSameBroadcastDomain(anyLong(),
                                                anyShort(),
                                                anyLong(),
                                                anyShort()))
            .andReturn(false).anyTimes();

}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:24,代码来源:DeviceManagerImplTest.java


示例13: testDeviceIndex

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
@Test
public void testDeviceIndex() throws Exception {
    EnumSet<IDeviceService.DeviceField> indexFields =
            EnumSet.noneOf(IDeviceService.DeviceField.class);
    indexFields.add(IDeviceService.DeviceField.IPV4);
    indexFields.add(IDeviceService.DeviceField.VLAN);
    deviceManager.addIndex(false, indexFields);

    indexFields = EnumSet.noneOf(IDeviceService.DeviceField.class);
    deviceManager.addIndex(false, indexFields);

    ITopologyService mockTopology = createMock(ITopologyService.class);
    deviceManager.topology = mockTopology;
    expect(mockTopology.isAttachmentPointPort(anyLong(),
                                              anyShort())).
                                              andReturn(true).anyTimes();
    expect(mockTopology.getL2DomainId(EasyMock.anyLong())).andReturn(1L).anyTimes();
    replay(mockTopology);
    doTestDeviceQuery();
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:21,代码来源:DeviceManagerImplTest.java


示例14: testDeviceClassIndex

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
@Test
public void testDeviceClassIndex() throws Exception {
    EnumSet<IDeviceService.DeviceField> indexFields =
            EnumSet.noneOf(IDeviceService.DeviceField.class);
    indexFields.add(IDeviceService.DeviceField.IPV4);
    indexFields.add(IDeviceService.DeviceField.VLAN);
    deviceManager.addIndex(true, indexFields);

    ITopologyService mockTopology = createMock(ITopologyService.class);
    deviceManager.topology = mockTopology;
    expect(mockTopology.isAttachmentPointPort(anyLong(),
                                              anyShort())).
                                              andReturn(true).anyTimes();
    expect(mockTopology.getL2DomainId(EasyMock.anyLong())).andReturn(1L).anyTimes();
    replay(mockTopology);

    doTestDeviceClassQuery();
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:19,代码来源:DeviceManagerImplTest.java


示例15: getModuleDependencies

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
@Override
public Collection<Class<? extends IFloodlightService>> getModuleDependencies() {
	Collection<Class<? extends IFloodlightService>> l =
			new ArrayList<Class<? extends IFloodlightService>>();
	l.add(IFloodlightProviderService.class);
	l.add(IStorageSourceService.class);
	l.add(ITopologyService.class);
	l.add(IRestApiService.class);
	l.add(IThreadPoolService.class);
	l.add(IEntityClassifierService.class);
	l.add(ISyncService.class);
	return l;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:14,代码来源:DeviceManagerImpl.java


示例16: init

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext fmc) throws FloodlightModuleException {
	this.perClassIndices =
			new HashSet<EnumSet<DeviceField>>();
	addIndex(true, EnumSet.of(DeviceField.IPv4));
	addIndex(true, EnumSet.of(DeviceField.IPv6));

	this.deviceListeners = new ListenerDispatcher<String, IDeviceListener>();
	this.suppressAPs = Collections.newSetFromMap(
			new ConcurrentHashMap<SwitchPort, Boolean>());

	this.floodlightProvider =
			fmc.getServiceImpl(IFloodlightProviderService.class);
	this.storageSource =
			fmc.getServiceImpl(IStorageSourceService.class);
	this.topology =
			fmc.getServiceImpl(ITopologyService.class);
	this.restApi = fmc.getServiceImpl(IRestApiService.class);
	this.threadPool = fmc.getServiceImpl(IThreadPoolService.class);
	this.entityClassifier = fmc.getServiceImpl(IEntityClassifierService.class);
	this.debugCounters = fmc.getServiceImpl(IDebugCounterService.class);
	this.debugEventService = fmc.getServiceImpl(IDebugEventService.class);
	this.syncService = fmc.getServiceImpl(ISyncService.class);
	this.deviceSyncManager = new DeviceSyncManager();
	this.haListenerDelegate = new HAListenerDelegate();
	registerDeviceManagerDebugCounters();
	registerDeviceManagerDebugEvents();
	this.addListener(new DeviceDebugEventLogger());
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:30,代码来源:DeviceManagerImpl.java


示例17: getModuleDependencies

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
@Override
public Collection<Class<? extends IFloodlightService>> getModuleDependencies() {
	Collection<Class<? extends IFloodlightService>> l =
			new ArrayList<Class<? extends IFloodlightService>>();
	l.add(IFloodlightProviderService.class);
	l.add(IDeviceService.class);
	l.add(IRoutingService.class);
	l.add(ITopologyService.class);
	l.add(IDebugCounterService.class);
	return l;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:12,代码来源:Forwarding.java


示例18: getModuleDependencies

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
@Override
public Collection<Class<? extends IFloodlightService>>
        getModuleDependencies() {
    Collection<Class<? extends IFloodlightService>> l = new ArrayList<Class<? extends IFloodlightService>>();
    l.add(IFloodlightProviderService.class);
    l.add(ITopologyService.class);
    l.add(IFlowReconcileService.class);
    l.add(ILinkDiscoveryService.class);
    return l;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:11,代码来源:PortDownReconciliation.java


示例19: init

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
@Override
public
        void
        init(FloodlightModuleContext context)
                                             throws FloodlightModuleException {
    switchService = context.getServiceImpl(IOFSwitchService.class);
    topology = context.getServiceImpl(ITopologyService.class);
    frm = context.getServiceImpl(IFlowReconcileService.class);
    lds = context.getServiceImpl(ILinkDiscoveryService.class);
    cntx = new FloodlightContext();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:12,代码来源:PortDownReconciliation.java


示例20: retrieve

import net.floodlightcontroller.topology.ITopologyService; //导入依赖的package包/类
@Get("json")
public Map<String, List<String>> retrieve() {
    IOFSwitchService switchService =
            (IOFSwitchService) getContext().getAttributes().
                get(IOFSwitchService.class.getCanonicalName());
    ITopologyService topologyService =
            (ITopologyService) getContext().getAttributes().
                get(ITopologyService.class.getCanonicalName());

    Form form = getQuery();
    String queryType = form.getFirstValue("type", true);
    boolean openflowDomain = true;
    if (queryType != null && "l2".equals(queryType)) {
        openflowDomain = false;
    }

    Map<String, List<String>> switchClusterMap = new HashMap<String, List<String>>();
    for (DatapathId dpid: switchService.getAllSwitchDpids()) {
        DatapathId clusterDpid =
                (openflowDomain
                 ? topologyService.getOpenflowDomainId(dpid)
                 :topologyService.getOpenflowDomainId(dpid));
        List<String> switchesInCluster = switchClusterMap.get(clusterDpid.toString());
        if (switchesInCluster != null) {
            switchesInCluster.add(dpid.toString());
        } else {
            List<String> l = new ArrayList<String>();
            l.add(dpid.toString());
            switchClusterMap.put(clusterDpid.toString(), l);
        }
    }
    return switchClusterMap;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:34,代码来源:SwitchClustersResource.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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