@Override
  public HttpURLConnection getConnectionAsCurrent(String spec,
                                                  String requestMethod,
                                                  InputStream body,
                                                  Map<String, String> headers) throws IOException {
    return getConnectionAs(spec, requestMethod, body, headers, viewContext.getUsername());
  }
Get an instance of HostPortRestrictionHandler

@return
ambari-server/src/main/java/org/apache/ambari/server/view/ViewURLStreamProvider.java