Merge "Migrate XML output to yang-data-codec-xml"
[netconf.git] / restconf / sal-rest-connector / src / main / java / org / opendaylight / restconf / base / services / impl / RestconfOperationsServiceImpl.java
index 612b03bdec1b96b477ca68f00a936fc78797a305..5053db01ad90d60707d655ecf2d75d7a42d39331 100644 (file)
@@ -35,12 +35,12 @@ import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveSchemaContext;
+import org.opendaylight.yangtools.yang.model.util.SimpleSchemaContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Implementation of {@link RestconfOperationsService}
+ * Implementation of {@link RestconfOperationsService}.
  *
  */
 public class RestconfOperationsServiceImpl implements RestconfOperationsService {
@@ -51,12 +51,12 @@ public class RestconfOperationsServiceImpl implements RestconfOperationsService
     private final DOMMountPointServiceHandler domMountPointServiceHandler;
 
     /**
-     * Set {@link SchemaContextHandler} for getting actual {@link SchemaContext}
+     * Set {@link SchemaContextHandler} for getting actual {@link SchemaContext}.
      *
      * @param schemaContextHandler
-     *            - handling schema context
+     *             handling schema context
      * @param domMountPointServiceHandler
-     *            - handling dom mount point service
+     *             handling dom mount point service
      */
     public RestconfOperationsServiceImpl(final SchemaContextHandler schemaContextHandler,
             final DOMMountPointServiceHandler domMountPointServiceHandler) {
@@ -80,7 +80,6 @@ public class RestconfOperationsServiceImpl implements RestconfOperationsService
                     ref.get(), Optional.of(this.domMountPointServiceHandler.get()));
             mountPoint = mountPointIdentifier.getMountPoint();
             modules = ref.getModules(mountPoint);
-
         } else {
             final String errMsg =
                     "URI has bad format. If operations behind mount point should be showed, URI has to end with ";
@@ -99,9 +98,9 @@ public class RestconfOperationsServiceImpl implements RestconfOperationsService
      * of schema nodes and module.
      *
      * @param modules
-     *            - set of modules for get RPCs from every module
+     *             set of modules for get RPCs from every module
      * @param mountPoint
-     *            - mount point, if in use otherwise null
+     *             mount point, if in use otherwise null
      * @return {@link NormalizedNodeContext}
      */
     private static NormalizedNodeContext getOperations(final Set<Module> modules, final DOMMountPoint mountPoint) {
@@ -130,8 +129,7 @@ public class RestconfOperationsServiceImpl implements RestconfOperationsService
         neededModules.forEach(imp -> fakeModules.add(new FakeImportedModule(imp)));
         fakeModules.add(new FakeRestconfModule(neededModules, fakeCont));
 
-        final SchemaContext fakeSchemaCtx =
-                EffectiveSchemaContext.resolveSchemaContext(ImmutableSet.copyOf(fakeModules));
+        final SchemaContext fakeSchemaCtx = SimpleSchemaContext.forModules(ImmutableSet.copyOf(fakeModules));
         final InstanceIdentifierContext<ContainerSchemaNode> instanceIdentifierContext =
                 new InstanceIdentifierContext<>(null, fakeCont, mountPoint, fakeSchemaCtx);
         return new NormalizedNodeContext(instanceIdentifierContext, containerBuilder.build());