From 4b0562da384bde2ae9a48f0aadd9f87c1b5ea686 Mon Sep 17 00:00:00 2001 From: Vilmos Nagy Date: Thu, 22 Dec 2022 17:45:37 +0100 Subject: [PATCH] #16161 implement an EventBuilder constructor which can be called from scheduled tasks --- .../src/main/java/org/keycloak/events/EventBuilder.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server-spi-private/src/main/java/org/keycloak/events/EventBuilder.java b/server-spi-private/src/main/java/org/keycloak/events/EventBuilder.java index 92ad9dd4bb..166bd5ad26 100755 --- a/server-spi-private/src/main/java/org/keycloak/events/EventBuilder.java +++ b/server-spi-private/src/main/java/org/keycloak/events/EventBuilder.java @@ -48,6 +48,11 @@ public class EventBuilder { private Event event; public EventBuilder(RealmModel realm, KeycloakSession session, ClientConnection clientConnection) { + this(realm, session); + ipAddress(clientConnection.getRemoteAddr()); + } + + public EventBuilder(RealmModel realm, KeycloakSession session) { this.realm = realm; event = new Event(); @@ -76,7 +81,6 @@ public class EventBuilder { .collect(Collectors.toList()); realm(realm); - ipAddress(clientConnection.getRemoteAddr()); } private EventBuilder(EventStoreProvider store, List listeners, RealmModel realm, Event event) {