From 2e02c078fb57fa806d3ff2bf7a1ed2df34966acc Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Tue, 15 Mar 2016 21:10:30 +0100 Subject: 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 --- .../netscape/cmstools/tps/token/TokenFindCLI.java | 31 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'base/java-tools/src/com/netscape/cmstools') 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; -- cgit