From d3b42421a179763e5ee9d9a0213a248291c0599a Mon Sep 17 00:00:00 2001 From: Michal Polkorab Date: Wed, 4 Dec 2013 19:58:26 +0100 Subject: [PATCH] Optional fields - reverted Signed-off-by: Michal Polkorab --- .../factories/FlowModInputMessageFactory.java | 10 ++-------- .../factories/GroupModInputMessageFactory.java | 15 +++------------ .../factories/OF10FlowModInputMessageFactory.java | 4 +--- .../protocol/impl/util/ActionsSerializer.java | 10 +++------- 4 files changed, 9 insertions(+), 30 deletions(-) diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactory.java index 8889339a..511f1622 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactory.java @@ -49,18 +49,12 @@ public class FlowModInputMessageFactory implements OFSerializer { out.writeShort(message.getHardTimeout().intValue()); out.writeShort(message.getPriority()); out.writeInt(message.getBufferId().intValue()); - if (message.getOutPort() != null) { - out.writeInt(message.getOutPort().getValue().intValue()); - } - - if (message.getOutGroup() != null) { - out.writeInt(message.getOutGroup().intValue()); - } + out.writeInt(message.getOutPort().getValue().intValue()); + out.writeInt(message.getOutGroup().intValue()); out.writeShort(createFlowModFlagsBitmask(message.getFlags())); ByteBufUtils.padBuffer(PADDING_IN_FLOW_MOD_MESSAGE, out); MatchSerializer.encodeMatch(message.getMatch(), out); InstructionsSerializer.encodeInstructions(message.getInstructions(), out); - } @Override diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GroupModInputMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GroupModInputMessageFactory.java index 26ca0d46..b60a7c29 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GroupModInputMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GroupModInputMessageFactory.java @@ -63,18 +63,9 @@ public class GroupModInputMessageFactory implements OFSerializer if (buckets != null) { for (BucketsList currentBucket : buckets) { outBuffer.writeShort(computeLengthOfBucket(currentBucket)); - - if (null != currentBucket.getWeight()) { - outBuffer.writeShort(currentBucket.getWeight().shortValue()); - } - - if (null != currentBucket.getWatchPort()) { - outBuffer.writeInt(currentBucket.getWatchPort().getValue().intValue()); - } - - if (null != currentBucket.getWatchGroup()) { - outBuffer.writeInt(currentBucket.getWatchGroup().intValue()); - } + outBuffer.writeShort(currentBucket.getWeight().shortValue()); + outBuffer.writeInt(currentBucket.getWatchPort().getValue().intValue()); + outBuffer.writeInt(currentBucket.getWatchGroup().intValue()); ByteBufUtils.padBuffer(PADDING_IN_BUCKET, outBuffer); ActionsSerializer.encodeActions(currentBucket.getActionsList(), outBuffer); } diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowModInputMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowModInputMessageFactory.java index f0858af0..7821cd49 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowModInputMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowModInputMessageFactory.java @@ -48,9 +48,7 @@ public class OF10FlowModInputMessageFactory implements OFSerializer