Class AuditStore

java.lang.Object
com.sodius.oslc.server.audit.AuditStore

public abstract class AuditStore extends Object
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 Details

    • AuditStore

      public AuditStore()
  • Method Details

    • getInstance

      public static AuditStore 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

      public static void setInstance(AuditStore store)
      Replaces the current store instance with the given one.
      Parameters:
      store - the new store.
      Throws:
      NullPointerException - if store is null
    • store

      public abstract void store(AuditEvent event)
      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

      public StreamingOutput getExporter(List<MediaType> mediaTypes)
      Provides an exporter to be called to export audit logs for the given MediaType Default implementation throws an UnsupportedOperationException. 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