Set schemas to global context 77/67277/1
authorMiroslav Macko <miroslav.macko@pantheon.tech>
Thu, 18 Jan 2018 10:24:33 +0000 (11:24 +0100)
committerMiroslav Macko <miroslav.macko@pantheon.tech>
Thu, 18 Jan 2018 10:30:15 +0000 (11:30 +0100)
- onGlobalContextUpdated schemas need to be set to the global context

Change-Id: I86c898d8b70c0f1a7fcc61be1cb0b542c8f05096
Signed-off-by: Miroslav Macko <miroslav.macko@pantheon.tech>
restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/handlers/SchemaContextHandler.java

index 4d35fd92c942a30f8c7f86d6b6f5e8abd32c17d8..62857ff8f57ce71d36c313fe7d5fd9065d72432e 100644 (file)
@@ -12,6 +12,7 @@ import java.util.Collection;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
 import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
 import org.opendaylight.restconf.RestConnectorProvider;
 import org.opendaylight.restconf.Rfc8040.IetfYangLibrary;
@@ -54,6 +55,7 @@ public class SchemaContextHandler implements SchemaContextListenerHandler {
     @Override
     public void onGlobalContextUpdated(final SchemaContext context) {
         Preconditions.checkNotNull(context);
+        ControllerContext.getInstance().setSchemas(context);
         this.context = null;
         this.context = context;
         this.moduleSetId++;