DeviceManagementGrpcServer

public class DeviceManagementGrpcServer
extends DeviceManagementGrpc.DeviceManagementImplBase

java.lang.Object
   ↳ com.proto.tradefed.device.DeviceManagementGrpc.DeviceManagementImplBase
     ↳ com.android.tradefed.service.management.DeviceManagementGrpcServer


GRPC server allowing to reserve a device from Tradefed.

Summary

Public constructors

DeviceManagementGrpcServer(int port, IDeviceManager deviceManager, ICommandScheduler scheduler)
DeviceManagementGrpcServer(Server server, IDeviceManager deviceManager, ICommandScheduler scheduler)
DeviceManagementGrpcServer(ServerBuilder<?> serverBuilder, IDeviceManager deviceManager, ICommandScheduler scheduler)

Public methods

ITestDevice getDeviceFromReservation(String reservationId)
void getDevicesStatus(GetDevicesStatusRequest request, StreamObserver<GetDevicesStatusResponse> responseObserver)
static Integer getPort()

Returns the port used by the server.

void releaseReservation(ReleaseReservationRequest request, StreamObserver<ReleaseReservationResponse> responseObserver)
void reserveDevice(ReserveDeviceRequest request, StreamObserver<ReserveDeviceResponse> responseObserver)
void shutdown()

Stop the grpc server.

void start()

Start the grpc server.

void stopLeasing(StopLeasingRequest request, StreamObserver<StopLeasingResponse> responseObserver)

Public constructors

DeviceManagementGrpcServer

public DeviceManagementGrpcServer (int port, 
                IDeviceManager deviceManager, 
                ICommandScheduler scheduler)

Parameters
port int

deviceManager IDeviceManager

scheduler ICommandScheduler

DeviceManagementGrpcServer

public DeviceManagementGrpcServer (Server server, 
                IDeviceManager deviceManager, 
                ICommandScheduler scheduler)

Parameters
server Server

deviceManager IDeviceManager

scheduler ICommandScheduler

DeviceManagementGrpcServer

public DeviceManagementGrpcServer (ServerBuilder<?> serverBuilder, 
                IDeviceManager deviceManager, 
                ICommandScheduler scheduler)

Parameters
serverBuilder ServerBuilder

deviceManager IDeviceManager

scheduler ICommandScheduler

Public methods

getDeviceFromReservation

public ITestDevice getDeviceFromReservation (String reservationId)

Parameters
reservationId String

Returns
ITestDevice

getDevicesStatus

public void getDevicesStatus (GetDevicesStatusRequest request, 
                StreamObserver<GetDevicesStatusResponse> responseObserver)

Parameters
request GetDevicesStatusRequest

responseObserver StreamObserver

getPort

public static Integer getPort ()

Returns the port used by the server.

Returns
Integer

releaseReservation

public void releaseReservation (ReleaseReservationRequest request, 
                StreamObserver<ReleaseReservationResponse> responseObserver)

Parameters
request ReleaseReservationRequest

responseObserver StreamObserver

reserveDevice

public void reserveDevice (ReserveDeviceRequest request, 
                StreamObserver<ReserveDeviceResponse> responseObserver)

Parameters
request ReserveDeviceRequest

responseObserver StreamObserver

shutdown

public void shutdown ()

Stop the grpc server.

start

public void start ()

Start the grpc server.

stopLeasing

public void stopLeasing (StopLeasingRequest request, 
                StreamObserver<StopLeasingResponse> responseObserver)

Parameters
request StopLeasingRequest

responseObserver StreamObserver