Class ProgressLogImpl

java.lang.Object
ch.tocco.nice2.tasks.impl.progress.ProgressLogImpl
All Implemented Interfaces:
ProgressLog

public class ProgressLogImpl extends Object implements ProgressLog
  • Constructor Details

  • Method Details

    • log

      public LogEntry log(String textKey)
      Description copied from interface: ProgressLog
      Log a message.

      Creates a new log entry with status "running". If the last log entry before this new entry is not completed, it will be completed automatically.

      Specified by:
      log in interface ProgressLog
      Parameters:
      textKey - the key (textressources) of the message to display
      Returns:
      the created LogEntry
    • log

      public LogEntry log(String textKey, Map<String,String> vars)
      Description copied from interface: ProgressLog
      Log a message.

      Creates a new log entry with status "running". If the last log entry before this new entry is not completed, it will be completed automatically.

      Specified by:
      log in interface ProgressLog
      Parameters:
      textKey - the key (textressources) of the message to display
      vars - a map with the parameters to replace the placeholders in the log message with
      Returns:
      the created LogEntry
    • getLogEntries

      public List<LogEntry> getLogEntries()
      Description copied from interface: ProgressLog
      Get e (unmodifiable) list containing the log entries.
      Specified by:
      getLogEntries in interface ProgressLog
      Returns:
      a list containing the log entries.
    • findLogEntryByState

      public Optional<LogEntry> findLogEntryByState(String state)
      Description copied from interface: ProgressLog
      Find a single LogEntry for a given state value. This value must uniquely identify the log entry!

      If more than one result is found, an exception is thrown. Otherwise either the single result is returned or none.

      Specified by:
      findLogEntryByState in interface ProgressLog
    • findLatestLogEntry

      public Optional<LogEntry> findLatestLogEntry()
      Specified by:
      findLatestLogEntry in interface ProgressLog