Search in sources :

Example 6 with AgentDeviceDTO

use of com.testsigma.agent.dto.AgentDeviceDTO in project testsigma by testsigmahq.

the class DeviceContainer method getAgentDevice.

private AgentDeviceDTO getAgentDevice(String uniqueId) throws DeviceContainerException {
    try {
        AgentDeviceDTO agentDeviceDTO = null;
        String agentUuid = agentConfig.getUUID();
        String authHeader = WebAppHttpClient.BEARER + " " + this.agentConfig.getJwtApiKey();
        HttpResponse<AgentDeviceDTO> response = httpClient.get(ServerURLBuilder.agentConnectedDeviceURL(agentUuid, uniqueId), new TypeReference<>() {
        }, authHeader);
        if (response.getStatusCode() == HttpStatus.OK.value()) {
            agentDeviceDTO = response.getResponseEntity();
        }
        return agentDeviceDTO;
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        throw new DeviceContainerException(e.getMessage(), e);
    }
}
Also used : DeviceContainerException(com.testsigma.agent.exception.DeviceContainerException) AgentDeviceDTO(com.testsigma.agent.dto.AgentDeviceDTO) AutomatorException(com.testsigma.automator.exceptions.AutomatorException) TestsigmaException(com.testsigma.agent.exception.TestsigmaException) DeviceContainerException(com.testsigma.agent.exception.DeviceContainerException)

Aggregations

AgentDeviceDTO (com.testsigma.agent.dto.AgentDeviceDTO)6 DeviceContainerException (com.testsigma.agent.exception.DeviceContainerException)6 TestsigmaException (com.testsigma.agent.exception.TestsigmaException)6 AutomatorException (com.testsigma.automator.exceptions.AutomatorException)6