ClusterClient

public class ClusterClient
extends Object implements IClusterClient

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


Es una implementación de IClusterClient para interactuar con el backend de TFC.

Resumen

Constructores públicos

ClusterClient()

Métodos públicos

IClusterEventUploader<ClusterCommandEvent> getCommandEventUploader()

Obtén un objeto IClusterEventUploader que se pueda usar para subir objetos ClusterCommandEvent.

ClusterCommand.State getCommandState(String requestId, String commandId)

Determina el estado de un comando de clúster.

ClusterCommandStatus getCommandStatus(String requestId, String commandId)

Obtiene el estado de un comando de clúster (el estado y el motivo de cancelación si se canceló).

IClusterEventUploader<ClusterHostEvent> getHostEventUploader()

Obtén un objeto IClusterEventUploader que se pueda usar para subir objetos ClusterHostEvent.

TestContext getTestContext(String requestId, String commandId)

TestEnvironment getTestEnvironment(String requestId)

Obtiene TestEnvironment para una solicitud.

List<TestResource> getTestResources(String requestId)

Obtiene TestResources para una solicitud.

List<ClusterCommand> leaseHostCommands(String clusterId, String hostname, List<ClusterDeviceInfo> deviceInfos, List<String> nextClusterIds, int maxTasksTolease)

Arrenda ClusterCommand para el host determinado.

void updateTestContext(String requestId, String commandId, TestContext testContext)

Constructores públicos

ClusterClient

public ClusterClient ()

Métodos públicos

getCommandEventUploader

public IClusterEventUploader<ClusterCommandEvent> getCommandEventUploader ()

Obtén un objeto IClusterEventUploader que se pueda usar para subir objetos ClusterCommandEvent.

Muestra
IClusterEventUploader<ClusterCommandEvent>

getCommandState

public ClusterCommand.State getCommandState (String requestId, 
                String commandId)

Determina el estado de un comando de clúster.

Parámetros
requestId String: ID de la solicitud del clúster

commandId String: ID del comando del clúster

Muestra
ClusterCommand.State Estado del comando del clúster o ClusterCommand.State.UNKNOWN si no se pudo determinar el estado

getCommandStatus

public ClusterCommandStatus getCommandStatus (String requestId, 
                String commandId)

Obtiene el estado de un comando de clúster (el estado y el motivo de cancelación si se canceló).

Parámetros
requestId String: ID de la solicitud del clúster

commandId String: ID del comando del clúster

Muestra
ClusterCommandStatus Es un ClusterCommandStatus que representa el estado y el motivo de cancelación si se cancela el comando. El estado es ClusterCommand.State.UNKNOWN si no se pudo determinar.

getHostEventUploader

public IClusterEventUploader<ClusterHostEvent> getHostEventUploader ()

Obtén un objeto IClusterEventUploader que se pueda usar para subir objetos ClusterHostEvent.

Muestra
IClusterEventUploader<ClusterHostEvent>

getTestContext

public TestContext getTestContext (String requestId, 
                String commandId)

Parámetros
requestId String

commandId String

Muestra
TestContext

Arroja
IOException
JSONException

getTestEnvironment

public TestEnvironment getTestEnvironment (String requestId)

Obtiene TestEnvironment para una solicitud.

Muestra
TestEnvironment Un objeto TestEnvironment.

Arroja
IOException
JSONException

getTestResources

public List<TestResource> getTestResources (String requestId)

Obtiene TestResources para una solicitud.

Muestra
List<TestResource> una lista de TestResource.

Arroja
IOException
JSONException

leaseHostCommands

public List<ClusterCommand> leaseHostCommands (String clusterId, 
                String hostname, 
                List<ClusterDeviceInfo> deviceInfos, 
                List<String> nextClusterIds, 
                int maxTasksTolease)

Arrenda ClusterCommand para el host determinado.

Parámetros
clusterId String: ID del clúster para el host

hostname String: Nombre de host

deviceInfos List: deviceInfos que tiene el host

nextClusterIds List: Es una lista de los próximos IDs de clústeres desde los que se pueden arrendar comandos.

maxTasksTolease int: Es la cantidad máxima de tareas que se pueden arrendar actualmente.

Muestra
List<ClusterCommand> una lista de ClusterCommand

Arroja
JSONException

updateTestContext

public void updateTestContext (String requestId, 
                String commandId, 
                TestContext testContext)

Parámetros
requestId String

commandId String

testContext TestContext

Arroja
IOException
JSONException