Browse code

Chore: move LDAP/AD UserManagerImpl method to abstract UserManager class

Anthony Prades authored on 13/04/2018 15:53:23
Showing 3 changed files
... ...
@@ -49,7 +49,8 @@ public class UserManagerTest {
49 49
 		}
50 50
 
51 51
 		@Override
52
-		public void update(ItemValue<User> currentUser, MailFilter mailFilter) throws ServerFault {
52
+		public void update(ImportStatus importStatus, ItemValue<User> currentUser, MailFilter mailFilter)
53
+				throws ServerFault {
53 54
 		}
54 55
 	}
55 56
 
... ...
@@ -56,7 +56,26 @@ public abstract class UserManager extends EntityManager {
56 56
 		this.domainAliases = domainAliases;
57 57
 	}
58 58
 
59
-	public abstract void update(ItemValue<User> currentUser, MailFilter mailFilter) throws ServerFault;
59
+	public void update(ItemValue<User> currentUser, MailFilter mailFilter) throws ServerFault {
60
+		ImportStatus fakeImportStatus = new ImportStatus(new IScannerLogs() {
61
+			@Override
62
+			public void warn(Map<String, String> messages) {
63
+			}
64
+
65
+			@Override
66
+			public void info(Map<String, String> messages) {
67
+			}
68
+
69
+			@Override
70
+			public void error(Map<String, String> messages) {
71
+			}
72
+		});
73
+
74
+		update(fakeImportStatus, currentUser, mailFilter);
75
+	}
76
+
77
+	public abstract void update(ImportStatus importStatus, ItemValue<User> currentUser, MailFilter mailFilter)
78
+			throws ServerFault;
60 79
 
61 80
 	private static User getEmptyUser() {
62 81
 		User user = new User();
... ...
@@ -24,7 +24,6 @@ import java.util.Collections;
24 24
 import java.util.HashMap;
25 25
 import java.util.Iterator;
26 26
 import java.util.List;
27
-import java.util.Map;
28 27
 import java.util.Set;
29 28
 import java.util.regex.Pattern;
30 29
 
... ...
@@ -41,7 +40,6 @@ import net.bluemind.core.utils.UIDGenerator;
41 41
 import net.bluemind.domain.api.Domain;
42 42
 import net.bluemind.mailbox.api.MailFilter;
43 43
 import net.bluemind.mailbox.api.Mailbox.Routing;
44
-import net.bluemind.system.importation.commons.IScannerLogs;
45 44
 import net.bluemind.system.importation.commons.ImportStatus;
46 45
 import net.bluemind.system.importation.commons.UserManager;
47 46
 import net.bluemind.system.importation.tools.VCardHelper;
... ...
@@ -116,24 +114,6 @@ public class UserManagerImpl extends UserManager {
116 116
 	}
117 117
 
118 118
 	@Override
119
-	public void update(ItemValue<User> currentUser, MailFilter mailFilter) throws ServerFault {
120
-		ImportStatus fakeImportStatus = new ImportStatus(new IScannerLogs() {
121
-			@Override
122
-			public void warn(Map<String, String> messages) {
123
-			}
124
-
125
-			@Override
126
-			public void info(Map<String, String> messages) {
127
-			}
128
-
129
-			@Override
130
-			public void error(Map<String, String> messages) {
131
-			}
132
-		});
133
-
134
-		update(fakeImportStatus, currentUser, mailFilter);
135
-	}
136
-
137 119
 	public void update(ImportStatus importStatus, ItemValue<User> currentUser, MailFilter mailFilter)
138 120
 			throws ServerFault {
139 121
 		if (currentUser != null) {