Interface LogEventNotifier
public interface LogEventNotifier
Interface for visibility/dependency purposes which logging systems call to when roll or delete events occur and which
listeners for these events call to register. The implementer maintains the collection of listeners and, on event
occurrence, notifies all listeners.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deRegisterListener
(LogEventListener eventListener) deRegister a listener for log events.getOldestLogRecordTime
(String repositoryType) return the oldest record of the current type.void
recordFileAction
(String eventType, String repositoryType, Date curOldestDate) record that a file action has taken place on a file type, leaving current oldest record as curOldestDatevoid
registerListener
(LogEventListener eventListener) register a new listener for log events.void
setOldestDate
(Date oldestDate, String repositoryType) set the oldest date based on repository type.
-
Method Details
-
setOldestDate
set the oldest date based on repository type. This is generally called soon after this object is constructed as the managers are notified of the object- Parameters:
oldestDate
- oldest date in the repository for that repository type. This may be null if manager is unable to determine oldest daterepositoryType
- type of repository (log/trace)
-
recordFileAction
record that a file action has taken place on a file type, leaving current oldest record as curOldestDate- Parameters:
eventType
- roll or deleterepositoryType
- log or tracecurOldestDate
- this will be null if it does not change the value or oldest date not determinable
-
registerListener
register a new listener for log events. This listener will be notified any time a roll or delete event occurs on a log or trace system.- Parameters:
eventListener
- implementer of the LogEventListener interface
-
deRegisterListener
deRegister a listener for log events. Indicates that this listener is no longer interested in receiving log and trace events- Parameters:
eventListener
- implementer of the LogEventListener interface
-
getOldestLogRecordTime
return the oldest record of the current type. For this sample, does not differentiate. In reality later, this will forward to the appropriate repositoryManager which will calculate oldest record.- Parameters:
repositoryType
- Log vs Trace- Returns:
- Date of oldest record in the repository. Null if manager could not determine this.
-