LaunchControlProvider
public
class
LaunchControlProvider
extends Object
implements
IBuildProvider,
IConfigurationReceiver,
IDiscoverDependencies,
IInvocationContextReceiver,
ITestLoggerReceiver
| java.lang.Object | |
| ↳ | com.google.android.tradefed.build.LaunchControlProvider |
IBuildProvider 實作,向 Google 啟動控制伺服器查詢要測試的版本。
不建議建立子類別。使用 extra-target-downloads 和 --additional-files-filter 指定要下載的構件。
TODO: refactor out the launch control client and download logic, and merge it with the future "One Common Device Flasher Library To Rule Them All" (tm)
摘要
巢狀類別 | |
|---|---|
class |
LaunchControlProvider.DownloadFileDescriptor
|
常數 | |
|---|---|
String |
BUILD_ID_PARAM
|
String |
BUILD_NAME_PARAM
|
String |
LC_BASE_URL
|
String |
MIN_BUILD_ID_PARAM
|
String |
QUERY_TYPE_PARAM
|
String |
QUERY_WINDOW_PARAM
|
String |
TEST_TAG_PARAM
|
欄位 | |
|---|---|
protected
boolean |
mEnableResolveSymlinks
|
公用建構函式 | |
|---|---|
LaunchControlProvider()
|
|
公用方法 | |
|---|---|
void
|
addFileFilter(String filter)
|
void
|
addOptionalFileFilter(String optionalFilter)
|
void
|
addRemoteZipFilter(String fileFilter)
新增可部分下載的遠端 ZIP 檔案篩選器。 |
void
|
cleanUp(IBuildInfo info)
清理所有暫時建構檔案。 |
void
|
clearExtraDownloads()
|
IFileDownloader
|
createLaunchControlDownloader(RemoteBuildInfo remoteBuild)
建立下載器的工廠方法,用於啟動控制檔案。 |
void
|
decrementTestBuild(String buildId)
|
IBuildInfo
|
fetchRemoteBuild(RemoteBuildInfo remoteBuild)
將啟動控制項回應轉換為本機 |
void
|
forceUseCas(boolean useCas)
|
Collection<String>
|
getAdditionalFilesFilters()
|
String
|
getBranch()
取得目前指定的查詢分支 |
IBuildInfo
|
getBuild()
擷取受測建構版本的資料。 |
String
|
getBuildArchivePath()
取得建構構件封存的路徑 |
String
|
getBuildFlavor()
取得要查詢的建構風味 |
String
|
getBuildId()
取得要查詢的建構 ID |
String
|
getBuildOs()
|
IConfiguration
|
getConfiguration()
傳回使用的已注入 |
Set<String>
|
getContentBasedReportingDefault()
|
IInvocationContext
|
getInvocationContext()
|
String
|
getLcHostname()
取得要在查詢中使用的 Launch Control 主機名稱 |
String
|
getLcProtocol()
取得要在查詢中使用的 Launch Control 通訊協定 |
QueryType
|
getQueryType()
取得要使用的查詢類型 |
RemoteBuildInfo
|
getRemoteBuild()
不必下載所有檔案,即可取得啟動控制項回應。 |
Set<String>
|
getRemoteZipFilters()
取得可部分下載的 ZIP 檔案篩選器組合。 |
boolean
|
getReportContentBasedRollout()
|
boolean
|
getReportContentInformation()
|
String
|
getTestConfigOnlyZip()
取得僅含測試設定的 ZIP 檔案。 |
ITestLogger
|
getTestLogger()
|
String
|
getTestTag()
取得要在查詢中使用的測試標記 |
boolean
|
getUseSsoClient()
Get if sso client should be used |
static
void
|
handleExtraTargetDownloads(IBuildInfo build, List<Entry<String, File>> entries)
Handles files dynamically download to backfill their metadata |
boolean
|
isChunkingUncompressedDisabled()
|
boolean
|
isSecondaryParallelDownload()
是否啟用平行下載。 |
Set<String>
|
reportTestZipFileFilter()
|
void
|
resetTestBuild()
執行 |
void
|
resetTestBuild(String buildId)
執行 |
void
|
setAdditionalFilesFilters(Collection<String> additionalFilesFilters)
|
void
|
setBranch(String branch)
設定要查詢的分支 |
void
|
setBuildArchivePath(String buildArchivePath)
設定建構構件封存的路徑 |
void
|
setBuildFlavor(String flavor)
設定要查詢的建構變種版本 |
void
|
setBuildId(String buildId)
設定要查詢的建構 ID |
void
|
setBuildOs(String os)
|
void
|
setConfiguration(IConfiguration configuration)
注入使用的 |
void
|
setContentBasedReportingDefault(Set<String> contentBasedReportingDefault)
|
void
|
setEnableResolveSymlinks(boolean enableResolveSymlinks)
|
void
|
setFetchSigned(boolean fetchSigned)
|
void
|
setInvocationContext(IInvocationContext invocationContext)
|
void
|
setLcHostname(String lcHostname)
設定要在查詢中使用的 Launch Control 主機名稱 |
void
|
setLcProtocol(String lcProtocol)
設定要在查詢中使用的 Launch Control 通訊協定 |
void
|
setMinBuildId(int minBuildId)
設定要使用的最小建構 ID。 |
void
|
setParallelSecondaryDownload(boolean parallel)
|
void
|
setPartialDownloadForZip(boolean enableZipPartialDownload)
|
void
|
setQueryType(QueryType queryType)
設定要使用的查詢類型 |
void
|
setReportContentBasedRollout(boolean reportContentBasedRollout)
|
void
|
setReportContentInformation(boolean reportContentInfo)
|
void
|
setSkipCloudContent(boolean skipCloudContent)
|
void
|
setTestLogger(ITestLogger testLogger)
注入 |
void
|
setTestTag(String tag)
設定要使用的測試標記。 |
void
|
setUseBuildApi(boolean useBuildApi)
設定值,控管建構供應商是否應使用 Android Build API |
void
|
setUseSsoClient(boolean useSsoClient)
設定是否應使用 SSO 用戶端 |
boolean
|
shouldFetchSigned()
|
boolean
|
shouldReportContentInformation()
|
boolean
|
shouldUseBuildApi()
傳回建構供應商是否應使用 Android Build API |
常數
BUILD_ID_PARAM
protected static final String BUILD_ID_PARAM
常數值: "bid"
BUILD_NAME_PARAM
protected static final String BUILD_NAME_PARAM
常數值: "id"
LC_BASE_URL
protected static final String LC_BASE_URL
常數值: "%s://%s/buildbot-update"
MIN_BUILD_ID_PARAM
protected static final String MIN_BUILD_ID_PARAM
常數值: "min_build_id"
QUERY_TYPE_PARAM
protected static final String QUERY_TYPE_PARAM
常數值: "op"
QUERY_WINDOW_PARAM
protected static final String QUERY_WINDOW_PARAM
常數值: "query_window"
TEST_TAG_PARAM
protected static final String TEST_TAG_PARAM
常數值: "test_tag"
欄位
mEnableResolveSymlinks
protected boolean mEnableResolveSymlinks
公用建構函式
LaunchControlProvider
public LaunchControlProvider ()
公用方法
addFileFilter
public void addFileFilter (String filter)
| 參數 | |
|---|---|
filter |
String |
addOptionalFileFilter
public void addOptionalFileFilter (String optionalFilter)
| 參數 | |
|---|---|
optionalFilter |
String |
addRemoteZipFilter
public void addRemoteZipFilter (String fileFilter)
新增可部分下載的遠端 ZIP 檔案篩選器。
| 參數 | |
|---|---|
fileFilter |
String |
clearExtraDownloads
public void clearExtraDownloads ()
createLaunchControlDownloader
public IFileDownloader createLaunchControlDownloader (RemoteBuildInfo remoteBuild)
建立下載器的工廠方法,用於啟動控制檔案。
| 參數 | |
|---|---|
remoteBuild |
RemoteBuildInfo |
| 傳回 | |
|---|---|
IFileDownloader |
|
decrementTestBuild
public void decrementTestBuild (String buildId)
| 參數 | |
|---|---|
buildId |
String |
fetchRemoteBuild
public IBuildInfo fetchRemoteBuild (RemoteBuildInfo remoteBuild)
將啟動控制回應轉換為本機 IBuildInfo,其中包含所有必要檔案。
設為公開,因此這個套件以外的專業領域可以直接使用。通常應改用 getBuild()。
| 參數 | |
|---|---|
remoteBuild |
RemoteBuildInfo:啟動控制伺服器回應 |
| 傳回 | |
|---|---|
IBuildInfo |
IBuildInfo,其中包含建構檔案的本地化版本 |
| 擲回 | |
|---|---|
BuildRetrievalError |
如果無法下載建構檔案 |
forceUseCas
public void forceUseCas (boolean useCas)
| 參數 | |
|---|---|
useCas |
boolean |
getAdditionalFilesFilters
public Collection<String> getAdditionalFilesFilters ()
| 傳回 | |
|---|---|
Collection<String> |
|
getBranch
public String getBranch ()
取得目前指定的查詢分支
| 傳回 | |
|---|---|
String |
分支 |
getBuild
public IBuildInfo getBuild ()
擷取受測建構版本的資料。
| 傳回 | |
|---|---|
IBuildInfo |
受測建構的 IBuildInfo,或 null (如果沒有可供測試的建構) |
| 擲回 | |
|---|---|
BuildRetrievalError |
|
getBuildArchivePath
public String getBuildArchivePath ()
取得建構構件封存的路徑
| 傳回 | |
|---|---|
String |
|
getBuildFlavor
public String getBuildFlavor ()
取得要查詢的建構版本
| 傳回 | |
|---|---|
String |
|
getBuildId
public String getBuildId ()
取得要查詢的建構 ID
| 傳回 | |
|---|---|
String |
|
getBuildOs
public String getBuildOs ()
| 傳回 | |
|---|---|
String |
|
getConfiguration
public IConfiguration getConfiguration ()
傳回使用的已插入 IConfiguration。
| 傳回 | |
|---|---|
IConfiguration |
|
getContentBasedReportingDefault
public Set<String> getContentBasedReportingDefault ()
| 傳回 | |
|---|---|
Set<String> |
|
getLcHostname
public String getLcHostname ()
取得要在查詢中使用的 Launch Control 主機名稱
| 傳回 | |
|---|---|
String |
|
getLcProtocol
public String getLcProtocol ()
取得要在查詢中使用的 Launch Control 通訊協定
| 傳回 | |
|---|---|
String |
|
getRemoteBuild
public RemoteBuildInfo getRemoteBuild ()
不必下載所有檔案,即可取得啟動控制項回應。
設為公開,因此這個套件以外的專業領域可以直接使用。通常應改用 getBuild()。
| 傳回 | |
|---|---|
RemoteBuildInfo |
發射控制系統的 RemoteBuildInfo 回應 |
| 擲回 | |
|---|---|
BuildRetrievalError |
如果發生未預期的錯誤,導致無法擷取建構資訊 |
getRemoteZipFilters
public Set<String> getRemoteZipFilters ()
取得可部分下載的 ZIP 檔案篩選器組合。
| 傳回 | |
|---|---|
Set<String> |
|
getReportContentBasedRollout
public boolean getReportContentBasedRollout ()
| 傳回 | |
|---|---|
boolean |
|
getReportContentInformation
public boolean getReportContentInformation ()
| 傳回 | |
|---|---|
boolean |
|
getTestConfigOnlyZip
public String getTestConfigOnlyZip ()
取得僅含測試的設定 ZIP 檔。
| 傳回 | |
|---|---|
String |
|
getTestTag
public String getTestTag ()
取得要在查詢中使用的測試標記
| 傳回 | |
|---|---|
String |
|
getUseSsoClient
public boolean getUseSsoClient ()
取得是否應使用 SSO 用戶端
| 傳回 | |
|---|---|
boolean |
|
handleExtraTargetDownloads
public static void handleExtraTargetDownloads (IBuildInfo build, List<Entry<String, File>> entries)
處理動態下載的檔案,以回填中繼資料
| 參數 | |
|---|---|
build |
IBuildInfo |
entries |
List |
| 擲回 | |
|---|---|
BuildRetrievalError |
|
isChunkingUncompressedDisabled
public boolean isChunkingUncompressedDisabled ()
| 傳回 | |
|---|---|
boolean |
|
isSecondaryParallelDownload
public boolean isSecondaryParallelDownload ()
是否啟用平行下載功能。
| 傳回 | |
|---|---|
boolean |
|
reportTestZipFileFilter
public Set<String> reportTestZipFileFilter ()
| 傳回 | |
|---|---|
Set<String> |
|
resetTestBuild
public void resetTestBuild ()
執行 QueryType.RESET_TEST_BUILD 查詢,要求啟動控制項從「已測試的建構版本」集中移除已設定的建構版本。
錯誤處理和重試機制有限。LCProxy 已淘汰,因此不建議使用。
resetTestBuild
public void resetTestBuild (String buildId)
執行 QueryType.RESET_TEST_BUILD 查詢,要求啟動控制項從「已測試的建構」集中移除指定建構。
錯誤處理和重試機制有限。LCProxy 淘汰後,這項功能也將停用。
| 參數 | |
|---|---|
buildId |
String:要重設的建構 ID |
setAdditionalFilesFilters
public void setAdditionalFilesFilters (Collection<String> additionalFilesFilters)
| 參數 | |
|---|---|
additionalFilesFilters |
Collection |
setBranch
public void setBranch (String branch)
設定要查詢的分支版本
setBuildArchivePath
public void setBuildArchivePath (String buildArchivePath)
設定建構作業構件封存的路徑
setBuildFlavor
public void setBuildFlavor (String flavor)
設定要查詢的建構風味
setBuildId
public void setBuildId (String buildId)
設定要查詢的建構 ID
setBuildOs
public void setBuildOs (String os)
| 參數 | |
|---|---|
os |
String |
setConfiguration
public void setConfiguration (IConfiguration configuration)
注入使用的 IConfiguration。
| 參數 | |
|---|---|
configuration |
IConfiguration |
setContentBasedReportingDefault
public void setContentBasedReportingDefault (Set<String> contentBasedReportingDefault)
| 參數 | |
|---|---|
contentBasedReportingDefault |
Set |
setEnableResolveSymlinks
public void setEnableResolveSymlinks (boolean enableResolveSymlinks)
| 參數 | |
|---|---|
enableResolveSymlinks |
boolean |
setFetchSigned
public void setFetchSigned (boolean fetchSigned)
| 參數 | |
|---|---|
fetchSigned |
boolean |
setInvocationContext
public void setInvocationContext (IInvocationContext invocationContext)
| 參數 | |
|---|---|
invocationContext |
IInvocationContext |
setLcHostname
public void setLcHostname (String lcHostname)
設定要在查詢中使用的 Launch Control 主機名稱
| 參數 | |
|---|---|
lcHostname |
String |
setLcProtocol
public void setLcProtocol (String lcProtocol)
設定要在查詢中使用的 Launch Control 通訊協定
setMinBuildId
public void setMinBuildId (int minBuildId)
設定要使用的最低建構 ID。
| 參數 | |
|---|---|
minBuildId |
int |
setParallelSecondaryDownload
public void setParallelSecondaryDownload (boolean parallel)
| 參數 | |
|---|---|
parallel |
boolean |
setPartialDownloadForZip
public void setPartialDownloadForZip (boolean enableZipPartialDownload)
| 參數 | |
|---|---|
enableZipPartialDownload |
boolean |
setReportContentBasedRollout
public void setReportContentBasedRollout (boolean reportContentBasedRollout)
| 參數 | |
|---|---|
reportContentBasedRollout |
boolean |
setReportContentInformation
public void setReportContentInformation (boolean reportContentInfo)
| 參數 | |
|---|---|
reportContentInfo |
boolean |
setSkipCloudContent
public void setSkipCloudContent (boolean skipCloudContent)
| 參數 | |
|---|---|
skipCloudContent |
boolean |
setTestLogger
public void setTestLogger (ITestLogger testLogger)
注入 ITestLogger 例項
| 參數 | |
|---|---|
testLogger |
ITestLogger |
setTestTag
public void setTestTag (String tag)
設定要使用的測試標記。
| 參數 | |
|---|---|
tag |
String |
setUseBuildApi
public void setUseBuildApi (boolean useBuildApi)
設定值,控管建構供應商是否應使用 Android Build API
| 參數 | |
|---|---|
useBuildApi |
boolean |
setUseSsoClient
public void setUseSsoClient (boolean useSsoClient)
設定是否應使用單一登入用戶端
| 參數 | |
|---|---|
useSsoClient |
boolean |
shouldFetchSigned
public boolean shouldFetchSigned ()
| 傳回 | |
|---|---|
boolean |
|
shouldReportContentInformation
public boolean shouldReportContentInformation ()
| 傳回 | |
|---|---|
boolean |
|
shouldUseBuildApi
public boolean shouldUseBuildApi ()
傳回建構供應商是否應使用 Android Build API
| 傳回 | |
|---|---|
boolean |
|
受保護的方法
convertBuildToSigned
protected void convertBuildToSigned (RemoteBuildInfo remoteBuild)
修改這個 RemoteBuildInfo 中的參數,說明已簽署的建構版本。
| 參數 | |
|---|---|
remoteBuild |
RemoteBuildInfo:要修改的 RemoteBuildInfo |
| 擲回 | |
|---|---|
|
com.android.tradefed.build.BuildRetrievalError |
BuildRetrievalError |
|
createHttpHelper
protected IHttpHelper createHttpHelper ()
建立 HttpHelper 的工廠方法。
公開此屬性,以便模擬單元測試。
| 傳回 | |
|---|---|
IHttpHelper |
|
createSignedParameter
protected String createSignedParameter (String param)
修改單一參數,以代表已簽署的參數。如果參數已採用簽署格式,系統會原封不動地傳回。
| 參數 | |
|---|---|
param |
String:初始參數 (可為未簽署或已簽署) |
| 傳回 | |
|---|---|
String |
簽署的參數 |
| 擲回 | |
|---|---|
BuildRetrievalError |
如果參數格式錯誤,無法處理 |
deleteCacheEntry
protected void deleteCacheEntry (String remoteFilePath)
從快取中移除檔案,以免檔案損毀。
| 參數 | |
|---|---|
remoteFilePath |
String:與 IFileDownloader.downloadFile(String) 中指定的遠端檔案相同。 |
downloadAdditionalFiles
protected void downloadAdditionalFiles (RemoteBuildInfo remoteBuild, IFileDownloader downloader, IBuildInfo localBuild)
| 參數 | |
|---|---|
remoteBuild |
RemoteBuildInfo |
downloader |
IFileDownloader |
localBuild |
IBuildInfo |
| 擲回 | |
|---|---|
BuildRetrievalError |
|
downloadBuildFiles
protected IBuildInfo downloadBuildFiles (RemoteBuildInfo remoteBuild, String testTargetName, String buildName, IFileDownloader downloader)
從 remoteBuild 下載 --download-build-key 中設定的必要檔案金鑰,並儲存在 IBuildInfo 中。
| 參數 | |
|---|---|
remoteBuild |
RemoteBuildInfo:啟動控制伺服器回應 |
testTargetName |
String:測試目標名稱 |
buildName |
String:啟動控制項定義的建構版本名稱 |
downloader |
IFileDownloader:用於下載建構檔案的 IFileDownloader |
| 傳回 | |
|---|---|
IBuildInfo |
IBuildInfo,其中包含建構檔案的本地化版本 |
| 擲回 | |
|---|---|
BuildRetrievalError |
如果無法下載建構檔案 |
downloadFilesNonBlocking
protected final List<Entry<LaunchControlProvider.DownloadFileDescriptor, File>> downloadFilesNonBlocking (IFileDownloader downloader, List<LaunchControlProvider.DownloadFileDescriptor> toBeDownloaded)
下載檔案路徑集,並強制執行必要路徑。
| 參數 | |
|---|---|
downloader |
IFileDownloader |
toBeDownloaded |
List |
| 傳回 | |
|---|---|
List<Entry<LaunchControlProvider.DownloadFileDescriptor, File>> |
|
| 擲回 | |
|---|---|
BuildRetrievalError |
|
getBuildArtifactHelper
protected AndroidBuildArtifactHelper getBuildArtifactHelper ()
| 傳回 | |
|---|---|
AndroidBuildArtifactHelper |
|
| 擲回 | |
|---|---|
BuildRetrievalError |
|
getExtraDownloadMap
protected MultiMap<String, File> getExtraDownloadMap ()
傳回額外下載目標的地圖。
| 傳回 | |
|---|---|
MultiMap<String, File> |
|
getGlobalDownloadExclusionPatterns
protected Set<String> getGlobalDownloadExclusionPatterns ()
| 傳回 | |
|---|---|
Set<String> |
|
getWorkFolder
protected final File getWorkFolder ()
傳回目前的叫用工作資料夾。
| 傳回 | |
|---|---|
File |
|
handleDirectoryDownload
protected final File handleDirectoryDownload (File downloadedFile)
| 參數 | |
|---|---|
downloadedFile |
File |
| 傳回 | |
|---|---|
File |
|
performBuildApiQuery
protected RemoteBuildInfo performBuildApiQuery ()
| 傳回 | |
|---|---|
RemoteBuildInfo |
|
| 擲回 | |
|---|---|
BuildRetrievalError |
|
performValidityCheckForBuildApi
protected void performValidityCheckForBuildApi ()
queryForBuild
protected RemoteBuildInfo queryForBuild (MultiMap<String, String> params)
執行啟動控制項查詢,如果發生錯誤,請多次重試。
| 參數 | |
|---|---|
params |
MultiMap:啟動控制項的參數 |
| 傳回 | |
|---|---|
RemoteBuildInfo |
從啟動控制項擷取的 RemoteBuildInfo |
| 擲回 | |
|---|---|
BuildRetrievalError |
|
queryForBuild
protected RemoteBuildInfo queryForBuild ()
執行啟動控制項查詢,如果發生錯誤,請多次重試。
| 傳回 | |
|---|---|
RemoteBuildInfo |
從啟動控制項擷取的 RemoteBuildInfo |
| 擲回 | |
|---|---|
BuildRetrievalError |
|
queryForBuildWithBuildApi
protected RemoteBuildInfo queryForBuildWithBuildApi ()
對建構 API 執行建構查詢。
注意:輸入參數是由各種類別範圍變數隱含
| 傳回 | |
|---|---|
RemoteBuildInfo |
從回應剖析出的 RemoteBuildInfo。 |
| 擲回 | |
|---|---|
|
com.android.tradefed.build.BuildRetrievalError |
BuildRetrievalError |
|
replaceParamWithSigned
protected void replaceParamWithSigned (RemoteBuildInfo buildInfo, RemoteBuildInfo.BuildAttributeKey key)
| 參數 | |
|---|---|
buildInfo |
RemoteBuildInfo |
key |
RemoteBuildInfo.BuildAttributeKey |
| 擲回 | |
|---|---|
BuildRetrievalError |
|
useCasDefaultRollout
protected boolean useCasDefaultRollout ()
| 傳回 | |
|---|---|
boolean |
|