diff options
author | Endi S. Dewata <edewata@redhat.com> | 2014-02-10 13:56:15 -0500 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2014-03-04 22:41:46 -0500 |
commit | 56b9ead088c59ea76d796002e74d42d7e31eac44 (patch) | |
tree | 38473afc8d126936ef806b44af2aae01f2ab8fcd /base/java-tools | |
parent | 9e14d6f3e5e69093067f0a76e5b7090c102e11d3 (diff) | |
download | pki-56b9ead088c59ea76d796002e74d42d7e31eac44.tar.gz pki-56b9ead088c59ea76d796002e74d42d7e31eac44.tar.xz pki-56b9ead088c59ea76d796002e74d42d7e31eac44.zip |
Added CLI parameter to select message format.
A new CLI parameter has been added to allow the user select the
REST message format. This is done by setting the default consumes
and produces when creating the client proxy. For this to work the
hard-coded @Consumes and @Produces annotations need to be removed
from the interface definition. A new interceptor has been added
to validate the message format before executing the operation.
Ticket #554
Diffstat (limited to 'base/java-tools')
-rw-r--r-- | base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java b/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java index 082c8140b..3527238d2 100644 --- a/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java +++ b/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java @@ -185,6 +185,10 @@ public class MainCLI extends CLI { option.setArgName("list"); options.addOption(option); + option = new Option(null, "message-format", true, "Message format: xml (default), json"); + option.setArgName("format"); + options.addOption(option); + options.addOption("v", false, "Verbose"); options.addOption(null, "help", false, "Help"); options.addOption(null, "version", false, "Version"); @@ -252,6 +256,10 @@ public class MainCLI extends CLI { } if (verbose) System.out.println("Security database: "+this.certDatabase.getAbsolutePath()); + + String messageFormat = cmd.getOptionValue("message-format"); + config.setMessageFormat(messageFormat); + if (verbose) System.out.println("Message format: " + messageFormat); } public void convertCertStatusList(String list, Collection<Integer> statuses) throws Exception { |