1515// specific language governing permissions and limitations
1616// under the License.
1717
18- package org .openqa .selenium .grid .node .httpd ;
18+ package org .openqa .selenium .grid .node .config ;
1919
2020import static org .openqa .selenium .grid .config .StandardGridRoles .NODE_ROLE ;
21+ import static org .openqa .selenium .grid .node .config .NodeOptions .DEFAULT_DETECT_DRIVERS ;
22+ import static org .openqa .selenium .grid .node .config .NodeOptions .DEFAULT_HEARTBEAT_PERIOD ;
23+ import static org .openqa .selenium .grid .node .config .NodeOptions .DEFAULT_MAX_SESSIONS ;
24+ import static org .openqa .selenium .grid .node .config .NodeOptions .DEFAULT_REGISTER_CYCLE ;
25+ import static org .openqa .selenium .grid .node .config .NodeOptions .DEFAULT_REGISTER_PERIOD ;
26+ import static org .openqa .selenium .grid .node .config .NodeOptions .NODE_SECTION ;
2127
2228import com .google .auto .service .AutoService ;
2329
2834import org .openqa .selenium .grid .config .NonSplittingSplitter ;
2935import org .openqa .selenium .grid .config .Role ;
3036
31- import java .net .URL ;
3237import java .util .Collections ;
3338import java .util .HashSet ;
3439import java .util .List ;
3944public class NodeFlags implements HasRoles {
4045
4146 @ Parameter (
42- names = "--max-sessions" ,
47+ names = "--max-sessions. Default value is the number of available processors. " ,
4348 description = "Maximum number of concurrent sessions." )
44- @ ConfigValue (section = "node" , name = "max-concurrent -sessions" , example = "8" )
45- public int maxSessions ;
49+ @ ConfigValue (section = NODE_SECTION , name = "max-sessions" , example = "8" )
50+ public int maxSessions = DEFAULT_MAX_SESSIONS ;
4651
4752 @ Parameter (
4853 names = {"--detect-drivers" }, arity = 1 ,
4954 description = "Autodetect which drivers are available on the current system, " +
50- "and add them to the Node. Defaults to true. " )
51- @ ConfigValue (section = "node" , name = "detect-drivers" , example = "true" )
52- public Boolean autoconfigure ;
55+ "and add them to the Node." )
56+ @ ConfigValue (section = NODE_SECTION , name = "detect-drivers" , example = "true" )
57+ public Boolean autoconfigure = DEFAULT_DETECT_DRIVERS ;
5358
5459 @ Parameter (
5560 names = {"-I" , "--driver-implementation" },
5661 description = "Drivers that should be checked. If specified, will skip autoconfiguration. " +
5762 "Example: -I \" firefox\" -I \" chrome\" " )
58- @ ConfigValue (section = "node" , name = "drivers" , example = "[\" firefox\" , \" chrome\" ]" )
63+ @ ConfigValue (
64+ section = NODE_SECTION ,
65+ name = "driver-implementation" ,
66+ example = "[\" firefox\" , \" chrome\" ]" )
5967 public Set <String > driverNames = new HashSet <>();
6068
6169 @ Parameter (
@@ -68,23 +76,23 @@ public class NodeFlags implements HasRoles {
6876 variableArity = true ,
6977 splitter = NonSplittingSplitter .class )
7078 @ ConfigValue (
71- section = "node" ,
79+ section = NODE_SECTION ,
7280 name = "driver-factories" ,
7381 example = "[\" org.openqa.selenium.example.LynxDriverFactory '{\" browserName\" : \" lynx\" }']" )
7482 public List <String > driverFactory2Config ;
7583
7684 @ Parameter (
77- names = {"--public -url" },
85+ names = {"--grid -url" },
7886 description = "Public URL of the Grid as a whole (typically the address of the Hub " +
7987 "or the Router)" )
80- @ ConfigValue (section = "node" , name = "grid-url" , example = "\" https://grid.example.com\" " )
81- public URL gridUri ;
88+ @ ConfigValue (section = NODE_SECTION , name = "grid-url" , example = "\" https://grid.example.com\" " )
89+ public String gridUri ;
8290
8391 @ Parameter (
8492 names = {"--driver-configuration" },
8593 description = "List of configured drivers a Node supports. " +
8694 "It is recommended to provide this type of configuration through a toml config " +
87- "file to improve readability." +
95+ "file to improve readability. Command line example: " +
8896 "--drivers-configuration name=\" Firefox Nightly\" max-sessions=2 " +
8997 "stereotype='{\" browserName\" : \" firefox\" , \" browserVersion\" : \" 86\" , " +
9098 "\" moz:firefoxOptions\" : " +
@@ -93,7 +101,7 @@ public class NodeFlags implements HasRoles {
93101 variableArity = true ,
94102 splitter = NonSplittingSplitter .class )
95103 @ ConfigValue (
96- section = "node" ,
104+ section = NODE_SECTION ,
97105 name = "driver-configuration" ,
98106 prefixed = true ,
99107 example = "\n " +
@@ -106,24 +114,25 @@ public class NodeFlags implements HasRoles {
106114
107115 @ Parameter (
108116 names = "--register-cycle" ,
109- description = "How often, in seconds, the Node will try to register itself for the first time to the Distributor." )
110- @ ConfigValue (section = "node" , name = "register-cycle" , example = "10" )
111- public int registerCycle ;
117+ description = "How often, in seconds, the Node will try to register itself for "
118+ + "the first time to the Distributor." )
119+ @ ConfigValue (section = NODE_SECTION , name = "register-cycle" , example = "10" )
120+ public int registerCycle = DEFAULT_REGISTER_CYCLE ;
112121
113122 @ Parameter (
114123 names = "--register-period" ,
115124 description = "How long, in seconds, will the Node try to register to the Distributor for " +
116125 "the first time. After this period is completed, the Node will not attempt " +
117126 "to register again." )
118- @ ConfigValue (section = "node" , name = "register-period" , example = "120" )
119- public int registerPeriod ;
127+ @ ConfigValue (section = NODE_SECTION , name = "register-period" , example = "120" )
128+ public int registerPeriod = DEFAULT_REGISTER_PERIOD ;
120129
121130 @ Parameter (
122131 names = "--heartbeat-period" ,
123132 description = "How often, in seconds, will the Node send heartbeat events to the Distributor " +
124133 "to inform it that the Node is up." )
125- @ ConfigValue (section = "node" , name = "heartbeat-period" , example = "10" )
126- public int heartbeatPeriod ;
134+ @ ConfigValue (section = NODE_SECTION , name = "heartbeat-period" , example = "10" )
135+ public int heartbeatPeriod = DEFAULT_HEARTBEAT_PERIOD ;
127136
128137 @ Override
129138 public Set <Role > getRoles () {
0 commit comments