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;
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<PathMetric> pathMetricList = noPathCase.getNoPath().getPathProperties().getPathMetric();
LOG.info("GNPy : path is not feasible : {}", noPathType);
for (PathMetric pathMetric : pathMetricList) {
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(),
}
return Optional.ofNullable((T) bindingNodeEntry.getValue());
}
+
+ public Response getResponse() {
+ return response;
+ }
}