GCS配置服务器

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)

检查两个主机名是否属于同一主机。

公共构造函数

GCS配置服务器

public GCSConfigurationServer ()

公共方法

获取配置

public InputStream getConfig (String name)

通过名称获取配置内容。

参数
name String : 配置的名称

退货
InputStream ERROR(/InputStream)是配置文件内容。

投掷
ConfigurationException

获取当前主机配置

public String getCurrentHostConfig ()

获取当前 Tradefed 会话的当前主机的配置文件名。 Tradefed 从IConfigurationServer开始将从服务器获取主机配置,而不是从本地文件读取主机配置文件。

退货
String主机配置文件名。

投掷
ConfigurationException

受保护的方法

下载文件

protected File downloadFile (String name)

参数
name String

退货
File

投掷
ConfigurationException

获取主机配置

protected String getHostConfig (String hostname, 
                String cluster)

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

参数
hostname String :主机名

cluster String :集群名称。

退货
String相对于 gcs 存储桶的路径。

投掷
com.android.tradefed.config.ConfigurationException
ConfigurationException

相同主机

protected boolean sameHost (String currentHostname, 
                String hostname)

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

参数
currentHostname String : 当前主机名

hostname String : config 中的主机名。

退货
boolean如果它们是同一主机则为 true,否则为 false;