1 package com.pentila.entSavoie.userPurge;
3 import java.util.ArrayList;
7 import javax.naming.Binding;
8 import javax.naming.NamingEnumeration;
9 import javax.naming.NamingException;
10 import javax.naming.directory.Attributes;
11 import javax.naming.directory.SearchControls;
12 import javax.naming.directory.SearchResult;
14 import com.liferay.portal.kernel.dao.orm.QueryUtil;
15 import com.liferay.portal.kernel.exception.SystemException;
16 import com.liferay.portal.kernel.log.Log;
17 import com.liferay.portal.kernel.log.LogFactoryUtil;
18 import com.liferay.portal.kernel.util.PropsKeys;
19 import com.liferay.portal.model.Organization;
20 import com.liferay.portal.model.User;
21 import com.liferay.portal.security.ldap.PortalLDAPUtil;
22 import com.liferay.portal.service.CompanyLocalServiceUtil;
23 import com.liferay.portal.service.UserLocalServiceUtil;
24 import com.liferay.portal.util.PrefsPropsUtil;
25 import com.liferay.portlet.documentlibrary.folder.service.DLFolderLocalServiceUtil;
26 import com.liferay.portlet.documentlibrary.model.DLFileEntry;
27 import com.liferay.portlet.documentlibrary.model.DLFolder;
28 import com.liferay.portlet.documentlibrary.model.DLFolderConstants;
29 import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil;
30 import com.pentila.entSavoie.cahierDeTexte.model.EventCDT;
31 import com.pentila.entSavoie.cahierDeTexte.model.EventSTSRef;
32 import com.pentila.entSavoie.cahierDeTexte.service.EventCDTLocalServiceUtil;
33 import com.pentila.entSavoie.cahierDeTexte.service.EventSTSRefLocalServiceUtil;
34 import com.pentila.entSavoie.cartable.model.DlLink;
35 import com.pentila.entSavoie.cartable.service.CasierEntryLocalServiceUtil;
36 import com.pentila.entSavoie.cartable.service.DlLinkLocalServiceUtil;
37 import com.pentila.entSavoie.casier.Constants;
38 import com.pentila.entSavoie.directory.OrganizationFinderServiceUtil;
39 import com.pentila.entSavoie.gestionMenus.model.PronoteLink;
40 import com.pentila.entSavoie.gestionMenus.service.PronoteLinkLocalServiceUtil;
41 import com.pentila.entSavoie.internalMessaging.model.InternalFolderMessage;
42 import com.pentila.entSavoie.internalMessaging.model.InternalMessage;
43 import com.pentila.entSavoie.internalMessaging.service.InternalFolderMessageLocalServiceUtil;
44 import com.pentila.entSavoie.internalMessaging.service.InternalMessageLocalServiceUtil;
45 import com.pentila.entSavoie.userManagement.service.LDAPMappingLocalServiceUtil;
46 import com.pentila.entSavoie.userProperties.model.UserContact;
47 import com.pentila.entSavoie.userProperties.service.NotifyConfigLocalServiceUtil;
48 import com.pentila.entSavoie.userProperties.service.UserContactLocalServiceUtil;
49 import com.pentila.entSavoie.userProperties.service.UserMailSynchronisationLocalServiceUtil;
50 import com.pentila.entSavoie.userProperties.service.UserPropertiesLocalServiceUtil;
51 import com.pentila.entSavoie.userProperties.service.UserRelationshipLocalServiceUtil;
53 public class UserPurgeImpl {
55 private static Log logger = LogFactoryUtil.getLog(UserPurgeImpl.class);
58 * Purges all expired users in LDAP (ENTValidAccount = 2)
59 * @return the list of purged userIds
61 public static List<Long> purgeExpiredUsers (long companyId) {
63 logger.info("Start purgeExpiredUsers");
64 List<Long> purgedUserList = new ArrayList<Long>();
66 // Fetch users in LDAP with ENTPersonJointure = 2
67 SearchControls cons = new SearchControls(SearchControls.SUBTREE_SCOPE, 0, 0, null, false, false);
68 long todayDate = getTodayDate();
69 String invalidUsersToDeleteSearchFilter = "(ENTValidAccount=2)";
71 NamingEnumeration<SearchResult> invalidUsersEnum = null;
72 String usersBaseDN = "";
74 usersBaseDN = "ou=people,"+PrefsPropsUtil.getString(companyId, PropsKeys.LDAP_BASE_DN);
75 } catch (SystemException e) {
76 logger.error("Could not get the users base dn or the user filter");
79 if (usersBaseDN.equals("")) {
80 logger.error("Could not get the users base dn or the user filter");
84 invalidUsersEnum = PortalLDAPUtil.doContextSearch(companyId, usersBaseDN, invalidUsersToDeleteSearchFilter, cons);
85 } catch (Exception e) {
87 logger.info("Could not perform the LDAP context search for invalid users.");
91 if (invalidUsersEnum == null) {
92 logger.info("Could not perform the LDAP context search for invalid users.");
97 while (invalidUsersEnum.hasMoreElements()) {
99 logger.info("Processing user deletion number "+count);
101 SearchResult result = invalidUsersEnum.nextElement();
102 if (result == null) {
105 Attributes attrs = result.getAttributes();
107 logger.info("No attributes for this user, skipping ...");
111 // Get ENTExpireAccount value
112 String entExpireAccount = getAttributeValue(attrs, "ENTExpireAccount");
113 if (entExpireAccount == null) {
114 logger.info("entExpireAccount cannot be fetched => skipping ...");
117 long expireDate = Integer.parseInt(entExpireAccount);
120 String uid = getAttributeValue(attrs, "uid");
122 logger.info("uid cannot be fetched => skipping ...");
127 // String userDn = "";
129 // userDn = PrefsPropsUtil.getString(companyId, PropsKeys.LDAP_USERS_DN);
130 // } catch (SystemException e1) {
131 // logger.info("Could not get ldap.users.dn variable in portal-ext.properties");
132 // e1.printStackTrace();
135 String dn = "uid="+uid+","+usersBaseDN;
136 logger.info("Deleting user with dn = "+dn);
138 // Get ENTPersonLogin attribute
139 String entPersonLogin = getAttributeValue(attrs, "ENTPersonLogin");
140 if (entPersonLogin == null) {
141 logger.info("Could not get ENTPersonLogin attribute in result.");
145 // Manage inconsistent state of users marked for deletion but with an expiration date in the future
146 if (expireDate > todayDate) {
147 logger.info("Error with dn "+dn+" (login="+entPersonLogin+") with ENTValidAccount=2 but ENTExpireAccount > today : "+entExpireAccount);
151 // Run the deletion in LDAP
153 PortalLDAPUtil.delete(companyId, dn);
154 logger.info("User with dn="+dn+" deleted in LDAP.");
155 } catch (Exception e) {
157 logger.error("Failed to delete dn "+dn+" in LDAP");
163 user = UserLocalServiceUtil.getUserByScreenName(companyId, entPersonLogin);
164 } catch (Exception e) {
165 logger.info("Could not find userId for entPersonLogin "+entPersonLogin);
169 long userId = user.getUserId();
171 // The deletion in DB
172 purgeUserInDB(userId);
173 logger.info("User with dn="+dn+" deleted in DB.");
175 purgedUserList.add(userId);
177 logger.info("Could not find userId for entPersonLogin "+entPersonLogin);
181 logger.info("END user purge : deleted "+count+ " users");
182 return purgedUserList;
187 * Get the attribute value from the list of attributes
189 * @param attributeName
192 private static String getAttributeValue(Attributes attrs, String attributeName) {
195 if (attrs.get(attributeName) != null && attrs.get(attributeName).get() != null) {
196 res = attrs.get(attributeName).get().toString();
198 } catch (NamingException e1) {
199 logger.debug("Could not get "+attributeName+" attribute");
200 e1.printStackTrace();
207 * Returns the today date (in number of days since 01/01/1970)
210 private static long getTodayDate() {
211 Date today = new Date();
212 return today.getTime() / 86400000;
217 * Deletes the user in the LDAP
221 public static boolean purgeUserInLDAP (long companyId, String screenName) {
223 logger.info("Cleaning user login "+screenName+" in LDAP...");
226 Binding b = PortalLDAPUtil.getUser(companyId, screenName);
228 logger.error("Binding is null");
231 String[] attrs2fetch = {"uid"};
232 Attributes attrs = PortalLDAPUtil.doContextAttributes(companyId, PortalLDAPUtil.getNameInNamespace(companyId, b), attrs2fetch);
234 String uid = getAttributeValue(attrs, "uid");
239 userDn = PrefsPropsUtil.getString(companyId, PropsKeys.LDAP_USERS_DN);
240 } catch (SystemException e) {
241 logger.info("Could not get ldap.users.dn variable in portal-ext.properties");
244 dn = "uid="+uid+","+userDn;
246 } catch(Exception e){
252 logger.error("Could not get dn from the screenName in LDAP");
257 logger.info("About to delete user in LDAP with dn = "+dn);
258 PortalLDAPUtil.delete(companyId, dn);
259 } catch (Exception e) {
261 logger.error("Failed to delete dn "+dn);
264 logger.info("Deleted user login "+screenName+" in LDAP (dn="+dn+")");
270 * Cleans up all data related to a given userId (both DB and LDAP)
273 public static boolean purgeUserInDB(long userId) {
275 logger.info("Cleaning up user id "+userId+" in DB ...");
278 // 1. Cleaning messaging
279 cleanupMessaging(userId);
281 // 2. Cleaning DLFileEntries
282 cleanupDLFileEntries(userId);
283 //cleanupDLFolders(userId);
285 // 3. Cleaning CDT events
286 cleanupCDTEvents(userId);
288 // 4. Cleanup notify config
289 cleanupNotifyConfig(userId);
291 // 5. Cleanup user mail synchronisation
292 cleanupMailSynchronisation(userId);
294 // 6. Cleanup user properties
295 cleanupUserProperties(userId);
297 // 7. Cleanup user relationships
298 cleanupUserRelationships(userId);
300 // 8. Cleanup dropbox entries
301 cleanupDropboxEntries(userId);
303 // 9. Cleanup LDAPMapping
304 cleanupLDAPMapping(userId);
306 // 10. Cleanup user contact
307 cleanupUserContact(userId);
309 // 10. Cleanup Pronote links
310 cleanupPronoteLinks(userId);
313 logger.info("Deleting user itself in DB ...");
315 UserLocalServiceUtil.deleteUser(userId);
316 } catch (Exception e) {
317 logger.error("Could not delete user of user id "+userId);
321 printUserReport(userId);
326 * Clean up internal messaging for userId
329 private static void cleanupMessaging(long userId) {
331 logger.info("Cleaning internal messages for user "+userId+" ...");
335 user = UserLocalServiceUtil.getUser(userId);
336 } catch (Exception e1) {
337 logger.error("Could not find user with userId = "+userId);
341 if (user == null || user.getGroup() == null) {
342 logger.error("UserId "+userId+" has no group associated.");
345 } catch (Exception e) {
349 // Get SENDING BOX dlfolder
350 DLFolder sendingBox = null;
352 sendingBox = DLFolderLocalServiceUtil.getFolder(user.getGroup().getGroupId(), DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, Constants.SENDING_BOX_FOLDER_NAME);
353 } catch (Exception exc) {
354 logger.error("Could not get sending box for user "+userId);
357 if (sendingBox == null) {
358 logger.error("Could not get sending box for user "+userId);
361 logger.info("Sending box folderid is "+sendingBox.getFolderId());
363 List<InternalFolderMessage> folderMessageList;
365 folderMessageList = InternalFolderMessageLocalServiceUtil.getUserFolderMessages(userId);
366 if (folderMessageList != null) {
368 // Loop over user's folders
369 for (InternalFolderMessage folder : folderMessageList) {
370 logger.debug("Folder name = "+folder.getFolderName()+", id="+folder.getFolderMessageId());
374 // Delete messages + internal receivers + attached files + attached files folders
376 List<InternalMessage> messageList = InternalMessageLocalServiceUtil.getMessagesByFolder(folder.getFolderMessageId(), userId);
377 if (messageList != null) {
378 for (InternalMessage message : messageList) {
380 if (message.getFolderMessageId() == sendingBox.getFolderId()) {
381 logger.info("Do not delete message "+message.getMessageId()+" because in user's sending box");
385 InternalMessageLocalServiceUtil.deleteMessageAndDependencies(message);
386 logger.debug("Deleted message id "+message.getMessageId()+ "(subject="+message.getMessageSubject()+")");
387 userNbMessagesSuccess++;
388 } catch (Exception e) {
389 userNbMessagesError++;
394 } catch (Exception e) {
395 logger.info("Error : could not get all messages by folderId "+folder.getFolderMessageId());
399 } catch (SystemException e) {
407 * Clean up DL file entries for given userId
410 private static void cleanupDLFolders(long userId) {
412 logger.info("Cleaning up DLFolders for user id "+userId+" ...");
414 User user = getUser(userId);
417 List<DLFolder> dlFolderList = DLFolderLocalServiceUtil.getFolders(user.getGroupId(), 0, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
418 for (DLFolder dlFolder : dlFolderList) {
419 if (dlFolder.getName().equals(Constants.DROP_BOX_FOLDER_NAME) || dlFolder.getName().equals(Constants.SCHOOL_BAG_FOLDER_NAME)) {
420 logger.info("Deleting folder "+dlFolder.getName());
421 DLFolderLocalServiceUtil.deleteFolder(dlFolder.getFolderId());
424 } catch (Exception e) {
425 logger.error("Unable to get user's DLFolders", e);
431 * Clean up DL file entries for given userId
434 private static void cleanupDLFileEntries(long userId) {
436 logger.info("Cleaning up DLFileEntries for user id "+userId+" ...");
438 User user = getUser(userId);
440 // Get DL entries for the user
441 List<DLFileEntry> fileList = new ArrayList<DLFileEntry>();
443 fileList = DLFileEntryLocalServiceUtil.getGroupFileEntries(user.getGroup().getGroupId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS);
444 } catch (Exception e) {
445 logger.error("Could not get group file entries for userId "+userId);
449 if (fileList == null) {
450 logger.error("Could not get group file entries for userId "+userId);
454 // Get SENDING BOX and IM_BOX dlfolders
455 // Because we do not want to delete sent files and internalmessage PJfolders
456 DLFolder sendingBox = null;
457 DLFolder imBox = null;
459 sendingBox = DLFolderLocalServiceUtil.getFolder(user.getGroup().getGroupId(), DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, Constants.SENDING_BOX_FOLDER_NAME);
460 imBox = DLFolderLocalServiceUtil.getFolder(user.getGroup().getGroupId(), DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, Constants.IM_BOX_FOLDER_NAME);
461 } catch (Exception exc) {
462 logger.error("Could not get sending box or im box for user "+userId);
465 // Loop over DL files
466 for (DLFileEntry dlFile : fileList) {
467 logger.info("Deleting DLFileEntry "+dlFile.getTitle()+" (id="+dlFile.getFileEntryId()+", folderId="+dlFile.getFolderId()+")");
469 // If file is in user's sending box => do not delete it
470 if (sendingBox != null && dlFile.getFolderId() == sendingBox.getFolderId()) {
471 logger.info("This file "+dlFile.getFileEntryId()+" is in the user's sending box => do not delete it");
472 userNbSourceLinkDLFiles++;
476 // If file is in a PJ folder that is in user's im box => do not delete it
477 DLFolder fileFolder = null;
479 fileFolder = DLFolderLocalServiceUtil.getDLFolder(dlFile.getFolderId());
480 } catch (Exception e) {
482 if (fileFolder != null && imBox != null && fileFolder.getParentFolderId() == imBox.getFolderId()) {
483 logger.info("This file "+dlFile.getFileEntryId()+" is in the user's im box => do not delete it");
484 userNbSourceLinkDLFiles++;
488 // If this file is a source link => do not delete
490 List<DlLink> dlSourceLinkList = DlLinkLocalServiceUtil.getDlFileLinkBySourceId(dlFile.getFileEntryId());
491 if (dlSourceLinkList != null && !dlSourceLinkList.isEmpty()) {
492 logger.info("Do not delete file id "+dlFile.getFileEntryId()+" because it is a source link for "+dlSourceLinkList.size()+" targets.");
493 userNbSourceLinkDLFiles++;
496 logger.info("No source link for dl file entry "+dlFile.getFileEntryId()+".");
498 } catch (SystemException e) {
499 logger.error("Could not get source link for dlFileEntry "+dlFile.getFileEntryId());
502 // If this file is a target link => delete the link and delete the file
503 DlLink dlTargetLink = null;
505 dlTargetLink = DlLinkLocalServiceUtil.getDlFileLinkByTarget(dlFile.getFileEntryId());
506 DlLinkLocalServiceUtil.deleteDlLink(dlTargetLink);
507 logger.info("Deleting target link");
508 userNbTargetLinkDLFiles++;
509 } catch (Exception e) {
512 // Delete the file itself in both DB and File System
514 DLFileEntryLocalServiceUtil.deleteDLFileEntry(dlFile);
515 logger.info("Deleted file entry "+dlFile.getFileEntryId()+" in DB and FS OK");
516 } catch (SystemException e) {
517 logger.error("Could not delete dlFileEntry "+dlFile.getFileEntryId());
518 userNbDLFilesError++;
529 * Clean up CDT events for given userId
532 private static void cleanupCDTEvents(long userId) {
534 logger.info("Cleaning up CDT events for user id "+userId+" ...");
535 List<EventCDT> eventCDTList = EventCDTLocalServiceUtil.getEventCDTbyCreator(userId);
536 if (eventCDTList != null) {
537 for (EventCDT event : eventCDTList) {
539 EventCDTLocalServiceUtil.deleteAttachFilesToEventCDT(userId, event.getEvtId());
540 } catch (Exception e) {
541 logger.error("Could not delete attach files of event id "+event.getEvtId());
544 EventCDTLocalServiceUtil.deleteEvent(event); // Also delete the index
545 userNbEventsSuccess++;
546 } catch (Exception e) {
547 logger.error("Could not delete event id "+event.getEvtId());
555 user = UserLocalServiceUtil.getUser(userId);
557 Organization etabRattachement = OrganizationFinderServiceUtil.getEtabRatachement(user);
558 if (etabRattachement != null) {
559 List<EventSTSRef> eventSTSRefList = EventSTSRefLocalServiceUtil.getEventSTSRefByEtabIdUserId(etabRattachement.getOrganizationId(), userId);
560 for (EventSTSRef eventSTS : eventSTSRefList) {
562 EventSTSRefLocalServiceUtil.deleteEventSTSRef(eventSTS);
563 userNbEventsSuccess++;
564 } catch (Exception e) {
565 logger.error("Could not delete eventSTSRefs");
571 } catch (Exception e) {
572 logger.error("Could not delete eventSTSRefs");
578 * Clean up notify configuration for given userId
581 private static void cleanupNotifyConfig(long userId) {
583 logger.info("Cleaning notify configuration ...");
585 NotifyConfigLocalServiceUtil.deleteNotifyConfigByUser(userId);
586 } catch (Exception e) {
587 logger.error("Could not delete the notify configuration for user id "+userId);
593 * Clean up mail synchronization data for given userId
596 private static void cleanupMailSynchronisation(long userId) {
598 logger.info("Cleaning mail sychronisation ...");
600 UserMailSynchronisationLocalServiceUtil.deleteUserMailSynchronisation(userId);
601 } catch (Exception e) {
602 logger.error("Could not delete the mail synchronisation for user id "+userId);
608 * Clean up user properties for given userId
611 private static void cleanupUserProperties(long userId) {
613 logger.info("Cleaning user properties ...");
615 UserPropertiesLocalServiceUtil.deleteUserPropertiesByUserId(userId);
616 } catch (Exception e) {
617 logger.error("Could not delete user properties for userid "+userId);
623 * Clean up user relationships for given userId
626 private static void cleanupUserRelationships(long userId) {
628 logger.info("Cleaning user relationships ...");
630 UserRelationshipLocalServiceUtil.deleteByFromUserId(userId);
631 userNbRelationshipsSuccess++;
632 } catch (Exception e) {
633 logger.error("Could not delete relationship with user id "+userId);
634 userNbRelationshipsError++;
637 UserRelationshipLocalServiceUtil.deleteByToUserId(userId);
638 userNbRelationshipsSuccess++;
639 } catch (Exception e) {
640 logger.error("Could not delete relationship with user id "+userId);
641 userNbRelationshipsError++;
648 * Clean up DL user groups for given userId
651 private static void cleanupDropboxEntries(long userId) {
653 logger.info("Cleaning user dropbox entries ...");
657 companyId = CompanyLocalServiceUtil.getCompanies().get(0).getCompanyId();
658 } catch (SystemException e) {
659 logger.error("Failed to get the companyId");
664 CasierEntryLocalServiceUtil.deleteByGroupId(companyId, getUser(userId).getGroup().getGroupId());
665 } catch (Exception e) {
666 logger.error("Failed to delete dropbox entries");
672 private static User getUser(long userId) {
675 user = UserLocalServiceUtil.getUser(userId);
676 } catch (Exception e1) {
677 logger.error("Could not find user with userId = "+userId);
681 if (user == null || user.getGroup() == null) {
682 logger.error("UserId "+userId+" has no group associated.");
685 } catch (Exception e) {
692 private static void cleanupLDAPMapping(long userId) {
694 logger.info("Cleaning user LDAP Mapping ...");
696 LDAPMappingLocalServiceUtil.deleteLDAPMapping(userId);
697 } catch (Exception e) {
698 logger.error("Failed to delete LDAPMapping");
703 private static void cleanupUserContact(long userId) {
705 logger.info("Cleaning user contact infos ...");
707 UserContact userContact = UserContactLocalServiceUtil.getUserContactByUserId(userId);
708 UserContactLocalServiceUtil.deleteUserContact(userContact);
709 } catch (Exception e) {
710 logger.error("Failed to delete user contact infos");
715 private static void cleanupPronoteLinks(long userId) {
717 logger.info("Cleaning user pronote links ...");
719 List<PronoteLink> pronoteLinks = PronoteLinkLocalServiceUtil.getUserPronoteLinks(userId);
720 if (pronoteLinks != null) {
721 for (PronoteLink pronoteLink : pronoteLinks) {
722 PronoteLinkLocalServiceUtil.deletePronoteLink(pronoteLink);
725 } catch (Exception e) {
726 logger.error("Failed to delete user pronote links");
731 // private static void initFileOutput() {
733 // FileWriter fw = new FileWriter(DEFAULT_OUTPUT_FILE_PATH+"_"+new SimpleDateFormat("yyyyMMdd-HHmmss").format(new Date())+".txt", true);
734 // output = new BufferedWriter(fw);
736 // } catch (IOException e) {
737 // logger.error("Could not open write buffer.");
738 // e.printStackTrace();
744 // * Write a file path to output file (contains all file paths to delete further)
746 // private static void writeFileOutput(String filePath) {
748 // output.write(filePath+"\n");
750 // } catch (IOException e) {
751 // logger.error("Could not write data into output file: "+filePath);
752 // e.printStackTrace();
758 * Prints a report for a given user
760 private static void printUserReport(long userId) {
762 StringBuilder str = new StringBuilder();
763 str.append("============================\n");
764 str.append("USER CLEANUP REPORT\n\n");
765 str.append("Cleanup for user "+userId+"\n");
766 str.append(" - "+userNbMessagesSuccess+" internal messages deleted\n");
767 str.append(" - "+userNbDLFilesSuccess+" DL files marked for deletion\n");
768 str.append(" - "+userNbTargetLinkDLFiles+" DL links deleted\n");
769 str.append(" - "+userNbEventsSuccess+" CDT events deleted\n");
770 str.append(" - "+userNbRelationshipsSuccess+" relationships deleted\n");
772 str.append("Errors:");
773 if (userNbMessagesError > 0) {
774 str.append(" - "+userNbMessagesError+" internal messages not deleted\n");
776 if (userNbDLFilesError > 0) {
777 str.append(" - "+userNbDLFilesError+" DL files not deleted\n");
779 if (userNbSourceLinkDLFiles > 0) {
780 str.append(" - "+userNbSourceLinkDLFiles+" DL files not deleted because source links\n");
782 if (userNbEventsError > 0) {
783 str.append(" - "+userNbEventsError+" CDT events not deleted\n");
785 if (userNbRelationshipsError > 0) {
786 str.append(" - "+userNbRelationshipsError+" relationships not deleted\n");
789 str.append("============================\n");
791 String userReport = str.toString();
792 logger.info("\n"+userReport);
797 * Initiates all counts related to a given user
799 private static void initUserCounts() {
800 userNbMessagesSuccess = 0;
801 userNbMessagesError = 0;
802 userNbDLFilesSuccess = 0;
803 userNbDLFilesError = 0;
804 userNbSourceLinkDLFiles = 0;
805 userNbTargetLinkDLFiles = 0;
806 userNbEventsSuccess = 0;
807 userNbEventsError = 0;
808 userNbRelationshipsSuccess = 0;
809 userNbRelationshipsError = 0;
813 private static int userNbMessagesSuccess;
814 private static int userNbMessagesError;
817 private static int userNbDLFilesSuccess;
818 private static int userNbDLFilesError;
819 private static int userNbSourceLinkDLFiles;
820 private static int userNbTargetLinkDLFiles;
823 private static int userNbEventsSuccess;
824 private static int userNbEventsError;
827 private static int userNbRelationshipsSuccess;
828 private static int userNbRelationshipsError;