ClusterCommand

public class ClusterCommand
extends Object

java.lang.Object
   ↳ com.android.tradefed.cluster.ClusterCommand


A class that represents a task fetched from TF Cluster.

Summary

Public constructors

ClusterCommand(String commandId, String taskId, String cmdLine)
ClusterCommand(String requestId, String commandId, String taskId, String cmdLine, String attemptId, ClusterCommand.RequestType requestType, Integer shardCount, Integer shardIndex)

Constructor.

Public methods

static ClusterCommand fromJson(JSONObject json)
String getAttemptId()

Returns the attempt ID.

String getCommandId()

Returns the command ID.

String getCommandLine()

Returns the command line string.

UniqueMultiMap<String, String> getExtraOptions()
String getRequestId()

Returns the request ID.

ClusterCommand.RequestType getRequestType()

Returns a request type

Integer getShardCount()

Returns a shard count.

Integer getShardIndex()

Returns a shard index.

getTargetDeviceSerials()

Returns the list of target device serials on which this command will attempt to run.

String getTaskId()

Returns the task ID.

void setTargetDeviceSerials( targetDeviceSerials)

Sets the list of target device serials on which the command will try to run.

Public constructors

ClusterCommand

public ClusterCommand (String commandId, 
                String taskId, 
                String cmdLine)

Parameters
commandId String

taskId String

cmdLine String

ClusterCommand

public ClusterCommand (String requestId, 
                String commandId, 
                String taskId, 
                String cmdLine, 
                String attemptId, 
                ClusterCommand.RequestType requestType, 
                Integer shardCount, 
                Integer shardIndex)

Constructor.

Parameters
requestId String: A request ID

commandId String: The ID of the command that issued this task

taskId String: The ID of this task

cmdLine String: The command line to run

attemptId String

requestType ClusterCommand.RequestType: A request type

shardCount Integer: A shard count

shardIndex Integer: A shard index

Public methods

fromJson

public static ClusterCommand fromJson (JSONObject json)

Parameters
json JSONObject

Returns
ClusterCommand

Throws
JSONException

getAttemptId

public String getAttemptId ()

Returns the attempt ID. The attempt is randomly generated GUID used to distinguish multiple command runs.

Returns
String the attempt ID

getCommandId

public String getCommandId ()

Returns the command ID.

Returns
String the command ID

getCommandLine

public String getCommandLine ()

Returns the command line string.

Returns
String the command line string.

getExtraOptions

public UniqueMultiMap<String, String> getExtraOptions ()

Returns
UniqueMultiMap<String, String> multimap of additional options to inject

getRequestId

public String getRequestId ()

Returns the request ID.

Returns
String the request ID

getRequestType

public ClusterCommand.RequestType getRequestType ()

Returns a request type

Returns
ClusterCommand.RequestType a request type

getShardCount

public Integer getShardCount ()

Returns a shard count.

Returns
Integer a shard count.

getShardIndex

public Integer getShardIndex ()

Returns a shard index.

Returns
Integer a shard index.

getTargetDeviceSerials

public  getTargetDeviceSerials ()

Returns the list of target device serials on which this command will attempt to run.

Returns
the list of target device serials

getTaskId

public String getTaskId ()

Returns the task ID.

Returns
String task ID.

setTargetDeviceSerials

public void setTargetDeviceSerials ( targetDeviceSerials)

Sets the list of target device serials on which the command will try to run.

Parameters
targetDeviceSerials : the list of device serials to set