diff options
author | Endi S. Dewata <edewata@redhat.com> | 2014-02-14 21:30:38 -0500 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2014-02-18 11:36:36 -0500 |
commit | f1f3637c28aa59b5059f1496fa7fd13b180ba19d (patch) | |
tree | 6c6a4504f01bbbdb338b66862e80f2268124031f /base/common/src/com/netscape/certsrv/tps | |
parent | 44ea95f3750c79620cbc9e25fff03fd61e88d02c (diff) | |
download | pki-f1f3637c28aa59b5059f1496fa7fd13b180ba19d.tar.gz pki-f1f3637c28aa59b5059f1496fa7fd13b180ba19d.tar.xz pki-f1f3637c28aa59b5059f1496fa7fd13b180ba19d.zip |
Updated REST interface for TPS profile mappings.
The REST interface for TPS profile mappings 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/tps')
-rw-r--r-- | base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingClient.java | 9 | ||||
-rw-r--r-- | base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingResource.java | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingClient.java b/base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingClient.java index dcb35132e..409d8d718 100644 --- a/base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingClient.java +++ b/base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingClient.java @@ -41,11 +41,13 @@ public class ProfileMappingClient extends Client { } public ProfileMappingCollection findProfileMappings(Integer start, Integer size) { - return resource.findProfileMappings(start, size); + Response response = resource.findProfileMappings(start, size); + return client.getEntity(response, ProfileMappingCollection.class); } public ProfileMappingData getProfileMapping(String profileMappingID) { - return resource.getProfileMapping(profileMappingID); + Response response = resource.getProfileMapping(profileMappingID); + return client.getEntity(response, ProfileMappingData.class); } public ProfileMappingData addProfileMapping(ProfileMappingData profileMappingData) { @@ -64,6 +66,7 @@ public class ProfileMappingClient extends Client { } public void removeProfileMapping(String profileMappingID) { - resource.removeProfileMapping(profileMappingID); + Response response = resource.removeProfileMapping(profileMappingID); + client.getEntity(response, Void.class); } } diff --git a/base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingResource.java b/base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingResource.java index 698a1b13b..19d62bce0 100644 --- a/base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingResource.java +++ b/base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingResource.java @@ -44,15 +44,17 @@ import com.netscape.certsrv.authentication.AuthMethodMapping; public interface ProfileMappingResource { @GET + @ClientResponseType(entityType=ProfileMappingCollection.class) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public ProfileMappingCollection findProfileMappings( + public Response findProfileMappings( @QueryParam("start") Integer start, @QueryParam("size") Integer size); @GET @Path("{profileMappingID}") + @ClientResponseType(entityType=ProfileMappingData.class) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public ProfileMappingData getProfileMapping(@PathParam("profileMappingID") String profileMappingID); + public Response getProfileMapping(@PathParam("profileMappingID") String profileMappingID); @POST @ACLMapping("profile-mappings.add") @@ -83,7 +85,8 @@ public interface ProfileMappingResource { @DELETE @Path("{profileMappingID}") + @ClientResponseType(entityType=Void.class) @ACLMapping("profile-mappings.remove") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public void removeProfileMapping(@PathParam("profileMappingID") String profileMappingID); + public Response removeProfileMapping(@PathParam("profileMappingID") String profileMappingID); } |