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


Java OFTableFeaturesStatsReply类代码示例

本文整理汇总了Java中org.projectfloodlight.openflow.protocol.OFTableFeaturesStatsReply的典型用法代码示例。如果您正苦于以下问题:Java OFTableFeaturesStatsReply类的具体用法?Java OFTableFeaturesStatsReply怎么用?Java OFTableFeaturesStatsReply使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: processOFTableFeatures

import org.projectfloodlight.openflow.protocol.OFTableFeaturesStatsReply; //导入依赖的package包/类
@Override
public void processOFTableFeatures(List<OFTableFeaturesStatsReply> replies) {
	/*
	 * Parse out all the individual replies for each table.
	 */
	for (OFTableFeaturesStatsReply reply : replies) {
		/*
		 * Add or update the features for a particular table.
		 */
		List<OFTableFeatures> tfs = reply.getEntries();
		for (OFTableFeatures tf : tfs) {
			tableFeaturesByTableId.put(tf.getTableId(), TableFeatures.of(tf));
			tables.add(tf.getTableId());
			log.trace("Received TableFeatures for TableId {}, TableName {}", tf.getTableId().toString(), tf.getName());
		}
	}
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:18,代码来源:OFSwitch.java

示例2: processOFStatsReply

import org.projectfloodlight.openflow.protocol.OFTableFeaturesStatsReply; //导入依赖的package包/类
@Override
/**
 * Accumulate a list of the OFTableFeaturesStatsReply's until there 
 * are no more remaining. Then, pass the list to the switch for 
 * parsing and configuration.
 * 
 * The assumption is that the OFMessage dispatcher will call this each
 * time, which it does. We don't loop and receive here.
 * 
 * @param m, The potential OFTableFeaturesStatsReply message we want to include
 */
void processOFStatsReply(OFStatsReply m) {
	if (m.getStatsType() == OFStatsType.TABLE_FEATURES) {
		replies.add((OFTableFeaturesStatsReply) m);
		if (!((OFTableFeaturesStatsReply)m).getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
			handleTableFeaturesMessage(replies, false);
			nextState();
		} 
	} else {
		/* should only receive TABLE_FEATURES here */
		log.error("Received {} message but expected TABLE_FEATURES.", m.getStatsType().toString());
	}

}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:25,代码来源:OFSwitchHandshakeHandler.java

示例3: handleTableFeatures

import org.projectfloodlight.openflow.protocol.OFTableFeaturesStatsReply; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void handleTableFeatures(boolean subHandShakeComplete) throws Exception {
   	// build the table features stats reply
   	OFTableFeaturesStatsReply tf = createTableFeaturesStatsReply();
   	
   	reset(sw);
   	sw.startDriverHandshake();
       expectLastCall().once();
       expect(sw.isDriverHandshakeComplete()).andReturn(subHandShakeComplete).once();
   	sw.processOFTableFeatures(anyObject(List.class));
   	expectLastCall().once();
   	expect(sw.getOFFactory()).andReturn(factory).anyTimes();
   	replay(sw);
   	
   	switchHandler.processOFMessage(tf);
   }
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:17,代码来源:OFSwitchHandshakeHandlerVer13Test.java

示例4: createTableFeaturesStatsReply

import org.projectfloodlight.openflow.protocol.OFTableFeaturesStatsReply; //导入依赖的package包/类
protected OFTableFeaturesStatsReply createTableFeaturesStatsReply() {
	OFTableFeaturesStatsReply statsReply = factory.buildTableFeaturesStatsReply()
			.setEntries(Collections.singletonList(factory.buildTableFeatures()
					.setConfig(0)
					.setMaxEntries(100)
					.setMetadataMatch(U64.NO_MASK)
					.setMetadataWrite(U64.NO_MASK)
					.setName("MyTable")
					.setTableId(TableId.of(1))
					.setProperties(Collections.singletonList((OFTableFeatureProp)factory.buildTableFeaturePropMatch()
							.setOxmIds(Collections.singletonList(U32.of(100)))
							.build())
							).build()
					)

					).build();
	return statsReply;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:19,代码来源:OFSwitchHandlerTestBase.java

示例5: processOFStatsReply

import org.projectfloodlight.openflow.protocol.OFTableFeaturesStatsReply; //导入依赖的package包/类
@Override
/**
 * Accumulate a list of the OFTableFeaturesStatsReply's until there
 * are no more remaining. Then, pass the list to the switch for
 * parsing and configuration.
 *
 * The assumption is that the OFMessage dispatcher will call this each
 * time, which it does. We don't loop and receive here.
 *
 * @param m, The potential OFTableFeaturesStatsReply message we want to include
 */
void processOFStatsReply(OFStatsReply m) {
	if (m.getStatsType() == OFStatsType.TABLE_FEATURES) {
		replies.add((OFTableFeaturesStatsReply) m);
		if (!((OFTableFeaturesStatsReply)m).getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
			handleTableFeaturesMessage(replies, false);
			nextState();
		}
	} else {
		/* should only receive TABLE_FEATURES here */
		log.error("Received {} message but expected TABLE_FEATURES.", m.getStatsType().toString());
	}

}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:25,代码来源:OFSwitchHandshakeHandler.java

示例6: processOFTableFeatures

import org.projectfloodlight.openflow.protocol.OFTableFeaturesStatsReply; //导入依赖的package包/类
@Override
public void processOFTableFeatures(List<OFTableFeaturesStatsReply> replies) {
	/*
	 * Parse out all the individual replies for each table.
	 */
	for (OFTableFeaturesStatsReply reply : replies) {
		/*
		 * Add or update the features for a particular table.
		 */
		List<OFTableFeatures> tfs = reply.getEntries();
		for (OFTableFeatures tf : tfs) {
			tableFeaturesByTableId.put(tf.getTableId(), TableFeatures.of(tf));
			log.trace("Received TableFeatures for TableId {}, TableName {}", tf.getTableId().toString(), tf.getName());
		}
	}
}
 
开发者ID:rizard,项目名称:fast-failover-demo,代码行数:17,代码来源:OFSwitch.java

示例7: handleTableFeatures

import org.projectfloodlight.openflow.protocol.OFTableFeaturesStatsReply; //导入依赖的package包/类
public void handleTableFeatures(boolean subHandShakeComplete) throws Exception {
	// build the table features stats reply
	OFTableFeaturesStatsReply tf = createTableFeaturesStatsReply();
	
	reset(sw);
	sw.startDriverHandshake();
    expectLastCall().once();
    expect(sw.isDriverHandshakeComplete()).andReturn(subHandShakeComplete).once();
	sw.processOFTableFeatures(anyObject(List.class));
	expectLastCall().once();
	expect(sw.getOFFactory()).andReturn(factory).anyTimes();
	replay(sw);
	
	switchHandler.processOFMessage(tf);
}
 
开发者ID:rizard,项目名称:fast-failover-demo,代码行数:16,代码来源:OFSwitchHandshakeHandlerVer13Test.java

示例8: addInternalStatsReplyListener

import org.projectfloodlight.openflow.protocol.OFTableFeaturesStatsReply; //导入依赖的package包/类
/**
 * Append a listener to receive an OFStatsReply and update the 
 * internal OFSwitch data structures.
 * 
 * This presently taps into the following stats request 
 * messages to listen for the corresponding reply:
 * -- OFTableFeaturesStatsRequest
 * 
 * Extend this to tap into and update other OFStatsType messages.
 * 
 * @param future
 * @param request
 * @return
 */
private <REPLY extends OFStatsReply> ListenableFuture<List<REPLY>> addInternalStatsReplyListener(final ListenableFuture<List<REPLY>> future, OFStatsRequest<REPLY> request) {
	switch (request.getStatsType()) {
	case TABLE_FEATURES:
		/* case YOUR_CASE_HERE */
		future.addListener(new Runnable() {
			/*
			 * We know the reply will be a list of OFStatsReply.
			 */
			@SuppressWarnings("unchecked")
			@Override
			public void run() {
				/*
				 * The OFConnection handles REPLY_MORE for us in the case there
				 * are multiple OFStatsReply messages with the same XID.
				 */
				try {
					List<? extends OFStatsReply> replies = future.get();
					if (!replies.isEmpty()) {
						/*
						 * By checking only the 0th element, we assume all others are the same type.
						 * TODO If not, what then?
						 */
						switch (replies.get(0).getStatsType()) {
						case TABLE_FEATURES:
							processOFTableFeatures((List<OFTableFeaturesStatsReply>) future.get());
							break;
							/* case YOUR_CASE_HERE */
						default:
							throw new Exception("Received an invalid OFStatsReply of " 
									+ replies.get(0).getStatsType().toString() + ". Expected TABLE_FEATURES.");
						}
					}
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		}, MoreExecutors.sameThreadExecutor()); /* No need for another thread. */
	default:
		break;
	}
	return future; /* either unmodified or with an additional listener */
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:57,代码来源:OFSwitch.java

示例9: WaitTableFeaturesReplyState

import org.projectfloodlight.openflow.protocol.OFTableFeaturesStatsReply; //导入依赖的package包/类
WaitTableFeaturesReplyState() {
	super(false);
	replies = new ArrayList<OFTableFeaturesStatsReply>();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:5,代码来源:OFSwitchHandshakeHandler.java


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