Package org.wildfly.security.audit
Class JsonSecurityEventFormatter
- java.lang.Object
-
- org.wildfly.security.auth.server.event.SecurityEventVisitor<Void,String>
-
- org.wildfly.security.audit.JsonSecurityEventFormatter
-
public class JsonSecurityEventFormatter extends SecurityEventVisitor<Void,String>
A formatter for security events that converts events into JSON strings.- Author:
- Darran Lofthouse
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJsonSecurityEventFormatter.BuilderA builder for JSON security event formatter.
-
Field Summary
Fields Modifier and Type Field Description private Supplier<DateTimeFormatter>dateTimeFormatterSupplierprivate jakarta.json.spi.JsonProviderjsonProvider
-
Constructor Summary
Constructors Constructor Description JsonSecurityEventFormatter(JsonSecurityEventFormatter.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JsonSecurityEventFormatter.Builderbuilder()Obtain a newJsonSecurityEventFormatter.Buildercapable of building aJsonSecurityEventFormatter.private voidhandleAuthenticationFailedEvent(SecurityAuthenticationFailedEvent event, jakarta.json.JsonObjectBuilder objectBuilder)StringhandleAuthenticationFailedEvent(SecurityAuthenticationFailedEvent event, Void param)Handle a security authentication failed event.private voidhandleDefiniteOutcomeEvent(SecurityDefiniteOutcomeEvent event, jakarta.json.JsonObjectBuilder objectBuilder)StringhandleDefiniteOutcomeEvent(SecurityDefiniteOutcomeEvent event, Void param)Handle a security definite outcome event.private voidhandlePermissionCheckEvent(SecurityPermissionCheckEvent event, jakarta.json.JsonObjectBuilder objectBuilder)StringhandlePermissionCheckEvent(SecurityPermissionCheckEvent event, Void param)Handle a security permission check event.private voidhandleRealmUnavailableEvent(SecurityRealmUnavailableEvent event, jakarta.json.JsonObjectBuilder objectBuilder)StringhandleRealmUnavailableEvent(SecurityRealmUnavailableEvent event, Void param)Handle a security realm unavailable event.private voidhandleSyslogAuditEvent(SyslogAuditEvent event, jakarta.json.JsonObjectBuilder objectBuilder)StringhandleSyslogAuditEvent(SyslogAuditEvent event, Void param)Handle an auditable event that is to be logged to syslog.private voidhandleUnknownEvent(SecurityEvent event, jakarta.json.JsonObjectBuilder objectBuilder)StringhandleUnknownEvent(SecurityEvent event, Void param)Handle any unhandled security event.-
Methods inherited from class org.wildfly.security.auth.server.event.SecurityEventVisitor
handleAuthenticationEvent, handleAuthenticationSuccessfulEvent, handlePermissionCheckFailedEvent, handlePermissionCheckSuccessfulEvent
-
-
-
-
Field Detail
-
dateTimeFormatterSupplier
private final Supplier<DateTimeFormatter> dateTimeFormatterSupplier
-
jsonProvider
private final jakarta.json.spi.JsonProvider jsonProvider
-
-
Constructor Detail
-
JsonSecurityEventFormatter
JsonSecurityEventFormatter(JsonSecurityEventFormatter.Builder builder)
-
-
Method Detail
-
handleUnknownEvent
public String handleUnknownEvent(SecurityEvent event, Void param)
Description copied from class:SecurityEventVisitorHandle any unhandled security event.- Overrides:
handleUnknownEventin classSecurityEventVisitor<Void,String>- Parameters:
event- the security eventparam- the visitor parameter- Returns:
- the visitor return value
-
handleUnknownEvent
private void handleUnknownEvent(SecurityEvent event, jakarta.json.JsonObjectBuilder objectBuilder)
-
handleDefiniteOutcomeEvent
public String handleDefiniteOutcomeEvent(SecurityDefiniteOutcomeEvent event, Void param)
Description copied from class:SecurityEventVisitorHandle a security definite outcome event.- Overrides:
handleDefiniteOutcomeEventin classSecurityEventVisitor<Void,String>- Parameters:
event- the security eventparam- the visitor parameter- Returns:
- the visitor return value
-
handleDefiniteOutcomeEvent
private void handleDefiniteOutcomeEvent(SecurityDefiniteOutcomeEvent event, jakarta.json.JsonObjectBuilder objectBuilder)
-
handleAuthenticationFailedEvent
public String handleAuthenticationFailedEvent(SecurityAuthenticationFailedEvent event, Void param)
Description copied from class:SecurityEventVisitorHandle a security authentication failed event.- Overrides:
handleAuthenticationFailedEventin classSecurityEventVisitor<Void,String>- Parameters:
event- the security eventparam- the visitor parameter- Returns:
- the visitor return value
-
handleAuthenticationFailedEvent
private void handleAuthenticationFailedEvent(SecurityAuthenticationFailedEvent event, jakarta.json.JsonObjectBuilder objectBuilder)
-
handlePermissionCheckEvent
public String handlePermissionCheckEvent(SecurityPermissionCheckEvent event, Void param)
Description copied from class:SecurityEventVisitorHandle a security permission check event.- Overrides:
handlePermissionCheckEventin classSecurityEventVisitor<Void,String>- Parameters:
event- the security eventparam- the visitor parameter- Returns:
- the visitor return value
-
handlePermissionCheckEvent
private void handlePermissionCheckEvent(SecurityPermissionCheckEvent event, jakarta.json.JsonObjectBuilder objectBuilder)
-
handleSyslogAuditEvent
public String handleSyslogAuditEvent(SyslogAuditEvent event, Void param)
Description copied from class:SecurityEventVisitorHandle an auditable event that is to be logged to syslog.- Overrides:
handleSyslogAuditEventin classSecurityEventVisitor<Void,String>- Parameters:
event- the security eventparam- the visitor parameter- Returns:
- the visitor return value
-
handleSyslogAuditEvent
private void handleSyslogAuditEvent(SyslogAuditEvent event, jakarta.json.JsonObjectBuilder objectBuilder)
-
handleRealmUnavailableEvent
public String handleRealmUnavailableEvent(SecurityRealmUnavailableEvent event, Void param)
Description copied from class:SecurityEventVisitorHandle a security realm unavailable event.- Overrides:
handleRealmUnavailableEventin classSecurityEventVisitor<Void,String>- Parameters:
event- the security eventparam- the visitor parameter- Returns:
- the visitor return value
-
handleRealmUnavailableEvent
private void handleRealmUnavailableEvent(SecurityRealmUnavailableEvent event, jakarta.json.JsonObjectBuilder objectBuilder)
-
builder
public static JsonSecurityEventFormatter.Builder builder()
Obtain a newJsonSecurityEventFormatter.Buildercapable of building aJsonSecurityEventFormatter.- Returns:
- a new
JsonSecurityEventFormatter.Buildercapable of building aJsonSecurityEventFormatter
-
-