public class LogBeanextends BaseBean
Bean for managing and displaying subscription log entries and statistics.
  • Field Details

    • logName

      private String logName
      Log the page is showing.
    • logged

      private String logged
      Contents of that log.
    • LOG_FILE

      private static final String LOG_FILE
      Name of the addressbook's own log file.
      See Also:
    • DASH_SPLIT

      private static final Pattern DASH_SPLIT
      Splits a log line at its separator.
  • Constructor Details

    • LogBean

      public LogBean()
      Constructs an empty log view; the JSP instantiates it via jsp:useBean and the log file is only read when a getter asks for the content.
  • Method Details

    • getLogName

      public String getLogName()
      Get the log file path.
      Returns:
      the absolute path to the log file
    • logFile

      private File logFile()
      The addressbook log file.
      Returns:
      the log file path, which may not exist on disk yet
    • reloadLog

      private void reloadLog()
      Reload the log file and parse entries into HTML.
    • locked_reloadLog

      private void locked_reloadLog()
      Reload the log file (synchronized wrapper).
    • getMessages

      public String getMessages()
      Get status messages for the UI.
      Returns:
      HTML formatted status message
    • setLogged

      public void setLogged(String logged)
      Set the log content.
      Parameters:
      logged - the new log content
    • getLogged

      public String getLogged()
      Get the current log content.
      Returns:
      the log content, or default if file doesn't exist
    • getTodayEntryCount

      public int getTodayEntryCount()
      Get the count of log entries from today.
      Returns:
      the number of entries logged today
    • countTodayEntries

      private int countTodayEntries()
      Count the number of log entries from today.
      Returns:
      the number of entries logged today
    • formatDate

      private String formatDate(String dateStr)
      Format a date string to a human-readable format. Handles both ISO format and old format.
      Parameters:
      dateStr - the date string to format
      Returns:
      the formatted date string
    • isToday

      private boolean isToday(String dateStr)
      Check if a date string represents today.
      Parameters:
      dateStr - the date string to check
      Returns:
      true if the date is today