本文整理汇总了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();
}
示例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();
}
示例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();
}