code: private static URI parseStringAsUri(String ipString) {
      try {
        URI uri = new URI("socket://" + ipString);
        if (uri.getHost() == null || uri.getPort() == -1) {
          throw new URISyntaxException(ipString, "URI must have host and port parts");
        }
        return uri;
      } catch (URISyntaxException e) {
        throw (IllegalArgumentException) new IllegalArgumentException(
            "Graphite server address needs to be defined as {host}:{port}.").initCause(e);
      }
    }
docs: It's a lot easier to configure and manage the location of the graphite server if we combine
  the ip and port into a single string. Using a "fake" transport and the ipString means we get
  standard host/port parsing (including domain names, ipv4 and ipv6) for free.