aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/core/common
diff options
context:
space:
mode:
authorAshlee Young <ashlee@onosfw.com>2015-10-19 10:14:31 -0700
committerAshlee Young <ashlee@onosfw.com>2015-10-19 10:14:31 -0700
commite9bb60be43af477f17b30ee1f2ba205565b7fa15 (patch)
tree981fd759a44b751fc45cde774f46fda37c11c257 /framework/src/onos/core/common
parent74f3941756a1386cbc1fa99ee73fdc8376a0b6a0 (diff)
Updated onos src tree to commit id 1e60f97ae50c05b94fcb6a10520738bfb5efdfd1
Diffstat (limited to 'framework/src/onos/core/common')
-rw-r--r--framework/src/onos/core/common/src/main/java/org/onosproject/codec/impl/CriterionCodec.java8
-rw-r--r--framework/src/onos/core/common/src/main/java/org/onosproject/codec/impl/EncodeCriterionCodecHelper.java25
2 files changed, 29 insertions, 4 deletions
diff --git a/framework/src/onos/core/common/src/main/java/org/onosproject/codec/impl/CriterionCodec.java b/framework/src/onos/core/common/src/main/java/org/onosproject/codec/impl/CriterionCodec.java
index 76f621f2..975503bb 100644
--- a/framework/src/onos/core/common/src/main/java/org/onosproject/codec/impl/CriterionCodec.java
+++ b/framework/src/onos/core/common/src/main/java/org/onosproject/codec/impl/CriterionCodec.java
@@ -61,6 +61,12 @@ public final class CriterionCodec extends JsonCodec<Criterion> {
protected static final String SLOT_GRANULARITY = "slotGranularity";
protected static final String OCH_SIGNAL_ID = "ochSignalId";
protected static final String TUNNEL_ID = "tunnelId";
+ protected static final String OCH_SIGNAL_TYPE = "ochSignalType";
+ protected static final String ODU_SIGNAL_ID = "oduSignalId";
+ protected static final String TRIBUTARY_PORT_NUMBER = "tributaryPortNumber";
+ protected static final String TRIBUTARY_SLOT_LEN = "tributarySlotLen";
+ protected static final String TRIBUTARY_SLOT_BITMAP = "tributarySlotBitmap";
+ protected static final String ODU_SIGNAL_TYPE = "oduSignalType";
@Override
public ObjectNode encode(Criterion criterion, CodecContext context) {
@@ -73,6 +79,4 @@ public final class CriterionCodec extends JsonCodec<Criterion> {
DecodeCriterionCodecHelper decoder = new DecodeCriterionCodecHelper(json);
return decoder.decode();
}
-
-
}
diff --git a/framework/src/onos/core/common/src/main/java/org/onosproject/codec/impl/EncodeCriterionCodecHelper.java b/framework/src/onos/core/common/src/main/java/org/onosproject/codec/impl/EncodeCriterionCodecHelper.java
index a962c0dd..f7af736e 100644
--- a/framework/src/onos/core/common/src/main/java/org/onosproject/codec/impl/EncodeCriterionCodecHelper.java
+++ b/framework/src/onos/core/common/src/main/java/org/onosproject/codec/impl/EncodeCriterionCodecHelper.java
@@ -38,6 +38,8 @@ import org.onosproject.net.flow.criteria.MetadataCriterion;
import org.onosproject.net.flow.criteria.MplsCriterion;
import org.onosproject.net.flow.criteria.OchSignalCriterion;
import org.onosproject.net.flow.criteria.OchSignalTypeCriterion;
+import org.onosproject.net.flow.criteria.OduSignalIdCriterion;
+import org.onosproject.net.flow.criteria.OduSignalTypeCriterion;
import org.onosproject.net.flow.criteria.PortCriterion;
import org.onosproject.net.flow.criteria.SctpPortCriterion;
import org.onosproject.net.flow.criteria.TcpPortCriterion;
@@ -108,7 +110,8 @@ public final class EncodeCriterionCodecHelper {
formatMap.put(Criterion.Type.OCH_SIGTYPE, new FormatOchSigType());
formatMap.put(Criterion.Type.TUNNEL_ID, new FormatTunnelId());
formatMap.put(Criterion.Type.DUMMY, new FormatDummyType());
-
+ formatMap.put(Criterion.Type.ODU_SIGID, new FormatOduSignalId());
+ formatMap.put(Criterion.Type.ODU_SIGTYPE, new FormatOduSignalType());
// Currently unimplemented
formatMap.put(Criterion.Type.ARP_OP, new FormatUnknown());
formatMap.put(Criterion.Type.ARP_SPA, new FormatUnknown());
@@ -351,7 +354,7 @@ public final class EncodeCriterionCodecHelper {
public ObjectNode encodeCriterion(ObjectNode root, Criterion criterion) {
final OchSignalTypeCriterion ochSignalTypeCriterion =
(OchSignalTypeCriterion) criterion;
- return root.put("ochSignalType", ochSignalTypeCriterion.signalType().name());
+ return root.put(CriterionCodec.OCH_SIGNAL_TYPE, ochSignalTypeCriterion.signalType().name());
}
}
@@ -364,6 +367,24 @@ public final class EncodeCriterionCodecHelper {
}
}
+ private static class FormatOduSignalId implements CriterionTypeFormatter {
+ @Override
+ public ObjectNode encodeCriterion(ObjectNode root, Criterion criterion) {
+ final OduSignalIdCriterion oduSignalIdCriterion =
+ (OduSignalIdCriterion) criterion;
+ return root.put(CriterionCodec.ODU_SIGNAL_ID, oduSignalIdCriterion.oduSignalId().toString());
+ }
+ }
+
+ private static class FormatOduSignalType implements CriterionTypeFormatter {
+ @Override
+ public ObjectNode encodeCriterion(ObjectNode root, Criterion criterion) {
+ final OduSignalTypeCriterion oduSignalTypeCriterion =
+ (OduSignalTypeCriterion) criterion;
+ return root.put(CriterionCodec.ODU_SIGNAL_TYPE, oduSignalTypeCriterion.signalType().name());
+ }
+ }
+
private class FormatDummyType implements CriterionTypeFormatter {
@Override