class DetectorClient {

    public DetectorMapping findDetectorMappingByUuid(UUID uuid) {
        Content content;
        List<DetectorMapping> result;

        val uri = String.format(baseUri + FIND_MAPPINGS_BY_UUID_PATH);
        val bodyMap = Collections.singletonMap("detectorUuid", uuid);
        try {
            val body = objectMapper.writeValueAsString(bodyMap);
            content = httpClient.post(uri, body);
        } catch (IOException e) {
            val message = "IOException while getting detectors mappings for" +
                    ": uuid=" + uuid +
                    ", httpMethod=POST" +
                    ", uri=" + uri;
            throw new DetectorException(message, e);
        }
        val typeRef = new TypeReference<List<DetectorMapping>>() {
        };
        try {
            result = objectMapper.readValue(content.asBytes(), typeRef);
        } catch (IOException e) {
            val message = "IOException while reading detectors mappings for" +
                    ": uuid=" + uuid;
            throw new DetectorException(message, e);
        }

        if (result == null || result.isEmpty()) {
            throw new DetectorException("No detector mappings for" +
                    ": uuid=" + uuid);
        }
        return result.get(0);
    }

}