From: Jakub Toth Date: Thu, 24 Nov 2016 15:02:22 +0000 (+0100) Subject: Bug 7231 - Upgrade ietf-restconf draft17 to draft18 X-Git-Tag: release/carbon~120 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=17f4fc5e182e583114bb48bbcd693f69a6852e59;p=netconf.git Bug 7231 - Upgrade ietf-restconf draft17 to draft18 Change-Id: Ie964ab3654f7a28472b138012a7235e599940ed4 Signed-off-by: Jakub Toth --- diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/RestconfWrapperProviders.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/RestconfWrapperProviders.java index 48b8670c8f..ec634bcd9b 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/RestconfWrapperProviders.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/RestconfWrapperProviders.java @@ -16,21 +16,21 @@ import org.opendaylight.restconf.RestConnectorProvider; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber; /** - * Wrapping providers from restconf draft02 and draft17. + * Wrapping providers from restconf draft02 and draft18. * */ public class RestconfWrapperProviders implements AutoCloseable, RestConnector { // DRAFT02 private final RestconfProviderImpl providerDraft02; - // DRAFT17 - private final RestConnectorProvider providerDraft17; + // DRAFT18 + private final RestConnectorProvider providerDraft18; /** * Init both providers: * * * @param port @@ -41,14 +41,14 @@ public class RestconfWrapperProviders implements AutoCloseable, RestConnector { this.providerDraft02 = new RestconfProviderImpl(); this.providerDraft02.setWebsocketPort(port); - this.providerDraft17 = new RestConnectorProvider(); + this.providerDraft18 = new RestConnectorProvider(); } /** * Register both providers, which will use the SAL layer: * * * @param broker @@ -58,8 +58,8 @@ public class RestconfWrapperProviders implements AutoCloseable, RestConnector { // Register draft02 provider broker.registerProvider(this.providerDraft02); - // Register draft17 provider - broker.registerProvider(this.providerDraft17); + // Register draft18 provider + broker.registerProvider(this.providerDraft18); } /** @@ -77,7 +77,7 @@ public class RestconfWrapperProviders implements AutoCloseable, RestConnector { @Override public void close() throws Exception { this.providerDraft02.close(); - this.providerDraft17.close(); + this.providerDraft18.close(); } } diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYangBodyWriter.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYangBodyWriter.java index 9516a3954e..8d7632733b 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYangBodyWriter.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYangBodyWriter.java @@ -18,10 +18,10 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.ext.MessageBodyWriter; import javax.ws.rs.ext.Provider; -import org.opendaylight.restconf.Draft17; +import org.opendaylight.restconf.Draft18; @Provider -@Produces({ SchemaRetrievalService.YANG_MEDIA_TYPE, Draft17.MediaTypes.YANG }) +@Produces({ SchemaRetrievalService.YANG_MEDIA_TYPE, Draft18.MediaTypes.YANG }) public class SchemaExportContentYangBodyWriter implements MessageBodyWriter { @Override diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYinBodyWriter.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYinBodyWriter.java index 724e593604..76a9c4a0dd 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYinBodyWriter.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYinBodyWriter.java @@ -18,12 +18,12 @@ import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.ext.MessageBodyWriter; import javax.ws.rs.ext.Provider; import javax.xml.stream.XMLStreamException; -import org.opendaylight.restconf.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.model.export.YinExportUtils; @Provider -@Produces({ SchemaRetrievalService.YIN_MEDIA_TYPE, Draft17.MediaTypes.YIN + RestconfConstants.XML }) +@Produces({ SchemaRetrievalService.YIN_MEDIA_TYPE, Draft18.MediaTypes.YIN + RestconfConstants.XML }) public class SchemaExportContentYinBodyWriter implements MessageBodyWriter { @Override diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/api/Draft02.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/api/Draft02.java index 0675f89ac6..0b1d287727 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/api/Draft02.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/api/Draft02.java @@ -7,12 +7,12 @@ */ package org.opendaylight.netconf.sal.rest.api; -import org.opendaylight.restconf.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.yangtools.yang.common.QName; /** * @deprecated Do not use old implementation of restconf draft. It will be - * replaced by {@link Draft17}. + * replaced by {@link Draft18}. * */ @Deprecated diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java index 179d2ad59c..305e006740 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java @@ -30,7 +30,7 @@ import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; 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.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; @@ -53,7 +53,7 @@ import org.slf4j.LoggerFactory; @Provider @Consumes({ Draft02.MediaTypes.DATA + RestconfService.JSON, Draft02.MediaTypes.OPERATION + RestconfService.JSON, - Draft17.MediaTypes.DATA + RestconfConstants.JSON, MediaType.APPLICATION_JSON }) + Draft18.MediaTypes.DATA + RestconfConstants.JSON, MediaType.APPLICATION_JSON }) public class JsonNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsProvider implements MessageBodyReader { private final static Logger LOG = LoggerFactory.getLogger(JsonNormalizedNodeBodyReader.class); diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHJsonBodyWriter.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHJsonBodyWriter.java index 1283d362cd..8165704c9c 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHJsonBodyWriter.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHJsonBodyWriter.java @@ -27,14 +27,14 @@ import org.opendaylight.netconf.sal.rest.api.RestconfService; 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.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.data.codec.gson.JsonWriterFactory; @Provider @Produces({Draft02.MediaTypes.PATCH_STATUS + RestconfService.JSON, - Draft17.MediaTypes.PATCH_STATUS + RestconfConstants.JSON}) + Draft18.MediaTypes.PATCH_STATUS + RestconfConstants.JSON}) public class PATCHJsonBodyWriter implements MessageBodyWriter { @Override diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHXmlBodyWriter.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHXmlBodyWriter.java index 747e273453..3a92515bcb 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHXmlBodyWriter.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHXmlBodyWriter.java @@ -28,12 +28,12 @@ import org.opendaylight.netconf.sal.rest.api.RestconfService; 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.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.utils.RestconfConstants; @Provider @Produces({Draft02.MediaTypes.PATCH_STATUS + RestconfService.XML, - Draft17.MediaTypes.PATCH_STATUS + RestconfConstants.XML}) + Draft18.MediaTypes.PATCH_STATUS + RestconfConstants.XML}) public class PATCHXmlBodyWriter implements MessageBodyWriter { private static final XMLOutputFactory XML_FACTORY; diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Draft17.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Draft18.java similarity index 94% rename from restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Draft17.java rename to restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Draft18.java index bfc6f0da0f..df4b45a904 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Draft17.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Draft18.java @@ -20,13 +20,13 @@ import org.opendaylight.yangtools.yang.common.QName; * * * - * We used old revision {@link Draft17.RestconfModule#REVISION} of restconf yang + * We used old revision {@link Draft18.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 Draft17 { +public final class Draft18 { - private Draft17() { + private Draft18() { throw new UnsupportedOperationException("Util class"); } @@ -79,8 +79,8 @@ public final class Draft17 { public static final String ERROR_LIST_SCHEMA_NODE = "error"; - public static final QName IETF_RESTCONF_QNAME = QName.create(Draft17.RestconfModule.NAMESPACE, Draft17.RestconfModule.REVISION, - Draft17.RestconfModule.NAME); + public static final QName IETF_RESTCONF_QNAME = QName.create(Draft18.RestconfModule.NAMESPACE, Draft18.RestconfModule.REVISION, + Draft18.RestconfModule.NAME); public static final QName ERRORS_CONTAINER_QNAME = QName.create(IETF_RESTCONF_QNAME, ERRORS_CONTAINER_SCHEMA_NODE); diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/RestConnectorProvider.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/RestConnectorProvider.java index 6f5964a626..e69584c8a2 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/RestConnectorProvider.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/RestConnectorProvider.java @@ -36,7 +36,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Provider for restconf draft17. + * Provider for restconf draft18. * */ public class RestConnectorProvider implements Provider, RestConnector, AutoCloseable { diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/common/references/SchemaContextRef.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/common/references/SchemaContextRef.java index b257d2f468..371fee4bfb 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/common/references/SchemaContextRef.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/common/references/SchemaContextRef.java @@ -12,7 +12,7 @@ import java.net.URI; import java.util.Date; import java.util.Set; import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint; -import org.opendaylight.restconf.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.model.api.Module; import org.opendaylight.yangtools.yang.model.api.SchemaContext; @@ -73,13 +73,13 @@ public final class SchemaContextRef { /** * Get {@link Module} by ietf-restconf qname from - * {@link Draft17.RestconfModule} + * {@link Draft18.RestconfModule} * * @return {@link Module} */ public Module getRestconfModule() { - return this.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME.getNamespace(), - Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision()); + return this.findModuleByNamespaceAndRevision(Draft18.RestconfModule.IETF_RESTCONF_QNAME.getNamespace(), + Draft18.RestconfModule.IETF_RESTCONF_QNAME.getRevision()); } /** diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/handlers/RpcServiceHandler.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/handlers/RpcServiceHandler.java index a2477cc6b5..37a736f324 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/handlers/RpcServiceHandler.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/handlers/RpcServiceHandler.java @@ -25,6 +25,4 @@ public class RpcServiceHandler implements Handler { public DOMRpcService get() { return this.rpcService; } - - } diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/JsonNormalizedNodeBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/JsonNormalizedNodeBodyReader.java index 4fa9576856..5b8acd269d 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/JsonNormalizedNodeBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/JsonNormalizedNodeBodyReader.java @@ -29,7 +29,7 @@ import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; 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.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; @@ -51,7 +51,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @Provider -@Consumes({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, MediaType.APPLICATION_JSON }) +@Consumes({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, MediaType.APPLICATION_JSON }) public class JsonNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsProvider implements MessageBodyReader { private final static Logger LOG = LoggerFactory.getLogger(JsonNormalizedNodeBodyReader.class); diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/JsonToPATCHBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/JsonToPATCHBodyReader.java index b0f50a6aa0..68b67ccdb9 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/JsonToPATCHBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/JsonToPATCHBodyReader.java @@ -35,7 +35,7 @@ import org.opendaylight.netconf.sal.restconf.impl.PATCHEntity; 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.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; @@ -51,7 +51,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @Provider -@Consumes({Draft17.MediaTypes.PATCH + RestconfConstants.JSON}) +@Consumes({Draft18.MediaTypes.PATCH + RestconfConstants.JSON}) public class JsonToPATCHBodyReader extends AbstractIdentifierAwareJaxRsProvider implements MessageBodyReader { diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/NormalizedNodeJsonBodyWriter.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/NormalizedNodeJsonBodyWriter.java index 349563a22b..6d31d6f26a 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/NormalizedNodeJsonBodyWriter.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/NormalizedNodeJsonBodyWriter.java @@ -27,7 +27,7 @@ import javax.ws.rs.ext.Provider; import org.opendaylight.netconf.sal.rest.api.RestconfNormalizedNodeWriter; import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext; import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; -import org.opendaylight.restconf.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; @@ -47,7 +47,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaNode; import org.opendaylight.yangtools.yang.model.api.SchemaPath; @Provider -@Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, MediaType.APPLICATION_JSON }) +@Produces({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, MediaType.APPLICATION_JSON }) public class NormalizedNodeJsonBodyWriter implements MessageBodyWriter { private static final int DEFAULT_INDENT_SPACES_NUM = 2; diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/NormalizedNodeXmlBodyWriter.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/NormalizedNodeXmlBodyWriter.java index b474f4e74b..a0fb26fb6a 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/NormalizedNodeXmlBodyWriter.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/NormalizedNodeXmlBodyWriter.java @@ -30,7 +30,7 @@ import javax.xml.stream.XMLStreamWriter; import org.opendaylight.netconf.sal.rest.api.RestconfNormalizedNodeWriter; import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext; import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; -import org.opendaylight.restconf.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @@ -44,7 +44,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.model.api.SchemaPath; @Provider -@Produces({ Draft17.MediaTypes.DATA + RestconfConstants.XML, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) +@Produces({ Draft18.MediaTypes.DATA + RestconfConstants.XML, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) public class NormalizedNodeXmlBodyWriter implements MessageBodyWriter { private static final XMLOutputFactory XML_FACTORY; diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/XmlNormalizedNodeBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/XmlNormalizedNodeBodyReader.java index 8ea2f92541..8c6fa6b819 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/XmlNormalizedNodeBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/XmlNormalizedNodeBodyReader.java @@ -34,7 +34,7 @@ import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; 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.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; @@ -57,7 +57,7 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; @Provider -@Consumes({ Draft17.MediaTypes.DATA + RestconfConstants.XML, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) +@Consumes({ Draft18.MediaTypes.DATA + RestconfConstants.XML, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) public class XmlNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsProvider implements MessageBodyReader { private final static Logger LOG = LoggerFactory.getLogger(XmlNormalizedNodeBodyReader.class); diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/XmlToPATCHBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/XmlToPATCHBodyReader.java index 1f6d5632a9..1bf1efbc9a 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/XmlToPATCHBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/XmlToPATCHBodyReader.java @@ -35,7 +35,7 @@ import org.opendaylight.netconf.sal.restconf.impl.PATCHEntity; 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.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; @@ -58,7 +58,7 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; @Provider -@Consumes({Draft17.MediaTypes.PATCH + RestconfConstants.XML}) +@Consumes({Draft18.MediaTypes.PATCH + RestconfConstants.XML}) public class XmlToPATCHBodyReader extends AbstractIdentifierAwareJaxRsProvider implements MessageBodyReader { diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/RestconfModulesService.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/RestconfModulesService.java index b9e6c139b7..e74bb66f47 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/RestconfModulesService.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/RestconfModulesService.java @@ -15,7 +15,7 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.UriInfo; import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; -import org.opendaylight.restconf.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.utils.RestconfConstants; /** @@ -32,7 +32,7 @@ public interface RestconfModulesService { */ @GET @Path("data/ietf-yang-library:modules-state") - @Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) public NormalizedNodeContext getModules(@Context UriInfo uriInfo); @@ -48,7 +48,7 @@ public interface RestconfModulesService { */ @GET @Path("data/ietf-yang-library:modules-state/{identifier:.+}") - @Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) public NormalizedNodeContext getModules(@PathParam("identifier") String identifier, @Context UriInfo uriInfo); @@ -65,7 +65,7 @@ public interface RestconfModulesService { */ @GET @Path("data/ietf-yang-library:modules-state/module/{identifier:.+}") - @Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.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 diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/RestconfOperationsService.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/RestconfOperationsService.java index f6874d6368..e6372d6408 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/RestconfOperationsService.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/RestconfOperationsService.java @@ -15,7 +15,7 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.UriInfo; import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; -import org.opendaylight.restconf.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.utils.RestconfConstants; /** @@ -34,7 +34,7 @@ public interface RestconfOperationsService { */ @GET @Path("/operations") - @Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) public NormalizedNodeContext getOperations(@Context UriInfo uriInfo); @@ -49,7 +49,7 @@ public interface RestconfOperationsService { */ @GET @Path("/operations/{identifier:.+}") - @Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.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 diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/RestconfSchemaService.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/RestconfSchemaService.java index 261455593e..93b52b2ef6 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/RestconfSchemaService.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/RestconfSchemaService.java @@ -12,7 +12,7 @@ import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import org.opendaylight.netconf.md.sal.rest.schema.SchemaExportContext; -import org.opendaylight.restconf.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.utils.RestconfConstants; /** @@ -30,7 +30,7 @@ public interface RestconfSchemaService { * @return {@link SchemaExportContext} */ @GET - @Produces({ Draft17.MediaTypes.YANG, Draft17.MediaTypes.YIN + RestconfConstants.XML }) + @Produces({ Draft18.MediaTypes.YANG, Draft18.MediaTypes.YIN + RestconfConstants.XML }) @Path("data/ietf-yang-library:modules/module/{identifier:.+}/schema") SchemaExportContext getSchema(@PathParam("identifier") String identifier); } diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/RestconfStreamsService.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/RestconfStreamsService.java index 732258fd2a..16912db0e8 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/RestconfStreamsService.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/RestconfStreamsService.java @@ -14,7 +14,7 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.UriInfo; import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; -import org.opendaylight.restconf.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.utils.RestconfConstants; /** @@ -33,7 +33,7 @@ public interface RestconfStreamsService { */ @GET @Path("data/ietf-restconf-monitoring:restconf-state/streams") - @Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) public NormalizedNodeContext getAvailableStreams(@Context UriInfo uriInfo); } \ No newline at end of file diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/impl/RestconfModulesServiceImpl.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/impl/RestconfModulesServiceImpl.java index 5b7a6ebd99..6ccc2225ff 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/impl/RestconfModulesServiceImpl.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/impl/RestconfModulesServiceImpl.java @@ -18,7 +18,7 @@ import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; 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.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.common.references.SchemaContextRef; import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler; import org.opendaylight.restconf.handlers.SchemaContextHandler; @@ -117,7 +117,7 @@ public class RestconfModulesServiceImpl implements RestconfModulesService { final MapNode moduleMap = RestconfMappingNodeUtil .restconfMappingNode(schemaContextRef.getRestconfModule(), modules); final DataSchemaNode moduleSchemaNode = RestconfSchemaUtil.getRestconfSchemaNode( - schemaContextRef.getRestconfModule(), Draft17.RestconfModule.MODULE_LIST_SCHEMA_NODE); + schemaContextRef.getRestconfModule(), Draft18.RestconfModule.MODULE_LIST_SCHEMA_NODE); Preconditions.checkState(moduleSchemaNode instanceof ListSchemaNode); if (mountPoint == null) { return new NormalizedNodeContext( @@ -148,7 +148,7 @@ public class RestconfModulesServiceImpl implements RestconfModulesService { final MapNode mapNodes = RestconfMappingNodeUtil.restconfMappingNode(restconfModule, modules); final DataSchemaNode schemaNode = RestconfSchemaUtil.getRestconfSchemaNode(restconfModule, - Draft17.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE); + Draft18.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE); Preconditions.checkState(schemaNode instanceof ContainerSchemaNode); final DataContainerNodeAttrBuilder modulContainerSchemaNodeBuilder = Builders .containerBuilder((ContainerSchemaNode) schemaNode); diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/impl/RestconfStreamsServiceImpl.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/impl/RestconfStreamsServiceImpl.java index 49247769d1..06f46ebc53 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/impl/RestconfStreamsServiceImpl.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/impl/RestconfStreamsServiceImpl.java @@ -13,7 +13,7 @@ import javax.ws.rs.core.UriInfo; 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.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.common.references.SchemaContextRef; import org.opendaylight.restconf.handlers.SchemaContextHandler; import org.opendaylight.restconf.rest.services.api.RestconfStreamsService; @@ -56,7 +56,7 @@ public class RestconfStreamsServiceImpl implements RestconfStreamsService { final Set availableStreams = Notificator.getStreamNames(); final DataSchemaNode streamListSchemaNode = RestconfSchemaUtil.getRestconfSchemaNode( - schemaContextRef.getRestconfModule(), Draft17.MonitoringModule.STREAM_LIST_SCHEMA_NODE); + schemaContextRef.getRestconfModule(), Draft18.MonitoringModule.STREAM_LIST_SCHEMA_NODE); Preconditions.checkState(streamListSchemaNode instanceof ListSchemaNode); final CollectionNodeBuilder listStreamBuilder = Builders .mapBuilder((ListSchemaNode) streamListSchemaNode); @@ -66,7 +66,7 @@ public class RestconfStreamsServiceImpl implements RestconfStreamsService { } final DataSchemaNode streamContSchemaNode = RestconfSchemaUtil.getRestconfSchemaNode( - schemaContextRef.getRestconfModule(), Draft17.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE); + schemaContextRef.getRestconfModule(), Draft18.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE); Preconditions.checkState(streamContSchemaNode instanceof ContainerSchemaNode); final DataContainerNodeAttrBuilder streamsContainerBuilder = Builders .containerBuilder((ContainerSchemaNode) streamContSchemaNode); diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/RestconfDataService.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/RestconfDataService.java index 3235f20671..6b5876cb58 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/RestconfDataService.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/RestconfDataService.java @@ -24,7 +24,7 @@ import org.opendaylight.netconf.sal.rest.impl.PATCH; 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.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.utils.RestconfConstants; /** @@ -45,7 +45,7 @@ public interface RestconfDataService { */ @GET @Path("/data/{identifier:.+}") - @Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) Response readData(@Encoded @PathParam("identifier") String identifier, @Context UriInfo uriInfo); @@ -58,7 +58,7 @@ public interface RestconfDataService { */ @GET @Path("/data") - @Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) Response readData(@Context UriInfo uriInfo); @@ -73,7 +73,7 @@ public interface RestconfDataService { */ @PUT @Path("/data/{identifier:.+}") - @Consumes({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Consumes({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) Response putData(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload, @Context UriInfo uriInfo); @@ -91,7 +91,7 @@ public interface RestconfDataService { */ @POST @Path("/data/{identifier:.+}") - @Consumes({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Consumes({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) Response postData(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload, @Context UriInfo uriInfo); @@ -107,7 +107,7 @@ public interface RestconfDataService { */ @POST @Path("/data") - @Consumes({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Consumes({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) Response postData(NormalizedNodeContext payload, @Context UriInfo uriInfo); @@ -136,9 +136,9 @@ public interface RestconfDataService { */ @PATCH @Path("/data/{identifier:.+}") - @Consumes({ Draft17.MediaTypes.PATCH + RestconfConstants.JSON, Draft17.MediaTypes.PATCH + RestconfConstants.XML }) - @Produces({ Draft17.MediaTypes.PATCH_STATUS + RestconfConstants.JSON, - Draft17.MediaTypes.PATCH_STATUS + RestconfConstants.XML }) + @Consumes({ Draft18.MediaTypes.PATCH + RestconfConstants.JSON, Draft18.MediaTypes.PATCH + RestconfConstants.XML }) + @Produces({ Draft18.MediaTypes.PATCH_STATUS + RestconfConstants.JSON, + Draft18.MediaTypes.PATCH_STATUS + RestconfConstants.XML }) PATCHStatusContext patchData(@Encoded @PathParam("identifier") String identifier, PATCHContext context, @Context UriInfo uriInfo); @@ -153,8 +153,8 @@ public interface RestconfDataService { */ @PATCH @Path("/data") - @Consumes({ Draft17.MediaTypes.PATCH + RestconfConstants.JSON, Draft17.MediaTypes.PATCH + RestconfConstants.XML }) - @Produces({ Draft17.MediaTypes.PATCH_STATUS + RestconfConstants.JSON, - Draft17.MediaTypes.PATCH_STATUS + RestconfConstants.XML }) + @Consumes({ Draft18.MediaTypes.PATCH + RestconfConstants.JSON, Draft18.MediaTypes.PATCH + RestconfConstants.XML }) + @Produces({ Draft18.MediaTypes.PATCH_STATUS + RestconfConstants.JSON, + Draft18.MediaTypes.PATCH_STATUS + RestconfConstants.XML }) PATCHStatusContext patchData(PATCHContext context, @Context UriInfo uriInfo); } diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/RestconfInvokeOperationsService.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/RestconfInvokeOperationsService.java index df58decd35..ebe762813a 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/RestconfInvokeOperationsService.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/RestconfInvokeOperationsService.java @@ -17,7 +17,7 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.UriInfo; import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; -import org.opendaylight.restconf.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.utils.RestconfConstants; /** @@ -41,9 +41,9 @@ public interface RestconfInvokeOperationsService { */ @POST @Path("/operations/{identifier:.+}") - @Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) - @Consumes({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Consumes({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) NormalizedNodeContext invokeRpc(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload, @Context UriInfo uriInfo); diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/mapping/RestconfMappingNodeUtil.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/mapping/RestconfMappingNodeUtil.java index ded6d9739a..0eb2e48a9b 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/mapping/RestconfMappingNodeUtil.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/mapping/RestconfMappingNodeUtil.java @@ -10,7 +10,7 @@ package org.opendaylight.restconf.utils.mapping; import com.google.common.base.Preconditions; import java.util.Collection; import java.util.Set; -import org.opendaylight.restconf.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.restconf.utils.schema.context.RestconfSchemaUtil; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; @@ -50,7 +50,7 @@ public final class RestconfMappingNodeUtil { */ public static MapNode restconfMappingNode(final Module restconfModule, final Set modules) { final DataSchemaNode modulListSchemaNode = RestconfSchemaUtil.getRestconfSchemaNode(restconfModule, - Draft17.RestconfModule.MODULE_LIST_SCHEMA_NODE); + Draft18.RestconfModule.MODULE_LIST_SCHEMA_NODE); Preconditions.checkState(modulListSchemaNode instanceof ListSchemaNode); final CollectionNodeBuilder listModuleBuilder = Builders diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/schema/context/RestconfSchemaUtil.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/schema/context/RestconfSchemaUtil.java index 984dd58abf..2b7e7559e3 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/schema/context/RestconfSchemaUtil.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/schema/context/RestconfSchemaUtil.java @@ -13,7 +13,7 @@ import java.util.Set; 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.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.yangtools.yang.model.api.DataNodeContainer; import org.opendaylight.yangtools.yang.model.api.DataSchemaNode; import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; @@ -44,7 +44,7 @@ public final class RestconfSchemaUtil { final Set groupings = restconfModule.getGroupings(); final GroupingDefinition restGroup = findSchemaNodeInCollection(groupings, - Draft17.RestconfModule.RESTCONF_GROUPING_SCHEMA_NODE); + Draft18.RestconfModule.RESTCONF_GROUPING_SCHEMA_NODE); final Collection childNodes = restGroup.getChildNodes(); final DataSchemaNode restCont = childNodes.iterator().next(); @@ -64,31 +64,31 @@ public final class RestconfSchemaUtil { private static DataSchemaNode findSchemaNode(final DataSchemaNode restCont, final String schemaNodeName) { switch (schemaNodeName) { //MODULES - case Draft17.RestconfModule.MODULE_LIST_SCHEMA_NODE: + case Draft18.RestconfModule.MODULE_LIST_SCHEMA_NODE: final DataSchemaNode moduleListSchNode = findSchemaNodeInCollection( ((DataNodeContainer) findSchemaNode(restCont, - Draft17.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE)).getChildNodes(), - Draft17.RestconfModule.MODULE_LIST_SCHEMA_NODE); + Draft18.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE)).getChildNodes(), + Draft18.RestconfModule.MODULE_LIST_SCHEMA_NODE); Preconditions.checkNotNull(moduleListSchNode); return moduleListSchNode; - case Draft17.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE: + case Draft18.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE: final DataSchemaNode modulesContSchNode = findSchemaNodeInCollection(((DataNodeContainer) restCont).getChildNodes(), - Draft17.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE); + Draft18.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE); Preconditions.checkNotNull(modulesContSchNode); return modulesContSchNode; //STREAMS - case Draft17.MonitoringModule.STREAM_LIST_SCHEMA_NODE: + case Draft18.MonitoringModule.STREAM_LIST_SCHEMA_NODE: final DataSchemaNode streamListSchNode = findSchemaNodeInCollection( ((DataNodeContainer) findSchemaNode(restCont, - Draft17.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE)).getChildNodes(), - Draft17.MonitoringModule.STREAM_LIST_SCHEMA_NODE); + Draft18.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE)).getChildNodes(), + Draft18.MonitoringModule.STREAM_LIST_SCHEMA_NODE); Preconditions.checkNotNull(streamListSchNode); return streamListSchNode; - case Draft17.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE: + case Draft18.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE: final DataSchemaNode streamsContSchNode = findSchemaNodeInCollection( ((DataNodeContainer) restCont).getChildNodes(), - Draft17.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE); + Draft18.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE); Preconditions.checkNotNull(streamsContSchNode); return streamsContSchNode; default: diff --git a/restconf/sal-rest-connector/src/main/resources/WEB-INF/web.xml b/restconf/sal-rest-connector/src/main/resources/WEB-INF/web.xml index e93219b820..c71898e415 100644 --- a/restconf/sal-rest-connector/src/main/resources/WEB-INF/web.xml +++ b/restconf/sal-rest-connector/src/main/resources/WEB-INF/web.xml @@ -60,7 +60,7 @@ Restconf - /17/* + /18/* diff --git a/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/rest/services/impl/RestconfModulesServiceTest.java b/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/rest/services/impl/RestconfModulesServiceTest.java index 523625ad82..ed959d3ae1 100644 --- a/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/rest/services/impl/RestconfModulesServiceTest.java +++ b/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/rest/services/impl/RestconfModulesServiceTest.java @@ -47,7 +47,7 @@ import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; 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.Draft17.RestconfModule; +import org.opendaylight.restconf.Draft18.RestconfModule; import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler; import org.opendaylight.restconf.handlers.SchemaContextHandler; import org.opendaylight.restconf.rest.services.api.RestconfModulesService; diff --git a/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/rest/services/impl/RestconfModulesServiceTestUtils.java b/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/rest/services/impl/RestconfModulesServiceTestUtils.java index 636ebdeab0..8ec10ceacf 100644 --- a/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/rest/services/impl/RestconfModulesServiceTestUtils.java +++ b/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/rest/services/impl/RestconfModulesServiceTestUtils.java @@ -29,7 +29,7 @@ import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService; 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.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler; import org.opendaylight.restconf.handlers.SchemaContextHandler; import org.opendaylight.restconf.utils.RestconfConstants; @@ -193,8 +193,8 @@ class RestconfModulesServiceTestUtils { when(schemaContext.findModuleByNamespaceAndRevision(any(URI.class), any(Date.class))).thenAnswer(invocation -> { final Object[] args = invocation.getArguments(); - if ((args[0] == Draft17.RestconfModule.IETF_RESTCONF_QNAME.getNamespace()) - && (args[1] == Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) { + if ((args[0] == Draft18.RestconfModule.IETF_RESTCONF_QNAME.getNamespace()) + && (args[1] == Draft18.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) { return parseCustomRestconfSource(restconfModuleName).findModuleByName( restconfModuleName, (Date) args[1]); } else { diff --git a/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/rest/services/impl/RestconfStreamsServiceTest.java b/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/rest/services/impl/RestconfStreamsServiceTest.java index ef5464eae1..8cc5d3b8df 100644 --- a/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/rest/services/impl/RestconfStreamsServiceTest.java +++ b/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/rest/services/impl/RestconfStreamsServiceTest.java @@ -37,7 +37,7 @@ import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; 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.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.restconf.handlers.SchemaContextHandler; import org.opendaylight.restconf.rest.services.api.RestconfStreamsService; import org.opendaylight.restconf.utils.mapping.RestconfMappingNodeConstants; @@ -112,8 +112,8 @@ public class RestconfStreamsServiceTest { public void getAvailableStreamsTest() throws Exception { // prepare conditions - get correct Restconf module when(this.contextHandler.get()).thenReturn(this.mockSchemaContext); - when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME - .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) + when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft18.RestconfModule.IETF_RESTCONF_QNAME + .getNamespace(), Draft18.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) .thenReturn(getTestingRestconfModule("ietf-restconf")); // make test @@ -146,8 +146,8 @@ public class RestconfStreamsServiceTest { public void getAvailableStreamsMissingRestconfModuleNegativeTest() { // prepare conditions - get null Restconf module when(this.contextHandler.get()).thenReturn(this.mockSchemaContext); - when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME - .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision())).thenReturn(null); + when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft18.RestconfModule.IETF_RESTCONF_QNAME + .getNamespace(), Draft18.RestconfModule.IETF_RESTCONF_QNAME.getRevision())).thenReturn(null); // make test this.thrown.expect(NullPointerException.class); @@ -163,8 +163,8 @@ public class RestconfStreamsServiceTest { public void getAvailableStreamsMissingListStreamNegativeTest() { // prepare conditions - get Restconf module with missing list stream when(this.contextHandler.get()).thenReturn(this.mockSchemaContext); - when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME - .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) + when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft18.RestconfModule.IETF_RESTCONF_QNAME + .getNamespace(), Draft18.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) .thenReturn(getTestingRestconfModule("restconf-module-with-missing-list-stream")); // make test and verify @@ -190,8 +190,8 @@ public class RestconfStreamsServiceTest { public void getAvailableStreamsMissingContainerStreamsNegativeTest() { // prepare conditions - get Restconf module with missing container streams when(this.contextHandler.get()).thenReturn(this.mockSchemaContext); - when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME - .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) + when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft18.RestconfModule.IETF_RESTCONF_QNAME + .getNamespace(), Draft18.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) .thenReturn(getTestingRestconfModule("restconf-module-with-missing-container-streams")); // make test and verify @@ -216,8 +216,8 @@ public class RestconfStreamsServiceTest { public void getAvailableStreamsIllegalListStreamNegativeTest() { // prepare conditions - get Restconf module with illegal list stream when(this.contextHandler.get()).thenReturn(this.mockSchemaContext); - when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME - .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) + when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft18.RestconfModule.IETF_RESTCONF_QNAME + .getNamespace(), Draft18.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) .thenReturn(getTestingRestconfModule("restconf-module-with-illegal-list-stream")); // make test @@ -233,8 +233,8 @@ public class RestconfStreamsServiceTest { public void getAvailableStreamsIllegalContainerStreamsNegativeTest() { // prepare conditions - get Restconf module with illegal container streams when(this.contextHandler.get()).thenReturn(this.mockSchemaContext); - when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME - .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) + when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft18.RestconfModule.IETF_RESTCONF_QNAME + .getNamespace(), Draft18.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) .thenReturn(getTestingRestconfModule("restconf-module-with-illegal-container-streams")); // make test @@ -250,8 +250,8 @@ public class RestconfStreamsServiceTest { 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(Draft17.RestconfModule.IETF_RESTCONF_QNAME - .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) + when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft18.RestconfModule.IETF_RESTCONF_QNAME + .getNamespace(), Draft18.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) .thenReturn(getTestingRestconfModule("restconf-module-with-illegal-leaf-description")); // make test @@ -266,7 +266,7 @@ public class RestconfStreamsServiceTest { * @return Restconf module */ private Module getTestingRestconfModule(final String s) { - return this.schemaContext.findModuleByName(s, Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision()); + return this.schemaContext.findModuleByName(s, Draft18.RestconfModule.IETF_RESTCONF_QNAME.getRevision()); } /** diff --git a/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/restful/services/impl/RestconfStreamsSubscriptionServiceImplTest.java b/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/restful/services/impl/RestconfStreamsSubscriptionServiceImplTest.java index c964ba36d3..cabbd00525 100644 --- a/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/restful/services/impl/RestconfStreamsSubscriptionServiceImplTest.java +++ b/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/restful/services/impl/RestconfStreamsSubscriptionServiceImplTest.java @@ -44,7 +44,7 @@ import org.opendaylight.yangtools.concepts.ListenerRegistration; public class RestconfStreamsSubscriptionServiceImplTest { - private static final String uri = "/restconf/17/data/ietf-restconf-monitoring:restconf-state/streams/stream/" + private static final String uri = "/restconf/18/data/ietf-restconf-monitoring:restconf-state/streams/stream/" + "toaster:toaster/toasterStatus/datastore=OPERATIONAL/scope=ONE"; private static Field listenersByStreamName; diff --git a/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/utils/mapping/RestconfMappingNodeUtilTest.java b/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/utils/mapping/RestconfMappingNodeUtilTest.java index 7cec6de631..1bd3011adb 100644 --- a/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/utils/mapping/RestconfMappingNodeUtilTest.java +++ b/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/utils/mapping/RestconfMappingNodeUtilTest.java @@ -35,9 +35,9 @@ 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.ErrorTag; import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType; -import org.opendaylight.restconf.Draft17; -import org.opendaylight.restconf.Draft17.MonitoringModule; -import org.opendaylight.restconf.Draft17.RestconfModule; +import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Draft18.MonitoringModule; +import org.opendaylight.restconf.Draft18.RestconfModule; import org.opendaylight.restconf.utils.schema.context.RestconfSchemaUtil; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil; @@ -756,7 +756,7 @@ public class RestconfMappingNodeUtilTest { */ private Module getTestingRestconfModule(final String s) { return RestconfMappingNodeUtilTest.schemaContext.findModuleByName( - s, Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision()); + s, Draft18.RestconfModule.IETF_RESTCONF_QNAME.getRevision()); } /** diff --git a/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/utils/schema/context/RestconfSchemaUtilTest.java b/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/utils/schema/context/RestconfSchemaUtilTest.java index 617f601c31..1af04476d8 100644 --- a/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/utils/schema/context/RestconfSchemaUtilTest.java +++ b/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/utils/schema/context/RestconfSchemaUtilTest.java @@ -11,8 +11,8 @@ package org.opendaylight.restconf.utils.schema.context; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; -import static org.opendaylight.restconf.Draft17.MonitoringModule; -import static org.opendaylight.restconf.Draft17.RestconfModule; +import static org.opendaylight.restconf.Draft18.MonitoringModule; +import static org.opendaylight.restconf.Draft18.RestconfModule; import com.google.common.collect.Sets; import java.util.NoSuchElementException; @@ -23,7 +23,7 @@ import org.junit.rules.ExpectedException; 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.Draft17; +import org.opendaylight.restconf.Draft18; import org.opendaylight.yangtools.yang.model.api.DataSchemaNode; import org.opendaylight.yangtools.yang.model.api.Module; import org.opendaylight.yangtools.yang.model.api.SchemaContext; @@ -389,6 +389,6 @@ public class RestconfSchemaUtilTest { * @return Restconf module */ private Module getTestingRestconfModule(final String s) { - return schemaContext.findModuleByName(s, Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision()); + return schemaContext.findModuleByName(s, Draft18.RestconfModule.IETF_RESTCONF_QNAME.getRevision()); } }