summaryrefslogtreecommitdiffstats
path: root/base/common/src
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2014-02-19 11:22:31 -0500
committerEndi S. Dewata <edewata@redhat.com>2014-02-19 12:51:02 -0500
commitd345bab896d2ac16dca164adb48031047affdf09 (patch)
tree5860c339fe823644a8691f980b26ba3636387b6d /base/common/src
parentabda3f089591fb9db31f6ddeb174e86c6bc0fbee (diff)
Updated REST interface for key requests.
The REST interface for key requests has been modified to return Response objects to allow better handling of server responses. Ticket #554
Diffstat (limited to 'base/common/src')
-rw-r--r--base/common/src/com/netscape/certsrv/key/KeyClient.java15
-rw-r--r--base/common/src/com/netscape/certsrv/key/KeyRequestResource.java16
2 files changed, 20 insertions, 11 deletions
diff --git a/base/common/src/com/netscape/certsrv/key/KeyClient.java b/base/common/src/com/netscape/certsrv/key/KeyClient.java
index bdb84fddb..374b793ff 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyClient.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyClient.java
@@ -102,7 +102,7 @@ public class KeyClient extends Client {
Integer pageSize,
Integer maxResults,
Integer maxTime) {
- return keyRequestClient.listRequests(
+ Response response = keyRequestClient.listRequests(
requestState,
requestType,
clientID,
@@ -110,10 +110,12 @@ public class KeyClient extends Client {
pageSize,
maxResults,
maxTime);
+ return client.getEntity(response, KeyRequestInfoCollection.class);
}
public KeyRequestInfo getRequestInfo(RequestId id) {
- return keyRequestClient.getRequestInfo(id);
+ Response response = keyRequestClient.getRequestInfo(id);
+ return client.getEntity(response, KeyRequestInfo.class);
}
public KeyRequestResponse archiveSecurityData(byte[] encoded, String clientId, String dataType, String algorithm, int strength) {
@@ -172,14 +174,17 @@ public class KeyClient extends Client {
}
public void approveRequest(RequestId id) {
- keyRequestClient.approveRequest(id);
+ Response response = keyRequestClient.approveRequest(id);
+ client.getEntity(response, Void.class);
}
public void rejectRequest(RequestId id) {
- keyRequestClient.rejectRequest(id);
+ Response response = keyRequestClient.rejectRequest(id);
+ client.getEntity(response, Void.class);
}
public void cancelRequest(RequestId id) {
- keyRequestClient.cancelRequest(id);
+ Response response = keyRequestClient.cancelRequest(id);
+ client.getEntity(response, Void.class);
}
}
diff --git a/base/common/src/com/netscape/certsrv/key/KeyRequestResource.java b/base/common/src/com/netscape/certsrv/key/KeyRequestResource.java
index e6e6c2e70..867136bc1 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyRequestResource.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyRequestResource.java
@@ -40,8 +40,9 @@ public interface KeyRequestResource {
* Used to generate list of key requests based on the search parameters
*/
@GET
+ @ClientResponseType(entityType=KeyRequestInfoCollection.class)
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- public KeyRequestInfoCollection listRequests(@QueryParam("requestState") String requestState,
+ public Response listRequests(@QueryParam("requestState") String requestState,
@QueryParam("requestType") String requestType,
@QueryParam("clientID") String clientID,
@QueryParam("start") RequestId start,
@@ -66,19 +67,22 @@ public interface KeyRequestResource {
*/
@GET
@Path("{id}")
+ @ClientResponseType(entityType=KeyRequestInfo.class)
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- public KeyRequestInfo getRequestInfo(@PathParam("id") RequestId id);
+ public Response getRequestInfo(@PathParam("id") RequestId id);
@POST
@Path("{id}/approve")
- public void approveRequest(@PathParam("id") RequestId id);
+ @ClientResponseType(entityType=Void.class)
+ public Response approveRequest(@PathParam("id") RequestId id);
@POST
@Path("{id}/reject")
- public void rejectRequest(@PathParam("id") RequestId id);
+ @ClientResponseType(entityType=Void.class)
+ public Response rejectRequest(@PathParam("id") RequestId id);
@POST
@Path("{id}/cancel")
- public void cancelRequest(@PathParam("id") RequestId id);
-
+ @ClientResponseType(entityType=Void.class)
+ public Response cancelRequest(@PathParam("id") RequestId id);
}