Java LinkInfo类代码示例

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


Java LinkInfo类代码示例

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

示例1: retrieve

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入依赖的package包/类
@Get("json")
public Set<LinkWithType> retrieve() {
    ILinkDiscoveryService ld = (ILinkDiscoveryService)getContext().getAttributes().
            get(ILinkDiscoveryService.class.getCanonicalName());
    Map<Link, LinkInfo> links = new HashMap<Link, LinkInfo>();
    Set<LinkWithType> returnLinkSet = new HashSet<LinkWithType>();

    if (ld != null) {
        links.putAll(ld.getLinks());
        for (Link link: links.keySet()) {
            LinkInfo info = links.get(link);
            LinkType type = ld.getLinkType(link, info);
            if (type == LinkType.DIRECT_LINK || type == LinkType.TUNNEL) {
                LinkWithType lwt = new LinkWithType(link,
                        type,LinkDirection.UNIDIRECTIONAL);
                returnLinkSet.add(lwt);
            }
        }
    }
    return returnLinkSet;
} 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:22,代码来源:DirectedLinksResource.java

示例2: getInfo

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入依赖的package包/类
@Override
public Map<String, Object> getInfo(String type) {
	if (!"summary".equals(type)) return null;

	Map<String, Object> info = new HashMap<String, Object>();

	int numDirectLinks = 0;
	for (Set<Link> links : switchLinks.values()) {
		for (Link link : links) {
			LinkInfo linkInfo = this.getLinkInfo(link);
			if (linkInfo != null &&
					linkInfo.getLinkType() == LinkType.DIRECT_LINK) {
				numDirectLinks++;
			}
		}
	}
	info.put("# inter-switch links", numDirectLinks / 2);
	info.put("# quarantine ports", quarantineQueue.size());
	return info;
} 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:21,代码来源:LinkDiscoveryManager.java

示例3: testAddOrUpdateLink

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入依赖的package包/类
@Test
public void testAddOrUpdateLink() throws Exception {
    LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();

    Link lt = new Link(DatapathId.of(1L), OFPort.of(2), DatapathId.of(2L), OFPort.of(1));
    LinkInfo info = new LinkInfo(new Date(),
                                 new Date(), null);
    linkDiscovery.addOrUpdateLink(lt, info);


    NodePortTuple srcNpt = new NodePortTuple(DatapathId.of(1L), OFPort.of(2));
    NodePortTuple dstNpt = new NodePortTuple(DatapathId.of(2L), OFPort.of(1));

    // check invariants hold
    assertNotNull(linkDiscovery.switchLinks.get(lt.getSrc()));
    assertTrue(linkDiscovery.switchLinks.get(lt.getSrc()).contains(lt));
    assertNotNull(linkDiscovery.getPortLinks().get(srcNpt));
    assertTrue(linkDiscovery.getPortLinks().get(srcNpt).contains(lt));
    assertNotNull(linkDiscovery.portLinks.get(dstNpt));
    assertTrue(linkDiscovery.portLinks.get(dstNpt).contains(lt));
    assertTrue(linkDiscovery.links.containsKey(lt));
} 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:23,代码来源:LinkDiscoveryManagerTest.java

示例4: testDeleteLink

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入依赖的package包/类
@Test
public void testDeleteLink() throws Exception {
    LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();

    Link lt = new Link(DatapathId.of(1L), OFPort.of(2), DatapathId.of(2L), OFPort.of(1));
    LinkInfo info = new LinkInfo(new Date(),
    		new Date(), null);
    linkDiscovery.addOrUpdateLink(lt, info);
    linkDiscovery.deleteLinks(Collections.singletonList(lt), "Test");

    // check invariants hold
    assertNull(linkDiscovery.switchLinks.get(lt.getSrc()));
    assertNull(linkDiscovery.switchLinks.get(lt.getDst()));
    assertNull(linkDiscovery.portLinks.get(lt.getSrc()));
    assertNull(linkDiscovery.portLinks.get(lt.getDst()));
    assertTrue(linkDiscovery.links.isEmpty());
} 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:18,代码来源:LinkDiscoveryManagerTest.java

示例5: testAddOrUpdateLinkToSelf

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入依赖的package包/类
@Test
public void testAddOrUpdateLinkToSelf() throws Exception {
    LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();

    Link lt = new Link(DatapathId.of(1L), OFPort.of(2), DatapathId.of(2L), OFPort.of(3));
    NodePortTuple srcNpt = new NodePortTuple(DatapathId.of(1L), OFPort.of(2));
    NodePortTuple dstNpt = new NodePortTuple(DatapathId.of(2L), OFPort.of(3));

    LinkInfo info = new LinkInfo(new Date(),
    		new Date(), null);
    linkDiscovery.addOrUpdateLink(lt, info);

    // check invariants hold
    assertNotNull(linkDiscovery.switchLinks.get(lt.getSrc()));
    assertTrue(linkDiscovery.switchLinks.get(lt.getSrc()).contains(lt));
    assertNotNull(linkDiscovery.portLinks.get(srcNpt));
    assertTrue(linkDiscovery.portLinks.get(srcNpt).contains(lt));
    assertNotNull(linkDiscovery.portLinks.get(dstNpt));
    assertTrue(linkDiscovery.portLinks.get(dstNpt).contains(lt));
    assertTrue(linkDiscovery.links.containsKey(lt));
} 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:22,代码来源:LinkDiscoveryManagerTest.java

示例6: testDeleteLinkToSelf

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入依赖的package包/类
@Test
public void testDeleteLinkToSelf() throws Exception {
    LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();

    Link lt = new Link(DatapathId.of(1L), OFPort.of(2), DatapathId.of(1L), OFPort.of(3));
    NodePortTuple srcNpt = new NodePortTuple(DatapathId.of(1L), OFPort.of(2));
    NodePortTuple dstNpt = new NodePortTuple(DatapathId.of(2L), OFPort.of(3));

    LinkInfo info = new LinkInfo(new Date(),
    		new Date(), null);
    linkDiscovery.addOrUpdateLink(lt, info);
    linkDiscovery.deleteLinks(Collections.singletonList(lt), "Test to self");

    // check invariants hold
    assertNull(linkDiscovery.switchLinks.get(lt.getSrc()));
    assertNull(linkDiscovery.switchLinks.get(lt.getDst()));
    assertNull(linkDiscovery.portLinks.get(srcNpt));
    assertNull(linkDiscovery.portLinks.get(dstNpt));
    assertTrue(linkDiscovery.links.isEmpty());
} 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:21,代码来源:LinkDiscoveryManagerTest.java

示例7: testRemovedSwitch

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入依赖的package包/类
@Test
public void testRemovedSwitch() {
    LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();

    Link lt = new Link(DatapathId.of(1L), OFPort.of(2), DatapathId.of(2L), OFPort.of(1));
    NodePortTuple srcNpt = new NodePortTuple(DatapathId.of(1L), OFPort.of(2));
    NodePortTuple dstNpt = new NodePortTuple(DatapathId.of(2L), OFPort.of(1));
    LinkInfo info = new LinkInfo(new Date(),
    		new Date(), null);
    linkDiscovery.addOrUpdateLink(lt, info);

    IOFSwitch sw1 = getMockSwitchService().getSwitch(DatapathId.of(1L));
    IOFSwitch sw2 = getMockSwitchService().getSwitch(DatapathId.of(2L));
    // Mock up our expected behavior
    linkDiscovery.switchRemoved(sw1.getId());
    verify(sw1, sw2);

    // check invariants hold
    assertNull(linkDiscovery.switchLinks.get(lt.getSrc()));
    assertNull(linkDiscovery.switchLinks.get(lt.getDst()));
    assertNull(linkDiscovery.portLinks.get(srcNpt));
    assertNull(linkDiscovery.portLinks.get(dstNpt));
    assertTrue(linkDiscovery.links.isEmpty());
} 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:25,代码来源:LinkDiscoveryManagerTest.java

示例8: testRemovedSwitchSelf

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入依赖的package包/类
@Test
public void testRemovedSwitchSelf() {
    LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();
    IOFSwitch sw1 = createMockSwitch(1L);
    replay(sw1);
    Link lt = new Link(DatapathId.of(1L), OFPort.of(2), DatapathId.of(1L), OFPort.of(3));
    LinkInfo info = new LinkInfo(new Date(),
                                 new Date(), null);
    linkDiscovery.addOrUpdateLink(lt, info);

    // Mock up our expected behavior
    linkDiscovery.switchRemoved(sw1.getId());

    verify(sw1);
    // check invariants hold
    assertNull(linkDiscovery.switchLinks.get(lt.getSrc()));
    assertNull(linkDiscovery.portLinks.get(lt.getSrc()));
    assertNull(linkDiscovery.portLinks.get(lt.getDst()));
    assertTrue(linkDiscovery.links.isEmpty());
} 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:21,代码来源:LinkDiscoveryManagerTest.java

示例9: getInfo

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入依赖的package包/类
@Override
public Map<String, Object> getInfo(String type) {
    if (!"summary".equals(type)) return null;

    Map<String, Object> info = new HashMap<String, Object>();

    int numDirectLinks = 0;
    for (Set<Link> links : switchLinks.values()) {
        for (Link link : links) {
            LinkInfo linkInfo = this.getLinkInfo(link);
            if (linkInfo != null &&
                linkInfo.getLinkType() == LinkType.DIRECT_LINK) {
                numDirectLinks++;
            }
        }
    }
    info.put("# inter-switch links", numDirectLinks / 2);
    info.put("# quarantine ports", quarantineQueue.size());
    return info;
} 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:21,代码来源:LinkDiscoveryManager.java

示例10: testAddOrUpdateLink

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入依赖的package包/类
@Test
public void testAddOrUpdateLink() throws Exception {
    LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();

    Link lt = new Link(1L, 2, 2L, 1);
    LinkInfo info = new LinkInfo(System.currentTimeMillis(),
                                 System.currentTimeMillis(), null);
    linkDiscovery.addOrUpdateLink(lt, info);


    NodePortTuple srcNpt = new NodePortTuple(1L, 2);
    NodePortTuple dstNpt = new NodePortTuple(2L, 1);

    // check invariants hold
    assertNotNull(linkDiscovery.switchLinks.get(lt.getSrc()));
    assertTrue(linkDiscovery.switchLinks.get(lt.getSrc()).contains(lt));
    assertNotNull(linkDiscovery.portLinks.get(srcNpt));
    assertTrue(linkDiscovery.portLinks.get(srcNpt).contains(lt));
    assertNotNull(linkDiscovery.portLinks.get(dstNpt));
    assertTrue(linkDiscovery.portLinks.get(dstNpt).contains(lt));
    assertTrue(linkDiscovery.links.containsKey(lt));
} 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:23,代码来源:LinkDiscoveryManagerTest.java

示例11: testDeleteLink

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入依赖的package包/类
@Test
public void testDeleteLink() throws Exception {
    LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();

    Link lt = new Link(1L, 2, 2L, 1);
    LinkInfo info = new LinkInfo(System.currentTimeMillis(),
                                 System.currentTimeMillis(), null);
    linkDiscovery.addOrUpdateLink(lt, info);
    linkDiscovery.deleteLinks(Collections.singletonList(lt), "Test");

    // check invariants hold
    assertNull(linkDiscovery.switchLinks.get(lt.getSrc()));
    assertNull(linkDiscovery.switchLinks.get(lt.getDst()));
    assertNull(linkDiscovery.portLinks.get(lt.getSrc()));
    assertNull(linkDiscovery.portLinks.get(lt.getDst()));
    assertTrue(linkDiscovery.links.isEmpty());
} 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:18,代码来源:LinkDiscoveryManagerTest.java

示例12: testAddOrUpdateLinkToSelf

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入依赖的package包/类
@Test
public void testAddOrUpdateLinkToSelf() throws Exception {
    LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();

    Link lt = new Link(1L, 2, 2L, 3);
    NodePortTuple srcNpt = new NodePortTuple(1L, 2);
    NodePortTuple dstNpt = new NodePortTuple(2L, 3);

    LinkInfo info = new LinkInfo(System.currentTimeMillis(),
                                 System.currentTimeMillis(), null);
    linkDiscovery.addOrUpdateLink(lt, info);

    // check invariants hold
    assertNotNull(linkDiscovery.switchLinks.get(lt.getSrc()));
    assertTrue(linkDiscovery.switchLinks.get(lt.getSrc()).contains(lt));
    assertNotNull(linkDiscovery.portLinks.get(srcNpt));
    assertTrue(linkDiscovery.portLinks.get(srcNpt).contains(lt));
    assertNotNull(linkDiscovery.portLinks.get(dstNpt));
    assertTrue(linkDiscovery.portLinks.get(dstNpt).contains(lt));
    assertTrue(linkDiscovery.links.containsKey(lt));
} 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:22,代码来源:LinkDiscoveryManagerTest.java

示例13: testDeleteLinkToSelf

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入依赖的package包/类
@Test
public void testDeleteLinkToSelf() throws Exception {
    LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();

    Link lt = new Link(1L, 2, 1L, 3);
    NodePortTuple srcNpt = new NodePortTuple(1L, 2);
    NodePortTuple dstNpt = new NodePortTuple(2L, 3);

    LinkInfo info = new LinkInfo(System.currentTimeMillis(),
                                 System.currentTimeMillis(), null);
    linkDiscovery.addOrUpdateLink(lt, info);
    linkDiscovery.deleteLinks(Collections.singletonList(lt), "Test to self");

    // check invariants hold
    assertNull(linkDiscovery.switchLinks.get(lt.getSrc()));
    assertNull(linkDiscovery.switchLinks.get(lt.getDst()));
    assertNull(linkDiscovery.portLinks.get(srcNpt));
    assertNull(linkDiscovery.portLinks.get(dstNpt));
    assertTrue(linkDiscovery.links.isEmpty());
} 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:21,代码来源:LinkDiscoveryManagerTest.java

示例14: testRemovedSwitch

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入依赖的package包/类
@Test
public void testRemovedSwitch() {
    LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();

    Link lt = new Link(1L, 2, 2L, 1);
    NodePortTuple srcNpt = new NodePortTuple(1L, 2);
    NodePortTuple dstNpt = new NodePortTuple(2L, 1);
    LinkInfo info = new LinkInfo(System.currentTimeMillis(),
                                 System.currentTimeMillis(), null);
    linkDiscovery.addOrUpdateLink(lt, info);

    IOFSwitch sw1 = getMockFloodlightProvider().getSwitch(1L);
    IOFSwitch sw2 = getMockFloodlightProvider().getSwitch(2L);
    // Mock up our expected behavior
    linkDiscovery.switchRemoved(sw1.getId());
    verify(sw1, sw2);

    // check invariants hold
    assertNull(linkDiscovery.switchLinks.get(lt.getSrc()));
    assertNull(linkDiscovery.switchLinks.get(lt.getDst()));
    assertNull(linkDiscovery.portLinks.get(srcNpt));
    assertNull(linkDiscovery.portLinks.get(dstNpt));
    assertTrue(linkDiscovery.links.isEmpty());
} 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:25,代码来源:LinkDiscoveryManagerTest.java

示例15: testRemovedSwitchSelf

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入依赖的package包/类
@Test
public void testRemovedSwitchSelf() {
    LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();
    IOFSwitch sw1 = createMockSwitch(1L);
    replay(sw1);
    Link lt = new Link(1L, 2, 1L, 3);
    LinkInfo info = new LinkInfo(System.currentTimeMillis(),
                                 System.currentTimeMillis(), null);
    linkDiscovery.addOrUpdateLink(lt, info);

    // Mock up our expected behavior
    linkDiscovery.switchRemoved(sw1.getId());

    verify(sw1);
    // check invariants hold
    assertNull(linkDiscovery.switchLinks.get(lt.getSrc()));
    assertNull(linkDiscovery.portLinks.get(lt.getSrc()));
    assertNull(linkDiscovery.portLinks.get(lt.getDst()));
    assertTrue(linkDiscovery.links.isEmpty());
} 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:21,代码来源:LinkDiscoveryManagerTest.java

本文标签属性:

示例:示例志愿表

代码:代码转换器

java:javascript18岁

LinkInfo:LinkInfo

上一篇:姜丹尼尔能赚钱吗(姜丹尼尔多高)
下一篇:C# Token.SetIsCommandArgument方法代码示例

为您推荐