* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.restconf.nb.rfc8040.jersey.providers.spi;
-import com.google.common.base.Optional;
import java.io.IOException;
import java.io.InputStream;
import java.io.PushbackInputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
+import java.util.Optional;
import javax.ws.rs.HttpMethod;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
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.mdsal.dom.api.DOMMountPointService;
import org.opendaylight.restconf.common.context.InstanceIdentifierContext;
-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;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
public abstract class AbstractIdentifierAwareJaxRsProvider<T> implements MessageBodyReader<T> {
private Request request;
private final SchemaContextHandler schemaContextHandler;
- private final DOMMountPointServiceHandler mountPointServiceHandler;
+ private final DOMMountPointService mountPointService;
- protected AbstractIdentifierAwareJaxRsProvider(SchemaContextHandler schemaContextHandler,
- DOMMountPointServiceHandler mountPointServiceHandler) {
+ protected AbstractIdentifierAwareJaxRsProvider(final SchemaContextHandler schemaContextHandler,
+ final DOMMountPointService mountPointService) {
this.schemaContextHandler = schemaContextHandler;
- this.mountPointServiceHandler = mountPointServiceHandler;
+ this.mountPointService = mountPointService;
}
@Override
protected abstract T emptyBody(InstanceIdentifierContext<?> path);
protected abstract T readBody(InstanceIdentifierContext<?> path, InputStream entityStream)
- throws IOException, WebApplicationException;
+ throws WebApplicationException;
private String getIdentifier() {
private InstanceIdentifierContext<?> getInstanceIdentifierContext() {
return ParserIdentifier.toInstanceIdentifier(getIdentifier(), getSchemaContext(),
- Optional.fromNullable(getMountPointService()));
+ Optional.ofNullable(getMountPointService()));
}
protected UriInfo getUriInfo() {
return this.uriInfo;
}
- protected SchemaContext getSchemaContext() {
+ protected EffectiveModelContext getSchemaContext() {
return schemaContextHandler.get();
}
protected DOMMountPointService getMountPointService() {
- return mountPointServiceHandler.get();
+ return mountPointService;
}
protected boolean isPost() {