From 92373fcdf556d9e181369e884aac6c58242b34b6 Mon Sep 17 00:00:00 2001 From: Al Niessner Date: Thu, 20 Feb 2025 13:57:45 -0800 Subject: [PATCH] hard ^Cded over what user said they want as instructed by management --- .../java/gov/nasa/pds/validate/ri/AuthInformation.java | 8 ++++++-- .../gov/nasa/pds/validate/ri/CommandLineInterface.java | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/gov/nasa/pds/validate/ri/AuthInformation.java b/src/main/java/gov/nasa/pds/validate/ri/AuthInformation.java index af73c1916..914925514 100644 --- a/src/main/java/gov/nasa/pds/validate/ri/AuthInformation.java +++ b/src/main/java/gov/nasa/pds/validate/ri/AuthInformation.java @@ -8,18 +8,21 @@ public class AuthInformation { final private String apiAuthFile; final private String osAuthFile; + final private String overrideIndex; final private String regConn; private transient ConnectionFactory factory = null; - private AuthInformation(String a, String A, String r) { + private AuthInformation(String a, String A, String r, String o) { this.apiAuthFile = A; this.osAuthFile = a; this.regConn = r; + this.overrideIndex = o; } public static AuthInformation buildFrom(CommandLine cl) { return new AuthInformation( cl.getOptionValue("a",""), cl.getOptionValue("A",""), - cl.getOptionValue("r","")); + cl.getOptionValue("r",""), + cl.getOptionValue("o", "registry")); } public synchronized ConnectionFactory getConnectionFactory() throws Exception { if (this.factory == null) { @@ -32,6 +35,7 @@ public synchronized ConnectionFactory getConnectionFactory() throws Exception { if (this.factory == null) { throw new IllegalArgumentException("did not supply necessary arguments on the CLI"); } + if (!this.overrideIndex.isBlank()) this.factory.setIndexName(this.overrideIndex); } return this.factory; } diff --git a/src/main/java/gov/nasa/pds/validate/ri/CommandLineInterface.java b/src/main/java/gov/nasa/pds/validate/ri/CommandLineInterface.java index 32060ba28..34baca400 100644 --- a/src/main/java/gov/nasa/pds/validate/ri/CommandLineInterface.java +++ b/src/main/java/gov/nasa/pds/validate/ri/CommandLineInterface.java @@ -36,6 +36,8 @@ public CommandLineInterface() { .hasArg(true).longOpt("auth-opensearch").numberOfArgs(1).optionalArg(true).build()); this.opts.addOption(Option.builder("h").desc("show this text and exit").hasArg(false) .longOpt("help").optionalArg(true).build()); + this.opts.addOption(Option.builder("o").desc("override the index in the connection file with this value (set to '' for no override) [registry]") + .hasArg(true).longOpt("override-index-name").optionalArg(true).build()); this.opts.addOption(Option.builder("r").argName("registry-connection").desc( "URL point to the registry connection information usually of the form app://connection/direct/localhost.xml") .hasArg(true).longOpt("registry-connection").numberOfArgs(1).optionalArg(true).build());