41
|
1 package christie.topology.manager;
|
|
2
|
48
|
3 import christie.daemon.Config;
|
|
4
|
|
5 public class TopologyManagerConfig extends Config {
|
41
|
6 public boolean showTime = false;
|
|
7 public String confFilePath;
|
74
|
8 public boolean dynamic = false;
|
41
|
9 public TopologyType type = TopologyType.Tree;
|
|
10 public int hasChild = 2;
|
|
11
|
|
12 public TopologyManagerConfig(String[] args) {
|
48
|
13 super(args);
|
41
|
14 for (int i = 0; i < args.length; i++) {
|
46
|
15 if ("--confFile".equals(args[i])) {
|
41
|
16 confFilePath = args[++i];
|
46
|
17 } else if ("--topology".equals(args[i])) {
|
41
|
18 String typeName = args[++i];
|
|
19 if ("tree".equals(typeName)) {
|
|
20 type = TopologyType.Tree;
|
|
21 }
|
46
|
22 } else if ("--child".equals(args[i])) {
|
41
|
23 hasChild = Integer.parseInt(args[++i]);
|
|
24 } else if ("--showTime".equals(args[i])) {
|
|
25 showTime = true;
|
|
26 }
|
|
27 }
|
74
|
28
|
|
29 if (confFilePath == null) dynamic = true;
|
41
|
30 }
|
|
31 }
|