diff options
author | Abhishek Koneru <akoneru@redhat.com> | 2012-08-06 13:17:38 -0400 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-08-13 09:05:05 -0500 |
commit | 2542a14178a7bbb8c1c2d98121ee317ee929bf85 (patch) | |
tree | 260ab351c36e41cea48e7032ce6e93c830a72d17 /base/common/src/com/netscape/cms/client/cert/CertFindCLI.java | |
parent | 39d24f814429e30b7f84dd0567a67eb943990403 (diff) | |
download | pki-2542a14178a7bbb8c1c2d98121ee317ee929bf85.tar.gz pki-2542a14178a7bbb8c1c2d98121ee317ee929bf85.tar.xz pki-2542a14178a7bbb8c1c2d98121ee317ee929bf85.zip |
Ticket 149 - Implementing the search functionality,server side.
Search function call supporting various already present.
Changes the ds call from searchCertificates to CertificateRepository.findCertRecords().
Added pagination using start and size options . provided in command line.
Conflicts:
base/common/src/com/netscape/cms/client/cert/CertRestClient.java
Diffstat (limited to 'base/common/src/com/netscape/cms/client/cert/CertFindCLI.java')
-rw-r--r-- | base/common/src/com/netscape/cms/client/cert/CertFindCLI.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/base/common/src/com/netscape/cms/client/cert/CertFindCLI.java b/base/common/src/com/netscape/cms/client/cert/CertFindCLI.java index 4890a6682..ea88c46cd 100644 --- a/base/common/src/com/netscape/cms/client/cert/CertFindCLI.java +++ b/base/common/src/com/netscape/cms/client/cert/CertFindCLI.java @@ -103,10 +103,16 @@ public class CertFindCLI extends CLI { searchData = new CertSearchData(); searchData.setSerialNumberRangeInUse(true); } + String s = cmd.getOptionValue("start"); + Integer start = s == null ? null : Integer.valueOf(s); + + s = cmd.getOptionValue("size"); + Integer size = s == null ? null : Integer.valueOf(s); + addSearchAttribute(cmd, searchData); CertDataInfos certs = null; try { - certs = parent.client.findCerts(searchData); + certs = parent.client.findCerts(searchData, start, size); } catch (CMSException e) { System.err.println("Error: Cannot list certificates. " + e.getMessage()); System.exit(-1); @@ -136,6 +142,15 @@ public class CertFindCLI extends CLI { Option option = null; + //pagination options + option = new Option(null, "start", true, "Page start"); + option.setArgName("start"); + options.addOption(option); + + option = new Option(null, "size", true, "Page size"); + option.setArgName("size"); + options.addOption(option); + //help options.addOption(null, "help", false, "Show help options"); |