Package org.saidone.component
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
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
init()
Creates the audit collection if it does not already exist.Methods inherited from class org.saidone.component.BaseComponent
setApplicationContext, shutDown, stop
-
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 classBaseComponent
-