public static String getRemoteAddress() {

    if(hasValidRequest()) {
      return getRemoteAddress(((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
    }

    return null;
  }
Returns remote address by using {@link HttpServletRequest} from {@link RequestContextHolder}
@return
ambari-server/src/main/java/org/apache/ambari/server/utils/RequestUtils.java