X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=pce%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fpce%2Fgnpy%2FGnpyResult.java;h=a039bfe68721d7fb2e3ff15c4a42cf95bfecf44b;hb=c5fc25e73679127ad29a5196410f24b50dcc8f7d;hp=2767005e222a59e9a58afa93560dfabb152b264c;hpb=8cf49e6eece556c6906baf38e357a884f606c932;p=transportpce.git diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyResult.java b/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyResult.java index 2767005e2..a039bfe68 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyResult.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyResult.java @@ -60,6 +60,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodes; import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter; +import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier; import org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter; import org.opendaylight.yangtools.yang.data.impl.schema.NormalizedNodeResult; @@ -149,8 +150,9 @@ public class GnpyResult { NoPathCase noPathCase = (NoPathCase) response.getResponseType(); String noPathType = noPathCase.getNoPath().getNoPath(); LOG.info("GNPy: No path - {}",noPathType); - if (((noPathType == "NO_FEASIBLE_BAUDRATE_WITH_SPACING") && (noPathType == "NO_FEASIBLE_MODE")) - && ((noPathType == "MODE_NOT_FEASIBLE") && (noPathType == "NO_SPECTRUM"))) { + if (((noPathType.equals("NO_FEASIBLE_BAUDRATE_WITH_SPACING")) + && (noPathType.equals("NO_FEASIBLE_MODE"))) && ((noPathType.equals("MODE_NOT_FEASIBLE")) + && (noPathType.equals("NO_SPECTRUM")))) { List pathMetricList = noPathCase.getNoPath().getPathProperties().getPathMetric(); LOG.info("GNPy : path is not feasible : {}", noPathType); for (PathMetric pathMetric : pathMetricList) { @@ -230,7 +232,9 @@ public class GnpyResult { NormalizedNodeResult result = new NormalizedNodeResult(); SchemaContext schemaContext = getSchemaContext(objectClass); try (NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(result); - JsonParserStream jsonParser = JsonParserStream.create(streamWriter, schemaContext, schemaContext);) { + JsonParserStream jsonParser = JsonParserStream.create(streamWriter, + JSONCodecFactorySupplier.DRAFT_LHOTKA_NETMOD_YANG_JSON_02.getShared(schemaContext), + schemaContext);) { LOG.debug("GNPy: the path to the reader {}", reader.getPath()); LOG.debug("GNPy: the reader {}", reader.toString()); LOG.debug("GNPy: the jsonParser class {} // jsonParser to string {}", jsonParser.getClass(), @@ -295,4 +299,8 @@ public class GnpyResult { } return Optional.ofNullable((T) bindingNodeEntry.getValue()); } + + public Response getResponse() { + return response; + } }