Class AuditServiceBuilder


  • public final class AuditServiceBuilder
    extends Object
    Builder for AuditService.
    • Method Detail

      • newAuditService

        public static AuditServiceBuilder newAuditService()
        Factory method for new instances of this builder.
        Returns:
        A new instance of the AuditServiceBuilder.
      • withConfiguration

        public AuditServiceBuilder withConfiguration​(AuditServiceConfiguration auditServiceConfiguration)
        Sets the AuditServiceConfiguration that is to be passed to the AuditService.

        AuditServiceConfiguration embodies the configuration state that can be set by system administrators.

        Parameters:
        auditServiceConfiguration - user-facing configuration that is to be applied to the AuditService.
        Returns:
        this builder for method-chaining.
      • withEventTopicsMetaData

        public AuditServiceBuilder withEventTopicsMetaData​(EventTopicsMetaData eventTopicsMetaData)
        Set the topic metadata that should be used by the audit service and the handlers.
        Parameters:
        eventTopicsMetaData - The metadata.
        Returns:
        This builder.
      • withDependencyProvider

        public AuditServiceBuilder withDependencyProvider​(DependencyProvider dependencyProvider)
        Register the DependencyProvider, after which, an AuditEventHandler can be registered and receive this provider. The dependency provider allows the handler to obtain resources or objects from the product which integrates the Audit Service.
        Parameters:
        dependencyProvider - the DependencyProvider to register.
        Returns:
        this builder for method-chaining.
      • withAuditEventHandlerFactory

        public AuditServiceBuilder withAuditEventHandlerFactory​(AuditEventHandlerFactory auditEventHandlerFactory)
        Register factory for creating instances of AuditEventHandler.
        Parameters:
        auditEventHandlerFactory - the AuditEventHandlerFactory to register.
        Returns:
        this builder for method-chaining.
      • withAuditEventHandler

        public AuditServiceBuilder withAuditEventHandler​(Class<? extends AuditEventHandler> clazz,
                                                         EventHandlerConfiguration configuration)
                                                  throws AuditException
        Register an AuditEventHandler. After that registration, that AuditEventHandler can be referred with the given name. This AuditEventHandler will only be notified about the events specified in the parameter events.
        Parameters:
        clazz - the AuditEventHandler type to register.
        configuration - the handler configuration.
        Returns:
        this builder for method-chaining.
        Throws:
        AuditException - if already asked to register a handler with the same name.
      • withAuditEventHandler

        public AuditServiceBuilder withAuditEventHandler​(AuditEventHandler auditEventHandler)
                                                  throws AuditException
        Register an AuditEventHandler.
        Parameters:
        auditEventHandler - the AuditEventHandler to register.
        Returns:
        this builder for method-chaining.
        Throws:
        AuditException - if already asked to register a handler with the same name.