diff options
author | Endi S. Dewata <edewata@redhat.com> | 2016-03-15 21:10:30 +0100 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2016-03-17 01:03:43 +0100 |
commit | 2e02c078fb57fa806d3ff2bf7a1ed2df34966acc (patch) | |
tree | 03c9803a6445b3fcbc982359adc82d36fccb76ab /base/java-tools/src/com/netscape/cmstools | |
parent | b5637ae9c646c99efce4ff874666b75400502b2d (diff) | |
download | pki-2e02c078fb57fa806d3ff2bf7a1ed2df34966acc.tar.gz pki-2e02c078fb57fa806d3ff2bf7a1ed2df34966acc.tar.xz pki-2e02c078fb57fa806d3ff2bf7a1ed2df34966acc.zip |
Added TPS token filter dialog.
The TPS UI Tokens page and the pki tps-token-find CLI have been
modified to provide an interface to filter tokens based on their
attributes.
The TokenService.findTokens() has been modified to accept
additional search criteria based on token attributes.
https://fedorahosted.org/pki/ticket/1482
Diffstat (limited to 'base/java-tools/src/com/netscape/cmstools')
-rw-r--r-- | base/java-tools/src/com/netscape/cmstools/tps/token/TokenFindCLI.java | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/token/TokenFindCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/token/TokenFindCLI.java index 9afc05ebe..cfe7c2fe3 100644 --- a/base/java-tools/src/com/netscape/cmstools/tps/token/TokenFindCLI.java +++ b/base/java-tools/src/com/netscape/cmstools/tps/token/TokenFindCLI.java @@ -48,7 +48,23 @@ public class TokenFindCLI extends CLI { } public void createOptions() { - Option option = new Option(null, "start", true, "Page start"); + Option option = new Option(null, "token", true, "Token ID"); + option.setArgName("token ID"); + options.addOption(option); + + option = new Option(null, "user", true, "User ID"); + option.setArgName("user ID"); + options.addOption(option); + + option = new Option(null, "type", true, "Token type"); + option.setArgName("type"); + options.addOption(option); + + option = new Option(null, "status", true, "Token status"); + option.setArgName("status"); + options.addOption(option); + + option = new Option(null, "start", true, "Page start"); option.setArgName("start"); options.addOption(option); @@ -78,6 +94,10 @@ public class TokenFindCLI extends CLI { String[] cmdArgs = cmd.getArgs(); String filter = cmdArgs.length > 0 ? cmdArgs[0] : null; + String tokenID = cmd.getOptionValue("token"); + String userID = cmd.getOptionValue("user"); + String type = cmd.getOptionValue("type"); + String status = cmd.getOptionValue("status"); String s = cmd.getOptionValue("start"); Integer start = s == null ? null : Integer.valueOf(s); @@ -85,7 +105,14 @@ public class TokenFindCLI extends CLI { s = cmd.getOptionValue("size"); Integer size = s == null ? null : Integer.valueOf(s); - TokenCollection result = tokenCLI.tokenClient.findTokens(filter, start, size); + TokenCollection result = tokenCLI.tokenClient.findTokens( + filter, + tokenID, + userID, + type, + status, + start, + size); MainCLI.printMessage(result.getTotal() + " entries matched"); if (result.getTotal() == 0) return; |