diff options
author | Endi S. Dewata <edewata@redhat.com> | 2014-02-14 22:07:54 -0500 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2014-02-19 11:09:58 -0500 |
commit | 0ac1abb747d76321d5c4830c5bad9c41592959d3 (patch) | |
tree | 927b71f9b4168e7d9e3e2367c3b4e533cca76ec6 /base/common/src/com/netscape/certsrv/profile | |
parent | 86dfed578c3230064f2c93156b38309070a478f8 (diff) | |
download | pki-0ac1abb747d76321d5c4830c5bad9c41592959d3.tar.gz pki-0ac1abb747d76321d5c4830c5bad9c41592959d3.tar.xz pki-0ac1abb747d76321d5c4830c5bad9c41592959d3.zip |
Updated REST interface for CA profiles.
The REST interface for CA profiles has been modified to return
Response objects to allow better handling of server responses.
Ticket #554
Diffstat (limited to 'base/common/src/com/netscape/certsrv/profile')
-rw-r--r-- | base/common/src/com/netscape/certsrv/profile/ProfileClient.java | 16 | ||||
-rw-r--r-- | base/common/src/com/netscape/certsrv/profile/ProfileResource.java | 12 |
2 files changed, 18 insertions, 10 deletions
diff --git a/base/common/src/com/netscape/certsrv/profile/ProfileClient.java b/base/common/src/com/netscape/certsrv/profile/ProfileClient.java index 94ff487bb..51d159aca 100644 --- a/base/common/src/com/netscape/certsrv/profile/ProfileClient.java +++ b/base/common/src/com/netscape/certsrv/profile/ProfileClient.java @@ -41,19 +41,23 @@ public class ProfileClient extends Client { } public ProfileData retrieveProfile(String id) { - return profileClient.retrieveProfile(id); + Response response = profileClient.retrieveProfile(id); + return client.getEntity(response, ProfileData.class); } public ProfileDataInfos listProfiles(Integer start, Integer size) { - return profileClient.listProfiles(start, size); + Response response = profileClient.listProfiles(start, size); + return client.getEntity(response, ProfileDataInfos.class); } public void enableProfile(String id) { - profileClient.modifyProfileState(id, "enable"); + Response response = profileClient.modifyProfileState(id, "enable"); + client.getEntity(response, Void.class); } public void disableProfile(String id) { - profileClient.modifyProfileState(id, "disable"); + Response response = profileClient.modifyProfileState(id, "disable"); + client.getEntity(response, Void.class); } public ProfileData createProfile(ProfileData data) { @@ -67,7 +71,7 @@ public class ProfileClient extends Client { } public void deleteProfile(String id) { - profileClient.deleteProfile(id); + Response response = profileClient.deleteProfile(id); + client.getEntity(response, Void.class); } - } diff --git a/base/common/src/com/netscape/certsrv/profile/ProfileResource.java b/base/common/src/com/netscape/certsrv/profile/ProfileResource.java index 39ed0e6e2..28b173bd4 100644 --- a/base/common/src/com/netscape/certsrv/profile/ProfileResource.java +++ b/base/common/src/com/netscape/certsrv/profile/ProfileResource.java @@ -22,17 +22,19 @@ import com.netscape.certsrv.authentication.AuthMethodMapping; public interface ProfileResource { @GET + @ClientResponseType(entityType=ProfileDataInfos.class) @ACLMapping("profiles.list") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public ProfileDataInfos listProfiles( + public Response listProfiles( @QueryParam("start") Integer start, @QueryParam("size") Integer size); @GET @Path("{id}") + @ClientResponseType(entityType=ProfileData.class) @ACLMapping("profiles.read") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public ProfileData retrieveProfile(@PathParam("id") String id); + public Response retrieveProfile(@PathParam("id") String id); @POST @ClientResponseType(entityType=ProfileData.class) @@ -43,9 +45,10 @@ public interface ProfileResource { @POST @Path("{id}") + @ClientResponseType(entityType=Void.class) @ACLMapping("profiles.approve") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public void modifyProfileState(@PathParam("id") String id, @QueryParam("action") String action); + public Response modifyProfileState(@PathParam("id") String id, @QueryParam("action") String action); @PUT @Path("{id}") @@ -57,8 +60,9 @@ public interface ProfileResource { @DELETE @Path("{id}") + @ClientResponseType(entityType=Void.class) @ACLMapping("profiles.delete") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public void deleteProfile(@PathParam("id") String id); + public Response deleteProfile(@PathParam("id") String id); }
\ No newline at end of file |