Ejemplo n.º 1
0
 /**
  * Sets the absolute home page {@link URL} for this instance. The users can provide the <code>
  * homePageUrlPath</code> if the home page resides in the same instance talking to discovery,
  * else in the cases where the instance is a proxy for some other server, it can provide the
  * full {@link URL}. If the full {@link URL} is provided it takes precedence.
  *
  * <p>The full {@link URL} should follow the format http://${netflix.appinfo.hostname}:7001/
  * where the value ${netflix.appinfo.hostname} is replaced at runtime.
  *
  * @param relativeUrl the relative url path of the home page.
  * @param explicitUrl - The full {@link URL} for the home page
  * @return the instance builder.
  */
 public Builder setHomePageUrl(String relativeUrl, String explicitUrl) {
   String hostNameInterpolationExpression = "${" + namespace + "hostname}";
   if (explicitUrl != null) {
     result.homePageUrl = explicitUrl.replace(hostNameInterpolationExpression, result.hostName);
   } else if (relativeUrl != null) {
     result.homePageUrl = HTTP_PROTOCOL + result.hostName + COLON + result.port + relativeUrl;
   }
   return this;
 }