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 Details

    • setOldestDate

      void setOldestDate(Date oldestDate, String repositoryType)
      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 date
      repositoryType - type of repository (log/trace)
    • recordFileAction

      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 curOldestDate
      Parameters:
      eventType - roll or delete
      repositoryType - log or trace
      curOldestDate - this will be null if it does not change the value or oldest date not determinable
    • registerListener

      void registerListener(LogEventListener eventListener)
      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

      void deRegisterListener(LogEventListener eventListener)
      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

      Date getOldestLogRecordTime(String repositoryType)
      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.