Use AsyncResponse in RPC invocation path
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / rests / services / api / RestconfInvokeOperationsService.java
index 0d5cde11c34157fa672bcc1aae627785c0cc7f53..e0db6a0f5ef8b943b2f05e525cc6e05ab6062671 100644 (file)
@@ -13,6 +13,8 @@ import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
+import javax.ws.rs.container.AsyncResponse;
+import javax.ws.rs.container.Suspended;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.UriInfo;
@@ -30,7 +32,7 @@ public interface RestconfInvokeOperationsService {
      * @param identifier module name and rpc identifier string for the desired operation
      * @param payload {@link NormalizedNodeContext} - the body of the operation
      * @param uriInfo URI info
-     * @return {@link NormalizedNodeContext}
+     * @param ar {@link AsyncResponse} which needs to be completed with a {@link NormalizedNodeContext} ouput
      */
     @POST
     @Path("/operations/{identifier:.+}")
@@ -48,6 +50,6 @@ public interface RestconfInvokeOperationsService {
         MediaType.APPLICATION_XML,
         MediaType.TEXT_XML
     })
-    NormalizedNodeContext invokeRpc(@Encoded @PathParam("identifier") String identifier,
-            NormalizedNodeContext payload, @Context UriInfo uriInfo);
+    void invokeRpc(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload,
+        @Context UriInfo uriInfo, @Suspended AsyncResponse ar);
 }