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 InputStream 是設定檔內容。

擲回
ConfigurationException

getCurrentHostConfig

public String getCurrentHostConfig ()

取得目前 Tradefed 工作階段的主機設定檔名稱。Tradefed 會從伺服器取得主機設定,而不是從本機檔案讀取主機設定檔。IConfigurationServer

傳回
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 bucket 的路徑。

擲回
com.android.tradefed.config.ConfigurationException
ConfigurationException

sameHost

protected boolean sameHost (String currentHostname, 
                String hostname)

檢查兩個主機名稱是否對應至同一部主機。在設定檔中,我們有時會使用主機的簡短名稱。

參數
currentHostname String:目前主機的名稱

hostname String:設定中的主機名稱。

傳回
boolean 如果兩者是相同主機,則為 true,否則為 false;