本文整理汇总了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());
}
示例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();
}
示例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();
}
示例4: factory
import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
@Override
public OFFactory factory() {
return OFFactories.getFactory(ofVersion);
}
示例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);
}
示例6: factory
import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
@Override
public OFFactory factory() {
return OFFactories.getFactory(OFVersion.OF_13);
}
示例7: setVersion
import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
public void setVersion(OFVersion version) {
OFFactory factory = OFFactories.getFactory(version);
this.reader = factory.getReader();
}
示例8: getOFFactory
import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
@Override
public OFFactory getOFFactory() {
return OFFactories.getFactory(OFVersion.OF_13);
}
示例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));
}
示例10: getFactory
import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
@Override
public OFFactory getFactory() {
return OFFactories.getFactory(OFVersion.OF_13);
}
示例11: getFactory
import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
@Override
public OFFactory getFactory() {
return OFFactories.getFactory(OFVersion.OF_10);
}
示例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();
}
示例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>>();
}
示例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));
}
示例15: setVersion
import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
public void setVersion(OFVersion version) {
OFFactory factory = OFFactories.getFactory(version);
this.reader = factory.getReader();
}