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


Java OFFactories.getFactory方法代码示例

本文整理汇总了Java中org.projectfloodlight.openflow.protocol.OFFactories.getFactory方法的典型用法代码示例。如果您正苦于以下问题:Java OFFactories.getFactory方法的具体用法?Java OFFactories.getFactory怎么用?Java OFFactories.getFactory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.projectfloodlight.openflow.protocol.OFFactories的用法示例。


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

示例1: processOFHello

import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
@Override
void processOFHello(OFHello m) throws IOException {
	OFVersion version = m.getVersion();
	/* Choose the lower of the two supported versions. */
	if (version.compareTo(factory.getVersion()) < 0) {
		factory = OFFactories.getFactory(version);
	} /* else The controller's version is < or = the switch's, so keep original controller factory. */
	
	OFMessageDecoder decoder = pipeline.get(OFMessageDecoder.class);
	decoder.setVersion(version);
	setState(new WaitFeaturesReplyState());
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:13,代码来源:OFChannelHandler.java

示例2: setUp

import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
@Before
public void setUp() throws IOException {
    factory = OFFactories.getFactory(OFVersion.OF_13);
    
    sw1 = new OFMessageDamperMockSwitch();
    sw2 = new OFMessageDamperMockSwitch();
    
    echoRequst1 = factory.buildEchoRequest().setData(new byte[] { 1 }).build();
    echoRequst1Clone = echoRequst1.createBuilder().build();
    echoRequst2 = factory.buildEchoRequest().setData(new byte[] { 2 }).build();
    
    hello1 = factory.buildHello().setXid(1L).build();
    hello2 = factory.buildHello().setXid(2L).build();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:15,代码来源:OFMessageDamperTest.java

示例3: setUp

import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {

    // Build our test packet
    IDebugCounterService debugCounter = new DebugCounterServiceImpl();
    switchManager = createMock(IOFSwitchManager.class);
    SwitchManagerCounters counters = new SwitchManagerCounters(debugCounter);

    expect(switchManager.getCounters()).andReturn(counters).anyTimes();
    replay(switchManager);

    factory = OFFactories.getFactory(OFVersion.OF_13);

    testMessage = factory.buildRoleReply()
            .setXid(1)
            .setRole(OFControllerRole.ROLE_MASTER)
            .build();

    IOFConnectionBackend conn = EasyMock.createNiceMock(IOFConnectionBackend.class);
    capturedMessage = new Capture<OFMessage>();
    conn.write(EasyMock.capture(capturedMessage));
    expectLastCall().anyTimes();
    expect(conn.getOFFactory()).andReturn(factory).anyTimes();
    expect(conn.getAuxId()).andReturn(OFAuxId.MAIN).anyTimes();
    EasyMock.replay(conn);

    IOFConnectionBackend auxConn = EasyMock.createNiceMock(IOFConnectionBackend.class);
    expect(auxConn.getOFFactory()).andReturn(factory).anyTimes();
    expect(auxConn.getAuxId()).andReturn(OFAuxId.of(1)).anyTimes();
    EasyMock.replay(auxConn);

    sw = new OFSwitchTest(conn, switchManager);
    sw.registerConnection(auxConn);
    sw.setControllerRole(OFControllerRole.ROLE_MASTER); /* must supply role now, otherwise write() will be blocked if not master/equal/other */

    switches = new ConcurrentHashMap<DatapathId, IOFSwitchBackend>();
    switches.put(sw.getId(), sw);
    reset(switchManager);
    //expect(switchManager.getSwitch(sw.getId())).andReturn(sw).anyTimes();
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:41,代码来源:OFSwitchBaseTest.java

示例4: factory

import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
@Override
public OFFactory factory() {
    return OFFactories.getFactory(ofVersion);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:AbstractOpenFlowSwitch.java

示例5: factory

import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
@Override
public OFFactory factory() {
    // return what-ever triggers requestPending = true
    return OFFactories.getFactory(OFVersion.OF_10);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:6,代码来源:OpenflowSwitchDriverAdapter.java

示例6: factory

import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
@Override
public OFFactory factory() {
    return OFFactories.getFactory(OFVersion.OF_13);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:OpenFlowGroupProviderTest.java

示例7: setVersion

import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
public void setVersion(OFVersion version) {
	OFFactory factory = OFFactories.getFactory(version);
	this.reader = factory.getReader();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:5,代码来源:OFMessageDecoder.java

示例8: getOFFactory

import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
@Override
public OFFactory getOFFactory() {
    return OFFactories.getFactory(OFVersion.OF_13);
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:5,代码来源:NullConnection.java

示例9: setUp

import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
@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,代码行数:7,代码来源:OFSwitchTest.java

示例10: getFactory

import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
@Override
public OFFactory getFactory() {
    return OFFactories.getFactory(OFVersion.OF_13);
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:5,代码来源:OFSwitchHandshakeHandlerVer13Test.java

示例11: getFactory

import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
@Override
public OFFactory getFactory() {
    return OFFactories.getFactory(OFVersion.OF_10);
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:5,代码来源:OFSwitchHandshakeHandlerVer10Test.java

示例12: setUp

import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {

    // Build our test packet
    IDebugCounterService debugCounter = new DebugCounterServiceImpl();
    switchManager = createMock(IOFSwitchManager.class);
    SwitchManagerCounters counters = new SwitchManagerCounters(debugCounter);

    expect(switchManager.getCounters()).andReturn(counters).anyTimes();
    replay(switchManager);

    factory = OFFactories.getFactory(OFVersion.OF_13);

    testMessage = factory.buildRoleReply()
            .setXid(1)
            .setRole(OFControllerRole.ROLE_MASTER)
            .build();

    IOFConnectionBackend conn = EasyMock.createNiceMock(IOFConnectionBackend.class);
    capturedMessage = new Capture<Iterable<OFMessage>>();
    expect(conn.write(EasyMock.capture(capturedMessage))).andReturn(Collections.<OFMessage>emptyList()).atLeastOnce();
    expect(conn.getOFFactory()).andReturn(factory).anyTimes();
    expect(conn.getAuxId()).andReturn(OFAuxId.MAIN).anyTimes();
    EasyMock.replay(conn);

    IOFConnectionBackend auxConn = EasyMock.createNiceMock(IOFConnectionBackend.class);
    expect(auxConn.getOFFactory()).andReturn(factory).anyTimes();
    expect(auxConn.getAuxId()).andReturn(OFAuxId.of(1)).anyTimes();
    expect(auxConn.write(EasyMock.capture(capturedMessage))).andReturn(Collections.<OFMessage>emptyList()).once();
    EasyMock.replay(auxConn);

    sw = new OFSwitchTest(conn, switchManager);
    sw.registerConnection(auxConn);
    sw.setControllerRole(OFControllerRole.ROLE_MASTER); /* must supply role now, otherwise write() will be blocked if not master/equal/other */

    switches = new ConcurrentHashMap<DatapathId, IOFSwitchBackend>();
    switches.put(sw.getId(), sw);
    reset(switchManager);
    //expect(switchManager.getSwitch(sw.getId())).andReturn(sw).anyTimes();
    setUpPorts();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:42,代码来源:OFSwitchBaseTest.java

示例13: MockOFSwitchImpl

import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
public MockOFSwitchImpl(MockOFConnection connection) {
    super(connection, OFFactories.getFactory(OFVersion.OF_10),
          EasyMock.createMock(IOFSwitchManager.class), connection.getDatapathId());
    statsMap = new HashMap<OFStatsType, List<OFStatsReply>>();
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:6,代码来源:MockOFSwitchImpl.java

示例14: OFSwitchTest

import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
public OFSwitchTest(IOFConnectionBackend connection, IOFSwitchManager switchManager) {
    super(connection, OFFactories.getFactory(OFVersion.OF_13), switchManager, DatapathId.of(1));
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:4,代码来源:OFSwitchBaseTest.java

示例15: setVersion

import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
public void setVersion(OFVersion version) {
    OFFactory factory = OFFactories.getFactory(version);
    this.reader = factory.getReader();
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:5,代码来源:OFMessageDecoder.java


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