org.springframework.boot.actuate.audit

Class AuditEvent

    • Constructor Detail

      • AuditEvent

        public AuditEvent(String principal,
                          String type,
                          Map<String,Object> data)
        Create a new audit event for the current time.
        Parameters:
        principal - the user principal responsible
        type - the event type
        data - the event data
      • AuditEvent

        public AuditEvent(String principal,
                          String type,
                          String... data)
        Create a new audit event for the current time from data provided as name-value pairs.
        Parameters:
        principal - the user principal responsible
        type - the event type
        data - the event data in the form 'key=value' or simply 'key'
      • AuditEvent

        public AuditEvent(Instant timestamp,
                          String principal,
                          String type,
                          Map<String,Object> data)
        Create a new audit event.
        Parameters:
        timestamp - the date/time of the event
        principal - the user principal responsible
        type - the event type
        data - the event data
    • Method Detail

      • getTimestamp

        public Instant getTimestamp()
        Returns the date/time that the event was logged.
        Returns:
        the timestamp
      • getPrincipal

        public String getPrincipal()
        Returns the user principal responsible for the event or an empty String if the principal is not available.
        Returns:
        the principal
      • getType

        public String getType()
        Returns the type of event.
        Returns:
        the event type
      • getData

        public Map<String,Object> getData()
        Returns the event data.
        Returns:
        the event data