WebUtils { public static void reportLoginEvent(final EventType eventType, final String username, final String ip, final boolean isSuccess, final String message) { if (azkabanEventReporter != null) { final Map<String, String> metadata = new HashMap<>(); metadata.put("azkabanHost", AzkabanWebServer.getAzkabanProperties().getString(AZKABAN_SERVER_HOST_NAME, hostName)); metadata.put("sessionUser", Strings.isNullOrEmpty(username) ? "unknown" : username); metadata.put("sessionIP", ip); metadata.put("reason", message); metadata.put("appOutcome", isSuccess ? "SUCCESS" : "FAILURE"); azkabanEventReporter.report(eventType, metadata); } }  static String displayBytes(final long sizeBytes); static String formatStatus(final Status status); static String getRealClientIpAddr(final Map<String, String> httpHeaders,
      final String remoteAddr); static String getRealClientIpAddr(final HttpServletRequest req); static void reportLoginEvent(final EventType eventType, final String username,
      final String ip, final boolean isSuccess, final String message); static void reportLoginEvent(final EventType eventType, final String username, final String ip); static final String X_FORWARDED_FOR_HEADER; }
@Test public void testReportLoginEvent() { WebUtils.reportLoginEvent(EventType.USER_LOGIN, "itsme", "127.0.0.1"); }