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 {
@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() {
return POST.equals(this.request.getMethod());
}
+ protected ControllerContext getControllerContext() {
+ return controllerContext;
+ }
+
Request getRequest() {
return this.request;
}