import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
/**
- * Wrapping providers from restconf draft02 and draft15.
+ * Wrapping providers from restconf draft02 and draft16.
*
*/
public class RestconfWrapperProviders implements AutoCloseable, RestConnector {
// DRAFT02
private final RestconfProviderImpl providerDraft02;
- // DRAFT15
- private final RestConnectorProvider providerDraft15;
+ // DRAFT16
+ private final RestConnectorProvider providerDraft16;
/**
* Init both providers:
* <ul>
* <li>draft02 - {@link RestconfProviderImpl}
- * <li>draft15 - {@link RestConnectorProvider}
+ * <li>draft16 - {@link RestConnectorProvider}
* </ul>
*
* @param port
this.providerDraft02 = new RestconfProviderImpl();
this.providerDraft02.setWebsocketPort(port);
- this.providerDraft15 = new RestConnectorProvider();
+ this.providerDraft16 = new RestConnectorProvider();
}
/**
* Register both providers, which will use the SAL layer:
* <ul>
* <li>draft02 - {@link RestconfProviderImpl}
- * <li>draft15 - {@link RestConnectorProvider}
+ * <li>draft16 - {@link RestConnectorProvider}
* </ul>
*
* @param broker
// Register draft02 provider
broker.registerProvider(this.providerDraft02);
- // Register draft15 provider
- broker.registerProvider(this.providerDraft15);
+ // Register draft16 provider
+ broker.registerProvider(this.providerDraft16);
}
/**
@Override
public void close() throws Exception {
this.providerDraft02.close();
- this.providerDraft15.close();
+ this.providerDraft16.close();
}
}
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
import javax.ws.rs.ext.Provider;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
@Provider
-@Produces({ SchemaRetrievalService.YANG_MEDIA_TYPE, Draft15.MediaTypes.YANG })
+@Produces({ SchemaRetrievalService.YANG_MEDIA_TYPE, Draft16.MediaTypes.YANG })
public class SchemaExportContentYangBodyWriter implements MessageBodyWriter<SchemaExportContext> {
@Override
import javax.ws.rs.ext.MessageBodyWriter;
import javax.ws.rs.ext.Provider;
import javax.xml.stream.XMLStreamException;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.utils.RestconfConstants;
import org.opendaylight.yangtools.yang.model.export.YinExportUtils;
@Provider
-@Produces({ SchemaRetrievalService.YIN_MEDIA_TYPE, Draft15.MediaTypes.YIN + RestconfConstants.XML })
+@Produces({ SchemaRetrievalService.YIN_MEDIA_TYPE, Draft16.MediaTypes.YIN + RestconfConstants.XML })
public class SchemaExportContentYinBodyWriter implements MessageBodyWriter<SchemaExportContext> {
@Override
*/
package org.opendaylight.netconf.sal.rest.api;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.yangtools.yang.common.QName;
/**
* @deprecated Do not use old implementation of restconf draft. It will be
- * replaced by {@link Draft15}.
+ * replaced by {@link Draft16}.
*
*/
@Deprecated
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.utils.patch.Draft15AbstractIdentifierAwareJaxRsProvider;
+import org.opendaylight.restconf.utils.patch.Draft16AbstractIdentifierAwareJaxRsProvider;
/**
* @deprecated This class will be replaced by
- * {@link Draft15AbstractIdentifierAwareJaxRsProvider}
+ * {@link Draft16AbstractIdentifierAwareJaxRsProvider}
*/
@Deprecated
public class AbstractIdentifierAwareJaxRsProvider {
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.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.utils.RestconfConstants;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode;
@Provider
@Consumes({ Draft02.MediaTypes.DATA + RestconfService.JSON, Draft02.MediaTypes.OPERATION + RestconfService.JSON,
- Draft15.MediaTypes.DATA + RestconfConstants.JSON, MediaType.APPLICATION_JSON })
+ Draft16.MediaTypes.DATA + RestconfConstants.JSON, MediaType.APPLICATION_JSON })
public class JsonNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsProvider implements MessageBodyReader<NormalizedNodeContext> {
private final static Logger LOG = LoggerFactory.getLogger(JsonNormalizedNodeBodyReader.class);
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.utils.patch.Draft15JsonToPATCHBodyReader;
+import org.opendaylight.restconf.utils.patch.Draft16JsonToPATCHBodyReader;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.slf4j.LoggerFactory;
/**
- * @deprecated This class will be replaced by {@link Draft15JsonToPATCHBodyReader}
+ * @deprecated This class will be replaced by {@link Draft16JsonToPATCHBodyReader}
*/
@Deprecated
@Provider
import org.opendaylight.netconf.sal.rest.api.RestconfService;
import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.utils.RestconfConstants;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
@Provider
@Produces({ Draft02.MediaTypes.API + RestconfService.JSON, Draft02.MediaTypes.DATA + RestconfService.JSON,
- Draft02.MediaTypes.OPERATION + RestconfService.JSON, Draft15.MediaTypes.DATA + RestconfConstants.JSON,
+ Draft02.MediaTypes.OPERATION + RestconfService.JSON, Draft16.MediaTypes.DATA + RestconfConstants.JSON,
MediaType.APPLICATION_JSON })
public class NormalizedNodeJsonBodyWriter implements MessageBodyWriter<NormalizedNodeContext> {
import org.opendaylight.netconf.sal.rest.api.RestconfService;
import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
@Provider
@Produces({ Draft02.MediaTypes.API + RestconfService.XML, Draft02.MediaTypes.DATA + RestconfService.XML,
- Draft02.MediaTypes.OPERATION + RestconfService.XML, Draft15.MediaTypes.DATA, MediaType.APPLICATION_XML,
+ Draft02.MediaTypes.OPERATION + RestconfService.XML, Draft16.MediaTypes.DATA, MediaType.APPLICATION_XML,
MediaType.TEXT_XML })
public class NormalizedNodeXmlBodyWriter implements MessageBodyWriter<NormalizedNodeContext> {
import org.opendaylight.netconf.sal.restconf.impl.PATCHStatusContext;
import org.opendaylight.netconf.sal.restconf.impl.PATCHStatusEntity;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.utils.RestconfConstants;
import org.opendaylight.yangtools.yang.data.codec.gson.JsonWriterFactory;
@Provider
@Produces({Draft02.MediaTypes.PATCH_STATUS + RestconfService.JSON,
- Draft15.MediaTypes.PATCH_STATUS + RestconfConstants.JSON})
+ Draft16.MediaTypes.PATCH_STATUS + RestconfConstants.JSON})
public class PATCHJsonBodyWriter implements MessageBodyWriter<PATCHStatusContext> {
@Override
import org.opendaylight.netconf.sal.restconf.impl.PATCHStatusContext;
import org.opendaylight.netconf.sal.restconf.impl.PATCHStatusEntity;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.utils.RestconfConstants;
@Provider
@Produces({Draft02.MediaTypes.PATCH_STATUS + RestconfService.XML,
- Draft15.MediaTypes.PATCH_STATUS + RestconfConstants.XML})
+ Draft16.MediaTypes.PATCH_STATUS + RestconfConstants.XML})
public class PATCHXmlBodyWriter implements MessageBodyWriter<PATCHStatusContext> {
private static final XMLOutputFactory XML_FACTORY;
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.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlUtils;
@Provider
@Consumes({ Draft02.MediaTypes.DATA + RestconfService.XML, Draft02.MediaTypes.OPERATION + RestconfService.XML,
- Draft15.MediaTypes.DATA, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+ Draft16.MediaTypes.DATA, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
public class XmlNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsProvider implements MessageBodyReader<NormalizedNodeContext> {
private final static Logger LOG = LoggerFactory.getLogger(XmlNormalizedNodeBodyReader.class);
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.utils.patch.Draft15XmlToPATCHBodyReader;
+import org.opendaylight.restconf.utils.patch.Draft16XmlToPATCHBodyReader;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
import org.w3c.dom.NodeList;
/**
- * @deprecated This class will be replaced by {@link Draft15XmlToPATCHBodyReader}
+ * @deprecated This class will be replaced by {@link Draft16XmlToPATCHBodyReader}
*/
@Deprecated
@Provider
* </ul>
* </ul>
*
- * We used old revision {@link Draft15.RestconfModule#REVISION} of restconf yang
+ * We used old revision {@link Draft16.RestconfModule#REVISION} of restconf yang
* because the latest restconf draft has to be supported by Yang 1.1 and we are
* not. Then, this is only partial implementation of the latest restconf draft.
*/
-public final class Draft15 {
+public final class Draft16 {
- private Draft15() {
+ private Draft16() {
throw new UnsupportedOperationException("Util class");
}
public static final String ERROR_LIST_SCHEMA_NODE = "error";
- public static final QName IETF_RESTCONF_QNAME = QName.create(Draft15.RestconfModule.NAMESPACE, Draft15.RestconfModule.REVISION,
- Draft15.RestconfModule.NAME);
+ public static final QName IETF_RESTCONF_QNAME = QName.create(Draft16.RestconfModule.NAMESPACE, Draft16.RestconfModule.REVISION,
+ Draft16.RestconfModule.NAME);
public static final QName ERRORS_CONTAINER_QNAME = QName.create(IETF_RESTCONF_QNAME, ERRORS_CONTAINER_SCHEMA_NODE);
import org.opendaylight.controller.sal.core.api.model.SchemaService;
import org.opendaylight.netconf.sal.rest.api.RestConnector;
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
-import org.opendaylight.restconf.common.wrapper.services.Draft15ServicesWrapperImpl;
+import org.opendaylight.restconf.common.wrapper.services.Draft16ServicesWrapperImpl;
import org.opendaylight.restconf.handlers.DOMDataBrokerHandler;
import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler;
import org.opendaylight.restconf.handlers.RpcServiceHandler;
import org.slf4j.LoggerFactory;
/**
- * Provider for restconf draft15.
+ * Provider for restconf draft16.
*
*/
public class RestConnectorProvider implements Provider, RestConnector, AutoCloseable {
public void onSessionInitiated(final ProviderSession session) {
final SchemaService schemaService = Preconditions.checkNotNull(session.getService(SchemaService.class));
- final Draft15ServicesWrapperImpl wrapperServices = Draft15ServicesWrapperImpl.getInstance();
+ final Draft16ServicesWrapperImpl wrapperServices = Draft16ServicesWrapperImpl.getInstance();
final SchemaContextHandler schemaCtxHandler = new SchemaContextHandler();
this.listenerRegistration = schemaService.registerSchemaContextListener(schemaCtxHandler);
import org.opendaylight.netconf.sal.rest.impl.PATCHXmlBodyWriter;
import org.opendaylight.netconf.sal.rest.impl.RestconfDocumentedExceptionMapper;
import org.opendaylight.netconf.sal.rest.impl.XmlNormalizedNodeBodyReader;
-import org.opendaylight.restconf.common.wrapper.services.Draft15ServicesWrapperImpl;
-import org.opendaylight.restconf.utils.patch.Draft15JsonToPATCHBodyReader;
-import org.opendaylight.restconf.utils.patch.Draft15XmlToPATCHBodyReader;
+import org.opendaylight.restconf.common.wrapper.services.Draft16ServicesWrapperImpl;
+import org.opendaylight.restconf.utils.patch.Draft16JsonToPATCHBodyReader;
+import org.opendaylight.restconf.utils.patch.Draft16XmlToPATCHBodyReader;
public class RestconfApplication extends Application {
return ImmutableSet.<Class<?>> builder().add(NormalizedNodeJsonBodyWriter.class)
.add(NormalizedNodeXmlBodyWriter.class).add(JsonNormalizedNodeBodyReader.class)
.add(XmlNormalizedNodeBodyReader.class).add(SchemaExportContentYinBodyWriter.class)
- .add(Draft15JsonToPATCHBodyReader.class).add(Draft15XmlToPATCHBodyReader.class)
+ .add(Draft16JsonToPATCHBodyReader.class).add(Draft16XmlToPATCHBodyReader.class)
.add(PATCHJsonBodyWriter.class).add(PATCHXmlBodyWriter.class)
.add(SchemaExportContentYangBodyWriter.class).add(RestconfDocumentedExceptionMapper.class)
.build();
@Override
public Set<Object> getSingletons() {
final Set<Object> singletons = new HashSet<>();
- singletons.add(Draft15ServicesWrapperImpl.getInstance());
+ singletons.add(Draft16ServicesWrapperImpl.getInstance());
return singletons;
}
}
import java.util.Date;
import java.util.Set;
import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
/**
* Get {@link Module} by ietf-restconf qname from
- * {@link Draft15.RestconfModule}
+ * {@link Draft16.RestconfModule}
*
* @return {@link Module}
*/
public Module getRestconfModule() {
- return this.findModuleByNamespaceAndRevision(Draft15.RestconfModule.IETF_RESTCONF_QNAME.getNamespace(),
- Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
+ return this.findModuleByNamespaceAndRevision(Draft16.RestconfModule.IETF_RESTCONF_QNAME.getNamespace(),
+ Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
}
/**
import org.opendaylight.restconf.handlers.RpcServiceHandler;
import org.opendaylight.restconf.handlers.SchemaContextHandler;
import org.opendaylight.restconf.handlers.TransactionChainHandler;
-import org.opendaylight.restconf.rest.services.api.Draft15BaseServicesWrapper;
+import org.opendaylight.restconf.rest.services.api.Draft16BaseServicesWrapper;
import org.opendaylight.restconf.rest.services.api.RestconfModulesService;
import org.opendaylight.restconf.rest.services.api.RestconfOperationsService;
import org.opendaylight.restconf.rest.services.api.RestconfSchemaService;
import org.opendaylight.restconf.rest.services.impl.RestconfOperationsServiceImpl;
import org.opendaylight.restconf.rest.services.impl.RestconfSchemaServiceImpl;
import org.opendaylight.restconf.rest.services.impl.RestconfStreamsServiceImpl;
-import org.opendaylight.restconf.restful.services.api.Draft15TransactionServicesWrapper;
+import org.opendaylight.restconf.restful.services.api.Draft16TransactionServicesWrapper;
import org.opendaylight.restconf.restful.services.api.RestconfDataService;
import org.opendaylight.restconf.restful.services.api.RestconfInvokeOperationsService;
import org.opendaylight.restconf.restful.services.api.RestconfStreamsSubscriptionService;
/**
* Wrapper for services:
* <ul>
- * <li>{@link Draft15BaseServicesWrapper}
- * <li>{@link Draft15TransactionServicesWrapper}
+ * <li>{@link Draft16BaseServicesWrapper}
+ * <li>{@link Draft16TransactionServicesWrapper}
* </ul>
*
*/
@Path("/")
-public class Draft15ServicesWrapperImpl implements Draft15BaseServicesWrapper, Draft15TransactionServicesWrapper {
+public class Draft16ServicesWrapperImpl implements Draft16BaseServicesWrapper, Draft16TransactionServicesWrapper {
private RestconfDataService delegRestconfDataService;
private RestconfInvokeOperationsService delegRestconfInvokeOpsService;
private RestconfStreamsService delegRestStrsService;
private RestconfSchemaService delegRestSchService;
- private Draft15ServicesWrapperImpl() {
+ private Draft16ServicesWrapperImpl() {
}
private static class InstanceHolder {
- public static final Draft15ServicesWrapperImpl INSTANCE = new Draft15ServicesWrapperImpl();
+ public static final Draft16ServicesWrapperImpl INSTANCE = new Draft16ServicesWrapperImpl();
}
- public static Draft15ServicesWrapperImpl getInstance() {
+ public static Draft16ServicesWrapperImpl getInstance() {
return InstanceHolder.INSTANCE;
}
* </ul>
*
*/
-public interface Draft15BaseServicesWrapper
+public interface Draft16BaseServicesWrapper
extends RestconfModulesService, RestconfOperationsService, RestconfStreamsService, RestconfSchemaService {
}
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.utils.RestconfConstants;
/**
*/
@GET
@Path("data/ietf-yang-library:modules-state")
- @Produces({ Draft15.MediaTypes.DATA + RestconfConstants.JSON, Draft15.MediaTypes.DATA, MediaType.APPLICATION_JSON,
+ @Produces({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML, MediaType.TEXT_XML })
public NormalizedNodeContext getModules(@Context UriInfo uriInfo);
*/
@GET
@Path("data/ietf-yang-library:modules-state/{identifier:.+}")
- @Produces({ Draft15.MediaTypes.DATA + RestconfConstants.JSON, Draft15.MediaTypes.DATA, MediaType.APPLICATION_JSON,
+ @Produces({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML, MediaType.TEXT_XML })
public NormalizedNodeContext getModules(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
*/
@GET
@Path("data/ietf-yang-library:modules-state/module/{identifier:.+}")
- @Produces({ Draft15.MediaTypes.DATA + RestconfConstants.JSON, Draft15.MediaTypes.DATA, MediaType.APPLICATION_JSON,
+ @Produces({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML, MediaType.TEXT_XML })
public NormalizedNodeContext getModule(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
}
\ No newline at end of file
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.utils.RestconfConstants;
/**
*/
@GET
@Path("/operations")
- @Produces({ Draft15.MediaTypes.DATA + RestconfConstants.JSON, Draft15.MediaTypes.DATA, MediaType.APPLICATION_JSON,
+ @Produces({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML, MediaType.TEXT_XML })
public NormalizedNodeContext getOperations(@Context UriInfo uriInfo);
*/
@GET
@Path("/operations/{identifier:.+}")
- @Produces({ Draft15.MediaTypes.DATA + RestconfConstants.JSON, Draft15.MediaTypes.DATA, MediaType.APPLICATION_JSON,
+ @Produces({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML, MediaType.TEXT_XML })
public NormalizedNodeContext getOperations(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
}
\ No newline at end of file
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import org.opendaylight.netconf.md.sal.rest.schema.SchemaExportContext;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.utils.RestconfConstants;
/**
* @return {@link SchemaExportContext}
*/
@GET
- @Produces({ Draft15.MediaTypes.YANG, Draft15.MediaTypes.YIN + RestconfConstants.XML })
+ @Produces({ Draft16.MediaTypes.YANG, Draft16.MediaTypes.YIN + RestconfConstants.XML })
@Path("data/ietf-yang-library:modules/module/{identifier:.+}/schema")
SchemaExportContext getSchema(@PathParam("identifier") String identifier);
}
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.utils.RestconfConstants;
/**
*/
@GET
@Path("data/ietf-restconf-monitoring:restconf-state/streams")
- @Produces({ Draft15.MediaTypes.DATA + RestconfConstants.JSON, Draft15.MediaTypes.DATA, MediaType.APPLICATION_JSON,
+ @Produces({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML, MediaType.TEXT_XML })
public NormalizedNodeContext getAvailableStreams(@Context UriInfo uriInfo);
}
\ No newline at end of file
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.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.common.references.SchemaContextRef;
import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler;
import org.opendaylight.restconf.handlers.SchemaContextHandler;
final MapNode moduleMap = RestconfMappingNodeUtil
.restconfMappingNode(schemaContextRef.getRestconfModule(), modules);
final DataSchemaNode moduleSchemaNode = RestconfSchemaUtil.getRestconfSchemaNode(
- schemaContextRef.getRestconfModule(), Draft15.RestconfModule.MODULE_LIST_SCHEMA_NODE);
+ schemaContextRef.getRestconfModule(), Draft16.RestconfModule.MODULE_LIST_SCHEMA_NODE);
Preconditions.checkState(moduleSchemaNode instanceof ListSchemaNode);
if (mountPoint == null) {
return new NormalizedNodeContext(
final MapNode mapNodes = RestconfMappingNodeUtil.restconfMappingNode(restconfModule, modules);
final DataSchemaNode schemaNode = RestconfSchemaUtil.getRestconfSchemaNode(restconfModule,
- Draft15.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);
import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
import org.opendaylight.netconf.sal.streams.listeners.Notificator;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.common.references.SchemaContextRef;
import org.opendaylight.restconf.handlers.SchemaContextHandler;
import org.opendaylight.restconf.rest.services.api.RestconfStreamsService;
final Set<String> availableStreams = Notificator.getStreamNames();
final DataSchemaNode streamListSchemaNode = RestconfSchemaUtil.getRestconfSchemaNode(
- schemaContextRef.getRestconfModule(), Draft15.MonitoringModule.STREAM_LIST_SCHEMA_NODE);
+ schemaContextRef.getRestconfModule(), Draft16.MonitoringModule.STREAM_LIST_SCHEMA_NODE);
Preconditions.checkState(streamListSchemaNode instanceof ListSchemaNode);
final CollectionNodeBuilder<MapEntryNode, MapNode> listStreamBuilder = Builders
.mapBuilder((ListSchemaNode) streamListSchemaNode);
}
final DataSchemaNode streamContSchemaNode = RestconfSchemaUtil.getRestconfSchemaNode(
- schemaContextRef.getRestconfModule(), Draft15.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE);
+ schemaContextRef.getRestconfModule(), Draft16.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE);
Preconditions.checkState(streamContSchemaNode instanceof ContainerSchemaNode);
final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> streamsContainerBuilder = Builders
.containerBuilder((ContainerSchemaNode) streamContSchemaNode);
* </ul>
*
*/
-public interface Draft15TransactionServicesWrapper
+public interface Draft16TransactionServicesWrapper
extends RestconfDataService, RestconfInvokeOperationsService, RestconfStreamsSubscriptionService {
}
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
import org.opendaylight.netconf.sal.restconf.impl.PATCHContext;
import org.opendaylight.netconf.sal.restconf.impl.PATCHStatusContext;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.utils.RestconfConstants;
/**
*/
@GET
@Path("/data/{identifier:.+}")
- @Produces({ Draft15.MediaTypes.DATA + RestconfConstants.JSON, Draft15.MediaTypes.DATA, MediaType.APPLICATION_JSON,
+ @Produces({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML, MediaType.TEXT_XML })
Response readData(@Encoded @PathParam("identifier") String identifier,
@Context UriInfo uriInfo);
*/
@PUT
@Path("/data/{identifier:.+}")
- @Consumes({ Draft15.MediaTypes.DATA + RestconfConstants.JSON, Draft15.MediaTypes.DATA, MediaType.APPLICATION_JSON,
+ @Consumes({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML, MediaType.TEXT_XML })
Response putData(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload);
*/
@POST
@Path("/data/{identifier:.+}")
- @Consumes({ Draft15.MediaTypes.DATA + RestconfConstants.JSON, Draft15.MediaTypes.DATA, MediaType.APPLICATION_JSON,
+ @Consumes({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML, MediaType.TEXT_XML })
Response postData(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload,
@Context UriInfo uriInfo);
*/
@POST
@Path("/data")
- @Consumes({ Draft15.MediaTypes.DATA + RestconfConstants.JSON, Draft15.MediaTypes.DATA, MediaType.APPLICATION_JSON,
+ @Consumes({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML, MediaType.TEXT_XML })
Response postData(NormalizedNodeContext payload, @Context UriInfo uriInfo);
*/
@PATCH
@Path("/data/{identifier:.+}")
- @Consumes({ Draft15.MediaTypes.PATCH + RestconfConstants.JSON, Draft15.MediaTypes.PATCH + RestconfConstants.XML })
- @Produces({ Draft15.MediaTypes.PATCH_STATUS + RestconfConstants.JSON,
- Draft15.MediaTypes.PATCH_STATUS + RestconfConstants.XML })
+ @Consumes({ Draft16.MediaTypes.PATCH + RestconfConstants.JSON, Draft16.MediaTypes.PATCH + RestconfConstants.XML })
+ @Produces({ Draft16.MediaTypes.PATCH_STATUS + RestconfConstants.JSON,
+ Draft16.MediaTypes.PATCH_STATUS + RestconfConstants.XML })
PATCHStatusContext patchData(@Encoded @PathParam("identifier") String identifier, PATCHContext context,
@Context UriInfo uriInfo);
*/
@PATCH
@Path("/data")
- @Consumes({ Draft15.MediaTypes.PATCH + RestconfConstants.JSON, Draft15.MediaTypes.PATCH + RestconfConstants.XML })
- @Produces({ Draft15.MediaTypes.PATCH_STATUS + RestconfConstants.JSON,
- Draft15.MediaTypes.PATCH_STATUS + RestconfConstants.XML })
+ @Consumes({ Draft16.MediaTypes.PATCH + RestconfConstants.JSON, Draft16.MediaTypes.PATCH + RestconfConstants.XML })
+ @Produces({ Draft16.MediaTypes.PATCH_STATUS + RestconfConstants.JSON,
+ Draft16.MediaTypes.PATCH_STATUS + RestconfConstants.XML })
PATCHStatusContext patchData(PATCHContext context, @Context UriInfo uriInfo);
}
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.utils.RestconfConstants;
/**
*/
@POST
@Path("/operations/{identifier:.+}")
- @Produces({ Draft15.MediaTypes.DATA + RestconfConstants.JSON, Draft15.MediaTypes.DATA, MediaType.APPLICATION_JSON,
+ @Produces({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML, MediaType.TEXT_XML })
- @Consumes({ Draft15.MediaTypes.DATA + RestconfConstants.JSON, Draft15.MediaTypes.DATA, MediaType.APPLICATION_JSON,
+ @Consumes({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML, MediaType.TEXT_XML })
NormalizedNodeContext invokeRpc(@Encoded @PathParam("identifier") String identifier,
NormalizedNodeContext payload, @Context UriInfo uriInfo);
import com.google.common.base.Preconditions;
import java.util.Collection;
import java.util.Set;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.utils.RestconfConstants;
import org.opendaylight.restconf.utils.schema.context.RestconfSchemaUtil;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
*/
public static MapNode restconfMappingNode(final Module restconfModule, final Set<Module> modules) {
final DataSchemaNode modulListSchemaNode = RestconfSchemaUtil.getRestconfSchemaNode(restconfModule,
- Draft15.RestconfModule.MODULE_LIST_SCHEMA_NODE);
+ Draft16.RestconfModule.MODULE_LIST_SCHEMA_NODE);
Preconditions.checkState(modulListSchemaNode instanceof ListSchemaNode);
final CollectionNodeBuilder<MapEntryNode, MapNode> listModuleBuilder = Builders
import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
import org.opendaylight.restconf.utils.parser.ParserIdentifier;
-public class Draft15AbstractIdentifierAwareJaxRsProvider {
+public class Draft16AbstractIdentifierAwareJaxRsProvider {
private static final String POST = "POST";
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.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.utils.RestconfConstants;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
import org.slf4j.LoggerFactory;
@Provider
-@Consumes({Draft15.MediaTypes.PATCH + RestconfConstants.JSON})
-public class Draft15JsonToPATCHBodyReader extends Draft15AbstractIdentifierAwareJaxRsProvider
+@Consumes({Draft16.MediaTypes.PATCH + RestconfConstants.JSON})
+public class Draft16JsonToPATCHBodyReader extends Draft16AbstractIdentifierAwareJaxRsProvider
implements MessageBodyReader<PATCHContext> {
- private final static Logger LOG = LoggerFactory.getLogger(Draft15JsonToPATCHBodyReader.class);
+ private final static Logger LOG = LoggerFactory.getLogger(Draft16JsonToPATCHBodyReader.class);
private String patchId;
@Override
private List<PATCHEntity> read(final JsonReader in, final InstanceIdentifierContext path) throws IOException {
final List<PATCHEntity> resultCollection = new ArrayList<>();
- final Draft15StringModuleInstanceIdentifierCodec codec = new Draft15StringModuleInstanceIdentifierCodec(
+ final Draft16StringModuleInstanceIdentifierCodec codec = new Draft16StringModuleInstanceIdentifierCodec(
path.getSchemaContext());
- final Draft15JsonToPATCHBodyReader.PatchEdit edit = new Draft15JsonToPATCHBodyReader.PatchEdit();
+ final Draft16JsonToPATCHBodyReader.PatchEdit edit = new Draft16JsonToPATCHBodyReader.PatchEdit();
while (in.hasNext()) {
switch (in.peek()) {
*/
private void parseByName(@Nonnull final String name, @Nonnull final PatchEdit edit,
@Nonnull final JsonReader in, @Nonnull final InstanceIdentifierContext path,
- @Nonnull final Draft15StringModuleInstanceIdentifierCodec codec,
+ @Nonnull final Draft16StringModuleInstanceIdentifierCodec codec,
@Nonnull final List<PATCHEntity> resultCollection) throws IOException {
switch (name) {
case "edit" :
*/
private void readEditDefinition(@Nonnull final PatchEdit edit, @Nonnull final JsonReader in,
@Nonnull final InstanceIdentifierContext path,
- @Nonnull final Draft15StringModuleInstanceIdentifierCodec codec) throws IOException {
+ @Nonnull final Draft16StringModuleInstanceIdentifierCodec codec) throws IOException {
final StringBuffer value = new StringBuffer();
in.beginObject();
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-final class Draft15StringModuleInstanceIdentifierCodec extends AbstractModuleStringInstanceIdentifierCodec {
+final class Draft16StringModuleInstanceIdentifierCodec extends AbstractModuleStringInstanceIdentifierCodec {
private final DataSchemaContextTree dataContextTree;
private final SchemaContext context;
private final String defaultPrefix;
- Draft15StringModuleInstanceIdentifierCodec(SchemaContext context) {
+ Draft16StringModuleInstanceIdentifierCodec(SchemaContext context) {
this.context = Preconditions.checkNotNull(context);
this.dataContextTree = DataSchemaContextTree.from(context);
this.defaultPrefix = "";
}
- Draft15StringModuleInstanceIdentifierCodec(SchemaContext context, @Nonnull String defaultPrefix) {
+ Draft16StringModuleInstanceIdentifierCodec(SchemaContext context, @Nonnull String defaultPrefix) {
this.context = Preconditions.checkNotNull(context);
this.dataContextTree = DataSchemaContextTree.from(context);
this.defaultPrefix = defaultPrefix;
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.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.utils.RestconfConstants;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.w3c.dom.NodeList;
@Provider
-@Consumes({Draft15.MediaTypes.PATCH + RestconfConstants.XML})
-public class Draft15XmlToPATCHBodyReader extends Draft15AbstractIdentifierAwareJaxRsProvider implements
+@Consumes({Draft16.MediaTypes.PATCH + RestconfConstants.XML})
+public class Draft16XmlToPATCHBodyReader extends Draft16AbstractIdentifierAwareJaxRsProvider implements
MessageBodyReader<PATCHContext> {
- private final static Logger LOG = LoggerFactory.getLogger(Draft15XmlToPATCHBodyReader.class);
+ private final static Logger LOG = LoggerFactory.getLogger(Draft16XmlToPATCHBodyReader.class);
private static final DocumentBuilderFactory BUILDERFACTORY;
static {
URI.create(namespace)).iterator().next();
// initialize codec + set default prefix derived from module name
- final Draft15StringModuleInstanceIdentifierCodec codec = new Draft15StringModuleInstanceIdentifierCodec(
+ final Draft16StringModuleInstanceIdentifierCodec codec = new Draft16StringModuleInstanceIdentifierCodec(
pathContext.getSchemaContext(), module.getName());
// find complete path to target and target schema node
/**
* Prepare non-conditional XPath suitable for deserialization
- * with {@link Draft15StringModuleInstanceIdentifierCodec}
+ * with {@link Draft16StringModuleInstanceIdentifierCodec}
* @param schemaNode Top schema node
* @param target Edit operation target
* @param value Element with value
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.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
final Set<GroupingDefinition> groupings = restconfModule.getGroupings();
final GroupingDefinition restGroup = findSchemaNodeInCollection(groupings,
- Draft15.RestconfModule.RESTCONF_GROUPING_SCHEMA_NODE);
+ Draft16.RestconfModule.RESTCONF_GROUPING_SCHEMA_NODE);
final Collection<DataSchemaNode> childNodes = restGroup.getChildNodes();
final DataSchemaNode restCont = childNodes.iterator().next();
private static DataSchemaNode findSchemaNode(final DataSchemaNode restCont, final String schemaNodeName) {
switch (schemaNodeName) {
//MODULES
- case Draft15.RestconfModule.MODULE_LIST_SCHEMA_NODE:
+ case Draft16.RestconfModule.MODULE_LIST_SCHEMA_NODE:
final DataSchemaNode moduleListSchNode = findSchemaNodeInCollection(
((DataNodeContainer) findSchemaNode(restCont,
- Draft15.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE)).getChildNodes(),
- Draft15.RestconfModule.MODULE_LIST_SCHEMA_NODE);
+ Draft16.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE)).getChildNodes(),
+ Draft16.RestconfModule.MODULE_LIST_SCHEMA_NODE);
Preconditions.checkNotNull(moduleListSchNode);
return moduleListSchNode;
- case Draft15.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE:
+ case Draft16.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE:
final DataSchemaNode modulesContSchNode = findSchemaNodeInCollection(((DataNodeContainer) restCont).getChildNodes(),
- Draft15.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE);
+ Draft16.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE);
Preconditions.checkNotNull(modulesContSchNode);
return modulesContSchNode;
//STREAMS
- case Draft15.MonitoringModule.STREAM_LIST_SCHEMA_NODE:
+ case Draft16.MonitoringModule.STREAM_LIST_SCHEMA_NODE:
final DataSchemaNode streamListSchNode = findSchemaNodeInCollection(
((DataNodeContainer) findSchemaNode(restCont,
- Draft15.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE)).getChildNodes(),
- Draft15.MonitoringModule.STREAM_LIST_SCHEMA_NODE);
+ Draft16.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE)).getChildNodes(),
+ Draft16.MonitoringModule.STREAM_LIST_SCHEMA_NODE);
Preconditions.checkNotNull(streamListSchNode);
return streamListSchNode;
- case Draft15.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE:
+ case Draft16.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE:
final DataSchemaNode streamsContSchNode = findSchemaNodeInCollection(
((DataNodeContainer) restCont).getChildNodes(),
- Draft15.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE);
+ Draft16.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE);
Preconditions.checkNotNull(streamsContSchNode);
return streamsContSchNode;
default:
<servlet-mapping>
<servlet-name>Restconf</servlet-name>
- <url-pattern>/15/*</url-pattern>
+ <url-pattern>/16/*</url-pattern>
</servlet-mapping>
<filter>
import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
import org.opendaylight.netconf.sal.restconf.impl.PATCHContext;
-import org.opendaylight.restconf.utils.patch.Draft15AbstractIdentifierAwareJaxRsProvider;
+import org.opendaylight.restconf.utils.patch.Draft16AbstractIdentifierAwareJaxRsProvider;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
public abstract class Draft11AbstractBodyReaderTest {
public Draft11AbstractBodyReaderTest() throws NoSuchFieldException,
SecurityException {
- uriField = Draft15AbstractIdentifierAwareJaxRsProvider.class
+ uriField = Draft16AbstractIdentifierAwareJaxRsProvider.class
.getDeclaredField("uriInfo");
uriField.setAccessible(true);
- requestField = Draft15AbstractIdentifierAwareJaxRsProvider.class
+ requestField = Draft16AbstractIdentifierAwareJaxRsProvider.class
.getDeclaredField("request");
requestField.setAccessible(true);
mediaType = getMediaType();
return TestRestconfUtils.loadSchemaContext(yangPath, schemaContext);
}
- protected static <T extends Draft15AbstractIdentifierAwareJaxRsProvider> void mockBodyReader(
+ protected static <T extends Draft16AbstractIdentifierAwareJaxRsProvider> void mockBodyReader(
final String identifier, final T normalizedNodeProvider,
final boolean isPost) throws NoSuchFieldException,
SecurityException, IllegalArgumentException, IllegalAccessException {
import org.junit.Test;
import org.opendaylight.netconf.sal.restconf.impl.PATCHContext;
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
-import org.opendaylight.restconf.utils.patch.Draft15JsonToPATCHBodyReader;
+import org.opendaylight.restconf.utils.patch.Draft16JsonToPATCHBodyReader;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
public class TestDraft11JsonPATCHBodyReader extends Draft11AbstractBodyReaderTest {
- private final Draft15JsonToPATCHBodyReader jsonPATCHBodyReader;
+ private final Draft16JsonToPATCHBodyReader jsonPATCHBodyReader;
private static SchemaContext schemaContext;
public TestDraft11JsonPATCHBodyReader() throws NoSuchFieldException, SecurityException {
super();
- jsonPATCHBodyReader = new Draft15JsonToPATCHBodyReader();
+ jsonPATCHBodyReader = new Draft16JsonToPATCHBodyReader();
}
@Override
import org.junit.Test;
import org.opendaylight.netconf.sal.restconf.impl.PATCHContext;
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
-import org.opendaylight.restconf.utils.patch.Draft15XmlToPATCHBodyReader;
+import org.opendaylight.restconf.utils.patch.Draft16XmlToPATCHBodyReader;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
public class TestDraft11XmlPATCHBodyReader extends Draft11AbstractBodyReaderTest {
- private final Draft15XmlToPATCHBodyReader xmlPATCHBodyReader;
+ private final Draft16XmlToPATCHBodyReader xmlPATCHBodyReader;
private static SchemaContext schemaContext;
public TestDraft11XmlPATCHBodyReader() throws NoSuchFieldException, SecurityException {
super();
- xmlPATCHBodyReader = new Draft15XmlToPATCHBodyReader();
+ xmlPATCHBodyReader = new Draft16XmlToPATCHBodyReader();
}
@Override
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.Draft15.RestconfModule;
+import org.opendaylight.restconf.Draft16.RestconfModule;
import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler;
import org.opendaylight.restconf.handlers.SchemaContextHandler;
import org.opendaylight.restconf.rest.services.api.RestconfModulesService;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-
import com.google.common.collect.ImmutableClassToInstanceMap;
import com.google.common.collect.Maps;
import java.io.File;
import org.opendaylight.controller.md.sal.dom.broker.impl.mount.DOMMountPointServiceImpl;
import org.opendaylight.controller.md.sal.dom.broker.spi.mount.SimpleDOMMountPoint;
import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler;
import org.opendaylight.restconf.handlers.SchemaContextHandler;
import org.opendaylight.restconf.utils.RestconfConstants;
when(schemaContext.findModuleByNamespaceAndRevision(any(URI.class), any(Date.class))).thenAnswer(invocation -> {
final Object[] args = invocation.getArguments();
- if (args[0] == Draft15.RestconfModule.IETF_RESTCONF_QNAME.getNamespace()
- && args[1] == Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision()) {
+ if ((args[0] == Draft16.RestconfModule.IETF_RESTCONF_QNAME.getNamespace())
+ && (args[1] == Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) {
return parseCustomRestconfSource(restconfModuleName).findModuleByName(
restconfModuleName, (Date) args[1]);
} else {
* @param restconfName File name of custom Restconf module
* @return <code>SchemaContext</code> containing custom Restconf module with one mount point
*/
- private static SchemaContext parseCustomRestconfSourceMountPoint(String restconfName) throws Exception {
+ private static SchemaContext parseCustomRestconfSourceMountPoint(final String restconfName) throws Exception {
final String restconf = TestRestconfUtils.class.getResource(
CUSTOM_RESTCONF_MODULES_MOUNT_POINT_PATH
+ restconfName + "/" + restconfName + ".yang").getPath();
TestModule() {}
- TestModule(String name, URI namespace, Date revision) {
+ TestModule(final String name, final URI namespace, final Date revision) {
this.name = name;
this.namespace = namespace.toString();
this.revision = SimpleDateFormatUtil.getRevisionFormat().format(revision);
}
String getName() {
- return name;
+ return this.name;
}
- void setName(String name) {
+ void setName(final String name) {
this.name = name;
}
String getNamespace() {
- return namespace;
+ return this.namespace;
}
- void setNamespace(String namespace) {
+ void setNamespace(final String namespace) {
this.namespace = namespace;
}
String getRevision() {
- return revision;
+ return this.revision;
}
- void setRevision(String revision) {
+ void setRevision(final String revision) {
this.revision = revision;
}
@Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ public boolean equals(final Object o) {
+ if (this == o) {
+ return true;
+ }
+ if ((o == null) || (getClass() != o.getClass())) {
+ return false;
+ }
- TestModule that = (TestModule) o;
+ final TestModule that = (TestModule) o;
- if (name != null ? !name.equals(that.name) : that.name != null) return false;
- if (namespace != null ? !namespace.equals(that.namespace) : that.namespace != null) return false;
- return revision != null ? revision.equals(that.revision) : that.revision == null;
+ if (this.name != null ? !this.name.equals(that.name) : that.name != null) {
+ return false;
+ }
+ if (this.namespace != null ? !this.namespace.equals(that.namespace) : that.namespace != null) {
+ return false;
+ }
+ return this.revision != null ? this.revision.equals(that.revision) : that.revision == null;
}
@Override
public int hashCode() {
- int result = name != null ? name.hashCode() : 0;
- result = 31 * result + (namespace != null ? namespace.hashCode() : 0);
- result = 31 * result + (revision != null ? revision.hashCode() : 0);
+ int result = this.name != null ? this.name.hashCode() : 0;
+ result = (31 * result) + (this.namespace != null ? this.namespace.hashCode() : 0);
+ result = (31 * result) + (this.revision != null ? this.revision.hashCode() : 0);
return result;
}
}
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError;
import org.opendaylight.netconf.sal.streams.listeners.Notificator;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.restconf.handlers.SchemaContextHandler;
import org.opendaylight.restconf.rest.services.api.RestconfStreamsService;
import org.opendaylight.restconf.utils.mapping.RestconfMappingNodeConstants;
public void getAvailableStreamsTest() throws Exception {
// prepare conditions - get correct Restconf module
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft15.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft16.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("ietf-restconf"));
// make test
public void getAvailableStreamsMissingRestconfModuleNegativeTest() {
// prepare conditions - get null Restconf module
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft15.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision())).thenReturn(null);
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft16.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision())).thenReturn(null);
// make test
this.thrown.expect(NullPointerException.class);
public void getAvailableStreamsMissingListStreamNegativeTest() {
// prepare conditions - get Restconf module with missing list stream
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft15.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft16.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("restconf-module-with-missing-list-stream"));
// make test and verify
public void getAvailableStreamsMissingContainerStreamsNegativeTest() {
// prepare conditions - get Restconf module with missing container streams
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft15.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft16.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("restconf-module-with-missing-container-streams"));
// make test and verify
public void getAvailableStreamsIllegalListStreamNegativeTest() {
// prepare conditions - get Restconf module with illegal list stream
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft15.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft16.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("restconf-module-with-illegal-list-stream"));
// make test
public void getAvailableStreamsIllegalContainerStreamsNegativeTest() {
// prepare conditions - get Restconf module with illegal container streams
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft15.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft16.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("restconf-module-with-illegal-container-streams"));
// make test
public void getAvailableStreamsIllegalLeafDescriptionNegativeTest() {
// prepare conditions - get Restconf module with illegal leaf description in list stream
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft15.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft16.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("restconf-module-with-illegal-leaf-description"));
// make test
* @return Restconf module
*/
private Module getTestingRestconfModule(final String s) {
- return this.schemaContext.findModuleByName(s, Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
+ return this.schemaContext.findModuleByName(s, Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
}
/**
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.verify;
-
import com.google.common.base.Optional;
import com.google.common.util.concurrent.Futures;
import javax.ws.rs.core.Response;
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
- refSchemaCtx = new SchemaContextRef(TestRestconfUtils.loadSchemaContext(PATH_FOR_NEW_SCHEMA_CONTEXT));
- schema = refSchemaCtx.get();
+ this.refSchemaCtx = new SchemaContextRef(TestRestconfUtils.loadSchemaContext(PATH_FOR_NEW_SCHEMA_CONTEXT));
+ this.schema = this.refSchemaCtx.get();
final QName baseQName = QName.create("http://example.com/ns/example-jukebox", "2015-04-04", "jukebox");
final QName containerQname = QName.create(baseQName, "player");
final QName listKeyQname = QName.create(baseQName, "name");
final YangInstanceIdentifier.NodeIdentifierWithPredicates nodeWithKey =
new YangInstanceIdentifier.NodeIdentifierWithPredicates(listQname, listKeyQname, "name of band");
- iid2 = YangInstanceIdentifier.builder()
+ this.iid2 = YangInstanceIdentifier.builder()
.node(baseQName)
.build();
.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(containerQname))
.withChild(buildLeaf)
.build();
- buildBaseCont = Builders.containerBuilder()
+ this.buildBaseCont = Builders.containerBuilder()
.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(baseQName))
.withChild(buildPlayerCont)
.build();
.withChild(content)
.withChild(content2)
.build();
- buildList = Builders.mapBuilder()
+ this.buildList = Builders.mapBuilder()
.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(listQname))
.withChild(mapEntryNode)
.build();
- doReturn(UriBuilder.fromUri("http://localhost:8181/restconf/15/")).when(uriInfo).getBaseUriBuilder();
- doReturn(readWrite).when(transactionChain).newReadWriteTransaction();
- doReturn(read).when(transactionChain).newReadOnlyTransaction();
+ doReturn(UriBuilder.fromUri("http://localhost:8181/restconf/16/")).when(this.uriInfo).getBaseUriBuilder();
+ doReturn(this.readWrite).when(this.transactionChain).newReadWriteTransaction();
+ doReturn(this.read).when(this.transactionChain).newReadOnlyTransaction();
}
@Test
public void testPostContainerData() {
- final InstanceIdentifierContext<? extends SchemaNode> iidContext = new InstanceIdentifierContext<>(iid2, null, null, schema);
- final NormalizedNodeContext payload = new NormalizedNodeContext(iidContext, buildBaseCont);
+ final InstanceIdentifierContext<? extends SchemaNode> iidContext = new InstanceIdentifierContext<>(this.iid2, null, null, this.schema);
+ final NormalizedNodeContext payload = new NormalizedNodeContext(iidContext, this.buildBaseCont);
- doReturn(Futures.immediateCheckedFuture(Optional.absent())).when(read).read(LogicalDatastoreType.CONFIGURATION, iid2);
+ doReturn(Futures.immediateCheckedFuture(Optional.absent())).when(this.read).read(LogicalDatastoreType.CONFIGURATION, this.iid2);
final YangInstanceIdentifier.NodeIdentifier identifier = ((ContainerNode) ((SingletonSet) payload.getData().getValue()).iterator().next()).getIdentifier();
final YangInstanceIdentifier node = payload.getInstanceIdentifierContext().getInstanceIdentifier().node(identifier);
- doReturn(Futures.immediateCheckedFuture(false)).when(readWrite).exists(LogicalDatastoreType.CONFIGURATION, node);
- doNothing().when(readWrite).put(LogicalDatastoreType.CONFIGURATION, node, payload.getData());
- doReturn(Futures.immediateCheckedFuture(null)).when(readWrite).submit();
- final TransactionVarsWrapper wrapper = new TransactionVarsWrapper(payload.getInstanceIdentifierContext(), null, transactionChain);
- final Response response = PostDataTransactionUtil.postData(uriInfo, payload, wrapper, refSchemaCtx);
+ doReturn(Futures.immediateCheckedFuture(false)).when(this.readWrite).exists(LogicalDatastoreType.CONFIGURATION, node);
+ doNothing().when(this.readWrite).put(LogicalDatastoreType.CONFIGURATION, node, payload.getData());
+ doReturn(Futures.immediateCheckedFuture(null)).when(this.readWrite).submit();
+ final TransactionVarsWrapper wrapper = new TransactionVarsWrapper(payload.getInstanceIdentifierContext(), null, this.transactionChain);
+ final Response response = PostDataTransactionUtil.postData(this.uriInfo, payload, wrapper, this.refSchemaCtx);
assertEquals(201, response.getStatus());
- verify(readWrite).exists(LogicalDatastoreType.CONFIGURATION, node);
- verify(readWrite).put(LogicalDatastoreType.CONFIGURATION, node, (NormalizedNode<?, ?>) ((SingletonSet) payload.getData().getValue()).iterator().next());
+ verify(this.readWrite).exists(LogicalDatastoreType.CONFIGURATION, node);
+ verify(this.readWrite).put(LogicalDatastoreType.CONFIGURATION, node, (NormalizedNode<?, ?>) ((SingletonSet) payload.getData().getValue()).iterator().next());
}
@Test
public void testPostListData() {
- final InstanceIdentifierContext<? extends SchemaNode> iidContext = new InstanceIdentifierContext<>(iid2, null, null, schema);
- final NormalizedNodeContext payload = new NormalizedNodeContext(iidContext, buildList);
+ final InstanceIdentifierContext<? extends SchemaNode> iidContext = new InstanceIdentifierContext<>(this.iid2, null, null, this.schema);
+ final NormalizedNodeContext payload = new NormalizedNodeContext(iidContext, this.buildList);
- doReturn(Futures.immediateCheckedFuture(Optional.absent())).when(read).read(LogicalDatastoreType.CONFIGURATION, iid2);
+ doReturn(Futures.immediateCheckedFuture(Optional.absent())).when(this.read).read(LogicalDatastoreType.CONFIGURATION, this.iid2);
final MapNode data = (MapNode) payload.getData();
final YangInstanceIdentifier.NodeIdentifierWithPredicates identifier = data.getValue().iterator().next().getIdentifier();
final YangInstanceIdentifier node = payload.getInstanceIdentifierContext().getInstanceIdentifier().node(identifier);
- doReturn(Futures.immediateCheckedFuture(false)).when(readWrite).exists(LogicalDatastoreType.CONFIGURATION, node);
- doNothing().when(readWrite).put(LogicalDatastoreType.CONFIGURATION, node, payload.getData());
- doReturn(Futures.immediateCheckedFuture(null)).when(readWrite).submit();
- final TransactionVarsWrapper wrapper = new TransactionVarsWrapper(payload.getInstanceIdentifierContext(), null, transactionChain);
- final Response response = PostDataTransactionUtil.postData(uriInfo, payload, wrapper, refSchemaCtx);
+ doReturn(Futures.immediateCheckedFuture(false)).when(this.readWrite).exists(LogicalDatastoreType.CONFIGURATION, node);
+ doNothing().when(this.readWrite).put(LogicalDatastoreType.CONFIGURATION, node, payload.getData());
+ doReturn(Futures.immediateCheckedFuture(null)).when(this.readWrite).submit();
+ final TransactionVarsWrapper wrapper = new TransactionVarsWrapper(payload.getInstanceIdentifierContext(), null, this.transactionChain);
+ final Response response = PostDataTransactionUtil.postData(this.uriInfo, payload, wrapper, this.refSchemaCtx);
assertEquals(201, response.getStatus());
- verify(readWrite).exists(LogicalDatastoreType.CONFIGURATION, node);
- verify(readWrite).put(LogicalDatastoreType.CONFIGURATION, node, data.getValue().iterator().next());
+ verify(this.readWrite).exists(LogicalDatastoreType.CONFIGURATION, node);
+ verify(this.readWrite).put(LogicalDatastoreType.CONFIGURATION, node, data.getValue().iterator().next());
}
@Test
public void testPostDataFail() {
- final InstanceIdentifierContext<? extends SchemaNode> iidContext = new InstanceIdentifierContext<>(iid2, null, null, schema);
- final NormalizedNodeContext payload = new NormalizedNodeContext(iidContext, buildBaseCont);
+ final InstanceIdentifierContext<? extends SchemaNode> iidContext = new InstanceIdentifierContext<>(this.iid2, null, null, this.schema);
+ final NormalizedNodeContext payload = new NormalizedNodeContext(iidContext, this.buildBaseCont);
- doReturn(Futures.immediateCheckedFuture(Optional.absent())).when(read).read(LogicalDatastoreType.CONFIGURATION, iid2);
+ doReturn(Futures.immediateCheckedFuture(Optional.absent())).when(this.read).read(LogicalDatastoreType.CONFIGURATION, this.iid2);
final YangInstanceIdentifier.NodeIdentifier identifier = ((ContainerNode) ((SingletonSet) payload.getData().getValue()).iterator().next()).getIdentifier();
final YangInstanceIdentifier node = payload.getInstanceIdentifierContext().getInstanceIdentifier().node(identifier);
- doReturn(Futures.immediateCheckedFuture(false)).when(readWrite).exists(LogicalDatastoreType.CONFIGURATION, node);
- doNothing().when(readWrite).put(LogicalDatastoreType.CONFIGURATION, node,
+ doReturn(Futures.immediateCheckedFuture(false)).when(this.readWrite).exists(LogicalDatastoreType.CONFIGURATION, node);
+ doNothing().when(this.readWrite).put(LogicalDatastoreType.CONFIGURATION, node,
payload.getData());
- doReturn(Futures.immediateFailedCheckedFuture(new DOMException((short) 414, "Post request failed"))).when(readWrite).submit();
- final TransactionVarsWrapper wrapper = new TransactionVarsWrapper(payload.getInstanceIdentifierContext(), null, transactionChain);
- final Response response = PostDataTransactionUtil.postData(uriInfo, payload, wrapper, refSchemaCtx);
+ doReturn(Futures.immediateFailedCheckedFuture(new DOMException((short) 414, "Post request failed"))).when(this.readWrite).submit();
+ final TransactionVarsWrapper wrapper = new TransactionVarsWrapper(payload.getInstanceIdentifierContext(), null, this.transactionChain);
+ final Response response = PostDataTransactionUtil.postData(this.uriInfo, payload, wrapper, this.refSchemaCtx);
assertEquals(Response.Status.INTERNAL_SERVER_ERROR, response.getStatusInfo());
- verify(readWrite).exists(LogicalDatastoreType.CONFIGURATION, node);
- verify(readWrite).put(LogicalDatastoreType.CONFIGURATION, node, (NormalizedNode<?, ?>) ((SingletonSet) payload.getData().getValue()).iterator().next());
+ verify(this.readWrite).exists(LogicalDatastoreType.CONFIGURATION, node);
+ verify(this.readWrite).put(LogicalDatastoreType.CONFIGURATION, node, (NormalizedNode<?, ?>) ((SingletonSet) payload.getData().getValue()).iterator().next());
}
}
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.Draft15;
-import org.opendaylight.restconf.Draft15.MonitoringModule;
-import org.opendaylight.restconf.Draft15.RestconfModule;
+import org.opendaylight.restconf.Draft16;
+import org.opendaylight.restconf.Draft16.MonitoringModule;
+import org.opendaylight.restconf.Draft16.RestconfModule;
import org.opendaylight.restconf.utils.schema.context.RestconfSchemaUtil;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
*/
private Module getTestingRestconfModule(final String s) {
return RestconfMappingNodeUtilTest.schemaContext.findModuleByName(
- s, Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
+ s, Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
}
/**
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
-import static org.opendaylight.restconf.Draft15.MonitoringModule;
-import static org.opendaylight.restconf.Draft15.RestconfModule;
+import static org.opendaylight.restconf.Draft16.MonitoringModule;
+import static org.opendaylight.restconf.Draft16.RestconfModule;
import com.google.common.collect.Sets;
import java.util.NoSuchElementException;
import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError;
-import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft16;
import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
* @return Restconf module
*/
private Module getTestingRestconfModule(final String s) {
- return schemaContext.findModuleByName(s, Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
+ return schemaContext.findModuleByName(s, Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
}
}