Package net.sf.basedb.core.log
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, callDbControl.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 theLoggableData
interface.The manual log entries are mainly intended for logging
ChangeType.VIEW
andChangeType.DOWNLOAD
but can be used for the other change types as well.- Since:
- 3.9
- Author:
- nicklas
-
-
Field Summary
Fields Modifier and Type Field Description private ChangeType
changeType
private BasicItem
item
private String
logInfo
private String
newValue
private String
oldValue
-
Constructor Summary
Constructors Constructor Description ManualLogEntry(BasicItem item, ChangeType changeType, String logInfo)
Create a new log entry.ManualLogEntry(BasicItem item, ChangeType changeType, String logInfo, String oldValue, String newValue)
Create a new log entry with optional old and new values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangeType
getChangeType()
Get the change type.BasicItem
getItem()
Get the item this log entry is related to.String
getLogInfo()
Get information about the log entry.String
getNewValue()
New value after the change.String
getOldValue()
Old value before the change.
-
-
-
Field Detail
-
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 Detail
-
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 tochangeType
- The type of log entrylogInfo
- 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 tochangeType
- The type of log entrylogInfo
- Other information about the log entryoldValue
- Old valuenewValue
- New value
-
-
Method Detail
-
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.
-
-