Package com.sodius.oslc.server.audit
Class AuditStore
java.lang.Object
com.sodius.oslc.server.audit.AuditStore
A storage of Audit Events.
Products should extend this class to dispatch to existing audit capability of the platform they integrate in, if any.
- Since:
- 3.7.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetExporter(List<MediaType> mediaTypes) Provides an exporter to be called to export audit logs for the given MediaType Default implementation throws anUnsupportedOperationException.static AuditStoreReturns the current store instance.static voidsetInstance(AuditStore store) Replaces the current store instance with the given one.abstract voidstore(AuditEvent event) Stores the given audit event.
-
Constructor Details
-
AuditStore
public AuditStore()
-
-
Method Details
-
getInstance
Returns the current store instance. If no instance was set, returns a store that ignores submitted events and does not store any information.- Returns:
- the current instance.
- See Also:
-
setInstance
Replaces the current store instance with the given one.- Parameters:
store- the new store.- Throws:
NullPointerException- if store is null
-
store
Stores the given audit event.- Parameters:
event- an audit event to store- Throws:
NullPointerException- if event is null or one of its required property is empty
-
getExporter
Provides an exporter to be called to export audit logs for the given MediaType Default implementation throws anUnsupportedOperationException. Subclasses may override if they support exporting audit events for the desired format.- Parameters:
mediaTypes- the compatible media types to export data into- Returns:
- a StreamingOutput to write the data into
- Throws:
UnsupportedOperationException- if MediaType isn't supported- Since:
- 4.0.0
-