本文整理汇总了Java中org.projectfloodlight.openflow.types.OFAuxId.MAIN属性的典型用法代码示例。如果您正苦于以下问题:Java OFAuxId.MAIN属性的具体用法?Java OFAuxId.MAIN怎么用?Java OFAuxId.MAIN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.projectfloodlight.openflow.types.OFAuxId
的用法示例。
在下文中一共展示了OFAuxId.MAIN属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enterState
@Override
void enterState() throws IOException{
setSwitchHandshakeTimeout();
// Handle non 1.3 connections
if (featuresReply.getVersion().compareTo(OFVersion.OF_13) < 0){
connection = new OFConnection(featuresReply.getDatapathId(), factory, channel, OFAuxId.MAIN, debugCounters, timer);
}
// Handle 1.3 connections
else {
connection = new OFConnection(featuresReply.getDatapathId(), factory, channel, featuresReply.getAuxiliaryId(), debugCounters, timer);
// If this is an aux connection, we set a longer echo idle time
if (!featuresReply.getAuxiliaryId().equals(OFAuxId.MAIN)) {
setAuxChannelIdle();
}
}
connection.updateLatency(U64.of(featuresLatency));
echoSendTime = 0;
// Notify the connection broker
notifyConnectionOpened(connection);
}
示例2: testGetActiveSwitch
/**
* Tests that the switch manager should only return a switch to a getActiveSwitch
* call when the switch is visible/active.
*/
@Test
public void testGetActiveSwitch() {
MockOFConnection connection = new MockOFConnection(DATAPATH_ID_1, OFAuxId.MAIN);
IOFSwitchBackend sw = new MockOFSwitchImpl(connection);
sw.setStatus(SwitchStatus.HANDSHAKE);
assertNull(switchManager.getActiveSwitch(DATAPATH_ID_1));
switchManager.switchAdded(sw);
assertNull(switchManager.getActiveSwitch(DATAPATH_ID_1));
sw.setStatus(SwitchStatus.MASTER);
assertEquals(sw, switchManager.getActiveSwitch(DATAPATH_ID_1));
sw.setStatus(SwitchStatus.QUARANTINED);
assertNull(switchManager.getActiveSwitch(DATAPATH_ID_1));
sw.setStatus(SwitchStatus.SLAVE);
assertEquals(sw, switchManager.getActiveSwitch(DATAPATH_ID_1));
sw.setStatus(SwitchStatus.DISCONNECTED);
assertNull(switchManager.getActiveSwitch(DATAPATH_ID_1));
// we don't care for updates. drain queue.
controller.processUpdateQueueForTesting();
}
示例3: setUp
@Before
public void setUp() throws Exception {
switchManager = createMock(IOFSwitchManager.class);
roleManager = createMock(RoleManager.class);
sw = createMock(IOFSwitchBackend.class);
timer = createMock(Timer.class);
expect(timer.newTimeout(anyObject(TimerTask.class), anyLong(), anyObject(TimeUnit.class))).andReturn(EasyMock.createNiceMock(Timeout.class));
replay(timer);
seenXids = null;
// TODO: should mock IDebugCounterService and make sure
// the expected counters are updated.
debugCounterService = new DebugCounterServiceImpl();
SwitchManagerCounters counters =
new SwitchManagerCounters(debugCounterService);
expect(switchManager.getCounters()).andReturn(counters).anyTimes();
replay(switchManager);
connection = new MockOFConnection(featuresReply.getDatapathId(), OFAuxId.MAIN);
switchHandler = new OFSwitchHandshakeHandler(connection, featuresReply, switchManager, roleManager, timer);
// replay sw. Reset it if you need more specific behavior
replay(sw);
}
示例4: testNewConnectionOpened
@Test
public void testNewConnectionOpened() {
MockOFConnection connection = new MockOFConnection(DATAPATH_ID_1, OFAuxId.MAIN);
OFFeaturesReply featuresReply = createOFFeaturesReply(DATAPATH_ID_1);
// Assert no switch handlers
assertTrue(switchManager.getSwitchHandshakeHandlers().isEmpty());
switchManager.connectionOpened(connection, featuresReply);
// Ensure a
assertTrue(switchManager.getSwitchHandshakeHandlers().size() == 1);
assertTrue(switchManager.getSwitchHandshakeHandlers().get(0).getDpid().equals(DATAPATH_ID_1));
}
示例5: testDuplicateConnectionOpened
@Test
public void testDuplicateConnectionOpened() {
// Seed with 1 connection and handler
testNewConnectionOpened();
MockOFConnection connection = new MockOFConnection(DATAPATH_ID_1, OFAuxId.MAIN);
OFFeaturesReply featuresReply = createOFFeaturesReply(DATAPATH_ID_1);
switchManager.connectionOpened(connection, featuresReply);
// Ensure duplicate connections are
assertTrue(switchManager.getSwitchHandshakeHandlers().size() == 1);
assertTrue(switchManager.getSwitchHandshakeHandlers().get(0).getDpid().equals(DATAPATH_ID_1));
}
示例6: setUp
@Before
public void setUp() throws Exception {
factory = OFFactories.getFactory(OFVersion.OF_13);
switchId = DatapathId.of(1);
timer = new HashedWheelTimer();
channel = EasyMock.createMock(Channel.class);
IDebugCounterService debugCounterService = new DebugCounterServiceImpl();
debugCounterService.registerModule(OFConnectionCounters.COUNTER_MODULE);
conn = new OFConnection(switchId, factory, channel, OFAuxId.MAIN,
debugCounterService, timer);
eventLoop = new TestEventLoop();
expect(channel.eventLoop()).andReturn(eventLoop).anyTimes();
}
示例7: setUp
@Before
public void setUp() throws Exception {
/*
* This needs to be called explicitly to ensure the featuresReply is not null.
* Otherwise, there is no guarantee @Before will for setUpFeaturesReply() will
* call that function before our @Before setUp() here.
*/
setUpFeaturesReply();
switchManager = createMock(IOFSwitchManager.class);
roleManager = createMock(RoleManager.class);
sw = createMock(IOFSwitchBackend.class);
timer = createMock(Timer.class);
expect(timer.newTimeout(anyObject(TimerTask.class), anyLong(), anyObject(TimeUnit.class))).andReturn(EasyMock.createNiceMock(Timeout.class));
replay(timer);
seenXids = null;
// TODO: should mock IDebugCounterService and make sure
// the expected counters are updated.
debugCounterService = new DebugCounterServiceImpl();
SwitchManagerCounters counters =
new SwitchManagerCounters(debugCounterService);
expect(switchManager.getCounters()).andReturn(counters).anyTimes();
replay(switchManager);
connection = new MockOFConnection(featuresReply.getDatapathId(), OFAuxId.MAIN);
switchHandler = new OFSwitchHandshakeHandler(connection, featuresReply, switchManager, roleManager, timer);
// replay sw. Reset it if you need more specific behavior
replay(sw);
}
示例8: setUp
@Before
public void setUp() throws Exception {
factory = OFFactories.getFactory(OFVersion.OF_13);
switchId = DatapathId.of(1);
timer = new HashedWheelTimer();
channel = EasyMock.createNiceMock(Channel.class);
IDebugCounterService debugCounterService = new DebugCounterServiceImpl();
debugCounterService.registerModule(OFConnectionCounters.COUNTER_MODULE);
conn = new OFConnection(switchId, factory, channel, OFAuxId.MAIN,
debugCounterService, timer);
}
示例9: getAuxId
@Override
public OFAuxId getAuxId() {
return OFAuxId.MAIN;
}
示例10: setUp
@Before
public void setUp() throws Exception {
MockOFConnection mockConnection = new MockOFConnection(DatapathId.of(1), OFAuxId.MAIN);
sw = new OFSwitch(mockConnection, OFFactories.getFactory(OFVersion.OF_10),
EasyMock.createMock(IOFSwitchManager.class), DatapathId.of(1));
}
示例11: setUp
@Before
public void setUp() throws Exception {
MockOFConnection mockConnection = new MockOFConnection(DatapathId.of(1), OFAuxId.MAIN);
sw = new OFSwitch(mockConnection, OFFactories.getFactory(OFVersion.OF_10),
EasyMock.createMock(IOFSwitchManager.class), DatapathId.of(1));
}