本文整理汇总了Java中net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager类的典型用法代码示例。如果您正苦于以下问题:Java LinkDiscoveryManager类的具体用法?Java LinkDiscoveryManager怎么用?Java LinkDiscoveryManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LinkDiscoveryManager类属于net.floodlightcontroller.linkdiscovery.internal包,在下文中一共展示了LinkDiscoveryManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleEvHistReq
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入依赖的package包/类
@Get("json")
public EventHistory<EventHistoryTopologyCluster> handleEvHistReq() {
// Get the event history count. Last <count> events would be returned
String evHistCount = (String)getRequestAttributes().get("count");
int count = EventHistory.EV_HISTORY_DEFAULT_SIZE;
try {
count = Integer.parseInt(evHistCount);
}
catch(NumberFormatException nFE) {
// Invalid input for event count - use default value
}
LinkDiscoveryManager topoManager =
(LinkDiscoveryManager)getContext().getAttributes().
get(ILinkDiscoveryService.class.getCanonicalName());
if (topoManager != null) {
return new EventHistory<EventHistoryTopologyCluster>(
topoManager.evHistTopologyCluster, count);
}
return null;
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:24,代码来源:EventHistoryTopologyClusterResource.java
示例2: handleEvHistReq
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入依赖的package包/类
@Get("json")
public EventHistory<EventHistoryTopologySwitch> handleEvHistReq() {
// Get the event history count. Last <count> events would be returned
String evHistCount = (String)getRequestAttributes().get("count");
int count = EventHistory.EV_HISTORY_DEFAULT_SIZE;
try {
count = Integer.parseInt(evHistCount);
}
catch(NumberFormatException nFE) {
// Invalid input for event count - use default value
}
LinkDiscoveryManager topoManager =
(LinkDiscoveryManager)getContext().getAttributes().
get(ILinkDiscoveryService.class.getCanonicalName());
return new EventHistory<EventHistoryTopologySwitch>(
topoManager.evHistTopologySwitch, count);
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:21,代码来源:EventHistoryTopologySwitchResource.java
示例3: handleEvHistReq
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入依赖的package包/类
@Get("json")
public EventHistory<EventHistoryTopologyLink> handleEvHistReq() {
// Get the event history count. Last <count> events would be returned
String evHistCount = (String)getRequestAttributes().get("count");
int count = EventHistory.EV_HISTORY_DEFAULT_SIZE;
try {
count = Integer.parseInt(evHistCount);
}
catch(NumberFormatException nFE) {
// Invalid input for event count - use default value
}
LinkDiscoveryManager linkDiscoveryManager =
(LinkDiscoveryManager)getContext().getAttributes().
get(ILinkDiscoveryService.class.getCanonicalName());
if (linkDiscoveryManager != null) {
return new EventHistory<EventHistoryTopologyLink>(
linkDiscoveryManager.evHistTopologyLink, count);
}
return null;
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:24,代码来源:EventHistoryTopologyLinkResource.java
示例4: testAddOrUpdateLink
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入依赖的package包/类
@Test
public void testAddOrUpdateLink() throws Exception {
LinkDiscoveryManager topology = getTopology();
Link lt = new Link(1L, 2, 2L, 1);
LinkInfo info = new LinkInfo(System.currentTimeMillis(),
System.currentTimeMillis(), null,
0, 0);
topology.addOrUpdateLink(lt, info);
NodePortTuple srcNpt = new NodePortTuple(1L, 2);
NodePortTuple dstNpt = new NodePortTuple(2L, 1);
// check invariants hold
assertNotNull(topology.switchLinks.get(lt.getSrc()));
assertTrue(topology.switchLinks.get(lt.getSrc()).contains(lt));
assertNotNull(topology.portLinks.get(srcNpt));
assertTrue(topology.portLinks.get(srcNpt).contains(lt));
assertNotNull(topology.portLinks.get(dstNpt));
assertTrue(topology.portLinks.get(dstNpt).contains(lt));
assertTrue(topology.links.containsKey(lt));
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:24,代码来源:LinkDiscoveryManagerTest.java
示例5: testDeleteLink
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入依赖的package包/类
@Test
public void testDeleteLink() throws Exception {
LinkDiscoveryManager topology = getTopology();
Link lt = new Link(1L, 2, 2L, 1);
LinkInfo info = new LinkInfo(System.currentTimeMillis(),
System.currentTimeMillis(), null,
0, 0);
topology.addOrUpdateLink(lt, info);
topology.deleteLinks(Collections.singletonList(lt), "Test");
// check invariants hold
assertNull(topology.switchLinks.get(lt.getSrc()));
assertNull(topology.switchLinks.get(lt.getDst()));
assertNull(topology.portLinks.get(lt.getSrc()));
assertNull(topology.portLinks.get(lt.getDst()));
assertTrue(topology.links.isEmpty());
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:19,代码来源:LinkDiscoveryManagerTest.java
示例6: testAddOrUpdateLinkToSelf
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入依赖的package包/类
@Test
public void testAddOrUpdateLinkToSelf() throws Exception {
LinkDiscoveryManager topology = getTopology();
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,
0, 0);
topology.addOrUpdateLink(lt, info);
// check invariants hold
assertNotNull(topology.switchLinks.get(lt.getSrc()));
assertTrue(topology.switchLinks.get(lt.getSrc()).contains(lt));
assertNotNull(topology.portLinks.get(srcNpt));
assertTrue(topology.portLinks.get(srcNpt).contains(lt));
assertNotNull(topology.portLinks.get(dstNpt));
assertTrue(topology.portLinks.get(dstNpt).contains(lt));
assertTrue(topology.links.containsKey(lt));
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:23,代码来源:LinkDiscoveryManagerTest.java
示例7: testDeleteLinkToSelf
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入依赖的package包/类
@Test
public void testDeleteLinkToSelf() throws Exception {
LinkDiscoveryManager topology = getTopology();
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,
0, 0);
topology.addOrUpdateLink(lt, info);
topology.deleteLinks(Collections.singletonList(lt), "Test to self");
// check invariants hold
assertNull(topology.switchLinks.get(lt.getSrc()));
assertNull(topology.switchLinks.get(lt.getDst()));
assertNull(topology.portLinks.get(srcNpt));
assertNull(topology.portLinks.get(dstNpt));
assertTrue(topology.links.isEmpty());
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:22,代码来源:LinkDiscoveryManagerTest.java
示例8: testRemovedSwitch
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入依赖的package包/类
@Test
public void testRemovedSwitch() {
LinkDiscoveryManager topology = getTopology();
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,
0, 0);
topology.addOrUpdateLink(lt, info);
IOFSwitch sw1 = getMockFloodlightProvider().getSwitches().get(1L);
IOFSwitch sw2 = getMockFloodlightProvider().getSwitches().get(2L);
// Mock up our expected behavior
topology.removedSwitch(sw1);
verify(sw1, sw2);
// check invariants hold
assertNull(topology.switchLinks.get(lt.getSrc()));
assertNull(topology.switchLinks.get(lt.getDst()));
assertNull(topology.portLinks.get(srcNpt));
assertNull(topology.portLinks.get(dstNpt));
assertTrue(topology.links.isEmpty());
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:26,代码来源:LinkDiscoveryManagerTest.java
示例9: testRemovedSwitchSelf
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入依赖的package包/类
@Test
public void testRemovedSwitchSelf() {
LinkDiscoveryManager topology = getTopology();
IOFSwitch sw1 = createMockSwitch(1L);
replay(sw1);
Link lt = new Link(1L, 2, 1L, 3);
LinkInfo info = new LinkInfo(System.currentTimeMillis(),
System.currentTimeMillis(), null,
0, 0);
topology.addOrUpdateLink(lt, info);
// Mock up our expected behavior
topology.removedSwitch(sw1);
verify(sw1);
// check invariants hold
assertNull(topology.switchLinks.get(lt.getSrc()));
assertNull(topology.portLinks.get(lt.getSrc()));
assertNull(topology.portLinks.get(lt.getDst()));
assertTrue(topology.links.isEmpty());
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:22,代码来源:LinkDiscoveryManagerTest.java
示例10: testAddOrUpdateLink
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入依赖的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,
0, 0);
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));
}
示例11: testDeleteLink
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入依赖的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,
0, 0);
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());
}
示例12: testAddOrUpdateLinkToSelf
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入依赖的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,
0, 0);
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));
}
示例13: testDeleteLinkToSelf
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入依赖的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,
0, 0);
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());
}
示例14: testRemovedSwitch
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入依赖的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,
0, 0);
linkDiscovery.addOrUpdateLink(lt, info);
IOFSwitch sw1 = getMockFloodlightProvider().getSwitches().get(1L);
IOFSwitch sw2 = getMockFloodlightProvider().getSwitches().get(2L);
// Mock up our expected behavior
linkDiscovery.removedSwitch(sw1);
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());
}
示例15: testRemovedSwitchSelf
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入依赖的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,
0, 0);
linkDiscovery.addOrUpdateLink(lt, info);
// Mock up our expected behavior
linkDiscovery.removedSwitch(sw1);
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());
}