private static boolean hasValidRequest() {
    return RequestContextHolder.getRequestAttributes() != null &&
      RequestContextHolder.getRequestAttributes() instanceof ServletRequestAttributes &&
      ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest() != null;
  }
Checks if RequestContextHolder contains a valid HTTP request
@return
ambari-server/src/main/java/org/apache/ambari/server/utils/RequestUtils.java