public MeterStatsBuilder setMeterId(MeterId value) { if (value != null) { BigInteger _constraint = BigInteger.valueOf(value.getValue()); boolean isValidRange = false; for (Range<BigInteger> r : _meterId_range()) { if (r.contains(_constraint)) { isValidRange = true; } } if (!isValidRange) { throw new IllegalArgumentException(String.format("Invalid range: %s, expected: %s.", value, _meterId_range)); } } this._meterId = value; return this; } public static List<Range<BigInteger>> _meterId_range() {
public MeterStatsBuilder setMeterId(MeterId value) { if (value != null) { BigInteger _constraint = BigInteger.valueOf(value.getValue()); boolean isValidRange = false; for (Range<BigInteger> r : _meterId_range()) { if (r.contains(_constraint)) { isValidRange = true; } } if (!isValidRange) { throw new IllegalArgumentException(String.format("Invalid range: %s, expected: %s.", value, _meterId_range)); } } this._meterId = value; return this; } public static List<Range<BigInteger>> _meterId_range() {
public MeterBuilder setMeterId(MeterId value) { if (value != null) { BigInteger _constraint = BigInteger.valueOf(value.getValue()); boolean isValidRange = false; for (Range<BigInteger> r : _meterId_range()) { if (r.contains(_constraint)) { isValidRange = true; } } if (!isValidRange) { throw new IllegalArgumentException(String.format("Invalid range: %s, expected: %s.", value, _meterId_range)); } } this._meterId = value; return this; } public static List<Range<BigInteger>> _meterId_range() {
public MeterConfigStatsBuilder setMeterId(MeterId value) { if (value != null) { BigInteger _constraint = BigInteger.valueOf(value.getValue()); boolean isValidRange = false; for (Range<BigInteger> r : _meterId_range()) { if (r.contains(_constraint)) { isValidRange = true; } } if (!isValidRange) { throw new IllegalArgumentException(String.format("Invalid range: %s, expected: %s.", value, _meterId_range)); } } this._meterId = value; return this; } public static List<Range<BigInteger>> _meterId_range() {
public MeterConfigStatsBuilder setMeterId(MeterId value) { if (value != null) { BigInteger _constraint = BigInteger.valueOf(value.getValue()); boolean isValidRange = false; for (Range<BigInteger> r : _meterId_range()) { if (r.contains(_constraint)) { isValidRange = true; } } if (!isValidRange) { throw new IllegalArgumentException(String.format("Invalid range: %s, expected: %s.", value, _meterId_range)); } } this._meterId = value; return this; } public static List<Range<BigInteger>> _meterId_range() {
public GetMeterStatisticsInputBuilder setMeterId(MeterId value) { if (value != null) { BigInteger _constraint = BigInteger.valueOf(value.getValue()); boolean isValidRange = false; for (Range<BigInteger> r : _meterId_range()) { if (r.contains(_constraint)) { isValidRange = true; } } if (!isValidRange) { throw new IllegalArgumentException(String.format("Invalid range: %s, expected: %s.", value, _meterId_range)); } } this._meterId = value; return this; } public static List<Range<BigInteger>> _meterId_range() {
public MeterStatisticsBuilder setMeterId(MeterId value) { if (value != null) { BigInteger _constraint = BigInteger.valueOf(value.getValue()); boolean isValidRange = false; for (Range<BigInteger> r : _meterId_range()) { if (r.contains(_constraint)) { isValidRange = true; } } if (!isValidRange) { throw new IllegalArgumentException(String.format("Invalid range: %s, expected: %s.", value, _meterId_range)); } } this._meterId = value; return this; } public static List<Range<BigInteger>> _meterId_range() {
private void meterCase(MeterCase meterCase) { Meter meter = meterCase.getMeter(); this.meterId = meter.getMeterId().getValue(); }
@Override public JsonObject objectToJsonMapper(DataObject meterStats) { JsonObject flowStatisticsJsonObject = null; MeterStatistics meterStat = (MeterStatistics) meterStats; if (meterStat.getByteInCount() != null && meterStat.getDuration() != null && meterStat.getFlowCount() != null && meterStat.getMeterBandStats() != null && meterStat.getMeterId() != null && meterStat.getPacketInCount() != null) { List<BandStat> bandStats = meterStat.getMeterBandStats().getBandStat(); flowStatisticsJsonObject = factory.createObjectBuilder() .add(properties.getProperty("STAT_TYPE"), properties.getProperty("MTR_STAT")) .add(properties.getProperty("TIMESTAMP"), System.currentTimeMillis()) .add(properties.getProperty("OFSTATS"), factory.createObjectBuilder() .add(properties.getProperty("MET_ID"), meterStat.getMeterId().getValue()) .add(properties.getProperty("BYT_IN_COUNT"), meterStat.getByteInCount().getValue()) .add(properties.getProperty("FLOW_COUNT"), meterStat.getFlowCount().getValue()) .add(properties.getProperty("PACK_IN_COUNT"), meterStat.getPacketInCount().getValue()) .add(properties.getProperty("DURATION_SEC"), meterStat.getDuration().getSecond().getValue()) .add(properties.getProperty("DURATION_NANOSEC"), meterStat.getDuration().getNanosecond().getValue()) .add(properties.getProperty("BAND_STAT"), createBandStatsJsonArrayObject(bandStats))) .build(); } return flowStatisticsJsonObject; }
@Override public Optional<Instruction> process(final @Nonnull org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.MeterCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) { Meter meter = source.getMeter(); MeterCaseBuilder meterCaseBuilder = new MeterCaseBuilder(); MeterBuilder meterBuilder = new MeterBuilder(); Long meterId = meter.getMeterId().getValue(); meterBuilder.setMeterId(meterId); meterCaseBuilder.setMeter(meterBuilder.build()); InstructionBuilder instructionBuilder = new InstructionBuilder(); instructionBuilder.setInstructionChoice(meterCaseBuilder.build()); return Optional.of(instructionBuilder.build()); } }
rec.setKeyValue(""+mk.getMeterId().getValue()); } else if (ia.getKey() instanceof FlowKey) {