From fcda005d88616a181ac86e6938873191f18cb435 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Tue, 28 Oct 2014 20:21:03 +0100 Subject: [PATCH] KEYCLOAK-772 Event settings are not imported --- .../keycloak/representations/idm/RealmRepresentation.java | 8 ++++---- .../org/keycloak/models/utils/RepresentationToModel.java | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java index 243479a7e4..3346371e48 100755 --- a/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java @@ -61,8 +61,8 @@ public class RealmRepresentation { protected String accountTheme; protected String adminTheme; protected String emailTheme; - protected boolean eventsEnabled; - protected long eventsExpiration; + protected Boolean eventsEnabled; + protected Long eventsExpiration; protected List eventsListeners; public String getId() { @@ -445,7 +445,7 @@ public class RealmRepresentation { this.failureFactor = failureFactor; } - public boolean isEventsEnabled() { + public Boolean isEventsEnabled() { return eventsEnabled; } @@ -453,7 +453,7 @@ public class RealmRepresentation { this.eventsEnabled = eventsEnabled; } - public long getEventsExpiration() { + public Long getEventsExpiration() { return eventsExpiration; } diff --git a/model/api/src/main/java/org/keycloak/models/utils/RepresentationToModel.java b/model/api/src/main/java/org/keycloak/models/utils/RepresentationToModel.java index 31e26c3609..961039505d 100755 --- a/model/api/src/main/java/org/keycloak/models/utils/RepresentationToModel.java +++ b/model/api/src/main/java/org/keycloak/models/utils/RepresentationToModel.java @@ -52,6 +52,9 @@ public class RepresentationToModel { if (rep.getQuickLoginCheckMilliSeconds() != null) newRealm.setQuickLoginCheckMilliSeconds(rep.getQuickLoginCheckMilliSeconds()); if (rep.getMaxDeltaTimeSeconds() != null) newRealm.setMaxDeltaTimeSeconds(rep.getMaxDeltaTimeSeconds()); if (rep.getFailureFactor() != null) newRealm.setFailureFactor(rep.getFailureFactor()); + if (rep.isEventsEnabled() != null) newRealm.setEventsEnabled(rep.isEventsEnabled()); + if (rep.getEventsExpiration() != null) newRealm.setEventsExpiration(rep.getEventsExpiration()); + if (rep.getEventsListeners() != null) newRealm.setEventsListeners(new HashSet(rep.getEventsListeners())); if (rep.getNotBefore() != null) newRealm.setNotBefore(rep.getNotBefore()); @@ -263,6 +266,9 @@ public class RepresentationToModel { if (rep.getAccountTheme() != null) realm.setAccountTheme(rep.getAccountTheme()); if (rep.getAdminTheme() != null) realm.setAdminTheme(rep.getAdminTheme()); if (rep.getEmailTheme() != null) realm.setEmailTheme(rep.getEmailTheme()); + if (rep.isEventsEnabled() != null) realm.setEventsEnabled(rep.isEventsEnabled()); + if (rep.getEventsExpiration() != null) realm.setEventsExpiration(rep.getEventsExpiration()); + if (rep.getEventsListeners() != null) realm.setEventsListeners(new HashSet(rep.getEventsListeners())); if (rep.getPasswordPolicy() != null) realm.setPasswordPolicy(new PasswordPolicy(rep.getPasswordPolicy()));