Add FIXMEs 60/109060/2
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 24 Nov 2023 17:22:48 +0000 (18:22 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 24 Nov 2023 18:04:28 +0000 (19:04 +0100)
ETag and Last-Modified should be part of the response payload maintained
on RestconfServer side. Add FIXMEs to reflect that.

JIRA: NETCONF-773
Change-Id: Ice8369fb6545569477a137079691c79e55f32927
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/JaxRsRestconf.java
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/api/RestconfServer.java

index f7e3d50cd51c748ac8e2bf9b5faf87d8ef2dc2b0..0d131bbf4416058d118aaf1bd3730743449b2378 100644 (file)
@@ -150,8 +150,10 @@ public final class JaxRsRestconf {
                         yield Response.status(Status.OK)
                             .entity(result)
                             // FIXME: is this ETag okay?
+                            // FIXME: use tag() method instead
                             .header("ETag", '"' + type.getModule().getRevision().map(Revision::toString).orElse(null)
                                 + "-" + type.getLocalName() + '"')
+                            // FIXME: use lastModified() method instead
                             .header("Last-Modified", FORMATTER.format(LocalDateTime.now(Clock.systemUTC())))
                             .build();
                     }
index dbef7817e8fbf25e806ae4b56b22792d6949e5ca..a7d44ea97c9f677c37395c37d2addabbd403fabb 100644 (file)
@@ -28,6 +28,9 @@ import org.opendaylight.yangtools.yang.common.Empty;
  * An implementation of a RESTCONF server, implementing the
  * <a href="https://www.rfc-editor.org/rfc/rfc8040#section-3.3">RESTCONF API Resource</a>.
  */
+// FIXME: configuration datastore should maintain ETag and Last-Modified headers, so that these can be returned when
+//        GET/PATCH/POST/PUT modify the data.
+// FIXME: NETCONF-773: as a first step in doing that we should carry those fields in our responses
 @NonNullByDefault
 public interface RestconfServer {
     /**