Class BasicEventLogger

java.lang.Object
org.infinispan.util.logging.events.impl.BasicEventLogger
All Implemented Interfaces:
Listenable, EventLogger

public class BasicEventLogger extends Object implements EventLogger
BasicEventLogger. An event logger which doesn't do anything aside from sending events to the logger and notifying the listeners.
Since:
8.2
Author:
Tristan Tarrant
  • Constructor Details

    • BasicEventLogger

      public BasicEventLogger(EventLoggerNotifier notifier, org.infinispan.commons.time.TimeService timeService)
  • Method Details

    • scope

      public EventLogger scope(String scope)
      Description copied from interface: EventLogger
      Sets the scope of this event log, e.g. a node address. This should be used for events which reference a single node in the cluster
      Specified by:
      scope in interface EventLogger
      Parameters:
      scope - a scope
      Returns:
      the event logger
    • context

      public EventLogger context(String context)
      Description copied from interface: EventLogger
      Sets a context of this event log.
      Specified by:
      context in interface EventLogger
      Parameters:
      context - the name of the context
      Returns:
      the event logger
    • detail

      public EventLogger detail(String detail)
      Description copied from interface: EventLogger
      Sets a detail for this event log which could include additional information.
      Specified by:
      detail in interface EventLogger
      Parameters:
      detail - the event log detail
      Returns:
      the event logger
    • who

      public EventLogger who(String who)
      Description copied from interface: EventLogger
      Sets a security name for this event log.
      Specified by:
      who in interface EventLogger
      Parameters:
      who - the security name
      Returns:
      the event logger
    • log

      public void log(EventLogLevel level, EventLogCategory category, String message)
      Description copied from interface: EventLogger
      Logs a message to the event log with the specified level
      Specified by:
      log in interface EventLogger
      Parameters:
      level - the severity level of the event
      message - the message to log
    • getEvents

      public List<EventLog> getEvents(Instant start, int count, Optional<EventLogCategory> category, Optional<EventLogLevel> level)
      The basic event logger doesn't collect anything.
      Specified by:
      getEvents in interface EventLogger
      Parameters:
      start - the instant from which to retrieve the logs
      count - the number of logs to retrieve
      category - an optional category filter
      level - an optional level filter
      Returns:
      a list of EventLogs
    • addListenerAsync

      public CompletionStage<Void> addListenerAsync(Object listener)
      Description copied from interface: Listenable
      Asynchronous version of Listenable.addListener(Object)
      Specified by:
      addListenerAsync in interface Listenable
      Parameters:
      listener - listener to add, must not be null
      Returns:
      CompletionStage that when complete the listener is fully installed
    • removeListenerAsync

      public CompletionStage<Void> removeListenerAsync(Object listener)
      Description copied from interface: Listenable
      Asynchronous version of Listenable.removeListener(Object)
      Specified by:
      removeListenerAsync in interface Listenable
      Parameters:
      listener - listener to remove, must not be null
      Returns:
      CompletionStage that when complete the listener is fully removed
    • getListeners

      public Set<Object> getListeners()
      Specified by:
      getListeners in interface Listenable
      Returns:
      a set of all listeners registered on this component.