1// Licensed to the Software Freedom Conservancy (SFC) under one2// or more contributor license agreements. See the NOTICE file3// distributed with this work for additional information4// regarding copyright ownership. The SFC licenses this file5// to you under the Apache License, Version 2.0 (the6// "License"); you may not use this file except in compliance7// with the License. You may obtain a copy of the License at8//9// http://www.apache.org/licenses/LICENSE-2.010//11// Unless required by applicable law or agreed to in writing,12// software distributed under the License is distributed on an13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY14// KIND, either express or implied. See the License for the15// specific language governing permissions and limitations16// under the License.17package org.openqa.selenium.grid.docker;18import com.beust.jcommander.Parameter;19import com.google.auto.service.AutoService;20import org.openqa.selenium.grid.config.ConfigValue;21import org.openqa.selenium.grid.config.HasRoles;22import org.openqa.selenium.grid.config.Role;23import java.net.URL;24import java.util.Collections;25import java.util.List;26import java.util.Set;27import static org.openqa.selenium.grid.config.StandardGridRoles.NODE_ROLE;28@AutoService(HasRoles.class)29public class DockerFlags implements HasRoles {30 @Parameter(31 names = {"--docker-url"},32 description = "URL for connecting to the docker daemon"33 )34 @ConfigValue(section = "docker", name = "url", example = "\"unix:/var/run/docker\"")35 private URL dockerUrl;36 @Parameter(37 names = {"--docker", "-D"},38 description = "Docker configs which map image name to stereotype capabilities (example " +39 "`-D selenium/standalone-firefox:latest '{\"browserName\": \"firefox\"}')",40 arity = 2,41 variableArity = true)42 @ConfigValue(43 section = "docker",44 name = "configs",45 example = "[\"selenium/standalone-firefox:latest\", \"{\\\"browserName\\\": \\\"firefox\\\"}\"]")46 private List<String> images2Capabilities;47 @Override48 public Set<Role> getRoles() {49 return Collections.singleton(NODE_ROLE);50 }51}...