code: protected String inferRootUrl() {
          if (isProtocolEnabled("https")) {
              Integer port = getHttpsPort();
              checkNotNull(port, "HTTPS_PORT sensors not set; is an acceptable port available?");
              return String.format("https://%s:%s/", getHostname(), port);
          } else if (isProtocolEnabled("http")) {
              Integer port = getHttpPort();
              checkNotNull(port, "HTTP_PORT sensors not set; is an acceptable port available?");
              return String.format("http://%s:%s/", getHostname(), port);
          } else {
              throw new IllegalStateException("HTTP and HTTPS protocols not enabled for " + entity + "; enabled protocols are " + getEnabledProtocols());
          }
      }
docs: TODO refactor this method (abstract super class)