Revert "Remove SchemaNode#getPath usage from JsonNormalizedNodeBodyReader"
[netconf.git] / restconf / restconf-nb-bierman02 / src / main / java / org / opendaylight / netconf / sal / rest / impl / AbstractIdentifierAwareJaxRsProvider.java
index c384d54ba053cbd0a64b7dac89a373b5cef907f4..761b3bdd2eab7c539ca7ee001f2d1a7b771ab568 100644 (file)
@@ -13,13 +13,12 @@ import javax.ws.rs.core.Request;
 import javax.ws.rs.core.UriInfo;
 import org.opendaylight.netconf.sal.rest.api.RestconfConstants;
 import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
-import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
+import org.opendaylight.restconf.common.context.InstanceIdentifierContext;
 
 /**
  * JAX-RS Provider.
  *
- * @deprecated This class will be replaced by
- *             {@link org.opendaylight.restconf.jersey.providers.AbstractIdentifierAwareJaxRsProvider}
+ * @deprecated This class will be replaced by AbstractIdentifierAwareJaxRsProvider in restconf-nb-rfc8040
  */
 @Deprecated
 public class AbstractIdentifierAwareJaxRsProvider {
@@ -32,12 +31,18 @@ public class AbstractIdentifierAwareJaxRsProvider {
     @Context
     private Request request;
 
+    private final ControllerContext controllerContext;
+
+    protected AbstractIdentifierAwareJaxRsProvider(ControllerContext controllerContext) {
+        this.controllerContext = controllerContext;
+    }
+
     protected final String getIdentifier() {
         return this.uriInfo.getPathParameters(false).getFirst(RestconfConstants.IDENTIFIER);
     }
 
     protected InstanceIdentifierContext<?> getInstanceIdentifierContext() {
-        return ControllerContext.getInstance().toInstanceIdentifier(getIdentifier());
+        return controllerContext.toInstanceIdentifier(getIdentifier());
     }
 
     protected UriInfo getUriInfo() {
@@ -48,6 +53,10 @@ public class AbstractIdentifierAwareJaxRsProvider {
         return POST.equals(this.request.getMethod());
     }
 
+    protected ControllerContext getControllerContext() {
+        return controllerContext;
+    }
+
     Request getRequest() {
         return this.request;
     }