From acbc3139281024824f927426562d25a1f764b34c Mon Sep 17 00:00:00 2001 From: Jakub Toth Date: Mon, 3 Oct 2016 15:48:08 +0200 Subject: [PATCH 1/1] Bug 6848 - Renaming to draft17 Change-Id: Ib76f9f0ed4e86a4e9cc15d82fd4ede5040964969 Signed-off-by: Jakub Toth --- .../RestconfWrapperProviders.java | 18 ++++---- .../SchemaExportContentYangBodyWriter.java | 4 +- .../SchemaExportContentYinBodyWriter.java | 4 +- .../netconf/sal/rest/api/Draft02.java | 4 +- .../AbstractIdentifierAwareJaxRsProvider.java | 3 +- .../impl/JsonNormalizedNodeBodyReader.java | 4 +- .../sal/rest/impl/JsonToPATCHBodyReader.java | 42 +++++++++---------- .../impl/NormalizedNodeJsonBodyWriter.java | 4 +- .../impl/NormalizedNodeXmlBodyWriter.java | 4 +- .../sal/rest/impl/PATCHJsonBodyWriter.java | 4 +- .../sal/rest/impl/PATCHXmlBodyWriter.java | 4 +- .../StringModuleInstanceIdentifierCodec.java | 3 +- .../impl/XmlNormalizedNodeBodyReader.java | 4 +- .../sal/rest/impl/XmlToPATCHBodyReader.java | 14 +++---- .../restconf/{Draft16.java => Draft17.java} | 10 ++--- .../restconf/RestConnectorProvider.java | 6 +-- .../restconf/RestconfApplication.java | 10 ++--- .../common/references/SchemaContextRef.java | 8 ++-- ...pperImpl.java => ServicesWrapperImpl.java} | 16 +++---- ...sWrapper.java => BaseServicesWrapper.java} | 2 +- .../services/api/RestconfModulesService.java | 8 ++-- .../api/RestconfOperationsService.java | 6 +-- .../services/api/RestconfSchemaService.java | 4 +- .../services/api/RestconfStreamsService.java | 4 +- .../impl/RestconfModulesServiceImpl.java | 6 +-- .../impl/RestconfStreamsServiceImpl.java | 6 +-- .../services/api/RestconfDataService.java | 22 +++++----- .../api/RestconfInvokeOperationsService.java | 6 +-- ...r.java => TransactionServicesWrapper.java} | 2 +- .../mapping/RestconfMappingNodeUtil.java | 4 +- ...AbstractIdentifierAwareJaxRsProvider.java} | 2 +- ...Reader.java => JsonToPATCHBodyReader.java} | 16 +++---- ... StringModuleInstanceIdentifierCodec.java} | 6 +-- ...yReader.java => XmlToPATCHBodyReader.java} | 12 +++--- .../schema/context/RestconfSchemaUtil.java | 24 +++++------ .../Draft11AbstractBodyReaderTest.java | 8 ++-- .../TestDraft11JsonPATCHBodyReader.java | 6 +-- .../TestDraft11XmlPATCHBodyReader.java | 6 +-- .../impl/RestconfModulesServiceTest.java | 2 +- .../impl/RestconfModulesServiceTestUtils.java | 6 +-- .../impl/RestconfStreamsServiceTest.java | 32 +++++++------- .../mapping/RestconfMappingNodeUtilTest.java | 8 ++-- .../context/RestconfSchemaUtilTest.java | 8 ++-- 43 files changed, 185 insertions(+), 187 deletions(-) rename restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/{Draft16.java => Draft17.java} (94%) rename restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/common/wrapper/services/{Draft16ServicesWrapperImpl.java => ServicesWrapperImpl.java} (92%) rename restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/{Draft16BaseServicesWrapper.java => BaseServicesWrapper.java} (94%) rename restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/{Draft16TransactionServicesWrapper.java => TransactionServicesWrapper.java} (92%) rename restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/{Draft16AbstractIdentifierAwareJaxRsProvider.java => AbstractIdentifierAwareJaxRsProvider.java} (95%) rename restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/{Draft16JsonToPATCHBodyReader.java => JsonToPATCHBodyReader.java} (95%) rename restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/{Draft16StringModuleInstanceIdentifierCodec.java => StringModuleInstanceIdentifierCodec.java} (86%) rename restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/{Draft16XmlToPATCHBodyReader.java => XmlToPATCHBodyReader.java} (96%) 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 5718c8be44..48b8670c8f 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 draft16. + * Wrapping providers from restconf draft02 and draft17. * */ public class RestconfWrapperProviders implements AutoCloseable, RestConnector { // DRAFT02 private final RestconfProviderImpl providerDraft02; - // DRAFT16 - private final RestConnectorProvider providerDraft16; + // DRAFT17 + private final RestConnectorProvider providerDraft17; /** * Init both providers: * * * @param port @@ -41,14 +41,14 @@ public class RestconfWrapperProviders implements AutoCloseable, RestConnector { this.providerDraft02 = new RestconfProviderImpl(); this.providerDraft02.setWebsocketPort(port); - this.providerDraft16 = new RestConnectorProvider(); + this.providerDraft17 = 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 draft16 provider - broker.registerProvider(this.providerDraft16); + // Register draft17 provider + broker.registerProvider(this.providerDraft17); } /** @@ -77,7 +77,7 @@ public class RestconfWrapperProviders implements AutoCloseable, RestConnector { @Override public void close() throws Exception { this.providerDraft02.close(); - this.providerDraft16.close(); + this.providerDraft17.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 e19654f77e..9516a3954e 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.Draft16; +import org.opendaylight.restconf.Draft17; @Provider -@Produces({ SchemaRetrievalService.YANG_MEDIA_TYPE, Draft16.MediaTypes.YANG }) +@Produces({ SchemaRetrievalService.YANG_MEDIA_TYPE, Draft17.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 74baf4189d..724e593604 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.Draft16; +import org.opendaylight.restconf.Draft17; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.model.export.YinExportUtils; @Provider -@Produces({ SchemaRetrievalService.YIN_MEDIA_TYPE, Draft16.MediaTypes.YIN + RestconfConstants.XML }) +@Produces({ SchemaRetrievalService.YIN_MEDIA_TYPE, Draft17.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 dd530b27a2..0675f89ac6 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.Draft16; +import org.opendaylight.restconf.Draft17; import org.opendaylight.yangtools.yang.common.QName; /** * @deprecated Do not use old implementation of restconf draft. It will be - * replaced by {@link Draft16}. + * replaced by {@link Draft17}. * */ @Deprecated diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/AbstractIdentifierAwareJaxRsProvider.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/AbstractIdentifierAwareJaxRsProvider.java index 80494561cb..caa4726d5c 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/AbstractIdentifierAwareJaxRsProvider.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/AbstractIdentifierAwareJaxRsProvider.java @@ -14,11 +14,10 @@ import javax.ws.rs.core.UriInfo; import org.opendaylight.netconf.sal.rest.api.RestconfConstants; import org.opendaylight.netconf.sal.restconf.impl.ControllerContext; import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext; -import org.opendaylight.restconf.utils.patch.Draft16AbstractIdentifierAwareJaxRsProvider; /** * @deprecated This class will be replaced by - * {@link Draft16AbstractIdentifierAwareJaxRsProvider} + * {@link org.opendaylight.restconf.utils.patch.AbstractIdentifierAwareJaxRsProvider} */ @Deprecated public class AbstractIdentifierAwareJaxRsProvider { 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 34b69e5dca..ea51998d9f 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.Draft16; +import org.opendaylight.restconf.Draft17; 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, - Draft16.MediaTypes.DATA + RestconfConstants.JSON, MediaType.APPLICATION_JSON }) + Draft17.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/JsonToPATCHBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonToPATCHBodyReader.java index 78099026cd..75240378cb 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonToPATCHBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonToPATCHBodyReader.java @@ -37,7 +37,6 @@ 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.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; @@ -52,7 +51,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * @deprecated This class will be replaced by {@link Draft16JsonToPATCHBodyReader} + * @deprecated This class will be replaced by + * {@link org.opendaylight.restconf.utils.patch.JsonToPATCHBodyReader} */ @Deprecated @Provider @@ -115,7 +115,7 @@ public class JsonToPATCHBodyReader extends AbstractIdentifierAwareJaxRsProvider final List resultList = read(jsonReader, path); jsonReader.close(); - return new PATCHContext(path, resultList, patchId); + return new PATCHContext(path, resultList, this.patchId); } private List read(final JsonReader in, final InstanceIdentifierContext path) throws IOException { @@ -338,8 +338,8 @@ public class JsonToPATCHBodyReader extends AbstractIdentifierAwareJaxRsProvider * @param in reader JsonReader reader * @return NormalizedNode representing data */ - private NormalizedNode readEditData(@Nonnull final JsonReader in, @Nonnull SchemaNode targetSchemaNode, - @Nonnull InstanceIdentifierContext path) { + private NormalizedNode readEditData(@Nonnull final JsonReader in, @Nonnull final SchemaNode targetSchemaNode, + @Nonnull final InstanceIdentifierContext path) { final NormalizedNodeResult resultHolder = new NormalizedNodeResult(); final NormalizedNodeStreamWriter writer = ImmutableNormalizedNodeStreamWriter.from(resultHolder); JsonParserStream.create(writer, path.getSchemaContext(), targetSchemaNode).parse(in); @@ -353,7 +353,7 @@ public class JsonToPATCHBodyReader extends AbstractIdentifierAwareJaxRsProvider * @return PATCHEntity */ private PATCHEntity prepareEditOperation(@Nonnull final PatchEdit edit) { - if (edit.getOperation() != null && edit.getTargetSchemaNode() != null + if ((edit.getOperation() != null) && (edit.getTargetSchemaNode() != null) && checkDataPresence(edit.getOperation(), (edit.getData() != null))) { if (isPatchOperationWithValue(edit.getOperation())) { // for lists allow to manipulate with list items through their parent @@ -407,51 +407,51 @@ public class JsonToPATCHBodyReader extends AbstractIdentifierAwareJaxRsProvider private NormalizedNode data; public String getId() { - return id; + return this.id; } - public void setId(String id) { + public void setId(final String id) { this.id = id; } public String getOperation() { - return operation; + return this.operation; } - public void setOperation(String operation) { + public void setOperation(final String operation) { this.operation = operation; } public YangInstanceIdentifier getTarget() { - return target; + return this.target; } - public void setTarget(YangInstanceIdentifier target) { + public void setTarget(final YangInstanceIdentifier target) { this.target = target; } public SchemaNode getTargetSchemaNode() { - return targetSchemaNode; + return this.targetSchemaNode; } - public void setTargetSchemaNode(SchemaNode targetSchemaNode) { + public void setTargetSchemaNode(final SchemaNode targetSchemaNode) { this.targetSchemaNode = targetSchemaNode; } public NormalizedNode getData() { - return data; + return this.data; } - public void setData(NormalizedNode data) { + public void setData(final NormalizedNode data) { this.data = data; } public void clear() { - id = null; - operation = null; - target = null; - targetSchemaNode = null; - data = null; + this.id = null; + this.operation = null; + this.target = null; + this.targetSchemaNode = null; + this.data = null; } } } diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/NormalizedNodeJsonBodyWriter.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/NormalizedNodeJsonBodyWriter.java index 66cc2c96c9..96389809db 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/NormalizedNodeJsonBodyWriter.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/NormalizedNodeJsonBodyWriter.java @@ -27,7 +27,7 @@ import org.opendaylight.netconf.sal.rest.api.RestconfNormalizedNodeWriter; 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.Draft16; +import org.opendaylight.restconf.Draft17; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @@ -47,7 +47,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath; @Provider @Produces({ Draft02.MediaTypes.API + RestconfService.JSON, Draft02.MediaTypes.DATA + RestconfService.JSON, - Draft02.MediaTypes.OPERATION + RestconfService.JSON, Draft16.MediaTypes.DATA + RestconfConstants.JSON, + Draft02.MediaTypes.OPERATION + RestconfService.JSON, Draft17.MediaTypes.DATA + RestconfConstants.JSON, MediaType.APPLICATION_JSON }) public class NormalizedNodeJsonBodyWriter implements MessageBodyWriter { diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/NormalizedNodeXmlBodyWriter.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/NormalizedNodeXmlBodyWriter.java index 9e1f7e72b1..ce9cf8f966 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/NormalizedNodeXmlBodyWriter.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/NormalizedNodeXmlBodyWriter.java @@ -29,7 +29,7 @@ import org.opendaylight.netconf.sal.rest.api.RestconfNormalizedNodeWriter; 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.Draft16; +import org.opendaylight.restconf.Draft17; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @@ -45,7 +45,7 @@ import javanet.staxutils.IndentingXMLStreamWriter; @Provider @Produces({ Draft02.MediaTypes.API + RestconfService.XML, Draft02.MediaTypes.DATA + RestconfService.XML, - Draft02.MediaTypes.OPERATION + RestconfService.XML, Draft16.MediaTypes.DATA + RestconfConstants.XML_ORIG, + Draft02.MediaTypes.OPERATION + RestconfService.XML, Draft17.MediaTypes.DATA + RestconfConstants.XML_ORIG, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) public class NormalizedNodeXmlBodyWriter implements MessageBodyWriter { 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 d097048f91..1283d362cd 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.Draft16; +import org.opendaylight.restconf.Draft17; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.data.codec.gson.JsonWriterFactory; @Provider @Produces({Draft02.MediaTypes.PATCH_STATUS + RestconfService.JSON, - Draft16.MediaTypes.PATCH_STATUS + RestconfConstants.JSON}) + Draft17.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 789ee8248d..747e273453 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.Draft16; +import org.opendaylight.restconf.Draft17; import org.opendaylight.restconf.utils.RestconfConstants; @Provider @Produces({Draft02.MediaTypes.PATCH_STATUS + RestconfService.XML, - Draft16.MediaTypes.PATCH_STATUS + RestconfConstants.XML}) + Draft17.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/netconf/sal/rest/impl/StringModuleInstanceIdentifierCodec.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/StringModuleInstanceIdentifierCodec.java index 77489dec72..63fe1a6ffb 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/StringModuleInstanceIdentifierCodec.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/StringModuleInstanceIdentifierCodec.java @@ -12,7 +12,6 @@ import com.google.common.base.Preconditions; import java.net.URI; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.opendaylight.restconf.utils.patch.Draft16StringModuleInstanceIdentifierCodec; import org.opendaylight.yangtools.yang.data.util.AbstractModuleStringInstanceIdentifierCodec; import org.opendaylight.yangtools.yang.data.util.DataSchemaContextTree; import org.opendaylight.yangtools.yang.model.api.Module; @@ -20,7 +19,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext; /** * @deprecated This class will be replaced by - * {@link Draft16StringModuleInstanceIdentifierCodec} + * {@link org.opendaylight.restconf.utils.patch.StringModuleInstanceIdentifierCodec} */ @Deprecated public final class StringModuleInstanceIdentifierCodec extends AbstractModuleStringInstanceIdentifierCodec { diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlNormalizedNodeBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlNormalizedNodeBodyReader.java index 27f3e78cbc..9eabd4cbe4 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlNormalizedNodeBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/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.Draft16; +import org.opendaylight.restconf.Draft17; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; @@ -58,7 +58,7 @@ import org.w3c.dom.Element; @Provider @Consumes({ Draft02.MediaTypes.DATA + RestconfService.XML, Draft02.MediaTypes.OPERATION + RestconfService.XML, - Draft16.MediaTypes.DATA + RestconfConstants.XML_ORIG, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) + Draft17.MediaTypes.DATA + RestconfConstants.XML_ORIG, 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/netconf/sal/rest/impl/XmlToPATCHBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlToPATCHBodyReader.java index a12dca89bd..7c82d01d9a 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlToPATCHBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlToPATCHBodyReader.java @@ -37,7 +37,6 @@ 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.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; @@ -59,7 +58,8 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; /** - * @deprecated This class will be replaced by {@link Draft16XmlToPATCHBodyReader} + * @deprecated This class will be replaced by + * {@link org.opendaylight.restconf.utils.patch.XmlToPATCHBodyReader} */ @Deprecated @Provider @@ -213,12 +213,12 @@ public class XmlToPATCHBodyReader extends AbstractIdentifierAwareJaxRsProvider i private List readValueNodes(@Nonnull final Element element, @Nonnull final String operation) { final Node valueNode = element.getElementsByTagName("value").item(0); - if (PATCHEditOperation.isPatchOperationWithValue(operation) && valueNode == null) { + if (PATCHEditOperation.isPatchOperationWithValue(operation) && (valueNode == null)) { throw new RestconfDocumentedException("Error parsing input", ErrorType.PROTOCOL, ErrorTag.MALFORMED_MESSAGE); } - if (!PATCHEditOperation.isPatchOperationWithValue(operation) && valueNode != null) { + if (!PATCHEditOperation.isPatchOperationWithValue(operation) && (valueNode != null)) { throw new RestconfDocumentedException("Error parsing input", ErrorType.PROTOCOL, ErrorTag.MALFORMED_MESSAGE); } @@ -250,7 +250,7 @@ public class XmlToPATCHBodyReader extends AbstractIdentifierAwareJaxRsProvider i */ private String prepareNonCondXpath(@Nonnull final DataSchemaNode schemaNode, @Nonnull final String target, @Nonnull final Element value, @Nonnull final String namespace, - @Nonnull String revision) { + @Nonnull final String revision) { final Iterator args = Splitter.on("/").split(target.substring(target.indexOf(':') + 1)).iterator(); final StringBuilder nonCondXpath = new StringBuilder(); @@ -262,12 +262,12 @@ public class XmlToPATCHBodyReader extends AbstractIdentifierAwareJaxRsProvider i nonCondXpath.append(s); childNode = ((DataNodeContainer) childNode).getDataChildByName(QName.create(namespace, revision, s)); - if (childNode instanceof ListSchemaNode && args.hasNext()) { + if ((childNode instanceof ListSchemaNode) && args.hasNext()) { appendKeys(nonCondXpath, ((ListSchemaNode) childNode).getKeyDefinition().iterator(), args); } } - if (childNode instanceof ListSchemaNode && value != null) { + if ((childNode instanceof ListSchemaNode) && (value != null)) { final Iterator keyValues = readKeyValues(value, ((ListSchemaNode) childNode).getKeyDefinition().iterator()); appendKeys(nonCondXpath, ((ListSchemaNode) childNode).getKeyDefinition().iterator(), keyValues); diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Draft16.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Draft17.java similarity index 94% rename from restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Draft16.java rename to restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Draft17.java index 0ec5b960b6..bfc6f0da0f 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Draft16.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Draft17.java @@ -20,13 +20,13 @@ import org.opendaylight.yangtools.yang.common.QName; * * * - * We used old revision {@link Draft16.RestconfModule#REVISION} of restconf yang + * We used old revision {@link Draft17.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 Draft16 { +public final class Draft17 { - private Draft16() { + private Draft17() { throw new UnsupportedOperationException("Util class"); } @@ -79,8 +79,8 @@ public final class Draft16 { public static final String ERROR_LIST_SCHEMA_NODE = "error"; - public static final QName IETF_RESTCONF_QNAME = QName.create(Draft16.RestconfModule.NAMESPACE, Draft16.RestconfModule.REVISION, - Draft16.RestconfModule.NAME); + public static final QName IETF_RESTCONF_QNAME = QName.create(Draft17.RestconfModule.NAMESPACE, Draft17.RestconfModule.REVISION, + Draft17.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 cc14b7f332..50012e643b 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 @@ -22,7 +22,7 @@ import org.opendaylight.controller.sal.core.api.Provider; 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.Draft16ServicesWrapperImpl; +import org.opendaylight.restconf.common.wrapper.services.ServicesWrapperImpl; import org.opendaylight.restconf.handlers.DOMDataBrokerHandler; import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler; import org.opendaylight.restconf.handlers.RpcServiceHandler; @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Provider for restconf draft16. + * Provider for restconf draft17. * */ public class RestConnectorProvider implements Provider, RestConnector, AutoCloseable { @@ -64,7 +64,7 @@ public class RestConnectorProvider implements Provider, RestConnector, AutoClose public void onSessionInitiated(final ProviderSession session) { final SchemaService schemaService = Preconditions.checkNotNull(session.getService(SchemaService.class)); - final Draft16ServicesWrapperImpl wrapperServices = Draft16ServicesWrapperImpl.getInstance(); + final ServicesWrapperImpl wrapperServices = ServicesWrapperImpl.getInstance(); final SchemaContextHandler schemaCtxHandler = new SchemaContextHandler(); this.listenerRegistration = schemaService.registerSchemaContextListener(schemaCtxHandler); diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/RestconfApplication.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/RestconfApplication.java index 92085ad78b..e9585f4c4a 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/RestconfApplication.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/RestconfApplication.java @@ -20,9 +20,9 @@ import org.opendaylight.netconf.sal.rest.impl.PATCHJsonBodyWriter; 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.Draft16ServicesWrapperImpl; -import org.opendaylight.restconf.utils.patch.Draft16JsonToPATCHBodyReader; -import org.opendaylight.restconf.utils.patch.Draft16XmlToPATCHBodyReader; +import org.opendaylight.restconf.common.wrapper.services.ServicesWrapperImpl; +import org.opendaylight.restconf.utils.patch.JsonToPATCHBodyReader; +import org.opendaylight.restconf.utils.patch.XmlToPATCHBodyReader; public class RestconfApplication extends Application { @@ -31,7 +31,7 @@ public class RestconfApplication extends Application { return ImmutableSet.> builder().add(NormalizedNodeJsonBodyWriter.class) .add(NormalizedNodeXmlBodyWriter.class).add(JsonNormalizedNodeBodyReader.class) .add(XmlNormalizedNodeBodyReader.class).add(SchemaExportContentYinBodyWriter.class) - .add(Draft16JsonToPATCHBodyReader.class).add(Draft16XmlToPATCHBodyReader.class) + .add(JsonToPATCHBodyReader.class).add(XmlToPATCHBodyReader.class) .add(PATCHJsonBodyWriter.class).add(PATCHXmlBodyWriter.class) .add(SchemaExportContentYangBodyWriter.class).add(RestconfDocumentedExceptionMapper.class) .build(); @@ -40,7 +40,7 @@ public class RestconfApplication extends Application { @Override public Set getSingletons() { final Set singletons = new HashSet<>(); - singletons.add(Draft16ServicesWrapperImpl.getInstance()); + singletons.add(ServicesWrapperImpl.getInstance()); return singletons; } } 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 cc1f677b16..b257d2f468 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.Draft16; +import org.opendaylight.restconf.Draft17; 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 Draft16.RestconfModule} + * {@link Draft17.RestconfModule} * * @return {@link Module} */ public Module getRestconfModule() { - return this.findModuleByNamespaceAndRevision(Draft16.RestconfModule.IETF_RESTCONF_QNAME.getNamespace(), - Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision()); + return this.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME.getNamespace(), + Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision()); } /** diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/common/wrapper/services/Draft16ServicesWrapperImpl.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/common/wrapper/services/ServicesWrapperImpl.java similarity index 92% rename from restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/common/wrapper/services/Draft16ServicesWrapperImpl.java rename to restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/common/wrapper/services/ServicesWrapperImpl.java index e4665e0090..0e7999b256 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/common/wrapper/services/Draft16ServicesWrapperImpl.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/common/wrapper/services/ServicesWrapperImpl.java @@ -19,7 +19,7 @@ import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler; 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.Draft16BaseServicesWrapper; +import org.opendaylight.restconf.rest.services.api.BaseServicesWrapper; import org.opendaylight.restconf.rest.services.api.RestconfModulesService; import org.opendaylight.restconf.rest.services.api.RestconfOperationsService; import org.opendaylight.restconf.rest.services.api.RestconfSchemaService; @@ -28,7 +28,7 @@ import org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceImpl; 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.Draft16TransactionServicesWrapper; +import org.opendaylight.restconf.restful.services.api.TransactionServicesWrapper; import org.opendaylight.restconf.restful.services.api.RestconfDataService; import org.opendaylight.restconf.restful.services.api.RestconfInvokeOperationsService; import org.opendaylight.restconf.restful.services.api.RestconfStreamsSubscriptionService; @@ -39,13 +39,13 @@ import org.opendaylight.restconf.restful.services.impl.RestconfStreamsSubscripti /** * Wrapper for services: *
    - *
  • {@link Draft16BaseServicesWrapper} - *
  • {@link Draft16TransactionServicesWrapper} + *
  • {@link BaseServicesWrapper} + *
  • {@link TransactionServicesWrapper} *
* */ @Path("/") -public class Draft16ServicesWrapperImpl implements Draft16BaseServicesWrapper, Draft16TransactionServicesWrapper { +public class ServicesWrapperImpl implements BaseServicesWrapper, TransactionServicesWrapper { private RestconfDataService delegRestconfDataService; private RestconfInvokeOperationsService delegRestconfInvokeOpsService; @@ -55,14 +55,14 @@ public class Draft16ServicesWrapperImpl implements Draft16BaseServicesWrapper, D private RestconfStreamsService delegRestStrsService; private RestconfSchemaService delegRestSchService; - private Draft16ServicesWrapperImpl() { + private ServicesWrapperImpl() { } private static class InstanceHolder { - public static final Draft16ServicesWrapperImpl INSTANCE = new Draft16ServicesWrapperImpl(); + public static final ServicesWrapperImpl INSTANCE = new ServicesWrapperImpl(); } - public static Draft16ServicesWrapperImpl getInstance() { + public static ServicesWrapperImpl getInstance() { return InstanceHolder.INSTANCE; } diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/Draft16BaseServicesWrapper.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/BaseServicesWrapper.java similarity index 94% rename from restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/Draft16BaseServicesWrapper.java rename to restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/BaseServicesWrapper.java index 7db56ed508..c63b2913f2 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/Draft16BaseServicesWrapper.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/services/api/BaseServicesWrapper.java @@ -17,6 +17,6 @@ package org.opendaylight.restconf.rest.services.api; * * */ -public interface Draft16BaseServicesWrapper +public interface BaseServicesWrapper extends RestconfModulesService, RestconfOperationsService, RestconfStreamsService, RestconfSchemaService { } 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 6de083d407..b9e6c139b7 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.Draft16; +import org.opendaylight.restconf.Draft17; import org.opendaylight.restconf.utils.RestconfConstants; /** @@ -32,7 +32,7 @@ public interface RestconfModulesService { */ @GET @Path("data/ietf-yang-library:modules-state") - @Produces({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.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({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.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({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.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 77bdc0d583..f6874d6368 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.Draft16; +import org.opendaylight.restconf.Draft17; import org.opendaylight.restconf.utils.RestconfConstants; /** @@ -34,7 +34,7 @@ public interface RestconfOperationsService { */ @GET @Path("/operations") - @Produces({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.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({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.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 8a21a2815f..261455593e 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.Draft16; +import org.opendaylight.restconf.Draft17; import org.opendaylight.restconf.utils.RestconfConstants; /** @@ -30,7 +30,7 @@ public interface RestconfSchemaService { * @return {@link SchemaExportContext} */ @GET - @Produces({ Draft16.MediaTypes.YANG, Draft16.MediaTypes.YIN + RestconfConstants.XML }) + @Produces({ Draft17.MediaTypes.YANG, Draft17.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 192e48f7d8..732258fd2a 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.Draft16; +import org.opendaylight.restconf.Draft17; import org.opendaylight.restconf.utils.RestconfConstants; /** @@ -33,7 +33,7 @@ public interface RestconfStreamsService { */ @GET @Path("data/ietf-restconf-monitoring:restconf-state/streams") - @Produces({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.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 4ac1750b7f..e4bc1b4239 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.Draft16; +import org.opendaylight.restconf.Draft17; 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(), Draft16.RestconfModule.MODULE_LIST_SCHEMA_NODE); + schemaContextRef.getRestconfModule(), Draft17.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, - Draft16.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE); + Draft17.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 15981b98d8..49247769d1 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.Draft16; +import org.opendaylight.restconf.Draft17; 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(), Draft16.MonitoringModule.STREAM_LIST_SCHEMA_NODE); + schemaContextRef.getRestconfModule(), Draft17.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(), Draft16.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE); + schemaContextRef.getRestconfModule(), Draft17.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 df0ac51928..4ada40c5fe 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.Draft16; +import org.opendaylight.restconf.Draft17; import org.opendaylight.restconf.utils.RestconfConstants; /** @@ -45,7 +45,7 @@ public interface RestconfDataService { */ @GET @Path("/data/{identifier:.+}") - @Produces({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) Response readData(@Encoded @PathParam("identifier") String identifier, @Context UriInfo uriInfo); @@ -61,7 +61,7 @@ public interface RestconfDataService { */ @PUT @Path("/data/{identifier:.+}") - @Consumes({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Consumes({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) Response putData(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload); @@ -78,7 +78,7 @@ public interface RestconfDataService { */ @POST @Path("/data/{identifier:.+}") - @Consumes({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Consumes({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) Response postData(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload, @Context UriInfo uriInfo); @@ -94,7 +94,7 @@ public interface RestconfDataService { */ @POST @Path("/data") - @Consumes({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Consumes({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) Response postData(NormalizedNodeContext payload, @Context UriInfo uriInfo); @@ -123,9 +123,9 @@ public interface RestconfDataService { */ @PATCH @Path("/data/{identifier:.+}") - @Consumes({ Draft16.MediaTypes.PATCH + RestconfConstants.JSON, Draft16.MediaTypes.PATCH + RestconfConstants.XML }) - @Produces({ Draft16.MediaTypes.PATCH_STATUS + RestconfConstants.JSON, - Draft16.MediaTypes.PATCH_STATUS + RestconfConstants.XML }) + @Consumes({ Draft17.MediaTypes.PATCH + RestconfConstants.JSON, Draft17.MediaTypes.PATCH + RestconfConstants.XML }) + @Produces({ Draft17.MediaTypes.PATCH_STATUS + RestconfConstants.JSON, + Draft17.MediaTypes.PATCH_STATUS + RestconfConstants.XML }) PATCHStatusContext patchData(@Encoded @PathParam("identifier") String identifier, PATCHContext context, @Context UriInfo uriInfo); @@ -140,8 +140,8 @@ public interface RestconfDataService { */ @PATCH @Path("/data") - @Consumes({ Draft16.MediaTypes.PATCH + RestconfConstants.JSON, Draft16.MediaTypes.PATCH + RestconfConstants.XML }) - @Produces({ Draft16.MediaTypes.PATCH_STATUS + RestconfConstants.JSON, - Draft16.MediaTypes.PATCH_STATUS + RestconfConstants.XML }) + @Consumes({ Draft17.MediaTypes.PATCH + RestconfConstants.JSON, Draft17.MediaTypes.PATCH + RestconfConstants.XML }) + @Produces({ Draft17.MediaTypes.PATCH_STATUS + RestconfConstants.JSON, + Draft17.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 9b7e920d92..df58decd35 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.Draft16; +import org.opendaylight.restconf.Draft17; import org.opendaylight.restconf.utils.RestconfConstants; /** @@ -41,9 +41,9 @@ public interface RestconfInvokeOperationsService { */ @POST @Path("/operations/{identifier:.+}") - @Produces({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) - @Consumes({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Consumes({ Draft17.MediaTypes.DATA + RestconfConstants.JSON, Draft17.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/restful/services/api/Draft16TransactionServicesWrapper.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/TransactionServicesWrapper.java similarity index 92% rename from restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/Draft16TransactionServicesWrapper.java rename to restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/TransactionServicesWrapper.java index 87aeda5000..f48a51b384 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/Draft16TransactionServicesWrapper.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/TransactionServicesWrapper.java @@ -16,7 +16,7 @@ package org.opendaylight.restconf.restful.services.api; * * */ -public interface Draft16TransactionServicesWrapper +public interface TransactionServicesWrapper extends RestconfDataService, RestconfInvokeOperationsService, RestconfStreamsSubscriptionService { } 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 7bf00504b1..ded6d9739a 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.Draft16; +import org.opendaylight.restconf.Draft17; 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, - Draft16.RestconfModule.MODULE_LIST_SCHEMA_NODE); + Draft17.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/patch/Draft16AbstractIdentifierAwareJaxRsProvider.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/AbstractIdentifierAwareJaxRsProvider.java similarity index 95% rename from restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/Draft16AbstractIdentifierAwareJaxRsProvider.java rename to restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/AbstractIdentifierAwareJaxRsProvider.java index 75c4504266..3fed78d523 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/Draft16AbstractIdentifierAwareJaxRsProvider.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/AbstractIdentifierAwareJaxRsProvider.java @@ -16,7 +16,7 @@ import org.opendaylight.netconf.sal.restconf.impl.ControllerContext; import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext; import org.opendaylight.restconf.utils.parser.ParserIdentifier; -public class Draft16AbstractIdentifierAwareJaxRsProvider { +public class AbstractIdentifierAwareJaxRsProvider { private static final String POST = "POST"; diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/Draft16JsonToPATCHBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/JsonToPATCHBodyReader.java similarity index 95% rename from restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/Draft16JsonToPATCHBodyReader.java rename to restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/JsonToPATCHBodyReader.java index b4434865c1..ac50c47ce0 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/Draft16JsonToPATCHBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/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.Draft16; +import org.opendaylight.restconf.Draft17; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; @@ -51,11 +51,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @Provider -@Consumes({Draft16.MediaTypes.PATCH + RestconfConstants.JSON}) -public class Draft16JsonToPATCHBodyReader extends Draft16AbstractIdentifierAwareJaxRsProvider +@Consumes({Draft17.MediaTypes.PATCH + RestconfConstants.JSON}) +public class JsonToPATCHBodyReader extends AbstractIdentifierAwareJaxRsProvider implements MessageBodyReader { - private final static Logger LOG = LoggerFactory.getLogger(Draft16JsonToPATCHBodyReader.class); + private final static Logger LOG = LoggerFactory.getLogger(JsonToPATCHBodyReader.class); private String patchId; @Override @@ -115,9 +115,9 @@ public class Draft16JsonToPATCHBodyReader extends Draft16AbstractIdentifierAware private List read(final JsonReader in, final InstanceIdentifierContext path) throws IOException { final List resultCollection = new ArrayList<>(); - final Draft16StringModuleInstanceIdentifierCodec codec = new Draft16StringModuleInstanceIdentifierCodec( + final StringModuleInstanceIdentifierCodec codec = new StringModuleInstanceIdentifierCodec( path.getSchemaContext()); - final Draft16JsonToPATCHBodyReader.PatchEdit edit = new Draft16JsonToPATCHBodyReader.PatchEdit(); + final JsonToPATCHBodyReader.PatchEdit edit = new JsonToPATCHBodyReader.PatchEdit(); while (in.hasNext()) { switch (in.peek()) { @@ -169,7 +169,7 @@ public class Draft16JsonToPATCHBodyReader extends Draft16AbstractIdentifierAware */ private void parseByName(@Nonnull final String name, @Nonnull final PatchEdit edit, @Nonnull final JsonReader in, @Nonnull final InstanceIdentifierContext path, - @Nonnull final Draft16StringModuleInstanceIdentifierCodec codec, + @Nonnull final StringModuleInstanceIdentifierCodec codec, @Nonnull final List resultCollection) throws IOException { switch (name) { case "edit" : @@ -208,7 +208,7 @@ public class Draft16JsonToPATCHBodyReader extends Draft16AbstractIdentifierAware */ private void readEditDefinition(@Nonnull final PatchEdit edit, @Nonnull final JsonReader in, @Nonnull final InstanceIdentifierContext path, - @Nonnull final Draft16StringModuleInstanceIdentifierCodec codec) throws IOException { + @Nonnull final StringModuleInstanceIdentifierCodec codec) throws IOException { final StringBuffer value = new StringBuffer(); in.beginObject(); diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/Draft16StringModuleInstanceIdentifierCodec.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/StringModuleInstanceIdentifierCodec.java similarity index 86% rename from restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/Draft16StringModuleInstanceIdentifierCodec.java rename to restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/StringModuleInstanceIdentifierCodec.java index 148834fcff..bc10c795aa 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/Draft16StringModuleInstanceIdentifierCodec.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/StringModuleInstanceIdentifierCodec.java @@ -17,19 +17,19 @@ import org.opendaylight.yangtools.yang.data.util.DataSchemaContextTree; import org.opendaylight.yangtools.yang.model.api.Module; import org.opendaylight.yangtools.yang.model.api.SchemaContext; -public final class Draft16StringModuleInstanceIdentifierCodec extends AbstractModuleStringInstanceIdentifierCodec { +public final class StringModuleInstanceIdentifierCodec extends AbstractModuleStringInstanceIdentifierCodec { private final DataSchemaContextTree dataContextTree; private final SchemaContext context; private final String defaultPrefix; - public Draft16StringModuleInstanceIdentifierCodec(final SchemaContext context) { + public StringModuleInstanceIdentifierCodec(SchemaContext context) { this.context = Preconditions.checkNotNull(context); this.dataContextTree = DataSchemaContextTree.from(context); this.defaultPrefix = ""; } - Draft16StringModuleInstanceIdentifierCodec(final SchemaContext context, @Nonnull final String defaultPrefix) { + StringModuleInstanceIdentifierCodec(final SchemaContext context, @Nonnull final String defaultPrefix) { this.context = Preconditions.checkNotNull(context); this.dataContextTree = DataSchemaContextTree.from(context); this.defaultPrefix = defaultPrefix; diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/Draft16XmlToPATCHBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/XmlToPATCHBodyReader.java similarity index 96% rename from restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/Draft16XmlToPATCHBodyReader.java rename to restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/XmlToPATCHBodyReader.java index 657866073c..599f7c1a94 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/Draft16XmlToPATCHBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/patch/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.Draft16; +import org.opendaylight.restconf.Draft17; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; @@ -58,11 +58,11 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; @Provider -@Consumes({Draft16.MediaTypes.PATCH + RestconfConstants.XML}) -public class Draft16XmlToPATCHBodyReader extends Draft16AbstractIdentifierAwareJaxRsProvider implements +@Consumes({Draft17.MediaTypes.PATCH + RestconfConstants.XML}) +public class XmlToPATCHBodyReader extends AbstractIdentifierAwareJaxRsProvider implements MessageBodyReader { - private final static Logger LOG = LoggerFactory.getLogger(Draft16XmlToPATCHBodyReader.class); + private final static Logger LOG = LoggerFactory.getLogger(XmlToPATCHBodyReader.class); private static final DocumentBuilderFactory BUILDERFACTORY; static { @@ -148,7 +148,7 @@ public class Draft16XmlToPATCHBodyReader extends Draft16AbstractIdentifierAwareJ URI.create(namespace)).iterator().next(); // initialize codec + set default prefix derived from module name - final Draft16StringModuleInstanceIdentifierCodec codec = new Draft16StringModuleInstanceIdentifierCodec( + final StringModuleInstanceIdentifierCodec codec = new StringModuleInstanceIdentifierCodec( pathContext.getSchemaContext(), module.getName()); // find complete path to target and target schema node @@ -235,7 +235,7 @@ public class Draft16XmlToPATCHBodyReader extends Draft16AbstractIdentifierAwareJ /** * Prepare non-conditional XPath suitable for deserialization - * with {@link Draft16StringModuleInstanceIdentifierCodec} + * with {@link StringModuleInstanceIdentifierCodec} * @param schemaNode Top schema node * @param target Edit operation target * @param value Element with value 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 5bc28f070b..984dd58abf 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.Draft16; +import org.opendaylight.restconf.Draft17; 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, - Draft16.RestconfModule.RESTCONF_GROUPING_SCHEMA_NODE); + Draft17.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 Draft16.RestconfModule.MODULE_LIST_SCHEMA_NODE: + case Draft17.RestconfModule.MODULE_LIST_SCHEMA_NODE: final DataSchemaNode moduleListSchNode = findSchemaNodeInCollection( ((DataNodeContainer) findSchemaNode(restCont, - Draft16.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE)).getChildNodes(), - Draft16.RestconfModule.MODULE_LIST_SCHEMA_NODE); + Draft17.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE)).getChildNodes(), + Draft17.RestconfModule.MODULE_LIST_SCHEMA_NODE); Preconditions.checkNotNull(moduleListSchNode); return moduleListSchNode; - case Draft16.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE: + case Draft17.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE: final DataSchemaNode modulesContSchNode = findSchemaNodeInCollection(((DataNodeContainer) restCont).getChildNodes(), - Draft16.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE); + Draft17.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE); Preconditions.checkNotNull(modulesContSchNode); return modulesContSchNode; //STREAMS - case Draft16.MonitoringModule.STREAM_LIST_SCHEMA_NODE: + case Draft17.MonitoringModule.STREAM_LIST_SCHEMA_NODE: final DataSchemaNode streamListSchNode = findSchemaNodeInCollection( ((DataNodeContainer) findSchemaNode(restCont, - Draft16.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE)).getChildNodes(), - Draft16.MonitoringModule.STREAM_LIST_SCHEMA_NODE); + Draft17.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE)).getChildNodes(), + Draft17.MonitoringModule.STREAM_LIST_SCHEMA_NODE); Preconditions.checkNotNull(streamListSchNode); return streamListSchNode; - case Draft16.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE: + case Draft17.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE: final DataSchemaNode streamsContSchNode = findSchemaNodeInCollection( ((DataNodeContainer) restCont).getChildNodes(), - Draft16.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE); + Draft17.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE); Preconditions.checkNotNull(streamsContSchNode); return streamsContSchNode; default: diff --git a/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/Draft11AbstractBodyReaderTest.java b/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/Draft11AbstractBodyReaderTest.java index c06655dedf..c88d1fb840 100644 --- a/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/Draft11AbstractBodyReaderTest.java +++ b/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/Draft11AbstractBodyReaderTest.java @@ -24,7 +24,7 @@ import org.opendaylight.netconf.sal.rest.api.RestconfConstants; 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.Draft16AbstractIdentifierAwareJaxRsProvider; +import org.opendaylight.restconf.utils.patch.AbstractIdentifierAwareJaxRsProvider; import org.opendaylight.yangtools.yang.model.api.SchemaContext; public abstract class Draft11AbstractBodyReaderTest { @@ -36,10 +36,10 @@ public abstract class Draft11AbstractBodyReaderTest { public Draft11AbstractBodyReaderTest() throws NoSuchFieldException, SecurityException { - uriField = Draft16AbstractIdentifierAwareJaxRsProvider.class + uriField = AbstractIdentifierAwareJaxRsProvider.class .getDeclaredField("uriInfo"); uriField.setAccessible(true); - requestField = Draft16AbstractIdentifierAwareJaxRsProvider.class + requestField = AbstractIdentifierAwareJaxRsProvider.class .getDeclaredField("request"); requestField.setAccessible(true); mediaType = getMediaType(); @@ -52,7 +52,7 @@ public abstract class Draft11AbstractBodyReaderTest { return TestRestconfUtils.loadSchemaContext(yangPath, schemaContext); } - protected static void mockBodyReader( + protected static void mockBodyReader( final String identifier, final T normalizedNodeProvider, final boolean isPost) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { diff --git a/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestDraft11JsonPATCHBodyReader.java b/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestDraft11JsonPATCHBodyReader.java index c8b85c52fb..f49251319a 100644 --- a/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestDraft11JsonPATCHBodyReader.java +++ b/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestDraft11JsonPATCHBodyReader.java @@ -18,17 +18,17 @@ import org.junit.BeforeClass; 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.Draft16JsonToPATCHBodyReader; +import org.opendaylight.restconf.utils.patch.JsonToPATCHBodyReader; import org.opendaylight.yangtools.yang.model.api.SchemaContext; public class TestDraft11JsonPATCHBodyReader extends Draft11AbstractBodyReaderTest { - private final Draft16JsonToPATCHBodyReader jsonPATCHBodyReader; + private final JsonToPATCHBodyReader jsonPATCHBodyReader; private static SchemaContext schemaContext; public TestDraft11JsonPATCHBodyReader() throws NoSuchFieldException, SecurityException { super(); - jsonPATCHBodyReader = new Draft16JsonToPATCHBodyReader(); + jsonPATCHBodyReader = new JsonToPATCHBodyReader(); } @Override diff --git a/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestDraft11XmlPATCHBodyReader.java b/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestDraft11XmlPATCHBodyReader.java index bfdb38457a..e8d60ca2b4 100644 --- a/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestDraft11XmlPATCHBodyReader.java +++ b/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestDraft11XmlPATCHBodyReader.java @@ -17,17 +17,17 @@ import org.junit.BeforeClass; 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.Draft16XmlToPATCHBodyReader; +import org.opendaylight.restconf.utils.patch.XmlToPATCHBodyReader; import org.opendaylight.yangtools.yang.model.api.SchemaContext; public class TestDraft11XmlPATCHBodyReader extends Draft11AbstractBodyReaderTest { - private final Draft16XmlToPATCHBodyReader xmlPATCHBodyReader; + private final XmlToPATCHBodyReader xmlPATCHBodyReader; private static SchemaContext schemaContext; public TestDraft11XmlPATCHBodyReader() throws NoSuchFieldException, SecurityException { super(); - xmlPATCHBodyReader = new Draft16XmlToPATCHBodyReader(); + xmlPATCHBodyReader = new XmlToPATCHBodyReader(); } @Override 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 f821e15519..998c99c3c5 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.Draft16.RestconfModule; +import org.opendaylight.restconf.Draft17.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 1f679643ac..636ebdeab0 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.Draft16; +import org.opendaylight.restconf.Draft17; 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] == Draft16.RestconfModule.IETF_RESTCONF_QNAME.getNamespace()) - && (args[1] == Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) { + if ((args[0] == Draft17.RestconfModule.IETF_RESTCONF_QNAME.getNamespace()) + && (args[1] == Draft17.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 4ee869a2f5..1e339ad18e 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.Draft16; +import org.opendaylight.restconf.Draft17; import org.opendaylight.restconf.handlers.SchemaContextHandler; import org.opendaylight.restconf.rest.services.api.RestconfStreamsService; import org.opendaylight.restconf.utils.mapping.RestconfMappingNodeConstants; @@ -108,8 +108,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(Draft16.RestconfModule.IETF_RESTCONF_QNAME - .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) + when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME + .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) .thenReturn(getTestingRestconfModule("ietf-restconf")); // make test @@ -142,8 +142,8 @@ public class RestconfStreamsServiceTest { public void getAvailableStreamsMissingRestconfModuleNegativeTest() { // prepare conditions - get null Restconf module when(this.contextHandler.get()).thenReturn(this.mockSchemaContext); - when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft16.RestconfModule.IETF_RESTCONF_QNAME - .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision())).thenReturn(null); + when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME + .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision())).thenReturn(null); // make test this.thrown.expect(NullPointerException.class); @@ -159,8 +159,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(Draft16.RestconfModule.IETF_RESTCONF_QNAME - .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) + when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME + .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) .thenReturn(getTestingRestconfModule("restconf-module-with-missing-list-stream")); // make test and verify @@ -186,8 +186,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(Draft16.RestconfModule.IETF_RESTCONF_QNAME - .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) + when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME + .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) .thenReturn(getTestingRestconfModule("restconf-module-with-missing-container-streams")); // make test and verify @@ -212,8 +212,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(Draft16.RestconfModule.IETF_RESTCONF_QNAME - .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) + when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME + .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) .thenReturn(getTestingRestconfModule("restconf-module-with-illegal-list-stream")); // make test @@ -229,8 +229,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(Draft16.RestconfModule.IETF_RESTCONF_QNAME - .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) + when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME + .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) .thenReturn(getTestingRestconfModule("restconf-module-with-illegal-container-streams")); // make test @@ -246,8 +246,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(Draft16.RestconfModule.IETF_RESTCONF_QNAME - .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) + when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME + .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision())) .thenReturn(getTestingRestconfModule("restconf-module-with-illegal-leaf-description")); // make test @@ -262,7 +262,7 @@ public class RestconfStreamsServiceTest { * @return Restconf module */ private Module getTestingRestconfModule(final String s) { - return this.schemaContext.findModuleByName(s, Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision()); + return this.schemaContext.findModuleByName(s, Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision()); } /** 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 5e75f8fa1f..7cec6de631 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.Draft16; -import org.opendaylight.restconf.Draft16.MonitoringModule; -import org.opendaylight.restconf.Draft16.RestconfModule; +import org.opendaylight.restconf.Draft17; +import org.opendaylight.restconf.Draft17.MonitoringModule; +import org.opendaylight.restconf.Draft17.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, Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision()); + s, Draft17.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 6c91868df8..617f601c31 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.Draft16.MonitoringModule; -import static org.opendaylight.restconf.Draft16.RestconfModule; +import static org.opendaylight.restconf.Draft17.MonitoringModule; +import static org.opendaylight.restconf.Draft17.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.Draft16; +import org.opendaylight.restconf.Draft17; 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, Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision()); + return schemaContext.findModuleByName(s, Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision()); } } -- 2.36.6