diff options
author | Endi S. Dewata <edewata@redhat.com> | 2013-11-08 12:36:33 -0500 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2013-11-08 19:28:52 -0500 |
commit | f74c644b09dd1e18289c4a543a211c3ff8cd02d9 (patch) | |
tree | 296fe00e281225bd825c41b319c8435a4219855d /base/java-tools/src/com/netscape/cmstools/tps | |
parent | 9d3090378bf4e5152df2c02d48ca8f9beeac2057 (diff) | |
download | pki-f74c644b09dd1e18289c4a543a211c3ff8cd02d9.tar.gz pki-f74c644b09dd1e18289c4a543a211c3ff8cd02d9.tar.xz pki-f74c644b09dd1e18289c4a543a211c3ff8cd02d9.zip |
Fixed find commands.
Some of the REST services have been fixed to consistently return a
DataCollection which contains the total count, the requested subset
of results, and links to request other subsets of the results.
The TPSConnectorFindCLI has been split into separate find and show
commands.
Ticket #749
Diffstat (limited to 'base/java-tools/src/com/netscape/cmstools/tps')
6 files changed, 12 insertions, 6 deletions
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorFindCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorFindCLI.java index 2ff8288a0..81724bb31 100644 --- a/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorFindCLI.java +++ b/base/java-tools/src/com/netscape/cmstools/tps/authenticator/AuthenticatorFindCLI.java @@ -74,7 +74,8 @@ public class AuthenticatorFindCLI extends CLI { AuthenticatorCollection result = authenticatorCLI.authenticatorClient.findAuthenticators(start, size); Collection<AuthenticatorData> authenticators = result.getEntries(); - MainCLI.printMessage(authenticators.size() + " authenticator(s) matched"); + MainCLI.printMessage(result.getTotal() + " authenticator(s) matched"); + if (result.getTotal() == 0) return; boolean first = true; diff --git a/base/java-tools/src/com/netscape/cmstools/tps/cert/TPSCertFindCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/cert/TPSCertFindCLI.java index 4d0827cb3..9ba66a62a 100644 --- a/base/java-tools/src/com/netscape/cmstools/tps/cert/TPSCertFindCLI.java +++ b/base/java-tools/src/com/netscape/cmstools/tps/cert/TPSCertFindCLI.java @@ -74,7 +74,8 @@ public class TPSCertFindCLI extends CLI { TPSCertCollection result = certCLI.certClient.findCerts(start, size); Collection<TPSCertData> certs = result.getEntries(); - MainCLI.printMessage(certs.size() + " certificate(s) matched"); + MainCLI.printMessage(result.getTotal() + " certificate(s) matched"); + if (result.getTotal() == 0) return; boolean first = true; diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionFindCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionFindCLI.java index 6112db4ff..7cb4c1b16 100644 --- a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionFindCLI.java +++ b/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionFindCLI.java @@ -74,7 +74,8 @@ public class ConnectionFindCLI extends CLI { ConnectionCollection result = connectionCLI.connectionClient.findConnections(start, size); Collection<ConnectionData> connections = result.getEntries(); - MainCLI.printMessage(connections.size() + " connection(s) matched"); + MainCLI.printMessage(result.getTotal() + " connection(s) matched"); + if (result.getTotal() == 0) return; boolean first = true; diff --git a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileFindCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileFindCLI.java index 9f822f6ba..907641462 100644 --- a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileFindCLI.java +++ b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileFindCLI.java @@ -74,7 +74,8 @@ public class ProfileFindCLI extends CLI { ProfileCollection result = profileCLI.profileClient.findProfiles(start, size); Collection<ProfileData> profiles = result.getEntries(); - MainCLI.printMessage(profiles.size() + " profile(s) matched"); + MainCLI.printMessage(result.getTotal() + " profile(s) matched"); + if (result.getTotal() == 0) return; boolean first = true; diff --git a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingFindCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingFindCLI.java index d96268be7..6e101a049 100644 --- a/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingFindCLI.java +++ b/base/java-tools/src/com/netscape/cmstools/tps/profile/ProfileMappingFindCLI.java @@ -74,7 +74,8 @@ public class ProfileMappingFindCLI extends CLI { ProfileMappingCollection result = profileMappingCLI.profileMappingClient.findProfileMappings(start, size); Collection<ProfileMappingData> profileMappings = result.getEntries(); - MainCLI.printMessage(profileMappings.size() + " profile mapping(s) matched"); + MainCLI.printMessage(result.getTotal() + " profile mapping(s) matched"); + if (result.getTotal() == 0) return; boolean first = true; 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 3ade40bb9..2e43f3cdd 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 @@ -74,7 +74,8 @@ public class TokenFindCLI extends CLI { TokenCollection result = tokenCLI.tokenClient.findTokens(start, size); Collection<TokenData> tokens = result.getEntries(); - MainCLI.printMessage(tokens.size() + " token(s) matched"); + MainCLI.printMessage(result.getTotal() + " token(s) matched"); + if (result.getTotal() == 0) return; boolean first = true; |