summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/vppclassifier/ClassifySessionReader.java11
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/vppclassifier/ClassifyTableReader.java11
2 files changed, 16 insertions, 6 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/vppclassifier/ClassifySessionReader.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/vppclassifier/ClassifySessionReader.java
index daaa88c56..5d22df267 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/vppclassifier/ClassifySessionReader.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/vppclassifier/ClassifySessionReader.java
@@ -43,6 +43,7 @@ import javax.xml.bind.DatatypeConverter;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.HexString;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev161214.OpaqueIndex;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev161214.VppNode;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev161214.VppNodeName;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev161214.classify.table.base.attributes.ClassifySession;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev161214.classify.table.base.attributes.ClassifySessionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev161214.classify.table.base.attributes.ClassifySessionKey;
@@ -102,9 +103,13 @@ public class ClassifySessionReader extends FutureJVppCustomizer
if (classifySession.isPresent()) {
final ClassifySessionDetails detail = classifySession.get();
- builder.setHitNext(
- readVppNode(detail.tableId, detail.hitNextIndex, classifyTableContext, ctx.getMappingContext(), LOG)
- .get());
+ final Optional<VppNode> node =
+ readVppNode(detail.tableId, detail.hitNextIndex, classifyTableContext, ctx.getMappingContext(), LOG);
+ if (node.isPresent()) {
+ builder.setHitNext(node.get());
+ } else {
+ builder.setHitNext(new VppNode(new VppNodeName("unknown"))); // TODO(HC2VPP-9): remove this workaround
+ }
if (detail.opaqueIndex != ~0) {
// value is specified:
builder.setOpaqueIndex(readOpaqueIndex(detail.tableId, detail.opaqueIndex, ctx.getMappingContext()));
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/vppclassifier/ClassifyTableReader.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/vppclassifier/ClassifyTableReader.java
index fba5fb694..6ecfbaa45 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/vppclassifier/ClassifyTableReader.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/vppclassifier/ClassifyTableReader.java
@@ -42,6 +42,7 @@ import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.HexString;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev161214.VppClassifier;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev161214.VppClassifierStateBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev161214.VppNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev161214.VppNodeName;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev161214.vpp.classifier.state.ClassifyTable;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev161214.vpp.classifier.state.ClassifyTableBuilder;
@@ -116,9 +117,13 @@ public class ClassifyTableReader extends FutureJVppCustomizer
builder.setClassifierNode(new VppNodeName(tableBaseNode.get()));
}
- builder.setMissNext(
- readVppNode(reply.tableId, reply.missNextIndex, classifyTableContext, ctx.getMappingContext(), LOG)
- .get());
+ final Optional<VppNode> node =
+ readVppNode(reply.tableId, reply.missNextIndex, classifyTableContext, ctx.getMappingContext(), LOG);
+ if (node.isPresent()) {
+ builder.setMissNext(node.get());
+ } else {
+ builder.setMissNext(new VppNode(new VppNodeName("unknown"))); // TODO(HC2VPP-9): remove this workaround
+ }
builder.setMask(new HexString(printHexBinary(reply.mask)));
builder.setActiveSessions(UnsignedInts.toLong(reply.activeSessions));