summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/certsrv/user
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2013-12-10 20:10:06 -0500
committerEndi S. Dewata <edewata@redhat.com>2013-12-16 19:15:43 -0500
commit017e14f93e376f7cbc20066f052a39c4552860d9 (patch)
treee7707f6cf39db3052261794b66a6934173b6104c /base/common/src/com/netscape/certsrv/user
parent5952a82975063c4ec27303091a44e586d1386933 (diff)
downloadpki-017e14f93e376f7cbc20066f052a39c4552860d9.tar.gz
pki-017e14f93e376f7cbc20066f052a39c4552860d9.tar.xz
pki-017e14f93e376f7cbc20066f052a39c4552860d9.zip
Using PATCH method for modify operations.
Some modify operations have been modified to use HTTP PATCH method since the request only contains changes to the resource, not the entire resource. To replace the entire resource, separate replace operations using HTTP PUT method will be used instead. The Backbone library is using the same convention by default. Ticket #654
Diffstat (limited to 'base/common/src/com/netscape/certsrv/user')
-rw-r--r--base/common/src/com/netscape/certsrv/user/UserResource.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/base/common/src/com/netscape/certsrv/user/UserResource.java b/base/common/src/com/netscape/certsrv/user/UserResource.java
index 19db939dd..90b46ef60 100644
--- a/base/common/src/com/netscape/certsrv/user/UserResource.java
+++ b/base/common/src/com/netscape/certsrv/user/UserResource.java
@@ -22,6 +22,7 @@ import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
@@ -33,6 +34,7 @@ import org.jboss.resteasy.annotations.ClientResponseType;
import com.netscape.certsrv.acls.ACLMapping;
import com.netscape.certsrv.authentication.AuthMethodMapping;
+import com.netscape.certsrv.base.PATCH;
/**
* @author Endi S. Dewata
@@ -63,7 +65,14 @@ public interface UserResource {
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public UserData getUser(@PathParam("userID") String userID);
- @POST
+ @PUT
+ @Path("{userID}")
+ @ClientResponseType(entityType=UserData.class)
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ public Response replaceUser(@PathParam("userID") String userID, UserData userData);
+
+ @PATCH
@Path("{userID}")
@ClientResponseType(entityType=UserData.class)
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })