public C process() { additionalOptions(options); try { CommandLine cli = new PosixParser().parse(options, args); process(cli); return builder.build(); } catch (ParseException e) { throw new IllegalArgumentException("invalid command line parameters; " + e); } } }
helpOption = cli.hasOption('h'); if (!helpOption) { builder.withVipAddress(cli.getOptionValue("n")); builder.withDataCenterType(DataCenterType.valueOf(cli.getOptionValue("d", "Basic"))); builder.withResolverType(resolverType); switch (resolverType) { case "dns": builder.withShutDownPort(Integer.parseInt(cli.getOptionValue("s", "7700"))); if (!cli.hasOption("n")) { throw new IllegalArgumentException("missing required server name option ('-n <server_name>')"); builder.withAppName(cli.getOptionValue("n")); builder.withWebAdminPort(Integer.parseInt(cli.getOptionValue("a", "8077"))); builder.withServerList((((List<String>) cli.getArgList()).toArray(new String[cli.getArgList().size()])));
helpOption = cli.hasOption('h'); if (!helpOption) { builder.withVipAddress(cli.getOptionValue("n")); builder.withDataCenterType(DataCenterType.valueOf(cli.getOptionValue("d", "Basic"))); builder.withResolverType(resolverType); switch (resolverType) { case "dns": builder.withShutDownPort(Integer.parseInt(cli.getOptionValue("s", "7700"))); if (!cli.hasOption("n")) { throw new IllegalArgumentException("missing required server name option ('-n <server_name>')"); builder.withAppName(cli.getOptionValue("n")); builder.withHttpPort(Integer.parseInt(cli.getOptionValue("b", "8080"))); builder.withWebAdminPort(Integer.parseInt(cli.getOptionValue("a", "8077"))); builder.withServerList((((List<String>) cli.getArgList()).toArray(new String[cli.getArgList().size()])));
public B withShutDownPort(int shutDownPort) { this.shutDownPort = shutDownPort; return self(); }
public B withDataCenterType(LocalDataCenterInfo.DataCenterType dataCenterType) { this.dataCenterType = dataCenterType; return self(); }
public B withResolverType(ResolverType resolverType) { this.resolverType = resolverType; return self(); }
public B withConnectionAutoTimeoutMs(long connectionAutoTimeoutMs) { this.connectionAutoTimeoutMs = connectionAutoTimeoutMs; return self(); }
public B withHeartbeatIntervalMs(long heartbeatIntervalMs) { this.heartbeatIntervalMs = heartbeatIntervalMs; return self(); }
public B withReadClusterVipAddress(String readClusterVipAddress) { this.readClusterVipAddress = readClusterVipAddress; return self(); }
public B withAppName(String appName) { this.appName = appName; return self(); }
public B withResolverType(ResolverType resolverType) { this.resolverType = resolverType; return self(); }
public B withVipAddress(String vipAddress) { this.vipAddress = vipAddress; return self(); }
public B withResolverType(String resolverTypeStr) { this.resolverType = ResolverType.valueOf(resolverTypeStr); return self(); }
public B withEvictionStrategyType(EvictionStrategyProvider.StrategyType strategyType) { this.evictionStrategyType = strategyType; return self(); }
public B withCodec(CodecType codec) { this.codec = codec; return self(); }
public B withHttpPort(int httpPort) { this.httpPort = httpPort; return self(); }
public B withDataCenterResolveIntervalSec(int dataCenterResolveIntervalSec) { this.dataCenterResolveIntervalSec = dataCenterResolveIntervalSec; return self(); }
public B withResolverType(String resolverTypeStr) { this.resolverType = ResolverType.valueOfIgnoreCase(resolverTypeStr); return self(); }
public C process() { additionalOptions(options); try { CommandLine cli = new PosixParser().parse(options, args); process(cli); return builder.build(); } catch (ParseException e) { throw new IllegalArgumentException("invalid command line parameters; " + e); } } }
public B withEvictionStrategyValue(String strategyValue) { this.evictionStrategyValue = strategyValue; return self(); }