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);
}
}
Aggregations