本文整理汇总了Java中org.projectfloodlight.openflow.protocol.meterband.OFMeterBand.getType方法的典型用法代码示例。如果您正苦于以下问题:Java OFMeterBand.getType方法的具体用法?Java OFMeterBand.getType怎么用?Java OFMeterBand.getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.projectfloodlight.openflow.protocol.meterband.OFMeterBand
的用法示例。
在下文中一共展示了OFMeterBand.getType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: serializeMeterConfigReply
import org.projectfloodlight.openflow.protocol.meterband.OFMeterBand; //导入方法依赖的package包/类
/***
* Serializes Meter Config Reply
* @author Naveen
* @param meterConfigReplies
* @param jGen
* @throws IOException
* @throws JsonProcessingException
*/
public static void serializeMeterConfigReply(List<OFMeterConfigStatsReply> meterConfigReplies, JsonGenerator jGen) throws IOException, JsonProcessingException{
OFMeterConfigStatsReply meterConfigReply = meterConfigReplies.get(0);
jGen.writeStringField("version", meterConfigReply.getVersion().toString()); //return the enum name
jGen.writeFieldName("meterConfig");
jGen.writeStartArray();
for (OFMeterConfig config : meterConfigReply.getEntries()) {
jGen.writeStartObject();
jGen.writeNumberField("meterId", config.getMeterId());
jGen.writeNumberField("flags", config.getFlags());
jGen.writeFieldName("meterBands");
jGen.writeStartArray();
for (OFMeterBand band : config.getEntries()) {
jGen.writeStartObject();
short type = (short)band.getType();
jGen.writeNumberField("bandType",type);
switch (type) {
case OFMeterBandTypeSerializerVer13.DROP_VAL:
OFMeterBandDrop bandDrop = (OFMeterBandDrop) band;
jGen.writeNumberField("rate", bandDrop.getRate());
jGen.writeNumberField("burstSize", bandDrop.getBurstSize());
break;
case OFMeterBandTypeSerializerVer13.DSCP_REMARK_VAL:
OFMeterBandDscpRemark bandDscp = (OFMeterBandDscpRemark) band;
jGen.writeNumberField("rate", bandDscp.getRate());
jGen.writeNumberField("burstSize", bandDscp.getBurstSize());
jGen.writeNumberField("precLevel", bandDscp.getPrecLevel());
break;
case OFMeterBandTypeSerializerVer13.EXPERIMENTER_VAL:
OFMeterBandExperimenter bandExp = (OFMeterBandExperimenter) band;
jGen.writeNumberField("rate", bandExp.getRate());
jGen.writeNumberField("burstSize", bandExp.getBurstSize());
jGen.writeNumberField("experimenter", bandExp.getExperimenter());
break;
default:
// shouldn't ever get here
break;
}//end of Switch Case
jGen.writeEndObject();
}//end of for loop
jGen.writeEndArray();
jGen.writeEndObject();
}//end of for loop
jGen.writeEndArray();
}
示例2: serializeMeterConfigReply
import org.projectfloodlight.openflow.protocol.meterband.OFMeterBand; //导入方法依赖的package包/类
/***
* Serializes Meter Config Reply
* @author Naveen
* @param meterConfigReplies
* @param jGen
* @throws IOException
* @throws JsonProcessingException
*/
public static void serializeMeterConfigReply(List<OFMeterConfigStatsReply> meterConfigReplies, JsonGenerator jGen) throws IOException, JsonProcessingException{
OFMeterConfigStatsReply meterConfigReply = meterConfigReplies.get(0);
jGen.writeStringField("version", meterConfigReply.getVersion().toString()); //return the enum name
jGen.writeFieldName("meterConfig");
jGen.writeStartArray();
for(OFMeterBand band : meterConfigReply.getEntries()) {
jGen.writeStartObject();
short type = (short)band.getType();
jGen.writeNumberField("bandType",type);
switch (type) {
case OFMeterBandTypeSerializerVer13.DROP_VAL:
OFMeterBandDrop bandDrop = (OFMeterBandDrop) band;
jGen.writeNumberField("rate", bandDrop.getRate());
jGen.writeNumberField("burstSize", bandDrop.getBurstSize());
break;
case OFMeterBandTypeSerializerVer13.DSCP_REMARK_VAL:
OFMeterBandDscpRemark bandDscp = (OFMeterBandDscpRemark) band;
jGen.writeNumberField("rate", bandDscp.getRate());
jGen.writeNumberField("burstSize", bandDscp.getBurstSize());
jGen.writeNumberField("precLevel", bandDscp.getPrecLevel());
break;
case OFMeterBandTypeSerializerVer13.EXPERIMENTER_VAL:
OFMeterBandExperimenter bandExp = (OFMeterBandExperimenter) band;
jGen.writeNumberField("rate", bandExp.getRate());
jGen.writeNumberField("burstSize", bandExp.getBurstSize());
jGen.writeNumberField("experimenter", bandExp.getExperimenter());
break;
default:
// shouldn't ever get here
break;
}//end of Switch Case
jGen.writeEndObject();
}//end of for loop
jGen.writeEndArray();
}
示例3: serializeMeterConfigReply
import org.projectfloodlight.openflow.protocol.meterband.OFMeterBand; //导入方法依赖的package包/类
/***
* Serializes Meter Config Reply
* @author Naveen
* @param meterConfigReplies
* @param jGen
* @throws IOException
* @throws JsonProcessingException
*/
public static void serializeMeterConfigReply(List<OFMeterConfigStatsReply> meterConfigReplies, JsonGenerator jGen) throws IOException, JsonProcessingException{
OFMeterConfigStatsReply meterConfigReply = meterConfigReplies.get(0);
jGen.writeStringField("version", meterConfigReply.getVersion().toString()); //return the enum name
jGen.writeFieldName("meterConfig");
jGen.writeStartArray();
for (OFMeterConfig config : meterConfigReply.getEntries()) {
jGen.writeStartObject();
jGen.writeNumberField("meterId", config.getMeterId());
jGen.writeNumberField("flags", config.getFlags());
jGen.writeFieldName("meterBands");
jGen.writeStartArray();
for (OFMeterBand band : config.getEntries()) {
jGen.writeStartObject();
short type = (short)band.getType();
jGen.writeNumberField("bandType",type);
switch (type) {
case OFMeterBandTypeSerializerVer13.DROP_VAL:
OFMeterBandDrop bandDrop = (OFMeterBandDrop) band;
jGen.writeNumberField("rate", bandDrop.getRate());
jGen.writeNumberField("burstSize", bandDrop.getBurstSize());
break;
case OFMeterBandTypeSerializerVer13.DSCP_REMARK_VAL:
OFMeterBandDscpRemark bandDscp = (OFMeterBandDscpRemark) band;
jGen.writeNumberField("rate", bandDscp.getRate());
jGen.writeNumberField("burstSize", bandDscp.getBurstSize());
jGen.writeNumberField("precLevel", bandDscp.getPrecLevel());
break;
case OFMeterBandTypeSerializerVer13.EXPERIMENTER_VAL:
OFMeterBandExperimenter bandExp = (OFMeterBandExperimenter) band;
jGen.writeNumberField("rate", bandExp.getRate());
jGen.writeNumberField("burstSize", bandExp.getBurstSize());
jGen.writeNumberField("experimenter", bandExp.getExperimenter());
break;
default:
// shouldn't ever get here
break;
}//end of Switch Case
jGen.writeEndObject();
}//end of for loop
jGen.writeEndArray();
jGen.writeEndObject();
}//end of for loop
jGen.writeEndArray();
}