class IncomingUrlService {

    public void receiveUrl(String url) {
        // Check if url is a valid http or https resource
        if (!UrlUtils.isValid(url)) {
            log.error("Url {} is not valid", url);
            return;
        }
        log.info("Received url {}, prepared to fetch robots.txt file for it", url);
        try {
            // Extract base url to create robots.txt url
            URI uri = new URI(url);
            String baseHost = DomainUtils.base(uri);

            log.debug("Validated url to base host: {}", baseHost);
            checkHost(baseHost);

        } catch (URISyntaxException e) {
            log.error("Can't create URI using url {}", url, e);
        }
    }

}