Bug 6848 - update url pattern of restconf from 16 to 17 50/46550/8
authorJakub Toth <jatoth@cisco.com>
Wed, 5 Oct 2016 13:33:07 +0000 (15:33 +0200)
committerJakub Toth <jatoth@cisco.com>
Tue, 11 Oct 2016 14:22:47 +0000 (14:22 +0000)
Change-Id: I41882d048a3aede5f4c47c3e160537f7a31a1fab
Signed-off-by: Jakub Toth <jatoth@cisco.com>
restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java
restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlNormalizedNodeBodyReader.java
restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/RestconfConstants.java
restconf/sal-rest-connector/src/main/resources/WEB-INF/web.xml

index 373dbb5adc3bbf5d95d3365d17efefc96af33b65..179d2ad59c5ed20a6a6821efb83949d77dbd6729 100644 (file)
@@ -70,7 +70,7 @@ public class JsonNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsPr
             final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream) throws IOException,
             WebApplicationException {
         try {
-            if(getUriInfo().getAbsolutePath().getPath().contains("restconf/16")){
+            if (getUriInfo().getAbsolutePath().getPath().contains(RestconfConstants.DRAFT_PATTERN)) {
                 final org.opendaylight.restconf.jersey.providers.JsonNormalizedNodeBodyReader jsonReaderNewRest =
                         new org.opendaylight.restconf.jersey.providers.JsonNormalizedNodeBodyReader();
                 jsonReaderNewRest.injectParams(getUriInfo(), getRequest());
index 37baa231e71fb96c753e03983d9e22189dedc510..8359ee0b1de4a3b4a08f8e8cbcef6f72ecc8b896 100644 (file)
@@ -34,6 +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.utils.RestconfConstants;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlUtils;
@@ -93,7 +94,7 @@ public class XmlNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsPro
             final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream) throws IOException,
             WebApplicationException {
         try {
-            if (getUriInfo().getAbsolutePath().getPath().contains("restconf/16")) {
+            if (getUriInfo().getAbsolutePath().getPath().contains(RestconfConstants.DRAFT_PATTERN)) {
                 final org.opendaylight.restconf.jersey.providers.XmlNormalizedNodeBodyReader xmlReaderNewRest =
                         new org.opendaylight.restconf.jersey.providers.XmlNormalizedNodeBodyReader();
                 xmlReaderNewRest.injectParams(getUriInfo(), getRequest());
index 67b01edf191c889886d8d259c32dc476f69f26ca..b6a2f9f0674598312d5c7c5ab0b3be974fcef7b4 100644 (file)
@@ -23,6 +23,7 @@ public final class RestconfConstants {
     public static final SimpleDateFormat REVISION_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
     public static final char SLASH = '/';
     public static final Splitter SLASH_SPLITTER = Splitter.on(SLASH);
+    public static final String DRAFT_PATTERN = "restconf/17";
 
     private RestconfConstants() {
         throw new UnsupportedOperationException("Util class");
index 3153c2f9bcf69934767d86bac68f94dc4d530759..e93219b820b2b63b1f500f5f812e3953278e9c4d 100644 (file)
@@ -60,7 +60,7 @@
 
     <servlet-mapping>
         <servlet-name>Restconf</servlet-name>
-        <url-pattern>/16/*</url-pattern>
+        <url-pattern>/17/*</url-pattern>
     </servlet-mapping>
 
     <filter>