Browse code

Fix: update dirEventProducer.changed everywhere

qvigand authored on 11/06/2018 14:37:06
Showing 4 changed files
... ...
@@ -134,7 +134,7 @@ public class GroupService implements IGroup {
134 134
 			gh.onGroupCreated(new GroupMessage(iv(uid, group), securityContext, groupContainer));
135 135
 		}
136 136
 
137
-		dirEventProducer.changed(uid);
137
+		dirEventProducer.changed(uid, storeService.getVersion());
138 138
 	}
139 139
 
140 140
 	ItemValue<Group> iv(String uid, Group g) {
... ...
@@ -173,7 +173,7 @@ public class GroupService implements IGroup {
173 173
 			gh.onGroupUpdated(new GroupMessage(iv(uid, previous), securityContext, groupContainer),
174 174
 					new GroupMessage(iv(uid, group), securityContext, groupContainer));
175 175
 		}
176
-		dirEventProducer.changed(uid);
176
+		dirEventProducer.changed(uid, storeService.getVersion());
177 177
 	}
178 178
 
179 179
 	@Override
... ...
@@ -186,7 +186,7 @@ public class GroupService implements IGroup {
186 186
 		}
187 187
 
188 188
 		storeService.update(uid, previousItemValue.value);
189
-		dirEventProducer.changed(uid);
189
+		dirEventProducer.changed(uid, storeService.getVersion());
190 190
 	}
191 191
 
192 192
 	@Override
... ...
@@ -247,7 +247,7 @@ public class GroupService implements IGroup {
247 247
 
248 248
 		storeService.delete(uid);
249 249
 
250
-		dirEventProducer.changed(uid);
250
+		dirEventProducer.changed(uid, storeService.getVersion());
251 251
 		for (IGroupHook gh : groupsHooks) {
252 252
 			gh.onGroupDeleted(new GroupMessage(iv(uid, previous), securityContext, groupContainer));
253 253
 		}
... ...
@@ -298,7 +298,7 @@ public class GroupService implements IGroup {
298 298
 			gh.onAddMembers(new GroupMessage(iv(uid, group.value), securityContext, groupContainer, members));
299 299
 		}
300 300
 
301
-		dirEventProducer.changed(uid);
301
+		dirEventProducer.changed(uid, storeService.getVersion());
302 302
 	}
303 303
 
304 304
 	private void checkCanManageGroupMembers(ItemValue<Group> group, List<Member> members) {
... ...
@@ -417,7 +417,7 @@ public class GroupService implements IGroup {
417 417
 		for (IGroupHook uh : groupsHooks) {
418 418
 			uh.onRemoveMembers(new GroupMessage(iv(uid, group.value), securityContext, groupContainer, members));
419 419
 		}
420
-		dirEventProducer.changed(uid);
420
+		dirEventProducer.changed(uid, storeService.getVersion());
421 421
 	}
422 422
 
423 423
 	@Override
... ...
@@ -522,7 +522,7 @@ public class GroupService implements IGroup {
522 522
 			throw new ServerFault("group " + uid + " not found in domain " + domainUid, ErrorCode.NOT_FOUND);
523 523
 		}
524 524
 		storeService.setExtId(uid, extId);
525
-		dirEventProducer.changed(uid);
525
+		dirEventProducer.changed(uid, storeService.getVersion());
526 526
 	}
527 527
 
528 528
 }
... ...
@@ -92,7 +92,7 @@ public class MailshareService implements IMailshare {
92 92
 		for (IMailshareHook h : hooks) {
93 93
 			h.onCreate(context, uid, mailshare, domainUid);
94 94
 		}
95
-		dirEventProducer.changed(uid);
95
+		dirEventProducer.changed(uid, storeService.getVersion());
96 96
 	}
97 97
 
98 98
 	@Override
... ...
@@ -123,7 +123,7 @@ public class MailshareService implements IMailshare {
123 123
 		for (IMailshareHook h : hooks) {
124 124
 			h.onUpdate(context, uid, mailshare, domainUid);
125 125
 		}
126
-		dirEventProducer.changed(uid);
126
+		dirEventProducer.changed(uid, storeService.getVersion());
127 127
 	}
128 128
 
129 129
 	@Override
... ...
@@ -159,7 +159,7 @@ public class MailshareService implements IMailshare {
159 159
 		for (IMailshareHook h : hooks) {
160 160
 			h.onDelete(context, uid, domainUid);
161 161
 		}
162
-		dirEventProducer.changed(uid);
162
+		dirEventProducer.changed(uid, storeService.getVersion());
163 163
 	}
164 164
 
165 165
 	@Override
... ...
@@ -175,7 +175,7 @@ public class MailshareService implements IMailshare {
175 175
 		byte[] asPng = ImageUtils.checkAndSanitize(photo);
176 176
 		byte[] icon = ImageUtils.resize(asPng, 22, 22);
177 177
 		storeService.setPhoto(uid, asPng, icon);
178
-		dirEventProducer.changed(uid);
178
+		dirEventProducer.changed(uid, storeService.getVersion());
179 179
 	}
180 180
 
181 181
 	@Override
... ...
@@ -188,7 +188,7 @@ public class MailshareService implements IMailshare {
188 188
 		}
189 189
 
190 190
 		storeService.deletePhoto(uid);
191
-		dirEventProducer.changed(uid);
191
+		dirEventProducer.changed(uid, storeService.getVersion());
192 192
 	}
193 193
 
194 194
 	@Override
... ...
@@ -133,7 +133,7 @@ public class ResourcesService implements IResources {
133 133
 		context.su().provider().instance(IContainerManagement.class, fbContainerUid)
134 134
 				.setAccessControlList(Arrays.asList(AccessControlEntry.create(domainUid, Verb.Read)));
135 135
 		context.su().provider().instance(IFreebusyMgmt.class, fbContainerUid).add(calContainerDescriptor.uid);
136
-		dirEventProducer.changed(uid);
136
+		dirEventProducer.changed(uid, storeService.getVersion());
137 137
 	}
138 138
 
139 139
 	private MailFilter discardRule() {
... ...
@@ -191,7 +191,7 @@ public class ResourcesService implements IResources {
191 191
 		IContainerManagement container = context.su().provider().instance(IContainerManagement.class,
192 192
 				CalendarContainerType.TYPE + ":" + uid);
193 193
 		container.update(descriptor);
194
-		dirEventProducer.changed(uid);
194
+		dirEventProducer.changed(uid, storeService.getVersion());
195 195
 	}
196 196
 
197 197
 	@Override
... ...
@@ -243,7 +243,7 @@ public class ResourcesService implements IResources {
243 243
 		}
244 244
 		mailboxes.deleted(uid, mailboxAdapter.asMailbox(domainUid, uid, previous.value));
245 245
 		storeService.delete(uid);
246
-		dirEventProducer.changed(uid);
246
+		dirEventProducer.changed(uid, storeService.getVersion());
247 247
 	}
248 248
 
249 249
 	@Override
... ...
@@ -302,7 +302,7 @@ public class ResourcesService implements IResources {
302 302
 
303 303
 		byte[] png = ImageUtils.checkAndSanitize(icon);
304 304
 		storeService.setPhoto(uid, icon, png);
305
-		dirEventProducer.changed(uid);
305
+		dirEventProducer.changed(uid, storeService.getVersion());
306 306
 	}
307 307
 
308 308
 	@Override
... ...
@@ -728,7 +728,7 @@ public class UserService implements IUserServerApi {
728 728
 		byte[] asPng = ImageUtils.checkAndSanitize(photo);
729 729
 		byte[] icon = ImageUtils.resize(asPng, 22, 22);
730 730
 		storeService.setPhoto(uid, asPng, icon);
731
-		eventProducer.changed(uid);
731
+		eventProducer.changed(uid, storeService.getVersion());
732 732
 	}
733 733
 
734 734
 	@Override
... ...
@@ -741,7 +741,7 @@ public class UserService implements IUserServerApi {
741 741
 		}
742 742
 
743 743
 		storeService.deletePhoto(uid);
744
-		eventProducer.changed(uid);
744
+		eventProducer.changed(uid, storeService.getVersion());
745 745
 	}
746 746
 
747 747
 	@Override
... ...
@@ -796,8 +796,8 @@ public class UserService implements IUserServerApi {
796 796
 	}
797 797
 
798 798
 	/**
799
-	 * If not <code>repair</code>, use {@link IDirEntryMaintenance#check(Set)}
800
-	 * If <code>repair</code>, use {@link IDirEntryMaintenance#repair(Set)}
799
+	 * If not <code>repair</code>, use {@link IDirEntryMaintenance#check(Set)} If
800
+	 * <code>repair</code>, use {@link IDirEntryMaintenance#repair(Set)}
801 801
 	 * 
802 802
 	 * <pre>
803 803
 	 * <code>
... ...
@@ -857,7 +857,7 @@ public class UserService implements IUserServerApi {
857 857
 		validator.create(userVCard);
858 858
 		previous.value.contactInfos = userVCard;
859 859
 		storeService.updateVCard(uid, userVCard);
860
-		eventProducer.changed(uid);
860
+		eventProducer.changed(uid, storeService.getVersion());
861 861
 	}
862 862
 
863 863
 	@Override
... ...
@@ -891,7 +891,7 @@ public class UserService implements IUserServerApi {
891 891
 			throw new ServerFault("user " + uid + " not found in domain " + domainName, ErrorCode.NOT_FOUND);
892 892
 		}
893 893
 		storeService.setExtId(uid, extId);
894
-		eventProducer.changed(uid);
894
+		eventProducer.changed(uid, storeService.getVersion());
895 895
 	}
896 896
 
897 897
 	@Override
... ...
@@ -900,7 +900,7 @@ public class UserService implements IUserServerApi {
900 900
 
901 901
 		if (accountType != null) {
902 902
 			DirEntryHandlers.byKind(DirEntry.Kind.USER).updateAccountType(bmContext, domainName, uid, accountType);
903
-			eventProducer.changed(uid);
903
+			eventProducer.changed(uid, storeService.getVersion());
904 904
 		}
905 905
 	}
906 906