keycloak-aplcache

Merge pull request #806 from stianst/master KEYCLOAK-772

10/28/2014 5:35:42 PM

Details

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 243479a..3346371 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<String> 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 31e26c3..9610395 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<String>(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<String>(rep.getEventsListeners()));
 
         if (rep.getPasswordPolicy() != null) realm.setPasswordPolicy(new PasswordPolicy(rep.getPasswordPolicy()));