246e97b918b00a4848cfbfb0b8094cd2804138c1
[portal/sdk.git] /
1 /*
2  * ============LICENSE_START==========================================
3  * ONAP Portal SDK
4  * ===================================================================
5  * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6  * ===================================================================
7  *
8  * Unless otherwise specified, all software contained herein is licensed
9  * under the Apache License, Version 2.0 (the “License”);
10  * you may not use this software except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *             http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Unless otherwise specified, all documentation contained herein is licensed
22  * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
23  * you may not use this documentation except in compliance with the License.
24  * You may obtain a copy of the License at
25  *
26  *             https://creativecommons.org/licenses/by/4.0/
27  *
28  * Unless required by applicable law or agreed to in writing, documentation
29  * distributed under the License is distributed on an "AS IS" BASIS,
30  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31  * See the License for the specific language governing permissions and
32  * limitations under the License.
33  *
34  * ============LICENSE_END============================================
35  *
36  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
37  */
38 package org.onap.portalsdk.analytics.scheduler;
39
40 import java.math.BigDecimal;
41 import java.sql.Connection;
42 import java.sql.ResultSet;
43 import java.sql.SQLException;
44 import java.sql.Statement;
45 import java.text.SimpleDateFormat;
46 import java.util.Calendar;
47 import java.util.Date;
48 import java.util.UUID;
49
50 import org.onap.portalsdk.analytics.error.RaptorException;
51 import org.onap.portalsdk.analytics.error.ReportSQLException;
52 import org.onap.portalsdk.analytics.scheduler.SchedulerUtil.Executor;
53 import org.onap.portalsdk.analytics.system.Globals;
54 import org.onap.portalsdk.analytics.util.Log;
55
56 public class SendNotifications {
57         
58         SchedulerUtil schedulerUtil;
59         public SendEmail sendEmail;
60         
61         public SendNotifications() throws Exception {
62                 schedulerUtil = new SchedulerUtil();
63                 sendEmail = new SendEmail();
64                 sendEmail.setSchedulerUtil(schedulerUtil);
65                 init();
66         }
67
68                 
69         public  void deInit() throws SQLException {
70                 schedulerUtil.closeConnection();
71         }
72         
73         public  void init() throws SQLException, ReportSQLException {
74                 schedulerUtil.init();
75         }
76         
77         public void send_notification(String p_mail_server, String p_sender, String p_system_name, String p_system_url, int connectionTimeout) throws RaptorException, Exception {
78
79                 System.out.println(p_mail_server + " " + p_sender + " " + p_system_name + " " + p_system_url);
80                 int p_time_interval = Globals.getSchedulerInterval();
81                 int v_num_recs = 0;
82                 String v_gen_key;
83                 BigDecimal v_id = null;
84                 String v_url;
85                 String v_r_action = "report.download.pdf";
86                 String v_email_msg;
87                 String v_formfields;
88                 // String error_m;
89                 // int transfer_timeout_limit = 1800;
90                 // boolean v_attach_email_yn = true;
91                 int v_schedule_id;
92                 Date v_touch_date;
93                 // Exception for_rec;
94
95                 Connection conn = schedulerUtil.getConnection();
96                 Statement stat = conn.createStatement();
97                 
98                 String CNotificationsql = 
99                                 /*
100                                 "SELECT x.rep_id, x.schedule_id, x.conditional_yn, x.condition_large_sql, x.notify_type, x.max_row, x.initial_formfields, x.processed_formfields, r.title, x.user_id "
101                                 + "FROM ("
102                                         + "SELECT rs.rep_id, rs.schedule_id, rs.sched_user_id user_id, rs.conditional_yn, rs.condition_large_sql, "
103                                         + "rs.notify_type, rs.max_row, rs.initial_formfields, rs.processed_formfields "
104                                         + "FROM cr_report_schedule rs "
105                                         + "WHERE rs.enabled_yn='Y' "
106                                         + "AND rs.start_"
107                                         + "date <= sysdate "
108                                         + "AND  (rs.end_date >= sysdate or rs.end_date is null ) "
109                                         + "AND rs.run_date IS NOT NULL "
110                                         + ") x, cr_report r "
111                                 + "WHERE x.rep_id = r.rep_id ";
112                                  */
113                 
114                 Globals.getAvailableSchedules().replace("[currentDate]", Globals.getCurrentDateString());
115                                 
116                 
117                 ResultSet rs = stat.executeQuery(CNotificationsql);
118
119                 while (rs.next()) {
120                         
121                         v_schedule_id = rs.getInt("schedule_id");
122                         int offset = get_report_sched_offset(rs.getInt("rep_id"), v_schedule_id);
123                         
124                         if(offset >= p_time_interval) continue;
125
126                         
127                         v_touch_date = (Date) schedulerUtil.getSingleResult("select touch_date from cr_report_email_sent_log where schedule_id = " + v_schedule_id + " and log_id = (select max(log_id) from cr_report_email_sent_log where schedule_id = " + v_schedule_id + ")", "touch_date");
128                         if (v_touch_date != null) {
129                                 if (Math.abs(System.currentTimeMillis() - v_touch_date.getTime()) /1000 < (p_time_interval - 1)) {
130                                         return;
131                                 }
132                         }
133
134                         if ("Y".equals(rs.getString("conditional_yn"))) {
135
136                                 v_num_recs = (Integer) schedulerUtil.getSingleResult("select count(*) count from (" + rs.getString("condition_large_sql") + " )", "count");
137                         }
138
139                         if (v_num_recs > 0 || "N".equals(rs.getString("conditional_yn"))) {
140
141                                 v_gen_key = ("Z" + UUID.randomUUID()).toString().substring(0,24); // 25 character string
142                                 Object sequenceId = schedulerUtil.getSingleResult(Globals.getSequenceNextVal().replace("[sequenceName]", "seq_email_sent_log_id"), "id");
143                                 
144                                 if(sequenceId instanceof Long)
145                                         v_id = new BigDecimal((Long)sequenceId);
146                                 else if(sequenceId instanceof BigDecimal)
147                                         v_id = (BigDecimal)sequenceId;
148                                 
149                                 schedulerUtil.insertOrUpdate("insert into cr_report_email_sent_log (log_id, gen_key, schedule_id, rep_id, user_id, touch_date) values (" + v_id + ",'" + v_gen_key + "'," + rs.getInt("schedule_id") + "," + rs.getInt("rep_id") + "," + rs.getInt("user_id") + ", " + Globals.getCurrentDateString() + " )");
150
151                                 int notify_type = rs.getInt("notify_type");
152                                 if (notify_type == 4)
153                                         v_r_action = "report.download";
154                                 else if (notify_type == 2)
155                                         v_r_action = "report.download.pdf";
156                                 else if (notify_type == 3)
157                                         v_r_action = "report.csv.download";
158                                 else if (notify_type == 5)
159                                         v_r_action = "report.download.excel2007";
160                                 else if (notify_type == 6)
161                                         v_r_action = "download.all";
162
163                                 if (rs.getObject("processed_formfields") != null)
164                                         v_formfields = modify_formfields(v_schedule_id, rs.getString("processed_formFields"));
165                                 else
166                                         v_formfields = strip_formfields(v_schedule_id, rs.getString("initial_formfields"));
167
168                                 v_url = p_system_url + "&r_action=" + v_r_action + "&log_id=" + v_id + "&user_id=" + rs.getString("user_id") + "&pdfAttachmentKey=" + v_gen_key + "&download_limit=" + rs.getInt("max_row") + v_formfields;
169
170                                 boolean v_attach_email_yn = shouldSendAttachmentInEmail(v_schedule_id);
171
172                                 v_email_msg = "<html><body><p><b><u><i>" + p_system_name + " System Notification</i></u></b></p>" + "<p>Report <b>" + rs.getString("title") + "</b> is available for viewing.</p><p>You can view the report if it is attached. </br>"
173                                                 + "If it is not attached, or you have problem to open it, you can log into Business Direct and run the report.</p>" + "</body></html>";
174
175                                 if (rs.getInt("notify_type") != 6) {
176
177                                         sendEmail.sendEmail(p_mail_server, p_sender, p_system_name + " System Notification: Report " + rs.getString("title") + " generated", v_email_msg, v_url, rs.getInt("notify_type"), v_schedule_id, p_time_interval, v_attach_email_yn,connectionTimeout);
178
179                                 } else {
180
181                                         // may not necessary
182                                         schedulerUtil.insertOrUpdate("insert into cr_schedule_activity_log (SCHEDULE_ID, url, notes, run_time) values  (" + v_schedule_id + ",'" + v_url + "'," + "'Success: http request began.', " + Globals.getCurrentDateString() + " )");
183                                         schedulerUtil.insertOrUpdate("insert into cr_schedule_activity_log (SCHEDULE_ID, url, notes, run_time) values  (" + v_schedule_id + ",'" + v_url + "'," + "'Success: http response recieved. Code  resp.status_code '' desc '' resp.reason_phrase', " + Globals.getCurrentDateString() + " )");
184
185                                 }
186                                 
187                                 schedulerUtil.insertOrUpdate("update cr_report_schedule set run_date = " + Globals.getCurrentDateString() +" where schedule_id=" + v_schedule_id);
188                                 
189                                 schedulerUtil.insertOrUpdate("update cr_report_email_sent_log set sent_date= " + Globals.getCurrentDateString() +" , access_flag='N' where log_id=" + v_id);
190                                 schedulerUtil.insertOrUpdate("insert into cr_schedule_activity_log (SCHEDULE_ID, url, notes, run_time) values (" + v_schedule_id + ",'" + v_url + "','Success: Email Sent', " + Globals.getCurrentDateString() + " )");
191
192                         }
193
194                 }
195
196                    if(rs!=null) 
197                                 rs.close();
198                    if(stat!=null)
199                         stat.close();
200                 //conn.close();
201
202         }
203
204         private boolean shouldSendAttachmentInEmail(int v_schedule_id) throws SQLException, ReportSQLException {
205
206                 String l_boolean = (String) schedulerUtil.getSingleResult("SELECT ATTACHMENT_YN from cr_report_schedule where schedule_id  = " + v_schedule_id, "ATTACHMENT_YN");
207                 if ("Y".equals(l_boolean))
208                         return true;
209                 return false;
210         }
211
212         private String strip_formfields(int v_schedule_id, String p_formfields) throws SQLException, ReportSQLException {
213
214                 String v_formfields_insert = "";
215                 String v_formfields_generate = "";
216                 String v_name = "";
217                 String v_value = "";
218                 
219                 
220                 String[] column_values = schedulerUtil.cr_dissecturl(p_formfields, "&");
221                 
222                 for(String column_value : column_values){
223                         if(column_value == null || column_value.isEmpty())
224                                 continue;
225                         
226                         v_name = column_value.substring(0, column_value.indexOf('='));
227                         v_formfields_insert += column_value + "&";
228                         v_value = column_value.substring(column_value.indexOf('=') + 1);
229                         if (column_value.indexOf("_auto") > 0) {
230                                 v_formfields_generate = v_formfields_generate + v_name.substring(0, v_name.indexOf("_auto")) + "=" + v_value + "&";
231                         } else {
232                                 v_formfields_generate = v_formfields_generate + column_value + "&";
233                         }
234                 }
235                 
236                 schedulerUtil.insertOrUpdate("update CR_REPORT_SCHEDULE set processed_formfields ='" + v_formfields_insert + "' where schedule_id = " + v_schedule_id);
237
238                 return v_formfields_generate.substring(0, v_formfields_generate.length());
239
240         }
241
242         private String modify_formfields(int v_schedule_id, String p_formfields) throws SQLException, ReportSQLException {
243
244                 class Result {
245
246                         String v_formfields_insert = "";
247                         String v_formfields_generate = "";
248                         String v_name = "";
249                         String v_value = "";
250                         Date v_date;
251                         String v_hour = "";
252                         String v_hour_value = "";
253                 }
254
255                 final Result result = new Result();
256
257                 final String v_recurrence = (String) schedulerUtil.getSingleResult("select recurrence from cr_report_schedule where schedule_id = " + v_schedule_id, "recurrence");
258
259                 String[] column_values = schedulerUtil.cr_dissecturl(p_formfields, "&");
260                 
261                 for(String column_value : column_values){
262                         if (column_value == null)
263                                 column_value = "";
264
265                         if ("MONTHLY".equals(v_recurrence)) {
266                                 if (column_value.indexOf("_auto") > 0) {
267                                         result.v_name = column_value.substring(0, column_value.indexOf('='));
268                                         result.v_date = schedulerUtil.to_date(column_value.substring(column_value.indexOf('=') + 1), "mm/dd/yyyy");
269                                         result.v_value = schedulerUtil.add_months(result.v_date, 1).toString();
270
271                                         if (result.v_name.length() > 0) {
272                                                 result.v_formfields_insert = result.v_formfields_insert + result.v_name + "=" + result.v_value + "&";
273                                                 result.v_formfields_generate = result.v_formfields_generate + result.v_name.substring(0, result.v_name.indexOf("_auto")) + "=" + result.v_value + "&";
274                                         }
275                                 } else {
276                                         result.v_formfields_insert = result.v_formfields_insert + column_value + "&";
277                                         result.v_formfields_generate = result.v_formfields_generate + column_value + "&";
278                                 }
279
280                         } else if ("DAILY".equals(v_recurrence)) {
281                                 if (column_value.indexOf("_auto") > 0) {
282                                         result.v_name = column_value.substring(0, column_value.indexOf('='));
283                                         result.v_date = schedulerUtil.to_date(column_value.substring(column_value.indexOf('=') + 1), "mm/dd/yyyy");
284                                         result.v_value = schedulerUtil.add_months(result.v_date, 1).toString();
285
286                                         if (result.v_name.length() > 0) {
287                                                 result.v_formfields_insert = result.v_formfields_insert + result.v_name + "=" + result.v_value + "&";
288                                                 result.v_formfields_generate = result.v_formfields_generate + result.v_name.substring(0, result.v_name.indexOf("_auto")) + "=" + result.v_value + "&";
289                                         }
290                                 } else {
291                                         result.v_formfields_insert = result.v_formfields_insert + column_value + "&";
292                                         result.v_formfields_generate = result.v_formfields_generate + column_value + "&";
293                                 }
294
295                         } else if ("DAILY_MO_FR".equals(v_recurrence)) {
296                                 if (column_value.indexOf("_auto") > 0) {
297                                         result.v_name = column_value.substring(0, column_value.indexOf('='));
298                                         result.v_date = schedulerUtil.to_date(column_value.substring(column_value.indexOf('=') + 1), "mm/dd/yyyy");
299                                         SimpleDateFormat sdf = new SimpleDateFormat("EEE");
300                                         sdf.format(result.v_date);
301                                         if ("FRI".equals(result.v_date.toString())) {
302                                                 result.v_date = schedulerUtil.add_days(result.v_date, 3);
303                                         } else if ("SAT".equals(result.v_date.toString())) {
304                                                 result.v_date = schedulerUtil.add_days(result.v_date, 2);
305                                         } else {
306                                                 result.v_date = schedulerUtil.add_days(result.v_date, 1);
307                                         }
308                                         result.v_value = result.v_date.toString();
309                                         if (result.v_name.length() > 0) {
310                                                 result.v_formfields_insert = result.v_formfields_insert + result.v_name + "=" + result.v_value + "&";
311                                                 result.v_formfields_generate = result.v_formfields_generate + result.v_name.substring(0, result.v_name.indexOf("_auto")) + "=" + result.v_value + "&";
312                                         }
313
314                                 } else {
315                                         result.v_formfields_insert = result.v_formfields_insert + column_value + "&";
316                                         result.v_formfields_generate = result.v_formfields_generate + column_value + "&";
317                                 }
318
319                         } else if ("HOURLY".equals(v_recurrence)) {
320                                 
321                                 result.v_name = column_value.indexOf('=')>0?column_value.substring(0, column_value.indexOf('=')) : "";
322                                 if (column_value.indexOf("_auto") > 0) {
323                                         
324                                         
325                                         String[] column_values2 = schedulerUtil.cr_dissecturl(p_formfields, "&");
326                                         
327                                         for(String column_value2 : column_values2){
328                                                 
329                                                 String key = column_value2.substring(0, column_value2.indexOf("="));
330                                                 if(key.equals(result.v_name.substring(0, result.v_name.indexOf("_auto")))  || key.equals(result.v_name.substring(0, result.v_name.indexOf("_Hr")))){
331                                                         result.v_hour = column_value2;
332                                                 }
333                                         }
334                                         
335 //                                      schedulerUtil.getAndExecute("select c.column_value from table(CR_DISSECTURL(p_formfields)) c where substr(c.column_value, 1, instr(c.column_value, '=')-1) = substr(" + result.v_name + ",1,instr(" + result.v_name + ",'_auto')-1)||'_Hr'", new Executor() {
336 //
337 //                                              @Override
338 //                                              public void execute(ResultSet rs) throws SQLException {
339 //
340 //                                                      result.v_hour = rs.getString("column_value");
341 //                                              }
342 //
343 //                                      });
344
345                                         if (result.v_hour.length() > 0) {
346                                                 result.v_hour_value = result.v_hour.substring(result.v_hour.indexOf('=') + 1);
347                                         }
348
349                                         result.v_date = schedulerUtil.to_date(column_value.substring(column_value.indexOf('=') + 1) + " " + result.v_hour_value, "mm/dd/yyyy HH24:MI:SS");
350
351                                         result.v_value = schedulerUtil.to_date_str(schedulerUtil.add_hours(result.v_date, 1), "mm/dd/yyyy HH24");
352
353                                         if (result.v_name.length() > 0) {
354                                                 if (result.v_hour.length() > 0) {
355
356                                                         result.v_formfields_insert = result.v_formfields_insert + result.v_name + "=" + result.v_value.substring(0, 10) + "&" + result.v_name.substring(0, result.v_name.indexOf("_auto")) + "_Hr=" + result.v_value.substring(11, 13);
357                                                         result.v_formfields_generate = result.v_formfields_generate + result.v_name.substring(0, result.v_name.indexOf("_auto")) + "=" + result.v_value.substring(0, 10) + "&" + result.v_name.substring(0, result.v_name.indexOf("_auto")) + "_Hr="
358                                                                         + result.v_value.substring(11, 13) + "&";
359
360                                                 } else {
361                                                         result.v_formfields_insert = result.v_formfields_insert + result.v_name + "=" + result.v_value + "&";
362                                                         result.v_formfields_generate = result.v_formfields_generate + result.v_name.substring(0, result.v_name.indexOf("_auto")) + "=" + result.v_value + "&";
363                                                 }
364                                         }
365                                 }
366                                 if (column_value.indexOf("_Hr") <= 0) {
367                                         result.v_formfields_insert = result.v_formfields_insert + column_value + "&";
368                                         result.v_formfields_generate = result.v_formfields_generate + column_value + "&";
369                                 }
370                         } else if ("WEEKLY".equals(v_recurrence)) {
371
372                                 if (column_value.indexOf("_auto") > 0) {
373                                         result.v_name = column_value.substring(0, column_value.indexOf('='));
374                                         result.v_date = schedulerUtil.to_date(column_value.substring(column_value.indexOf('=') + 1), "mm/dd/yyyy");
375                                         result.v_value = schedulerUtil.add_days(result.v_date, 7).toString();
376
377                                         if (result.v_name.length() > 0) {
378                                                 result.v_formfields_insert = result.v_formfields_insert + result.v_name + "=" + result.v_value + "&";
379                                                 result.v_formfields_generate = result.v_formfields_generate + result.v_name.substring(0, result.v_name.indexOf("_auto")) + "=" + result.v_value + "&";
380                                         }
381
382                                 } else {
383                                         result.v_formfields_insert = result.v_formfields_insert + column_value + "&";
384                                         result.v_formfields_generate = result.v_formfields_generate + column_value + "&";
385                                 }
386
387                         } else {
388                                 if (column_value.indexOf("_auto") > 0) {
389                                         result.v_name = column_value.substring(0, column_value.indexOf('='));
390                                         result.v_date = schedulerUtil.to_date(column_value.substring(column_value.indexOf('=') + 1), "mm/dd/yyyy");
391                                         result.v_value = schedulerUtil.add_days(result.v_date, 7).toString();
392                                         if (result.v_name.length() > 0) {
393                                                 result.v_formfields_insert = result.v_formfields_insert + result.v_name + "=" + result.v_value + "&";
394                                                 result.v_formfields_generate = result.v_formfields_generate + result.v_name.substring(0, result.v_name.indexOf("_auto")) + "=" + result.v_value + "&";
395                                         }
396
397                                 } else {
398                                         result.v_formfields_insert = result.v_formfields_insert + column_value + "&";
399                                         result.v_formfields_generate = result.v_formfields_generate + column_value + "&";
400                                 }
401                         }
402                 }
403
404                 schedulerUtil.insertOrUpdate("update CR_REPORT_SCHEDULE set processed_formfields ='" + result.v_formfields_insert + "' where schedule_id =" + v_schedule_id);
405                 return "&" + result.v_formfields_generate.substring(0, result.v_formfields_generate.length());
406         }
407
408         private int get_report_sched_offset(int p_rep_id, int p_schedule_id) throws SQLException, ReportSQLException {
409
410                 class CrReportSchedule {
411
412                         Date run_date;
413                         String recurrence;
414                 }
415                 Date v_last_date = null;
416                 Date v_sysdate = new Date();
417
418                 final CrReportSchedule v_report_schedule_rec = new CrReportSchedule();
419
420                 schedulerUtil.getAndExecute("SELECT * FROM cr_report_schedule WHERE rep_id = " + p_rep_id + " and schedule_id = " + p_schedule_id, new Executor() {
421
422                         @Override
423                         public void execute(ResultSet rs) throws SQLException {
424
425                                 v_report_schedule_rec.recurrence = rs.getString("recurrence");
426                                 java.sql.Timestamp runDate = rs.getTimestamp("run_date");
427                                 v_report_schedule_rec.run_date = new Date(runDate.getTime()) ;
428                         }
429
430                 });
431
432                 if (v_report_schedule_rec.run_date == null || v_report_schedule_rec.run_date.compareTo(v_sysdate) > 0) {
433                         return Integer.MAX_VALUE;
434                 }
435
436                 Date v_next_date = v_report_schedule_rec.run_date;
437
438                 while (v_next_date.compareTo(v_sysdate) < 0) {
439                         
440                         if ("HOURLY".equals(v_report_schedule_rec.recurrence)) {
441                                 v_next_date = SchedulerUtil.add_hours(v_next_date, 1);
442                         } else if ("DAILY".equals(v_report_schedule_rec.recurrence)) {
443                                 v_next_date = SchedulerUtil.add_days(v_next_date, 1);
444                         } else if ("DAILY_MO_FR".equals(v_report_schedule_rec.recurrence)) {
445                                 SimpleDateFormat sdf = new SimpleDateFormat("EEE");
446                                 sdf.format(v_next_date);
447                                 if ("FRI".equals(v_next_date.toString())) {
448                                         v_next_date = SchedulerUtil.add_days(v_next_date, 3);
449                                 } else if ("SAT".equals(v_next_date.toString())) {
450                                         v_next_date = SchedulerUtil.add_days(v_next_date, 2);
451                                 } else {
452                                         v_next_date = SchedulerUtil.add_days(v_next_date, 1);
453                                 }
454                         } else if ("WEEKLY".equals(v_report_schedule_rec.recurrence)) {
455                                 v_next_date = SchedulerUtil.add_days(v_next_date, 7);
456                         } else if ("MONTHLY".equals(v_report_schedule_rec.recurrence)) {
457                                 v_next_date = SchedulerUtil.add_months(v_next_date, 1);
458                         } else {
459                                 break;
460                         }
461                         v_last_date = v_next_date;
462                 }
463
464                 if (SchedulerUtil.trunc_hour(v_last_date).compareTo(SchedulerUtil.trunc_hour(v_sysdate)) == 0) {
465                         return (int)(Math.abs (v_sysdate.getTime() - v_last_date.getTime()) / 1000);
466                 } else {
467                         // More than an hour
468                         return 3601;
469                 }
470         }
471
472         public SchedulerUtil getSchedulerUtil() {
473                 return schedulerUtil;
474         }
475
476         public void setSchedulerUtil(SchedulerUtil schedulerUtil) {
477                 this.schedulerUtil = schedulerUtil;
478         }
479
480 }