summaryrefslogtreecommitdiffstats
path: root/base/common/src
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2016-04-16 14:19:50 -0400
committerAde Lee <alee@redhat.com>2016-04-20 17:30:11 -0400
commit2f730b62e589cd829c5fcb021a2a92d436073eac (patch)
treeb878387788d7d6a8484021c9ffe10395da575e28 /base/common/src
parent90f5798079ffe46502552daaddd1b6366eafac62 (diff)
downloadpki-2f730b62e589cd829c5fcb021a2a92d436073eac.tar.gz
pki-2f730b62e589cd829c5fcb021a2a92d436073eac.tar.xz
pki-2f730b62e589cd829c5fcb021a2a92d436073eac.zip
Added realm to methods for listing requests and keys
1. Added query parameters for the realm. If a realm is specified, then only the key requests and keys associated with the realm are returned. If no realm is specified, then only those requests and keys without a realm are returned. 2. Added parameters to keyClient and the CLI Part of Trac Ticket #2041
Diffstat (limited to 'base/common/src')
-rw-r--r--base/common/src/com/netscape/certsrv/key/KeyClient.java34
-rw-r--r--base/common/src/com/netscape/certsrv/key/KeyRequestResource.java3
-rw-r--r--base/common/src/com/netscape/certsrv/key/KeyResource.java3
3 files changed, 34 insertions, 6 deletions
diff --git a/base/common/src/com/netscape/certsrv/key/KeyClient.java b/base/common/src/com/netscape/certsrv/key/KeyClient.java
index 04eb6539f..1c8a76bfe 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyClient.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyClient.java
@@ -86,11 +86,19 @@ public class KeyClient extends Client {
* @param maxTime -- Maximum time for the operation to take
* @param start -- Start index of list
* @param size -- Size of the list to be returned.
+ * @param realm - authz realm
* @return a KeyInfoCollection object.
*/
public KeyInfoCollection listKeys(String clientKeyID, String status, Integer maxSize, Integer maxTime,
+ Integer start, Integer size, String realm) {
+ Response response = keyClient.listKeys(clientKeyID, status, maxSize, maxTime, start, size, realm);
+ return client.getEntity(response, KeyInfoCollection.class);
+ }
+
+ /* for backward compatibility */
+ public KeyInfoCollection listKeys(String clientKeyID, String status, Integer maxSize, Integer maxTime,
Integer start, Integer size) {
- Response response = keyClient.listKeys(clientKeyID, status, maxSize, maxTime, start, size);
+ Response response = keyClient.listKeys(clientKeyID, status, maxSize, maxTime, start, size, null);
return client.getEntity(response, KeyInfoCollection.class);
}
@@ -99,8 +107,22 @@ public class KeyClient extends Client {
*
* @param requestState -- State of the requests to be queried.
* @param requestType -- Type of the requests to be queried.
+ * @param realm -- Authz Realm
* @return a KeyRequestCollection object.
*/
+ public KeyRequestInfoCollection listRequests(String requestState, String requestType, String realm) {
+ return listRequests(
+ requestState,
+ requestType,
+ null,
+ new RequestId(0),
+ 100,
+ 100,
+ 10,
+ realm);
+ }
+
+ /* method for backwards compatibility */
public KeyRequestInfoCollection listRequests(String requestState, String requestType) {
return listRequests(
requestState,
@@ -109,7 +131,8 @@ public class KeyClient extends Client {
new RequestId(0),
100,
100,
- 10);
+ 10,
+ null);
}
/**
@@ -122,6 +145,7 @@ public class KeyClient extends Client {
* @param pageSize -- Size of the list to be returned.
* @param maxResults -- Maximum number of requests to be fetched
* @param maxTime -- Maximum time for the operation to take
+ * @param realm -- Authz Realm
* @return a KeyRequestInfoCollection object.
*/
public KeyRequestInfoCollection listRequests(
@@ -131,7 +155,8 @@ public class KeyClient extends Client {
RequestId start,
Integer pageSize,
Integer maxResults,
- Integer maxTime) {
+ Integer maxTime,
+ String realm) {
Response response = keyRequestClient.listRequests(
requestState,
requestType,
@@ -139,7 +164,8 @@ public class KeyClient extends Client {
start,
pageSize,
maxResults,
- maxTime);
+ maxTime,
+ realm);
return client.getEntity(response, KeyRequestInfoCollection.class);
}
diff --git a/base/common/src/com/netscape/certsrv/key/KeyRequestResource.java b/base/common/src/com/netscape/certsrv/key/KeyRequestResource.java
index 768127e42..26ab9908f 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyRequestResource.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyRequestResource.java
@@ -51,7 +51,8 @@ public interface KeyRequestResource {
@QueryParam("start") RequestId start,
@QueryParam("pageSize") Integer pageSize,
@QueryParam("maxResults") Integer maxResults,
- @QueryParam("maxTime") Integer maxTime);
+ @QueryParam("maxTime") Integer maxTime,
+ @QueryParam("realm") String realm);
@POST
@ClientResponseType(entityType=KeyRequestResponse.class)
diff --git a/base/common/src/com/netscape/certsrv/key/KeyResource.java b/base/common/src/com/netscape/certsrv/key/KeyResource.java
index 77c9a587e..71a355673 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyResource.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyResource.java
@@ -32,7 +32,8 @@ public interface KeyResource {
@QueryParam("maxResults") Integer maxResults,
@QueryParam("maxTime") Integer maxTime,
@QueryParam("start") Integer start,
- @QueryParam("size") Integer size);
+ @QueryParam("size") Integer size,
+ @QueryParam("realm") String realm);
@GET
@Path("active/{clientKeyID}")