当前位置: 首页>>代码示例>>Java>>正文


Java OFAuxId.MAIN属性代码示例

本文整理汇总了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);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:25,代码来源:OFChannelHandler.java

示例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();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:24,代码来源:OFSwitchManagerTest.java

示例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);
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:23,代码来源:OFSwitchHandlerTestBase.java

示例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));
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:12,代码来源:OFSwitchManagerTest.java

示例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));
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:14,代码来源:OFSwitchManagerTest.java

示例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();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:14,代码来源:OFConnectionTest.java

示例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);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:29,代码来源:OFSwitchHandlerTestBase.java

示例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);
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:11,代码来源:OFConnectionTest.java

示例9: getAuxId

@Override
public OFAuxId getAuxId() {
    return OFAuxId.MAIN;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:4,代码来源:NullConnection.java

示例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));
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:6,代码来源:OFSwitchTest.java

示例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));
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:6,代码来源:OFSwitchTest.java


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