org.springframework.data.auditing.config

## Class AuditingBeanDefinitionRegistrarSupport

- java.lang.Object
- - org.springframework.data.auditing.config.AuditingBeanDefinitionRegistrarSupport

All Implemented Interfaces:
  ImportBeanDefinitionRegistrar

    public abstract class AuditingBeanDefinitionRegistrarSupport
    extends Object
    implements ImportBeanDefinitionRegistrar

A `ImportBeanDefinitionRegistrar` that serves as a base class for store specific implementations for configuring audit support. Registers a `AuditingHandler` based on the provided configuration( `AuditingConfiguration`).

Author:
  Ranie Jade Ramiso, Thomas Darimont, Oliver Gierke, Francisco Soler

### Constructor Summary

Constructors
Constructor and Description
`AuditingBeanDefinitionRegistrarSupport()`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected BeanDefinitionBuilder` `configureDefaultAuditHandlerAttributes(AuditingConfiguration configuration, BeanDefinitionBuilder builder)` Configures the given `BeanDefinitionBuilder` with the default attributes from the given `AuditingConfiguration`.
`protected abstract Class<? extends Annotation>` `getAnnotation()` Return the annotation type to lookup configuration values from.
`protected BeanDefinitionBuilder` `getAuditHandlerBeanDefinitionBuilder(AuditingConfiguration configuration)` Creates a `BeanDefinitionBuilder` to ease the definition of store specific `AuditingHandler` implementations.
`protected abstract String` `getAuditingHandlerBeanName()` Return the name to be used to register the `AuditingHandler` under.
`protected AuditingConfiguration` `getConfiguration(AnnotationMetadata annotationMetadata)` Retrieve auditing configuration from the given `AnnotationMetadata`.
`protected abstract void` `registerAuditListenerBeanDefinition(BeanDefinition auditingHandlerDefinition, BeanDefinitionRegistry registry)` Register the listener to eventually trigger the `AuditingHandler`.
`void` `registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry)`
`protected void` `registerInfrastructureBeanWithId(AbstractBeanDefinition definition, String id, BeanDefinitionRegistry registry)` Registers the given `AbstractBeanDefinition` as infrastructure bean under the given id.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.springframework.context.annotation.ImportBeanDefinitionRegistrar

`registerBeanDefinitions`

### Constructor Detail

#### AuditingBeanDefinitionRegistrarSupport

    public AuditingBeanDefinitionRegistrarSupport()

### Method Detail

#### registerBeanDefinitions

    public void registerBeanDefinitions(AnnotationMetadata annotationMetadata,
                                        BeanDefinitionRegistry registry)

Specified by:
  `registerBeanDefinitions` in interface `ImportBeanDefinitionRegistrar`

#### getAuditHandlerBeanDefinitionBuilder

    protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingConfiguration configuration)

Creates a `BeanDefinitionBuilder` to ease the definition of store specific `AuditingHandler` implementations.

Parameters:
  `configuration` - must not be null.
Returns:

#### configureDefaultAuditHandlerAttributes

    protected BeanDefinitionBuilder configureDefaultAuditHandlerAttributes(AuditingConfiguration configuration,
                                                                           BeanDefinitionBuilder builder)

Configures the given `BeanDefinitionBuilder` with the default attributes from the given `AuditingConfiguration`.

Parameters:
  `configuration` - must not be null.
  `builder` - must not be null.
Returns:
  the builder with the audit attributes configured.

#### getConfiguration

    protected AuditingConfiguration getConfiguration(AnnotationMetadata annotationMetadata)

Retrieve auditing configuration from the given `AnnotationMetadata`.

Parameters:
  `annotationMetadata` - will never be null.
Returns:

#### getAnnotation

    protected abstract Class<? extends Annotation> getAnnotation()

Return the annotation type to lookup configuration values from.

Returns:
  must not be null.

#### registerAuditListenerBeanDefinition

    protected abstract void registerAuditListenerBeanDefinition(BeanDefinition auditingHandlerDefinition,
                                                                BeanDefinitionRegistry registry)

Register the listener to eventually trigger the `AuditingHandler`.

Parameters:
  `auditingHandlerDefinition` - will never be null.
  `registry` - will never be null.

#### getAuditingHandlerBeanName

    protected abstract String getAuditingHandlerBeanName()

Return the name to be used to register the `AuditingHandler` under.

Returns:

#### registerInfrastructureBeanWithId

    protected void registerInfrastructureBeanWithId(AbstractBeanDefinition definition,
                                                    String id,
                                                    BeanDefinitionRegistry registry)

Registers the given `AbstractBeanDefinition` as infrastructure bean under the given id.

Parameters:
  `definition` - must not be null.
  `id` - must not be null or empty.
  `registry` - must not be null.