X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=restconf%2Fsal-rest-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fsal%2Frest%2Fapi%2FRestconfService.java;h=e2775381a14b9e33cffd035257a5ce7729e84c5b;hb=dca9aa60cd4584298c414ff2722dff4f406fe0de;hp=fac2b1872e2c9c9cf3d179b0717188731b5f9e48;hpb=4c0c091813aea131d32dc70c5121a450eb9b7291;p=netconf.git diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/api/RestconfService.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/api/RestconfService.java index fac2b1872e..e2775381a1 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/api/RestconfService.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/api/RestconfService.java @@ -21,26 +21,34 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; +import org.opendaylight.netconf.sal.rest.api.Draft02.MediaTypes; +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.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. * @@ -54,36 +62,66 @@ public interface RestconfService { @GET public Object getRoot(); + /** + * @deprecated do not use this method. It will be replaced by + * {@link RestconfDataService#readData(UriInfo)} + */ + @Deprecated @GET @Path("/modules") @Produces({ Draft02.MediaTypes.API + JSON, Draft02.MediaTypes.API + XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) public NormalizedNodeContext getModules(@Context UriInfo uriInfo); + /** + * @deprecated do not use this method. It will be replaced by + * {@link RestconfDataService#readData(String, UriInfo)} + */ + @Deprecated @GET @Path("/modules/{identifier:.+}") @Produces({ Draft02.MediaTypes.API + JSON, Draft02.MediaTypes.API + XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) public NormalizedNodeContext getModules(@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("/modules/module/{identifier:.+}") @Produces({ Draft02.MediaTypes.API + JSON, Draft02.MediaTypes.API + XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) public NormalizedNodeContext getModule(@PathParam("identifier") String identifier, @Context UriInfo uriInfo); + /** + * @deprecated do not use this method. It will be replaced by + * {@link RestconfOperationsService#getOperations(UriInfo)} + */ + @Deprecated @GET @Path("/operations") @Produces({ Draft02.MediaTypes.API + JSON, Draft02.MediaTypes.API + XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) public NormalizedNodeContext getOperations(@Context UriInfo uriInfo); + /** + * @deprecated do not use this method. It will be replaced by + * {@link RestconfOperationsService#getOperations(String, UriInfo)} + */ + @Deprecated @GET @Path("/operations/{identifier:.+}") @Produces({ Draft02.MediaTypes.API + JSON, Draft02.MediaTypes.API + XML, MediaType.APPLICATION_JSON, 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, @@ -104,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, @@ -111,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, @@ -118,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, @@ -131,24 +190,62 @@ 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 will be replaced by + * {@link RestconfDataService#readData(String, UriInfo)} + */ + @Deprecated @GET @Path("/streams") @Produces({ Draft02.MediaTypes.API + JSON, Draft02.MediaTypes.API + XML, MediaType.APPLICATION_JSON, 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}) + @Produces({MediaTypes.PATCH_STATUS + JSON, MediaTypes.PATCH_STATUS + XML}) + 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}) + @Produces({MediaTypes.PATCH_STATUS + JSON, MediaTypes.PATCH_STATUS + XML}) + PATCHStatusContext patchConfigurationData(PATCHContext context, @Context UriInfo uriInfo); }