Skip to content

Commit

Permalink
hard ^Cded over what user said they want as instructed by management
Browse files Browse the repository at this point in the history
  • Loading branch information
Al Niessner authored and Al Niessner committed Feb 20, 2025
1 parent bf1ec53 commit 92373fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/gov/nasa/pds/validate/ri/AuthInformation.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 92373fc

Please sign in to comment.