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


Java OFStatisticsRequest.getStatisticType方法代码示例

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


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

示例1: serializeMessage

import org.openflow.protocol.OFStatisticsRequest; //导入方法依赖的package包/类
/**
 * Serializes an Openflow Statistics Request message for Pyretic
 * @param switchID switch id
 * @param statsRequest object to be serialized
 * @return
 */
public static String serializeMessage(long switchID, OFStatisticsRequest statsRequest) {
	String retString="";
	switch (statsRequest.getStatisticType()) {
		case DESC: 
			break;
		case FLOW:
			retString = "[\"flow_stats_request\", " + switchID + "]" + "\n";
			break;
		case AGGREGATE:
		case PORT:
			retString = "[\"port_stats_request\", " + switchID + "]" + "\n"; //maybe portId is also required
		case TABLE:
		case VENDOR:
		case QUEUE:
	}
	return retString;
}
 
开发者ID:fp7-netide,项目名称:Engine,代码行数:24,代码来源:MessageSerializer.java

示例2: handleStatsRequest

import org.openflow.protocol.OFStatisticsRequest; //导入方法依赖的package包/类
private void handleStatsRequest(OFMessage msg){
	OFStatisticsRequest request = (OFStatisticsRequest) msg;
	switch(request.getStatisticType()){
	case FLOW:
		handleFlowStatsRequest(msg);
		return;
	case DESC:
		handleDescrStatsRequest(msg);
		return;
	case VENDOR:
		handleVendorStatsRequest(msg);
		return;
	case AGGREGATE:
		handleAggregateStatsRequest(msg);
		return;
	case TABLE:
		handleTableStatsRequest(msg);
		return;
	case PORT:
		handlePortStatsRequest(msg);
		return;
	case QUEUE:
		handleQueueStatsRequest(msg);
		return;
	}
	
}
 
开发者ID:GlobalNOC,项目名称:FlowSpaceFirewall,代码行数:28,代码来源:Proxy.java

示例3: getStatistics

import org.openflow.protocol.OFStatisticsRequest; //导入方法依赖的package包/类
@Override
public synchronized Future<List<OFStatistics>> getStatistics(OFStatisticsRequest request) throws IOException {
	if (request == null) {
		throw new UnsupportedOperationException("Not supported.");
	}
	if (request.getStatisticType() == null
			|| !request.getStatisticType().equals(OFStatisticsType.PORT)) {
		throw new UnsupportedOperationException("Not supported.");
	}
	if (request.getStatistics() == null
			|| request.getStatistics().size() != 1) {
		throw new UnsupportedOperationException("Not supported.");
	}
	if (!request.getStatistics().get(0).getClass()
			.equals(OFPortStatisticsRequest.class)) {
		throw new UnsupportedOperationException("Not supported.");
	}
	final short port = ((OFPortStatisticsRequest) request.getStatistics()
			.get(0)).getPortNumber();
	return new Future<List<OFStatistics>>() {

		@Override
		public boolean cancel(boolean mayInterruptIfRunning) {
			return false;
		}

		@Override
		public boolean isCancelled() {
			return false;
		}

		@Override
		public boolean isDone() {
			return true;
		}

		@Override
		public List<OFStatistics> get() throws InterruptedException, ExecutionException {
			OFPortStatisticsReply reply = new OFPortStatisticsReply();
			reply.setTransmitBytes(traffic.get(port));
			List<OFStatistics> result = new ArrayList<>();
			result.add(reply);
			return result;
		}

		@Override
		public List<OFStatistics> get(long timeout, TimeUnit unit)
				throws InterruptedException, ExecutionException,
				TimeoutException {
			return get();
		}
	};
}
 
开发者ID:smartenit-eu,项目名称:smartenit,代码行数:54,代码来源:FakeStatisticsProviderOFSwitch.java


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