Class AbstractAuditLoggerConfiguration

java.lang.Object
se.swedenconnect.signservice.core.config.AbstractHandlerConfiguration<AuditLogger>
se.swedenconnect.signservice.audit.base.AbstractAuditLoggerConfiguration
All Implemented Interfaces:
HandlerConfiguration<AuditLogger>
Direct Known Subclasses:
CallbackAuditLoggerConfiguration, FileAuditLoggerConfiguration, LogSystemAuditLoggerConfiguration

public abstract class AbstractAuditLoggerConfiguration extends AbstractHandlerConfiguration<AuditLogger>
Abstract handler configuration for creating AuditLogger instances.
  • Constructor Details

    • AbstractAuditLoggerConfiguration

      public AbstractAuditLoggerConfiguration()
  • Method Details

    • getEventFactory

      @Nullable public Class<? extends AuditEventFactory> getEventFactory()
      If the default (DefaultAuditEventFactory) has been overridden (see setEventFactory(Class)), this method returns this class, otherwise it returns null.
      Returns:
      the event factory, or null if the default should be used
    • setEventFactory

      public void setEventFactory(@Nullable Class<? extends AuditEventFactory> eventFactory)
      By default the DefaultAuditEventFactory is used to create audit events. By assigning another class that may be overridden.

      Note that the class given must have a default constructor (i.e., a no-arg constructor).

      Parameters:
      eventFactory - the event factory to use (null to use default)
    • getPrincipal

      @Nullable public String getPrincipal()
      Gets the default principal to assign to audit events. It should be equal to the clientID that the audit logger is servicing. If the audit logger is a system logger, the AuditEvent.DEFAULT_PRINCIPAL should be used.
      Returns:
      the principal name or null
    • setPrincipal

      public void setPrincipal(@Nonnull String principal)
      Assigns the default principal to assign to audit events. It should be equal to the clientID that the audit logger is servicing. If the audit logger is a system logger, the AuditEvent.DEFAULT_PRINCIPAL should be used.
      Parameters:
      principal - the principal name