GCSConfigurationServer

public class GCSConfigurationServer
extends Object implements IConfigurationServer

java.lang.Object
   ↳ com.android.tradefed.config.gcs.GCSConfigurationServer


配置服务器从 Google Cloud Storage (GCS) 加载配置。

摘要

公共构造函数

GCSConfigurationServer()

公共方法

InputStream getConfig(String name)

按名称获取配置内容。

String getCurrentHostConfig()

获取当前 Tradefed 会话的当前主机的配置文件名称。

受保护的方法

File downloadFile(String name)
String getHostConfig(String hostname, String cluster)

获取主机的 tradefed 全局配置。

boolean sameHost(String currentHostname, String hostname)

检查两个主机名是否指向同一主机。

公共构造函数

GCSConfigurationServer

public GCSConfigurationServer ()

公共方法

getConfig

public InputStream getConfig (String name)

按名称获取配置内容。

参数
name String:配置的名称

返回
InputStream ERROR(/InputStream) 是配置文件内容。

抛出
ConfigurationException

getCurrentHostConfig

public String getCurrentHostConfig ()

获取当前 Tradefed 会话的当前主机的配置文件名称。使用 IConfigurationServer 启动的 Tradefed 会从服务器获取主机配置,而不是从本地文件读取主机配置文件。

返回
String 主机配置文件名称。

抛出
ConfigurationException

受保护的方法

downloadFile

protected File downloadFile (String name)

参数
name String

返回
File

抛出
ConfigurationException

getHostConfig

protected String getHostConfig (String hostname, 
                String cluster)

获取主机的 Tradefed 全局配置。如果提供了集群名称,请使用集群名称;否则,请使用主机名。

参数
hostname String:主机名

cluster String:集群名称。

返回
String 相对于 GCS 存储分区的路径。

抛出
com.android.tradefed.config.ConfigurationException
ConfigurationException

sameHost

protected boolean sameHost (String currentHostname, 
                String hostname)

检查两个主机名是否指向同一主机。在配置文件中,我们有时会使用主机的短名称。

参数
currentHostname String:当前主机的名称

hostname String:配置中的主机名。

返回
boolean 如果是同一主机,则为 true,否则为 false;