Project

General

Profile

1
package eu.dnetlib.data.emailSender;
2

    
3
import eu.dnetlib.data.claims.entity.Claim;
4
import eu.dnetlib.data.claims.entity.Context;
5
import eu.dnetlib.data.claims.entity.Notification;
6
import eu.dnetlib.data.claims.entity.Project;
7
import eu.dnetlib.data.claims.handler.*;
8
import eu.dnetlib.data.claims.utils.ClaimUtils;
9
//import eu.dnetlib.data.claims.utils.CommunityUtils;
10
import eu.dnetlib.data.claims.sql.SQLStoreException;
11
import eu.dnetlib.data.claims.utils.ManagerUtils;
12
import org.apache.log4j.Logger;
13
import org.springframework.beans.factory.annotation.Autowired;
14

    
15
import javax.mail.*;
16
import javax.mail.internet.AddressException;
17
import javax.mail.internet.InternetAddress;
18
import javax.mail.internet.MimeMessage;
19
import java.text.SimpleDateFormat;
20
import java.util.*;
21

    
22
public class EmailSender implements Runnable {
23

    
24
    private static final Logger logger = Logger.getLogger(EmailSender.class);
25

    
26
    @Autowired
27
    private FetchClaimHandler fetchClaimHandler = null;
28
    @Autowired
29
    private FetchProjectHandler fetchProjectHandler = null;
30
    @Autowired
31
    private FetchNotificationHandler fetchNotificationHandler = null;
32
    @Autowired
33
    private NotificationHandler notificationHandler = null;
34
    @Autowired
35
    private FetchContextHandler fetchContextHandler = null;
36

    
37
    @Autowired
38
    private String defaultFrequencyInHours;
39

    
40
//    @Autowired
41
//    private CommunityUtils communityUtils;
42

    
43
    @Autowired
44
    private ManagerUtils managerUtils;
45

    
46
    private static String manageCommunityUserNotificationsPage;
47
    private static String openaireProjectClaimsPage;
48
    private static String openaireCommunityClaimsPage;
49
    private static String username;
50
    private static String password;
51
    private static String host;
52
    private static String port;
53
    private static String from;
54
    private static String auth;
55
    private static String sslProtocols;
56
    private static String contactMail;
57
    private static String specialRecipients;
58
    private static String enabledCommunities;
59
    private static boolean notifyCommunityManagers;
60
    private static boolean notifyProjectManagers;
61

    
62
    @Override
63
    public void run() {
64
        logger.info("EmailSender thread is running. " + host);
65
        logger.info("Special Recipients  " + specialRecipients);
66
        logger.info("Enabled Communities " + enabledCommunities);
67

    
68
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
69
        Date date = new Date();
70
        String dateTo = (format.format(date));
71
        if(notifyCommunityManagers){
72
            defaultEmails_For_CommunityClaims(dateTo, format);  // daily for managers not in notification table
73
            notificationEmails_For_CommunityClaims(dateTo, format);
74
        }
75
        if(notifyProjectManagers) {
76
//        defaultEmails_For_ProjectClaims(dateTo, format);    // daily for managers not in notification table
77
//        notificationEmails_For_ProjectClaims(dateTo, format);
78
        }
79
    }
80

    
81
    public void defaultEmails_For_ProjectClaims(String dateTo, SimpleDateFormat format) {
82
        Map<String, List<String>> managersOfProject = new HashMap<String, List<String>>();
83
        Project project;
84
        List<Claim> claims = null;
85
        List<String> types = new ArrayList<String>();
86

    
87
        types.add(ClaimUtils.PROJECT);
88

    
89
        Calendar calendar = Calendar.getInstance();
90
        calendar.add(Calendar.HOUR_OF_DAY, -(Integer.parseInt(defaultFrequencyInHours)-1));
91
        calendar.add(Calendar.MINUTE, -59);
92
        calendar.add(Calendar.SECOND, -59);
93
        Date date = calendar.getTime();
94
        String dateFrom=(format.format(date));
95

    
96
        logger.debug("Sending emails for project claims between " + dateFrom + " and "+dateTo);
97

    
98
        try {
99
            // Get all claims between dateFrom and dateTo which satisfy source_type == "project" or target_type == "project"
100
            claims = fetchClaimHandler.fetchClaimsByDate(dateFrom, dateTo, null, null, "", "source", true, types, false);
101
        } catch (SQLStoreException|Exception e) {
102
            logger.error("Could not fetch claims by date from "+dateFrom+" to "+dateTo, e);
103
        }
104

    
105
        for (Claim claim: claims) {
106
            if (claim.getSourceType().equals("project")) {
107
                project = (Project)claim.getSource();
108
            } else {
109
                project = (Project)claim.getTarget();
110
            }
111

    
112
            if (!managersOfProject.containsKey(project.getOpenaireId())) {
113

    
114
                // specialRecipients are used currently for testing purposes
115
                List<String> tmpManagers = null;
116
                if (specialRecipients != null && !specialRecipients.isEmpty()) {
117
                    tmpManagers = new ArrayList<>(Arrays.asList(specialRecipients.split("\\s*,\\s*")));
118
                    logger.debug("Special recipients: " + specialRecipients);
119

    
120
                    if(tmpManagers != null) {
121
                        Iterator itr = tmpManagers.iterator();
122
                        while (itr.hasNext()) {
123
                            String manager = (String) itr.next();
124
                            Notification notification = null;
125
                            try {
126
                                notification = fetchNotificationHandler.fetchNotification(project.getOpenaireId(), manager);
127
                            } catch (Exception e) {
128
                                e.printStackTrace();
129
                            } catch (SQLStoreException e) {
130
                                e.printStackTrace();
131
                            }
132
                            if (notification != null) {
133
                                itr.remove();
134
                            }
135
                        }
136
                    }
137

    
138
                    managersOfProject.put(project.getOpenaireId(), tmpManagers);
139
                }
140

    
141
                // Send emails to actual project managers instead of special recipients
142
                List<String> managers = null;
143
                try {
144
                    managers = fetchProjectHandler.fetchContactEmailsByProjectId(project.getOpenaireId());
145
                    logger.debug("All actual Managers of project " + project.getOpenaireId() + ": "+managers);
146

    
147
                    if(managers != null) {
148
                        Iterator itr = managers.iterator();
149
                        while (itr.hasNext()) {
150
                            String manager = (String) itr.next();
151
                            Notification notification = fetchNotificationHandler.fetchNotification(project.getOpenaireId(), manager);
152
                            //if (notification != null && (!notification.isNotify() || notification.getFrequency() != 24)) {
153
                            if (notification != null) {
154
                                itr.remove();
155
                            }
156
                        }
157
                    }
158
                } catch (Exception e) {
159
                    e.printStackTrace();
160
                } catch (SQLStoreException e) {
161
                    e.printStackTrace();
162
                }
163

    
164
                logger.debug("Managers of project (not in notification table) " + project.getOpenaireId() + ": "+managers);
165
                /*
166
                managersOfProject.put(project.getOpenaireId(), managers);
167
                */
168

    
169
                if (managersOfProject.get(project.getOpenaireId()) != null &&
170
                        !managersOfProject.get(project.getOpenaireId()).isEmpty()) {
171
                    send(project.getOpenaireId(), project.getName(), "project", managersOfProject.get(project.getOpenaireId()));
172
                }
173
            }
174
        }
175
    }
176

    
177
    public void defaultEmails_For_CommunityClaims(String dateTo, SimpleDateFormat format) {
178
        Map<String, List<String>> managersOfCommunity = new HashMap<String, List<String>>();
179
        Context context;
180
        List<Claim> claims = null;
181
        List<String> types = new ArrayList<String>();
182

    
183
        types.add(ClaimUtils.CONTEXT);
184

    
185
        Calendar calendar = Calendar.getInstance();
186
        calendar.add(Calendar.HOUR_OF_DAY, -(Integer.parseInt(defaultFrequencyInHours)-1));
187
        calendar.add(Calendar.MINUTE, -59);
188
        calendar.add(Calendar.SECOND, -59);
189
        Date date = calendar.getTime();
190
        String dateFrom=(format.format(date));
191

    
192
        List<String> enabledCommunitiesList = null;
193
        if (enabledCommunities != null && !enabledCommunities.isEmpty()) {
194
            enabledCommunitiesList = Arrays.asList(enabledCommunities.split("\\s*,\\s*"));
195
        }
196

    
197
        logger.debug("Sending emails for community claims between " + dateFrom + " and "+dateTo);
198

    
199
        try {
200
            // Get all claims between dateFrom and dateTo which satisfy source_type == "context" or target_type == "context"
201
            claims = fetchClaimHandler.fetchClaimsByDate(dateFrom, dateTo, null, null, "", "source", true, types, false);
202
        } catch (SQLStoreException|Exception e) {
203
            logger.error("Could not fetch claims by date from "+dateFrom+" to "+dateTo, e);
204
        }
205
        logger.debug(claims.size() + "new claims found");
206
        for (Claim claim: claims) {
207
            if (claim.getSourceType().equals("context")) {
208
                context = (Context)claim.getSource();
209
            } else {
210
                context = (Context)claim.getTarget();
211
            }
212

    
213
            String openaireId = context.getOpenaireId().split("::")[0];
214
            if (!managersOfCommunity.containsKey(openaireId) && (enabledCommunitiesList == null || enabledCommunitiesList.contains(openaireId))) {
215

    
216
                /*
217
                // specialRecipients are used currently for testing purposes
218
                List<String> tmpManagers = null;
219
                if (specialRecipients != null && !specialRecipients.isEmpty()) {
220
                    tmpManagers = Arrays.asList(specialRecipients.split("\\s*,\\s*"));
221
                    logger.debug("Special recipients: " + specialRecipients);
222
                    managersOfCommunity.put(openaireId, tmpManagers);
223
                }
224
                */
225

    
226

    
227
                // Send emails to actual project managers instead of special recipients
228
                List<String> managers = null;
229
                try {
230
                    //CommunityUtils communityInfo = this.communityUtils.getCommunityInfo(openaireId);
231
                    List<ManagerUtils> managerUtils = this.managerUtils.getManagersByEmail(openaireId);
232
                    //managers = communityInfo.getManagers();
233
                    if(managerUtils != null) {
234
                        for (ManagerUtils manager:managerUtils) {
235
                            String managerMail = manager.getEmail();
236
                            Notification notification = fetchNotificationHandler.fetchNotification(openaireId, managerMail);
237
                            if (notification == null)  {
238
                                if(managers == null) {
239
                                    managers = new ArrayList<>();
240
                                }
241
                                managers.add(managerMail);
242
                                logger.debug("Sending email to community manager: "+ managerMail);
243
                            }
244
                        }
245
                    }
246
                    else {
247
                        logger.debug("Community Managers: null");
248
                    }
249
                } catch (Exception e) {
250
                    logger.error(e);
251
                    e.printStackTrace();
252
                } catch (SQLStoreException e) {
253
                    e.printStackTrace();
254
                    logger.error(e);
255
                }
256

    
257
                logger.debug("Managers of community " + openaireId + ": "+managers);
258
                managersOfCommunity.put(openaireId, managers);
259

    
260

    
261
                if (managersOfCommunity.get(openaireId) != null &&
262
                        !managersOfCommunity.get(openaireId).isEmpty()) {
263
                    send(openaireId, context.getTitle().split(">")[0], "community", managersOfCommunity.get(openaireId));
264
                }
265
            } else if(enabledCommunitiesList != null && !enabledCommunitiesList.contains(openaireId)) {
266
                logger.debug("Community "+openaireId+" is not enabled");
267
            }
268
        }
269
    }
270

    
271
    public void notificationEmails_For_ProjectClaims(String dateTo, SimpleDateFormat format) {
272
        Project project = null;
273
        List<String> types = new ArrayList<String>();
274

    
275
        types.add(ClaimUtils.PROJECT);
276

    
277
        logger.debug("Sending email for project claims from notification table");
278

    
279
        try {
280
            List<Notification> trueNotifications = fetchNotificationHandler.fetchTrueNotifications();
281
            logger.debug(trueNotifications);
282
            if(trueNotifications != null) {
283
                for(Notification notification : trueNotifications) {
284
                    List<String> managers = fetchProjectHandler.fetchContactEmailsByProjectId(notification.getOpenaireId());
285
                    if(managers != null && managers.contains(notification.getUserMail())) {
286

    
287
                        Date _dateTo = format.parse(dateTo);
288

    
289
                        Date _last_interaction_date = notification.getDate();
290
                        Calendar cal = Calendar.getInstance();
291
                        cal.setTime(_last_interaction_date);
292
                        cal.add(Calendar.SECOND, 1);
293
                        _last_interaction_date = cal.getTime();
294

    
295
                        String last_interaction_date = (format.format(_last_interaction_date));
296

    
297
                        long diff = _dateTo.getTime() - notification.getDate().getTime();
298
                        diff = diff / 1000;
299

    
300
                        if (diff >= (notification.getFrequency() * 3600)) {
301
                            if (fetchClaimHandler.fetchNumberOfClaimsByDateAndOpenaireId(last_interaction_date, dateTo, notification.getOpenaireId(), null, null, "", null, true, types, false) > 0) {
302
                                List<String> managersByNotification = new ArrayList<>();
303
                                managersByNotification.add(notification.getUserMail());
304

    
305
                                project = fetchProjectHandler.fetchProjectById(notification.getOpenaireId());
306

    
307
                                logger.debug("Sending email for project claims between " + last_interaction_date + " and " + dateTo + " to " + notification.getUserMail());
308

    
309
                                send(project.getOpenaireId(), project.getName(), "project", managersByNotification);
310
                            }
311

    
312
                            notificationHandler.updateNotificationLastInteractionDate(notification.getOpenaireId(), notification.getUserMail(), _dateTo);
313
                        }
314
                    } else {
315
                        logger.debug("managers do not contain "+notification.getUserMail());
316
                    }
317
                }
318
            } else {
319
                logger.debug("true notifications: null");
320
            }
321
        } catch (Exception e) {
322
            e.printStackTrace();
323
        } catch (SQLStoreException e) {
324
            e.printStackTrace();
325
        }
326
    }
327

    
328
    public void notificationEmails_For_CommunityClaims(String dateTo, SimpleDateFormat format) {
329
        Context context = null;
330
        List<String> types = new ArrayList<String>();
331

    
332
        types.add(ClaimUtils.CONTEXT);
333

    
334
        List<String> enabledCommunitiesList = null;
335
        if (enabledCommunities != null && !enabledCommunities.isEmpty()) {
336
            enabledCommunitiesList = Arrays.asList(enabledCommunities.split("\\s*,\\s*"));
337
        }
338

    
339
        logger.debug("Sending email for community claims from notification table");
340

    
341
        try {
342
            List<Notification> trueNotifications = fetchNotificationHandler.fetchTrueNotifications();
343

    
344
            Map<String, List<String>> allManagers = new HashMap<>();
345

    
346
            if(trueNotifications != null) {
347
                for(Notification notification : trueNotifications) {
348
                    if (enabledCommunitiesList == null || enabledCommunitiesList.contains(notification.getOpenaireId())) {
349

    
350
                        if(!allManagers.containsKey(notification.getOpenaireId())) {
351
                            allManagers.put(notification.getOpenaireId(), new ArrayList());
352

    
353
//                        CommunityUtils communityInfo = this.communityUtils.getCommunityInfo(notification.getOpenaireId());
354
                            List<ManagerUtils> managerUtils = this.managerUtils.getManagersByEmail(notification.getOpenaireId());
355

    
356
//                        List<String> managers = null;
357
                            if (managerUtils != null) {
358
                                for (ManagerUtils manager : managerUtils) {
359
                                    allManagers.get(notification.getOpenaireId()).add(manager.getEmail());
360
                                }
361
                            }
362
                        }
363

    
364

    
365
//                        if (managers != null && managers.contains(notification.getUserMail())) {
366
                        if(allManagers.get(notification.getOpenaireId()).contains(notification.getUserMail())) {
367
                            Date _dateTo = format.parse(dateTo);
368

    
369
                            Date _last_interaction_date = notification.getDate();
370
                            Calendar cal = Calendar.getInstance();
371
                            cal.setTime(_last_interaction_date);
372
                            cal.add(Calendar.SECOND, 1);
373
                            _last_interaction_date = cal.getTime();
374

    
375
                            String last_interaction_date = (format.format(_last_interaction_date));
376
                            long diff = _dateTo.getTime() - notification.getDate().getTime();
377
                            diff = diff / 1000;
378

    
379
                            if (diff >= (notification.getFrequency() * 3600)) {
380
                                if (fetchClaimHandler.fetchNumberOfClaimsByDateAndOpenaireId(last_interaction_date, dateTo, notification.getOpenaireId(), null, null, "", null, true, types, false) > 0) {
381
                                    List<String> managersByNotification = new ArrayList<>();
382
                                    managersByNotification.add(notification.getUserMail());
383

    
384
                                    // We need that to get name of community
385
                                    context = fetchContextHandler.fetchFirstContextByCommunityId(notification.getOpenaireId());
386

    
387
                                    logger.debug("Sending email for community claims between " + last_interaction_date + " and " + dateTo + " to " + notification.getUserMail());
388

    
389
                                    send(context.getOpenaireId().split("::")[0], context.getTitle().split(">")[0], "community", managersByNotification);
390
                                }
391

    
392
                                notificationHandler.updateNotificationLastInteractionDate(notification.getOpenaireId(), notification.getUserMail(), _dateTo);
393
                            } else {
394
                                logger.debug("[no notification] User "+notification.getUserMail()+" got latest notification at "+last_interaction_date+" and has set frequency to: "+notification.getFrequency());
395
                            }
396
                        } else {
397
                            logger.debug("User "+notification.getUserMail()+" is not manager of community "+notification.getOpenaireId());
398
                        }
399
                    } else {
400
                        logger.debug("Community "+notification.getOpenaireId()+" is not enabled");
401
                    }
402
                }
403
            }
404
        } catch (Exception e) {
405
            e.printStackTrace();
406
        } catch (SQLStoreException e) {
407
            e.printStackTrace();
408
        }
409
    }
410

    
411
    public void send(String openaire_id, String openaire_name, String type, List<String> managers) {
412
        logger.debug("Sending email");
413
        String openaireClaimsPageUrl = "";
414
        String manageUserNotificationsPage = "";
415
        String messageContent = "";
416
        String subject = "";
417

    
418
        if(type.equals("project")) {
419
            openaireClaimsPageUrl = openaireProjectClaimsPage + openaire_id;
420

    
421
            subject = "[OpenAIRE] Links notification";
422
            messageContent = "There are new Claims for: '" + openaire_name +"' project for which you seem to be a contact person." +
423
                    "<br>Click <a href=\""+openaireClaimsPageUrl+"\">here</a> to curate these Claims.";
424
        } else if(type.equals("community")) {
425
            openaireClaimsPageUrl = openaireCommunityClaimsPage.replace("{community}", openaire_id);
426

    
427
            manageUserNotificationsPage = manageCommunityUserNotificationsPage.replace("{community}", openaire_id);
428

    
429
            subject = "[OpenAIRE-Connect] "+openaire_name+": Links notification";
430
            messageContent =
431
                    " <div style=\"font-size:14px;\">" +
432
                    "    <p>" +
433
                    "       There are new links for '"+openaire_name+"' community. Click  <a href=\""+openaireClaimsPageUrl+"\">here</a> to view the links.\n" +
434
                    "    </p>" +
435
                    "    <p>OpenAIRE team<br/>" +
436
                    "       <a href=\"https://www.openaire.eu\">www.openaire.eu</a>" +
437
                    "    </p>" +
438
                    "    <p style=\"font-size:11px;\">You are receiving this e-mail as manager of the community  <a href=\"https://"+openaire_id+".openaire.eu\">"+openaire_name+"</a>." +
439
                    "    If you are not responsible for this community, please <a href=\"mailto:"+contactMail+"\">contact us</a>." +
440
                    "    <br/>" +
441
                    "    Click  <a href=\""+manageUserNotificationsPage+"\">here</a> to manage your notification settings. </p>" +
442
                    "    </div>"
443
                    ;
444
        }
445

    
446
        //logger.debug(messageContent);
447

    
448
        // Get system properties
449
        Properties properties = System.getProperties();
450
        properties.setProperty("mail.smtp.host", host);
451
        properties.put("mail.smtp.port", port);
452
        properties.put("mail.smtp.auth", auth); //enable authentication
453
        properties.put("mail.smtp.starttls.enable", "true");
454
        if(sslProtocols != null) {
455
            properties.put("mail.smtp.ssl.protocols", sslProtocols);
456
        }
457
        Session session = Session.getInstance(properties,
458
            new javax.mail.Authenticator() {
459
                protected PasswordAuthentication getPasswordAuthentication() {
460
                    return new PasswordAuthentication(username, password);
461
                }
462
            });
463

    
464
        try {
465
            // Create a default MimeMessage object.
466
            MimeMessage message = new MimeMessage(session);
467

    
468
            // Set From: header field of the header.
469
            message.setFrom(new InternetAddress(from));
470

    
471
            // Set To: header field of the header.
472
            for(String to : managers) {
473
                logger.debug(to);
474
                message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
475
            }
476
            message.addRecipient(Message.RecipientType.BCC, new InternetAddress("openaire.test@gmail.com"));
477

    
478
            // Set Subject: header field
479
            message.setSubject(subject);
480

    
481
            // For simple text setText() can be used instead of setContent()
482

    
483
            // Send the actual HTML message, as big as you like
484
            message.setContent(messageContent, "text/html");
485

    
486
            // Send message
487
            Transport.send(message);
488
            logger.debug("Sent message successfully....\n");
489

    
490
        } catch (AddressException ae) {
491
            logger.error("Email could not be send.", ae);
492

    
493
        } catch (MessagingException me) {
494
            logger.error("Email could not be send.", me);
495
        }
496
    }
497

    
498
    public void setFetchClaimHandler(FetchClaimHandler fetchClaimHandler) {
499
        this.fetchClaimHandler = fetchClaimHandler;
500
    }
501

    
502
    public void setFetchProjectHandler(FetchProjectHandler fetchProjectHandler) {
503
        this.fetchProjectHandler = fetchProjectHandler;
504
    }
505

    
506
    public void setFetchNotificationHandler(FetchNotificationHandler fetchNotificationHandler) {
507
        this.fetchNotificationHandler = fetchNotificationHandler;
508
    }
509

    
510
    public void setNotificationHandler(NotificationHandler notificationHandler) {
511
        this.notificationHandler = notificationHandler;
512
    }
513

    
514
    public void setFetchContextHandler(FetchContextHandler fetchContextHandler) {
515
        this.fetchContextHandler = fetchContextHandler;
516
    }
517

    
518
    public void setOpenaireProjectClaimsPage(String openaireProjectClaimsPage) {
519
        EmailSender.openaireProjectClaimsPage = openaireProjectClaimsPage;
520
    }
521

    
522
    public void setOpenaireCommunityClaimsPage(String openaireCommunityClaimsPage) {
523
        EmailSender.openaireCommunityClaimsPage = openaireCommunityClaimsPage;
524
    }
525

    
526
    public void setManageCommunityUserNotificationsPage(String manageCommunityUserNotificationsPage) {
527
        EmailSender.manageCommunityUserNotificationsPage = manageCommunityUserNotificationsPage;
528
    }
529

    
530
    public void setUsername(String username) {
531
        EmailSender.username = username;
532
    }
533

    
534
    public void setPassword(String password) {
535
        EmailSender.password = password;
536
    }
537

    
538
    public void setHost(String host) {
539
        EmailSender.host = host;
540
    }
541

    
542
    public void setPort(String port) {
543
        EmailSender.port = port;
544
    }
545

    
546
    public void setFrom(String from) {
547
        EmailSender.from = from;
548
    }
549

    
550
    public void setAuth(String auth) {
551
        EmailSender.auth = auth;
552
    }
553

    
554
    public void setContactMail(String contactMail) { EmailSender.contactMail = contactMail; }
555

    
556
    public void setSpecialRecipients(String specialRecipients) {
557
        EmailSender.specialRecipients = specialRecipients;
558
    }
559

    
560
    public void setDefaultFrequencyInHours(String defaultFrequencyInHours) {
561
        this.defaultFrequencyInHours = defaultFrequencyInHours;
562
    }
563

    
564
    public void setEnabledCommunities(String enabledCommunities) {
565
        EmailSender.enabledCommunities = enabledCommunities;
566
    }
567

    
568
    public static boolean isNotifyCommunityManagers() {
569
        return notifyCommunityManagers;
570
    }
571

    
572
    public static void setNotifyCommunityManagers(boolean notifyCommunityManagers) {
573
        EmailSender.notifyCommunityManagers = notifyCommunityManagers;
574
    }
575

    
576
    public static boolean isNotifyProjectManagers() {
577
        return notifyProjectManagers;
578
    }
579

    
580
    public static void setNotifyProjectManagers(boolean notifyProjectManagers) {
581
        EmailSender.notifyProjectManagers = notifyProjectManagers;
582
    }
583

    
584
//    public void setCommunityUtils(CommunityUtils communityUtils) {
585
//        this.communityUtils = communityUtils;
586
//    }
587
//
588
//    public CommunityUtils getCommunityUtils() {
589
//        return communityUtils;
590
//    }
591

    
592

    
593
    public ManagerUtils getManagerUtils() {
594
        return managerUtils;
595
    }
596

    
597
    public void setManagerUtils(ManagerUtils managerUtils) {
598
        this.managerUtils = managerUtils;
599
    }
600

    
601
    public static String getSslProtocols() {
602
        return sslProtocols;
603
    }
604

    
605
    public static void setSslProtocols(String sslProtocols) {
606
        EmailSender.sslProtocols = sslProtocols;
607
    }
608
}
(2-2/2)