/*** * Serializes Meter Feature Reply * @author Naveen * @param meterFeaturesReplies * @param jGen * @throws IOException * @throws JsonProcessingException */ public static void serializeMeterFeaturesReply(List<OFMeterFeaturesStatsReply> meterFeaturesReplies, JsonGenerator jGen) throws IOException, JsonProcessingException{ OFMeterFeaturesStatsReply meterFeaturesReply = meterFeaturesReplies.get(0); jGen.writeStringField("version", meterFeaturesReply.getVersion().toString()); //return the enum name OFMeterFeatures meterFeatures = meterFeaturesReply.getFeatures(); jGen.writeFieldName("meterFeatures"); jGen.writeStartObject(); jGen.writeNumberField("maxGroupsAll",meterFeatures.getMaxMeter()); jGen.writeNumberField("maxGroupsSelect",meterFeatures.getBandTypes()); jGen.writeNumberField("capabilities",meterFeatures.getCapabilities()); jGen.writeNumberField("maxGroupsIndirect",meterFeatures.getMaxBands()); jGen.writeNumberField("maxGroupsFf",meterFeatures.getMaxColor()); jGen.writeEndObject();//end of group Feature }
@Override public OFMeterFeatures getMeterFeatures() { if (this.meterfeatures != null) { return this.meterfeatures.getFeatures(); } else { return null; } }
private MeterFeatures buildMeterFeatures(Dpid dpid, OFMeterFeatures mf) { if (mf != null) { return new MeterFeaturesBuilder(mf, deviceId(uri(dpid))) .build(); } else { // This will usually happen for OpenFlow devices prior to 1.3 return MeterFeaturesBuilder.noMeterFeatures(deviceId(uri(dpid))); } }
@Override public OFMeterFeatures getMeterFeatures() { return null; }
public MeterFeaturesBuilder(OFMeterFeatures features, DeviceId deviceId) { this.ofMeterFeatures = checkNotNull(features); this.deviceId = deviceId; }
private void pushMeterFeatures(Dpid dpid, OFMeterFeatures meterFeatures) { providerService.pushMeterFeatures(deviceId(uri(dpid)), buildMeterFeatures(dpid, meterFeatures)); }
/** * Fetches the meter features of this switch. * @return unmodifiable meter features */ OFMeterFeatures getMeterFeatures();