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 工作階段。與從本機檔案讀取主機設定檔不同,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 值區的路徑。

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

sameHost

protected boolean sameHost (String currentHostname, 
                String hostname)

檢查兩個主機名稱是否屬於同一個主機。在設定檔中,我們有時會使用主機的簡寫名稱。

參數
currentHostname String:目前主辦人的名稱

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

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