Class ManualLogEntry

java.lang.Object
net.sf.basedb.core.log.ManualLogEntry
All Implemented Interfaces:
LoggableData

public class ManualLogEntry extends Object implements LoggableData
Represents a manual entry into the change history log. After creating an instance of this class, call DbControl.logEntry(ManualLogEntry) to register the entry. If the entry is actually logged or not depends on if logging has been enabled and also on the extensions that handle logging. Note that the built-in logging will only log entries for items that implements the LoggableData interface.

The manual log entries are mainly intended for logging ChangeType.VIEW and ChangeType.DOWNLOAD but can be used for the other change types as well.

Since:
3.9
Author:
nicklas
  • Field Details

    • changeType

      private final ChangeType changeType
    • item

      private final BasicItem item
    • logInfo

      private final String logInfo
    • oldValue

      private final String oldValue
    • newValue

      private final String newValue
  • Constructor Details

    • ManualLogEntry

      public ManualLogEntry(BasicItem item, ChangeType changeType, String logInfo)
      Create a new log entry. An item and change type is required.
      Parameters:
      item - The item the entry is related to
      changeType - The type of log entry
      logInfo - Other information about the log entry
    • ManualLogEntry

      public ManualLogEntry(BasicItem item, ChangeType changeType, String logInfo, String oldValue, String newValue)
      Create a new log entry with optional old and new values.
      Parameters:
      item - The item the entry is related to
      changeType - The type of log entry
      logInfo - Other information about the log entry
      oldValue - Old value
      newValue - New value
  • Method Details

    • getChangeType

      public ChangeType getChangeType()
      Get the change type.
    • getItem

      public BasicItem getItem()
      Get the item this log entry is related to.
    • getLogInfo

      public String getLogInfo()
      Get information about the log entry.
    • getOldValue

      public String getOldValue()
      Old value before the change.
    • getNewValue

      public String getNewValue()
      New value after the change.