Remove DataPostPath
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / server / api / RestconfServer.java
index 3751f21859cf3e17dccc67a02ac065c3e216329d..864eebfb17d5699063259a152b5263195b5068a8 100644 (file)
@@ -13,22 +13,13 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.restconf.api.ApiPath;
 import org.opendaylight.restconf.common.errors.RestconfFuture;
-import org.opendaylight.restconf.common.patch.PatchStatusContext;
-import org.opendaylight.restconf.nb.rfc8040.databind.ChildBody;
-import org.opendaylight.restconf.nb.rfc8040.databind.DataPostBody;
-import org.opendaylight.restconf.nb.rfc8040.databind.OperationInputBody;
-import org.opendaylight.restconf.nb.rfc8040.databind.PatchBody;
-import org.opendaylight.restconf.nb.rfc8040.databind.ResourceBody;
 import org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload;
-import org.opendaylight.restconf.server.api.DataPostResult.CreateResource;
 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: NETCONF-1207: configuration datastore should maintain ETag and Last-Modified headers, so that these can be
-//                      returned when PATCH/POST/PUT modify the data.
 @NonNullByDefault
 public interface RestconfServer {
     /**
@@ -64,7 +55,7 @@ public interface RestconfServer {
      * @param body data node for put to config DS
      * @return A {@link RestconfFuture} of the operation
      */
-    RestconfFuture<Empty> dataPATCH(ResourceBody body);
+    RestconfFuture<DataPatchResult> dataPATCH(ResourceBody body);
 
     /**
      * Partially modify the target data resource, as defined in
@@ -74,16 +65,16 @@ public interface RestconfServer {
      * @param body data node for put to config DS
      * @return A {@link RestconfFuture} of the operation
      */
-    RestconfFuture<Empty> dataPATCH(ApiPath identifier, ResourceBody body);
+    RestconfFuture<DataPatchResult> dataPATCH(ApiPath identifier, ResourceBody body);
 
     /**
      * Ordered list of edits that are applied to the datastore by the server, as defined in
      * <a href="https://www.rfc-editor.org/rfc/rfc8072#section-2">RFC8072, section 2</a>.
      *
      * @param body YANG Patch body
-     * @return A {@link RestconfFuture} of the {@link PatchStatusContext} content
+     * @return A {@link RestconfFuture} of the {@link DataYangPatchResult} content
      */
-    RestconfFuture<PatchStatusContext> dataPATCH(PatchBody body);
+    RestconfFuture<DataYangPatchResult> dataPATCH(PatchBody body);
 
     /**
      * Ordered list of edits that are applied to the datastore by the server, as defined in
@@ -91,17 +82,26 @@ public interface RestconfServer {
      *
      * @param identifier path to target
      * @param body YANG Patch body
-     * @return A {@link RestconfFuture} of the {@link PatchStatusContext} content
+     * @return A {@link RestconfFuture} of the {@link DataYangPatchResult} content
      */
-    RestconfFuture<PatchStatusContext> dataPATCH(ApiPath identifier, PatchBody body);
+    RestconfFuture<DataYangPatchResult> dataPATCH(ApiPath identifier, PatchBody body);
 
-    RestconfFuture<CreateResource> dataPOST(ChildBody body, Map<String, String> queryParameters);
+    RestconfFuture<DataPostResult.CreateResource> dataPOST(ChildBody body, Map<String, String> queryParameters);
 
+    /**
+     * Create or invoke a operation, as described in
+     * <a href="https://www.rfc-editor.org/rfc/rfc8040#section-4.4">RFC8040 section 4.4</a>.
+     *
+     * @param identifier path to target
+     * @param body body of the post request
+     * @param queryParameters query parameters
+     */
     RestconfFuture<? extends DataPostResult> dataPOST(ApiPath identifier, DataPostBody body,
         Map<String, String> queryParameters);
 
     /**
-     * Replace the data store.
+     * Replace the data store, as described in
+     * <a href="https://www.rfc-editor.org/rfc/rfc8040#section-4.5">RFC8040 section 4.5</a>.
      *
      * @param body data node for put to config DS
      * @param queryParameters Query parameters
@@ -110,7 +110,8 @@ public interface RestconfServer {
     RestconfFuture<DataPutResult> dataPUT(ResourceBody body, Map<String, String> queryParameters);
 
     /**
-     * Create or replace a data store resource.
+     * Create or replace a data store resource, as described in
+     * <a href="https://www.rfc-editor.org/rfc/rfc8040#section-4.5">RFC8040 section 4.5</a>.
      *
      * @param identifier resource identifier
      * @param body data node for put to config DS