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;