class DetectorClient {

    public DetectorDocument findDetectorDocument(UUID uuid) {
        notNull(uuid, "uuid can't be null");

        // http://modelservice/api/v2/detectors/findByUuid?uuid=%s
        // http://modelservice/api/v2/detectors/findByUuid?uuid=85f395a2-e276-7cfd-34bc-cb850ae3bc2e
        val uri = String.format(baseUri + FIND_DOCUMENT_PATH, uuid);

        Content content;
        try {
            content = httpClient.get(uri);
        } catch (IOException e) {
            val message = "IOException while getting detector document " + uuid +
                    ": httpMethod=GET" +
                    ", uri=" + uri +
                    ", message=" + e.getMessage();
            throw new DetectorException(message, e);
        }

        DetectorDocument document;
        try {
            document = objectMapper.readValue(content.asBytes(), DetectorDocument.class);
        } catch (IOException e) {
            val message = "IOException while reading detector document " + uuid;
            throw new DetectorException(message, e);
        }

        if (document == null) {
            throw new DetectorException("No detector document for uuid=" + uuid);
        }

        return document;
    }

}