集群客户端
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 |