1 package org.openkilda.wfm;
3 import org.kohsuke.args4j.Argument;
4 import org.kohsuke.args4j.CmdLineException;
5 import org.kohsuke.args4j.CmdLineParser;
6 import org.kohsuke.args4j.Option;
11 import java.io.FileInputStream;
12 import java.io.IOException;
13 import java.util.Properties;
16 @Option(
name =
"--local", usage =
"Do not push topology onto storm server, execute it local.")
17 private Boolean isLocal =
false;
19 @Option(
name=
"--name", usage=
"Set topology name.")
22 @Option(
name="--local-execution-time", usage="Work time limit, when started in \"local\" execution mode.")
25 @Argument(metaVar="CONFIG", multiValued=true, usage="Extra configuration file(s) (can accept multiple paths).")
26 private File extraConfiguration[] = {};
31 CmdLineParser
parser =
new CmdLineParser(
this);
55 private String fixTopologyName() {
60 if (
value.isEmpty()) {
66 private void loadExtraConfig() throws ConfigurationException {
69 properties.load(this.getClass().getResourceAsStream(Topology.TOPOLOGY_PROPERTIES));
70 }
catch (IOException e) {
71 throw new ConfigurationException(
"Unable to load default properties.", e);
74 for (File
path : extraConfiguration) {
75 Properties
override =
new Properties(
properties);
77 FileInputStream
source =
new FileInputStream(
path);
79 }
catch (IOException e) {
80 throw new ConfigurationException(String.format(
"Unable to load properties from %s",
path), e);
Integer getLocalExecutionTime()
CliArguments(String[] args)
Properties getProperties()
Integer localExecutionTime