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


Java OFPortStatsEntry.getVersion方法代码示例

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


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

示例1: serializePortReply

import org.projectfloodlight.openflow.protocol.OFPortStatsEntry; //导入方法依赖的package包/类
public static void serializePortReply(List<OFPortStatsReply> portReplies, JsonGenerator jGen) throws IOException, JsonProcessingException{		
	jGen.writeFieldName("port_reply");
	jGen.writeStartArray();
	for (OFPortStatsReply portReply : portReplies) {
		jGen.writeStartObject();
		jGen.writeStringField("version", portReply.getVersion().toString()); //return the enum name
		jGen.writeFieldName("port");
		jGen.writeStartArray();
		for(OFPortStatsEntry entry : portReply.getEntries()) {
			jGen.writeStartObject();
			jGen.writeStringField("portNumber",entry.getPortNo().toString());
			jGen.writeNumberField("receivePackets", entry.getRxPackets().getValue());
			jGen.writeNumberField("transmitPackets", entry.getTxPackets().getValue());
			jGen.writeNumberField("receiveBytes", entry.getRxBytes().getValue());
			jGen.writeNumberField("transmitBytes", entry.getTxBytes().getValue());
			jGen.writeNumberField("receiveDropped", entry.getRxDropped().getValue());
			jGen.writeNumberField("transmitDropped", entry.getTxDropped().getValue());
			jGen.writeNumberField("receiveErrors", entry.getRxErrors().getValue());
			jGen.writeNumberField("transmitErrors", entry.getTxErrors().getValue());
			jGen.writeNumberField("receiveFrameErrors", entry.getRxFrameErr().getValue());
			jGen.writeNumberField("receiveOverrunErrors", entry.getRxOverErr().getValue());
			jGen.writeNumberField("receiveCRCErrors", entry.getRxCrcErr().getValue());
			jGen.writeNumberField("collisions", entry.getCollisions().getValue());
			if (OFVersion.OF_13 == entry.getVersion()) {
				jGen.writeNumberField("durationSec", entry.getDurationSec());
				jGen.writeNumberField("durationNsec", entry.getDurationNsec());
			}
			jGen.writeEndObject();
		}
		jGen.writeEndArray();
		jGen.writeEndObject();
	}
	jGen.writeEndArray();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:35,代码来源:StatsReplySerializer.java

示例2: serializePortReply

import org.projectfloodlight.openflow.protocol.OFPortStatsEntry; //导入方法依赖的package包/类
public static void serializePortReply(List<OFPortStatsReply> portReplies, JsonGenerator jGen) throws IOException, JsonProcessingException{
	OFPortStatsReply portReply = portReplies.get(0); // we will get only one PortReply and it will contains many OFPortStatsEntry ?
	jGen.writeStringField("version", portReply.getVersion().toString()); //return the enum name
	jGen.writeFieldName("port");
	jGen.writeStartArray();
	for(OFPortStatsEntry entry : portReply.getEntries()) {
		jGen.writeStartObject();
		jGen.writeStringField("portNumber",entry.getPortNo().toString());
		jGen.writeNumberField("receivePackets", entry.getRxPackets().getValue());
		jGen.writeNumberField("transmitPackets", entry.getTxPackets().getValue());
		jGen.writeNumberField("receiveBytes", entry.getRxBytes().getValue());
		jGen.writeNumberField("transmitBytes", entry.getTxBytes().getValue());
		jGen.writeNumberField("receiveDropped", entry.getRxDropped().getValue());
		jGen.writeNumberField("transmitDropped", entry.getTxDropped().getValue());
		jGen.writeNumberField("receiveErrors", entry.getRxErrors().getValue());
		jGen.writeNumberField("transmitErrors", entry.getTxErrors().getValue());
		jGen.writeNumberField("receiveFrameErrors", entry.getRxFrameErr().getValue());
		jGen.writeNumberField("receiveOverrunErrors", entry.getRxOverErr().getValue());
		jGen.writeNumberField("receiveCRCErrors", entry.getRxCrcErr().getValue());
		jGen.writeNumberField("collisions", entry.getCollisions().getValue());
		if (OFVersion.OF_13 == entry.getVersion()) {
			jGen.writeNumberField("durationSec", entry.getDurationSec());
			jGen.writeNumberField("durationNsec", entry.getDurationNsec());
		}
		jGen.writeEndObject();
	}
	jGen.writeEndArray();
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:29,代码来源:StatsReplySerializer.java

示例3: serializePortReply

import org.projectfloodlight.openflow.protocol.OFPortStatsEntry; //导入方法依赖的package包/类
public static void serializePortReply(List<OFPortStatsReply> portReplies, JsonGenerator jGen) throws IOException, JsonProcessingException{
	jGen.writeFieldName("port_reply");
	jGen.writeStartArray();
	for (OFPortStatsReply portReply : portReplies) {
		jGen.writeStartObject();
		jGen.writeStringField("version", portReply.getVersion().toString()); //return the enum name
		jGen.writeFieldName("port");
		jGen.writeStartArray();
		for(OFPortStatsEntry entry : portReply.getEntries()) {
			jGen.writeStartObject();
			jGen.writeStringField("portNumber",entry.getPortNo().toString());
			jGen.writeNumberField("receivePackets", entry.getRxPackets().getValue());
			jGen.writeNumberField("transmitPackets", entry.getTxPackets().getValue());
			jGen.writeNumberField("receiveBytes", entry.getRxBytes().getValue());
			jGen.writeNumberField("transmitBytes", entry.getTxBytes().getValue());
			jGen.writeNumberField("receiveDropped", entry.getRxDropped().getValue());
			jGen.writeNumberField("transmitDropped", entry.getTxDropped().getValue());
			jGen.writeNumberField("receiveErrors", entry.getRxErrors().getValue());
			jGen.writeNumberField("transmitErrors", entry.getTxErrors().getValue());
			jGen.writeNumberField("receiveFrameErrors", entry.getRxFrameErr().getValue());
			jGen.writeNumberField("receiveOverrunErrors", entry.getRxOverErr().getValue());
			jGen.writeNumberField("receiveCRCErrors", entry.getRxCrcErr().getValue());
			jGen.writeNumberField("collisions", entry.getCollisions().getValue());
			if (OFVersion.OF_13 == entry.getVersion()) {
				jGen.writeNumberField("durationSec", entry.getDurationSec());
				jGen.writeNumberField("durationNsec", entry.getDurationNsec());
			}
			jGen.writeEndObject();
		}
		jGen.writeEndArray();
		jGen.writeEndObject();
	}
	jGen.writeEndArray();
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:35,代码来源:StatsReplySerializer.java


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