Class AuditCollectionCreator

java.lang.Object
org.saidone.component.BaseComponent
org.saidone.component.AuditCollectionCreator
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Component public class AuditCollectionCreator extends BaseComponent
Creates the MongoDB collection used for persisting AuditEntry records.

On application startup this component checks whether the collection "vault_audit" exists and, if not, creates it as a time series collection with the timestamp field as its time key. The created collection stores additional audit metadata in the metadata sub document and uses a seconds granularity.

  • Constructor Details

    • AuditCollectionCreator

      public AuditCollectionCreator()
  • Method Details

    • init

      @PostConstruct public void init()
      Creates the audit collection if it does not already exist.
      Overrides:
      init in class BaseComponent