集群客戶端
public interface IClusterClient
com.android.tradefed.cluster.IClusterClient |
與 TFC 後端交互的接口。
概括
公共方法 |
---|
abstract IClusterEventUploader < ClusterCommandEvent > | getCommandEventUploader () 獲取可用於上傳ClusterCommandEvent IClusterEventUploader 。 |
abstract ClusterCommand.State | getCommandState (String requestId, String commandId) 確定集群命令的狀態。 |
default ClusterCommandStatus | getCommandStatus (String requestId, String commandId) 獲取集群命令的命令狀態(取消時的狀態和取消原因)。 |
abstract IClusterEventUploader < ClusterHostEvent > | getHostEventUploader () 獲取可用於上傳ClusterHostEvent IClusterEventUploader 。 |
abstract TestContext | getTestContext (String requestId, String commandId) |
abstract TestEnvironment | getTestEnvironment (String requestId) 獲取請求的TestEnvironment 。 |
abstract | getTestResources (String requestId) 獲取請求的TestResource 。 |
abstract | leaseHostCommands (String clusterId, String hostname, devices, nextClusterIds, int maxTasksTolease) leaseHostCommands (String clusterId, String hostname, devices, nextClusterIds, int maxTasksTolease) leaseHostCommands (String clusterId, String hostname, devices, nextClusterIds, int maxTasksTolease) 為給定主機租用ClusterCommand 。 |
abstract void | updateTestContext (String requestId, String commandId, TestContext testContext) |
常量
TYPE_NAME
public static final String TYPE_NAME
唯一的配置對像類型名稱。用於從GlobalConfiguration
檢索單例實例。
常數值:“cluster_client”
公共方法
獲取命令狀態
public abstract ClusterCommand.State getCommandState (String requestId,
String commandId)
確定集群命令的狀態。
參數 |
---|
requestId | String : 集群請求ID |
commandId | String : 集群命令 ID |
獲取命令狀態
public ClusterCommandStatus getCommandStatus (String requestId,
String commandId)
獲取集群命令的命令狀態(取消時的狀態和取消原因)。
參數 |
---|
requestId | String : 集群請求ID |
commandId | String : 集群命令 ID |
獲取測試環境
public abstract TestContext getTestContext (String requestId,
String commandId)
參數 |
---|
requestId | String |
commandId | String |
獲取測試資源
public abstract getTestResources (String requestId)
獲取請求的TestResource
。
投擲 |
---|
| 異常 |
| org.json.JSONException異常 |
JSONException | |
租賃主機命令
public abstract leaseHostCommands (String clusterId,
String hostname,
devices,
nextClusterIds,
int maxTasksTolease)
為給定主機租用ClusterCommand
。
參數 |
---|
clusterId | String :主機的集群 ID |
hostname | String :主機名 |
devices | : 主機擁有的設備信息 |
nextClusterIds | :要從中租用命令的下一個集群 ID 的列表。 |
maxTasksTolease | int : 當前可以租用的最大任務數 |
投擲 |
---|
| org.json.JSONException異常 |
JSONException | |
更新測試環境
public abstract void updateTestContext (String requestId,
String commandId,
TestContext testContext)
參數 |
---|
requestId | String |
commandId | String |
testContext | TestContext |