#16161 implement an EventBuilder constructor which can be called from scheduled tasks

This commit is contained in:
Vilmos Nagy 2022-12-22 17:45:37 +01:00 committed by Pedro Igor
parent 780cb815dc
commit 4b0562da38

View file

@ -48,6 +48,11 @@ public class EventBuilder {
private Event event; private Event event;
public EventBuilder(RealmModel realm, KeycloakSession session, ClientConnection clientConnection) { public EventBuilder(RealmModel realm, KeycloakSession session, ClientConnection clientConnection) {
this(realm, session);
ipAddress(clientConnection.getRemoteAddr());
}
public EventBuilder(RealmModel realm, KeycloakSession session) {
this.realm = realm; this.realm = realm;
event = new Event(); event = new Event();
@ -76,7 +81,6 @@ public class EventBuilder {
.collect(Collectors.toList()); .collect(Collectors.toList());
realm(realm); realm(realm);
ipAddress(clientConnection.getRemoteAddr());
} }
private EventBuilder(EventStoreProvider store, List<EventListenerProvider> listeners, RealmModel realm, Event event) { private EventBuilder(EventStoreProvider store, List<EventListenerProvider> listeners, RealmModel realm, Event event) {