Bug 6664 - upgrade draft15 to draft16 - renaming
[netconf.git] / restconf / sal-rest-connector / src / main / java / org / opendaylight / restconf / rest / services / impl / RestconfModulesServiceImpl.java
index c5261958533b1ae7e2e54a1ceceab5996d665cff..4ac1750b7fd5401204c82ce10d61e14bbd23a729 100644 (file)
@@ -18,10 +18,10 @@ import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
 import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
 import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag;
 import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType;
-import org.opendaylight.restconf.Draft11;
-import org.opendaylight.restconf.common.handlers.api.SchemaContextHandler;
+import org.opendaylight.restconf.Draft16;
 import org.opendaylight.restconf.common.references.SchemaContextRef;
-import org.opendaylight.restconf.rest.handlers.api.DOMMountPointServiceHandler;
+import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler;
+import org.opendaylight.restconf.handlers.SchemaContextHandler;
 import org.opendaylight.restconf.rest.services.api.RestconfModulesService;
 import org.opendaylight.restconf.utils.RestconfConstants;
 import org.opendaylight.restconf.utils.mapping.RestconfMappingNodeUtil;
@@ -66,7 +66,7 @@ public class RestconfModulesServiceImpl implements RestconfModulesService {
 
     @Override
     public NormalizedNodeContext getModules(final UriInfo uriInfo) {
-        final SchemaContextRef schemaContextRef = new SchemaContextRef(this.schemaContextHandler.getSchemaContext());
+        final SchemaContextRef schemaContextRef = new SchemaContextRef(this.schemaContextHandler.get());
         return getModules(schemaContextRef.getModules(), schemaContextRef, null);
     }
 
@@ -79,10 +79,10 @@ public class RestconfModulesServiceImpl implements RestconfModulesService {
             LOG.debug(errMsg + " for " + identifier);
             throw new RestconfDocumentedException(errMsg, ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
         }
-        final SchemaContextRef schemaContextRef = new SchemaContextRef(this.schemaContextHandler.getSchemaContext());
+        final SchemaContextRef schemaContextRef = new SchemaContextRef(this.schemaContextHandler.get());
         final InstanceIdentifierContext<?> mountPointIdentifier = ParserIdentifier.toInstanceIdentifier(identifier,
                 schemaContextRef.get());
-        final DOMMountPointService domMointPointService = this.domMountPointServiceHandler.getDOMMountPointService();
+        final DOMMountPointService domMointPointService = this.domMountPointServiceHandler.get();
         final DOMMountPoint mountPoint = domMointPointService
                 .getMountPoint(mountPointIdentifier.getInstanceIdentifier()).get();
         return getModules(mountPoint.getSchemaContext().getModules(), schemaContextRef, mountPoint);
@@ -92,15 +92,14 @@ public class RestconfModulesServiceImpl implements RestconfModulesService {
     @Override
     public NormalizedNodeContext getModule(final String identifier, final UriInfo uriInfo) {
         Preconditions.checkNotNull(identifier);
-        final SchemaContextRef schemaContextRef = new SchemaContextRef(this.schemaContextHandler.getSchemaContext());
+        final SchemaContextRef schemaContextRef = new SchemaContextRef(this.schemaContextHandler.get());
         final QName moduleQname = ParserIdentifier.makeQNameFromIdentifier(identifier);
         Module module = null;
         DOMMountPoint mountPoint = null;
         if (identifier.contains(RestconfConstants.MOUNT)) {
             final InstanceIdentifierContext<?> point = ParserIdentifier.toInstanceIdentifier(identifier,
                     schemaContextRef.get());
-            final DOMMountPointService domMointPointService = this.domMountPointServiceHandler
-                    .getDOMMountPointService();
+            final DOMMountPointService domMointPointService = this.domMountPointServiceHandler.get();
             mountPoint = domMointPointService.getMountPoint(point.getInstanceIdentifier()).get();
             module = schemaContextRef.findModuleInMountPointByQName(mountPoint, moduleQname);
         } else {
@@ -118,7 +117,7 @@ public class RestconfModulesServiceImpl implements RestconfModulesService {
         final MapNode moduleMap = RestconfMappingNodeUtil
                 .restconfMappingNode(schemaContextRef.getRestconfModule(), modules);
         final DataSchemaNode moduleSchemaNode = RestconfSchemaUtil.getRestconfSchemaNode(
-                schemaContextRef.getRestconfModule(), Draft11.RestconfModule.MODULE_LIST_SCHEMA_NODE);
+                schemaContextRef.getRestconfModule(), Draft16.RestconfModule.MODULE_LIST_SCHEMA_NODE);
         Preconditions.checkState(moduleSchemaNode instanceof ListSchemaNode);
         if (mountPoint == null) {
             return new NormalizedNodeContext(
@@ -149,7 +148,7 @@ public class RestconfModulesServiceImpl implements RestconfModulesService {
 
         final MapNode mapNodes = RestconfMappingNodeUtil.restconfMappingNode(restconfModule, modules);
         final DataSchemaNode schemaNode = RestconfSchemaUtil.getRestconfSchemaNode(restconfModule,
-                Draft11.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE);
+                Draft16.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE);
         Preconditions.checkState(schemaNode instanceof ContainerSchemaNode);
         final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> modulContainerSchemaNodeBuilder = Builders
                 .containerBuilder((ContainerSchemaNode) schemaNode);