Code Review
/
openflowplugin.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix meter-id overlap
[openflowplugin.git]
/
openflowplugin-impl
/
src
/
main
/
java
/
org
/
opendaylight
/
openflowplugin
/
impl
/
protocol
/
serialization
/
multipart
/
MultipartRequestMeterStatsSerializer.java
diff --git
a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMeterStatsSerializer.java
b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMeterStatsSerializer.java
index e9dca48dcffab9879e2a2238a5580fdb494ac429..40453b39807a388a5d7c3ac8e93a6d7d775925aa 100644
(file)
--- a/
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMeterStatsSerializer.java
+++ b/
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMeterStatsSerializer.java
@@
-14,20
+14,15
@@
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestMeterStats;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestMeterStats;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody;
-public class MultipartRequestMeterStatsSerializer implements OFSerializer<MultipartRequest
Body
> {
+public class MultipartRequestMeterStatsSerializer implements OFSerializer<MultipartRequest
MeterStats
> {
private static final byte PADDING_IN_MULTIPART_REQUEST_METER_BODY = 4;
@Override
private static final byte PADDING_IN_MULTIPART_REQUEST_METER_BODY = 4;
@Override
- public void serialize(final MultipartRequestBody multipartRequestBody, final ByteBuf byteBuf) {
- final MultipartRequestMeterStats multipartRequestMeterStats = MultipartRequestMeterStats
- .class
- .cast(multipartRequestBody);
-
+ public void serialize(final MultipartRequestMeterStats multipartRequestMeterStats, final ByteBuf byteBuf) {
byteBuf.writeInt(MoreObjects
byteBuf.writeInt(MoreObjects
- .firstNonNull(multipartRequestMeterStats.getMeterId(), new MeterId(OFConstants.OFPM_ALL))
+ .firstNonNull(multipartRequestMeterStats.get
Stat
MeterId(), new MeterId(OFConstants.OFPM_ALL))
.getValue().intValue());
byteBuf.writeZero(PADDING_IN_MULTIPART_REQUEST_METER_BODY);
}
.getValue().intValue());
byteBuf.writeZero(PADDING_IN_MULTIPART_REQUEST_METER_BODY);
}