java.lang.Object
i2p.susi.dns.BaseBean
i2p.susi.dns.LogBean
Bean for managing and displaying subscription log entries and statistics.
Field Summary
FieldsFields inherited from class BaseBean
_context, action, lastSerial, method, PROP_PW_ENABLE, properties, serialModifier and TypeFieldDescriptionprotected final I2PAppContextThe I2P application context.protected StringThe current action.protected StringThe last serial number for CSRF.protected StringThe HTTP method.static final StringProperty for password enable.protected final PropertiesThe configuration properties.protected StringThe serial number.Constructor Summary
ConstructorsConstructorDescriptionLogBean()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 Summary
Modifier and TypeMethodDescriptionprivate intCount the number of log entries from today.private StringformatDate(String dateStr) Format a date string to a human-readable format.Get the current log content.Get the log file path.Get status messages for the UI.intGet the count of log entries from today.private booleanCheck if a date string represents today.private voidReload the log file (synchronized wrapper).private FilelogFile()The addressbook log file.private voidReload the log file and parse entries into HTML.voidSet the log content.Methods inherited from class BaseBean
_t, _t, _t, addressbookDir, configFile, debug, getAction, getSerial, getTheme, getThemeName, getThemes, isOverrideCssActive, loadConfig, ngettext, reload, setAction, setSerial, storeMethod, useSoraFont, warnModifier and TypeMethodDescriptionprotected static StringTranslate a string.protected static StringTranslate a string with one parameter.protected static StringTranslate a string with two parameters.protected FileReturns the addressbook directory.protected FileThe addressbook configuration file.protected voidLog a debug message.Get the action.Generate a new random serial for CSRF protection and clear the pending action.getTheme()Returns the theme path.The configured console theme name.String[]Get all themes.booleanDetermine if a user-provided override.css file is active.protected voidLoads the configuration if needed.protected static StringTranslate a string with plural form (ngettext).protected voidreload()Reloads the configuration from file.voidSets the action.voidSets the serial.voidstoreMethod(String method) Store the HTTP method.booleanChecks if Sora font should be used.protected voidLog a warning message.
Field Details
logName
Log the page is showing.logged
Contents of that log.LOG_FILE
Name of the addressbook's own log file.- See Also:
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
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
setLogged
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
isToday
Check if a date string represents today.- Parameters:
dateStr- the date string to check- Returns:
- true if the date is today