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 class
JsonSecurityEventFormatter.Builder
A builder for JSON security event formatter.
-
Field Summary
Fields Modifier and Type Field Description private Supplier<DateTimeFormatter>
dateTimeFormatterSupplier
private jakarta.json.spi.JsonProvider
jsonProvider
-
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.Builder
builder()
Obtain a newJsonSecurityEventFormatter.Builder
capable of building aJsonSecurityEventFormatter
.private void
handleAuthenticationFailedEvent(SecurityAuthenticationFailedEvent event, jakarta.json.JsonObjectBuilder objectBuilder)
String
handleAuthenticationFailedEvent(SecurityAuthenticationFailedEvent event, Void param)
Handle a security authentication failed event.private void
handleDefiniteOutcomeEvent(SecurityDefiniteOutcomeEvent event, jakarta.json.JsonObjectBuilder objectBuilder)
String
handleDefiniteOutcomeEvent(SecurityDefiniteOutcomeEvent event, Void param)
Handle a security definite outcome event.private void
handlePermissionCheckEvent(SecurityPermissionCheckEvent event, jakarta.json.JsonObjectBuilder objectBuilder)
String
handlePermissionCheckEvent(SecurityPermissionCheckEvent event, Void param)
Handle a security permission check event.private void
handleRealmUnavailableEvent(SecurityRealmUnavailableEvent event, jakarta.json.JsonObjectBuilder objectBuilder)
String
handleRealmUnavailableEvent(SecurityRealmUnavailableEvent event, Void param)
Handle a security realm unavailable event.private void
handleSyslogAuditEvent(SyslogAuditEvent event, jakarta.json.JsonObjectBuilder objectBuilder)
String
handleSyslogAuditEvent(SyslogAuditEvent event, Void param)
Handle an auditable event that is to be logged to syslog.private void
handleUnknownEvent(SecurityEvent event, jakarta.json.JsonObjectBuilder objectBuilder)
String
handleUnknownEvent(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:SecurityEventVisitor
Handle any unhandled security event.- Overrides:
handleUnknownEvent
in 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:SecurityEventVisitor
Handle a security definite outcome event.- Overrides:
handleDefiniteOutcomeEvent
in 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:SecurityEventVisitor
Handle a security authentication failed event.- Overrides:
handleAuthenticationFailedEvent
in 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:SecurityEventVisitor
Handle a security permission check event.- Overrides:
handlePermissionCheckEvent
in 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:SecurityEventVisitor
Handle an auditable event that is to be logged to syslog.- Overrides:
handleSyslogAuditEvent
in 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:SecurityEventVisitor
Handle a security realm unavailable event.- Overrides:
handleRealmUnavailableEvent
in 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.Builder
capable of building aJsonSecurityEventFormatter
.- Returns:
- a new
JsonSecurityEventFormatter.Builder
capable of building aJsonSecurityEventFormatter
-
-