Bug 5679 - implement ietf-restconf-monitoring - streams
[netconf.git] / restconf / sal-rest-connector / src / main / java / org / opendaylight / netconf / sal / rest / api / RestconfService.java
index 5bb80f7d2efe92e10ec51175fb249e4e8bcebdae..e2775381a14b9e33cffd035257a5ce7729e84c5b 100644 (file)
@@ -26,28 +26,29 @@ 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.rest.api.services.RestconfModulesService;
-import org.opendaylight.restconf.rest.api.services.RestconfOperationsService;
-import org.opendaylight.restconf.rest.api.services.RestconfStreamsService;
+import org.opendaylight.restconf.base.services.api.RestconfOperationsService;
+import org.opendaylight.restconf.restful.services.api.RestconfDataService;
+import org.opendaylight.restconf.restful.services.api.RestconfInvokeOperationsService;
 
 /**
- * The URI hierarchy for the RESTCONF resources consists of an entry point container, 4 top-level resources, and 1
- * field.
+ * The URI hierarchy for the RESTCONF resources consists of an entry point
+ * container, 4 top-level resources, and 1 field.
  * <ul>
  * <li><b>/restconf</b> - {@link #getRoot()}
  * <ul>
- *      <li><b>/config</b> - {@link #readConfigurationData(String, UriInfo)}
- *                              {@link #updateConfigurationData(String, NormalizedNodeContext)}
- *                              {@link #createConfigurationData(NormalizedNodeContext, UriInfo)}
- *                              {@link #createConfigurationData(String, NormalizedNodeContext, UriInfo)}
+ * <li><b>/config</b> - {@link #readConfigurationData(String, UriInfo)}
+ * {@link #updateConfigurationData(String, NormalizedNodeContext, UriInfo)}
+ * {@link #createConfigurationData(NormalizedNodeContext, UriInfo)}
+ * {@link #createConfigurationData(String, NormalizedNodeContext, UriInfo)}
  * {@link #deleteConfigurationData(String)}
  * <li><b>/operational</b> - {@link #readOperationalData(String, UriInfo)}
  * <li>/modules - {@link #getModules(UriInfo)}
  * <ul>
  * <li>/module
  * </ul>
- *      <li><b>/operations</b> - {@link #invokeRpc(String, NormalizedNodeContext, UriInfo)}
- *                               {@link #invokeRpc(String, NormalizedNodeContext, UriInfo)}
+ * <li><b>/operations</b> -
+ * {@link #invokeRpc(String, NormalizedNodeContext, UriInfo)}
+ * {@link #invokeRpc(String, NormalizedNodeContext, UriInfo)}
  * <li>/version (field)
  * </ul>
  * </ul>
@@ -62,8 +63,8 @@ public interface RestconfService {
     public Object getRoot();
 
     /**
-     * @deprecated do not use this method. It is replaced by
-     *             {@link RestconfModulesService#getModules(UriInfo)}
+     * @deprecated do not use this method. It will be replaced by
+     *             {@link RestconfDataService#readData(UriInfo)}
      */
     @Deprecated
     @GET
@@ -73,8 +74,8 @@ public interface RestconfService {
     public NormalizedNodeContext getModules(@Context UriInfo uriInfo);
 
     /**
-     * @deprecated do not use this method. It is replaced by
-     *             {@link RestconfModulesService#getModules(String, UriInfo)}
+     * @deprecated do not use this method. It will be replaced by
+     *             {@link RestconfDataService#readData(String, UriInfo)}
      */
     @Deprecated
     @GET
@@ -84,8 +85,8 @@ public interface RestconfService {
     public NormalizedNodeContext getModules(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
 
     /**
-     * @deprecated do not use this method. It is replaced by
-     *             {@link RestconfModulesService#getModule(String, UriInfo)}
+     * @deprecated do not use this method. It will be replaced by
+     *             {@link RestconfDataService#readData(String, UriInfo)}
      */
     @Deprecated
     @GET
@@ -95,7 +96,7 @@ public interface RestconfService {
     public NormalizedNodeContext getModule(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
 
     /**
-     * @deprecated do not use this method. It is replaced by
+     * @deprecated do not use this method. It will be replaced by
      *             {@link RestconfOperationsService#getOperations(UriInfo)}
      */
     @Deprecated
@@ -106,7 +107,7 @@ public interface RestconfService {
     public NormalizedNodeContext getOperations(@Context UriInfo uriInfo);
 
     /**
-     * @deprecated do not use this method. It is replaced by
+     * @deprecated do not use this method. It will be replaced by
      *             {@link RestconfOperationsService#getOperations(String, UriInfo)}
      */
     @Deprecated
@@ -116,6 +117,11 @@ public interface RestconfService {
             MediaType.APPLICATION_XML, MediaType.TEXT_XML })
     public NormalizedNodeContext getOperations(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
 
+    /**
+     * @deprecated do not use this method. It will be replaced by
+     *             {@link RestconfInvokeOperationsService#invokeRpc(String, NormalizedNodeContext, UriInfo)}
+     */
+    @Deprecated
     @POST
     @Path("/operations/{identifier:.+}")
     @Produces({ Draft02.MediaTypes.OPERATION + JSON, Draft02.MediaTypes.OPERATION + XML,
@@ -136,6 +142,11 @@ public interface RestconfService {
     public NormalizedNodeContext invokeRpc(@Encoded @PathParam("identifier") String identifier,
             @DefaultValue("") String noPayload, @Context UriInfo uriInfo);
 
+    /**
+     * @deprecated do not use this method. It will be replaced by
+     *             {@link RestconfDataService#readData(String, UriInfo)}
+     */
+    @Deprecated
     @GET
     @Path("/config/{identifier:.+}")
     @Produces({ Draft02.MediaTypes.DATA + JSON, Draft02.MediaTypes.DATA + XML, MediaType.APPLICATION_JSON,
@@ -143,6 +154,11 @@ public interface RestconfService {
     public NormalizedNodeContext readConfigurationData(@Encoded @PathParam("identifier") String identifier,
             @Context UriInfo uriInfo);
 
+    /**
+     * @deprecated do not use this method. It will be replaced by
+     *             {@link RestconfDataService#readData(String, UriInfo)}
+     */
+    @Deprecated
     @GET
     @Path("/operational/{identifier:.+}")
     @Produces({ Draft02.MediaTypes.DATA + JSON, Draft02.MediaTypes.DATA + XML, MediaType.APPLICATION_JSON,
@@ -150,12 +166,23 @@ public interface RestconfService {
     public NormalizedNodeContext readOperationalData(@Encoded @PathParam("identifier") String identifier,
             @Context UriInfo uriInfo);
 
+    /**
+     * @deprecated do not use this method. It will be replaced by
+     *             {@link RestconfDataService#putData(String, NormalizedNodeContext, UriInfo)}
+     */
+    @Deprecated
     @PUT
     @Path("/config/{identifier:.+}")
     @Consumes({ Draft02.MediaTypes.DATA + JSON, Draft02.MediaTypes.DATA + XML, MediaType.APPLICATION_JSON,
             MediaType.APPLICATION_XML, MediaType.TEXT_XML })
-    public Response updateConfigurationData(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload);
+    public Response updateConfigurationData(@Encoded @PathParam("identifier") String identifier,
+            NormalizedNodeContext payload, @Context UriInfo uriInfo);
 
+    /**
+     * @deprecated do not use this method. It will be replaced by
+     *             {@link RestconfDataService#postData(String, NormalizedNodeContext, UriInfo)}
+     */
+    @Deprecated
     @POST
     @Path("/config/{identifier:.+}")
     @Consumes({ Draft02.MediaTypes.DATA + JSON, Draft02.MediaTypes.DATA + XML, MediaType.APPLICATION_JSON,
@@ -163,23 +190,34 @@ public interface RestconfService {
     public Response createConfigurationData(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload,
             @Context UriInfo uriInfo);
 
+    /**
+     * @deprecated do not use this method. It will be replaced by
+     *             {@link RestconfDataService#postData(NormalizedNodeContext, UriInfo)}
+     */
+    @Deprecated
     @POST
     @Path("/config")
     @Consumes({ Draft02.MediaTypes.DATA + JSON, Draft02.MediaTypes.DATA + XML, MediaType.APPLICATION_JSON,
             MediaType.APPLICATION_XML, MediaType.TEXT_XML })
     public Response createConfigurationData(NormalizedNodeContext payload, @Context UriInfo uriInfo);
 
+    /**
+     * @deprecated do not use this method. It will be replaced by
+     *             {@link RestconfDataService#deleteData(String)}
+     */
+    @Deprecated
     @DELETE
     @Path("/config/{identifier:.+}")
     public Response deleteConfigurationData(@Encoded @PathParam("identifier") String identifier);
 
     @GET
     @Path("/streams/stream/{identifier:.+}")
-    public Response subscribeToStream(@Encoded @PathParam("identifier") String identifier, @Context UriInfo uriInfo);
+    public NormalizedNodeContext subscribeToStream(@Encoded @PathParam("identifier") String identifier,
+            @Context UriInfo uriInfo);
 
     /**
-     * @deprecated do not use this method. It is replaced by
-     *             {@link RestconfStreamsService#getAvailableStreams(UriInfo)}
+     * @deprecated do not use this method. It will be replaced by
+     *             {@link RestconfDataService#readData(String, UriInfo)}
      */
     @Deprecated
     @GET
@@ -188,6 +226,11 @@ public interface RestconfService {
             MediaType.APPLICATION_XML, MediaType.TEXT_XML })
     public NormalizedNodeContext getAvailableStreams(@Context UriInfo uriInfo);
 
+    /**
+     * @deprecated do not use this method. It will be replaced by
+     *             {@link RestconfDataService#patchData(String, PATCHContext, UriInfo)}
+     */
+    @Deprecated
     @PATCH
     @Path("/config/{identifier:.+}")
     @Consumes({MediaTypes.PATCH + JSON, MediaTypes.PATCH + XML})
@@ -195,6 +238,11 @@ public interface RestconfService {
     PATCHStatusContext patchConfigurationData(@Encoded @PathParam("identifier") String identifier, PATCHContext
             context, @Context UriInfo uriInfo);
 
+    /**
+     * @deprecated do not use this method. It will be replaced by
+     *             {@link RestconfDataService#patchData(PATCHContext, UriInfo)}
+     */
+    @Deprecated
     @PATCH
     @Path("/config")
     @Consumes({MediaTypes.PATCH + JSON, MediaTypes.PATCH + XML})