diff options
author | Endi S. Dewata <edewata@redhat.com> | 2014-02-14 15:26:16 -0500 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2014-02-18 11:35:47 -0500 |
commit | 9c3f874fa00f71c75bd7f90537bcdd6aab1d70c6 (patch) | |
tree | 104170847a5ed122c664160d910935bd2de2bdeb /base/common/src/com/netscape/certsrv/logging | |
parent | ec9ba2da596eba5c6f09f8f2b0c5d8bcf1413356 (diff) | |
download | pki-9c3f874fa00f71c75bd7f90537bcdd6aab1d70c6.tar.gz pki-9c3f874fa00f71c75bd7f90537bcdd6aab1d70c6.tar.xz pki-9c3f874fa00f71c75bd7f90537bcdd6aab1d70c6.zip |
Updated REST interface for TPS activities.
The REST interface for TPS activities 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/logging')
-rw-r--r-- | base/common/src/com/netscape/certsrv/logging/ActivityClient.java | 8 | ||||
-rw-r--r-- | base/common/src/com/netscape/certsrv/logging/ActivityResource.java | 9 |
2 files changed, 13 insertions, 4 deletions
diff --git a/base/common/src/com/netscape/certsrv/logging/ActivityClient.java b/base/common/src/com/netscape/certsrv/logging/ActivityClient.java index 48ecdd5c4..eae2f6f48 100644 --- a/base/common/src/com/netscape/certsrv/logging/ActivityClient.java +++ b/base/common/src/com/netscape/certsrv/logging/ActivityClient.java @@ -19,6 +19,8 @@ package com.netscape.certsrv.logging; import java.net.URISyntaxException; +import javax.ws.rs.core.Response; + import com.netscape.certsrv.client.Client; import com.netscape.certsrv.client.PKIClient; @@ -39,10 +41,12 @@ public class ActivityClient extends Client { } public ActivityCollection findActivities(Integer start, Integer size) { - return resource.findActivities(start, size); + Response response = resource.findActivities(start, size); + return client.getEntity(response, ActivityCollection.class); } public ActivityData getActivity(String tokenID) { - return resource.getActivity(tokenID); + Response response = resource.getActivity(tokenID); + return client.getEntity(response, ActivityData.class); } } diff --git a/base/common/src/com/netscape/certsrv/logging/ActivityResource.java b/base/common/src/com/netscape/certsrv/logging/ActivityResource.java index 6ecf41dd2..715233e63 100644 --- a/base/common/src/com/netscape/certsrv/logging/ActivityResource.java +++ b/base/common/src/com/netscape/certsrv/logging/ActivityResource.java @@ -23,6 +23,9 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import org.jboss.resteasy.annotations.ClientResponseType; /** @@ -32,13 +35,15 @@ import javax.ws.rs.core.MediaType; public interface ActivityResource { @GET + @ClientResponseType(entityType=ActivityCollection.class) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public ActivityCollection findActivities( + public Response findActivities( @QueryParam("start") Integer start, @QueryParam("size") Integer size); @GET @Path("{activityID}") + @ClientResponseType(entityType=ActivityData.class) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public ActivityData getActivity(@PathParam("activityID") String activityID); + public Response getActivity(@PathParam("activityID") String activityID); } |