import javax.ws.rs.core.Request;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.ext.MessageBodyReader;
+import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
import org.opendaylight.restconf.common.context.InstanceIdentifierContext;
-import org.opendaylight.restconf.nb.rfc8040.RestConnectorProvider;
+import org.opendaylight.restconf.nb.rfc8040.handlers.DOMMountPointServiceHandler;
import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
import org.opendaylight.restconf.nb.rfc8040.utils.RestconfConstants;
import org.opendaylight.restconf.nb.rfc8040.utils.parser.ParserIdentifier;
private Request request;
private final SchemaContextHandler schemaContextHandler;
+ private final DOMMountPointServiceHandler mountPointServiceHandler;
- protected AbstractIdentifierAwareJaxRsProvider(SchemaContextHandler schemaContextHandler) {
+ protected AbstractIdentifierAwareJaxRsProvider(SchemaContextHandler schemaContextHandler,
+ DOMMountPointServiceHandler mountPointServiceHandler) {
this.schemaContextHandler = schemaContextHandler;
+ this.mountPointServiceHandler = mountPointServiceHandler;
}
@Override
private InstanceIdentifierContext<?> getInstanceIdentifierContext() {
return ParserIdentifier.toInstanceIdentifier(getIdentifier(), getSchemaContext(),
- Optional.of(RestConnectorProvider.getMountPointService()));
+ Optional.fromNullable(getMountPointService()));
}
protected UriInfo getUriInfo() {
return schemaContextHandler.get();
}
+ protected DOMMountPointService getMountPointService() {
+ return mountPointServiceHandler.get();
+ }
+
protected boolean isPost() {
return HttpMethod.POST.equals(this.request.getMethod());
}