summaryrefslogtreecommitdiffstats
path: root/base/java-tools/src/com/netscape/cmstools/key
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/java-tools/src/com/netscape/cmstools/key
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/java-tools/src/com/netscape/cmstools/key')
-rw-r--r--base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java7
-rw-r--r--base/java-tools/src/com/netscape/cmstools/key/KeyRequestFindCLI.java7
2 files changed, 12 insertions, 2 deletions
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java
index 8ec7db4d9..954246f7e 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java
@@ -72,6 +72,10 @@ public class KeyFindCLI extends CLI {
option = new Option(null, "size", true, "Page size");
option.setArgName("size");
options.addOption(option);
+
+ option = new Option(null, "realm", true, "Realm");
+ option.setArgName("realm");
+ options.addOption(option);
}
public void execute(String[] args) {
@@ -103,6 +107,7 @@ public class KeyFindCLI extends CLI {
String clientKeyID = cmd.getOptionValue("clientKeyID");
String status = cmd.getOptionValue("status");
+ String realm = cmd.getOptionValue("realm");
String s = cmd.getOptionValue("maxResults");
Integer maxResults = s == null ? null : Integer.valueOf(s);
@@ -116,7 +121,7 @@ public class KeyFindCLI extends CLI {
s = cmd.getOptionValue("size");
Integer size = s == null ? null : Integer.valueOf(s);
- KeyInfoCollection keys = keyCLI.keyClient.listKeys(clientKeyID, status, maxResults, maxTime, start, size);
+ KeyInfoCollection keys = keyCLI.keyClient.listKeys(clientKeyID, status, maxResults, maxTime, start, size, realm);
Collection<KeyInfo> entries = keys.getEntries();
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyRequestFindCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyRequestFindCLI.java
index 92c98f042..de061d630 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyRequestFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyRequestFindCLI.java
@@ -77,6 +77,10 @@ public class KeyRequestFindCLI extends CLI {
option = new Option(null, "pageSize", true, "Page size");
option.setArgName("page size");
options.addOption(option);
+
+ option = new Option(null, "realm", true, "Authorization Realm");
+ option.setArgName("realm");
+ options.addOption(option);
}
public void execute(String[] args) {
@@ -109,6 +113,7 @@ public class KeyRequestFindCLI extends CLI {
String status = cmd.getOptionValue("status");
String type = cmd.getOptionValue("type");
String clientKeyID = cmd.getOptionValue("client");
+ String realm = cmd.getOptionValue("realm");
String s = cmd.getOptionValue("start");
RequestId start = s == null ? null : new RequestId(s);
@@ -123,7 +128,7 @@ public class KeyRequestFindCLI extends CLI {
Integer maxTime = s == null ? null : Integer.valueOf(s);
KeyRequestInfoCollection keys = keyCLI.keyClient.listRequests(
- status, type, clientKeyID, start, pageSize, maxResults, maxTime);
+ status, type, clientKeyID, start, pageSize, maxResults, maxTime, realm);
MainCLI.printMessage(keys.getTotal() + " entries matched");
if (keys.getTotal() == 0) return;