/*** * 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 void processOFStatisticsReply(OFChannelHandler h, OFStatsReply m) throws IOException, SwitchStateException { switch (m.getStatsType()) { case METER_FEATURES: log.debug("Received Meter Features"); OFMeterFeaturesStatsReply ofmfsr = (OFMeterFeaturesStatsReply) m; log.info("Received meter features from {} with max meters: {}", h.getSwitchInfoString(), ofmfsr.getFeatures().getMaxMeter()); h.meterFeaturesReply = ofmfsr; h.sendHandshakeDescriptionStatsRequest(); h.setState(WAIT_DESCRIPTION_STAT_REPLY); break; default: log.error("Unexpected OF Multi Part stats reply"); illegalMessageReceived(h, m); break; } }
@Override public void setMeterFeaturesReply(OFMeterFeaturesStatsReply meterFeaturesReply) { meterfeatures = meterFeaturesReply; }
/** * Sets the meter features reply for this switch. * @param meterFeaturesReply the meter features to set. */ void setMeterFeaturesReply(OFMeterFeaturesStatsReply meterFeaturesReply);
@Override public void setMeterFeaturesReply(OFMeterFeaturesStatsReply meterFeaturesReply) { }