This is an automated email from the ASF dual-hosted git repository.

arnold pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new bc289bcb4 refactor: add lombok to jobs module
bc289bcb4 is described below

commit bc289bcb4d25e2e0da20548067bc3b31a223b139
Author: Hemant Gupta <[email protected]>
AuthorDate: Wed Oct 12 05:07:10 2022 +0530

    refactor: add lombok to jobs module
---
 .../jobs/api/SchedulerApiResource.java             |  2 +-
 .../infrastructure/jobs/data/JobDetailData.java    | 36 ++++-----
 .../jobs/data/JobDetailHistoryData.java            | 31 +++-----
 .../jobs/data/SchedulerDetailData.java             | 13 +--
 .../infrastructure/jobs/domain/JobParameter.java   | 42 +++-------
 .../jobs/domain/ScheduledJobDetail.java            | 92 ++--------------------
 .../jobs/domain/ScheduledJobRunHistory.java        | 12 ++-
 .../jobs/domain/SchedulerDetail.java               | 36 ++-------
 .../jobs/service/JobRegisterServiceImpl.java       | 36 ++++-----
 .../jobs/service/JobSchedulerServiceImpl.java      |  4 +-
 ...dularWritePlatformServiceJpaRepositoryImpl.java |  4 +-
 .../jobs/service/SchedulerJobListener.java         | 11 +--
 .../service/SchedulerJobRunnerReadServiceImpl.java | 15 ++--
 13 files changed, 106 insertions(+), 228 deletions(-)

diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerApiResource.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerApiResource.java
index 5739829f4..91fe1c011 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerApiResource.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerApiResource.java
@@ -78,7 +78,7 @@ public class SchedulerApiResource {
         
this.context.authenticatedUser().validateHasReadPermission(SchedulerJobApiConstants.SCHEDULER_RESOURCE_NAME);
         final boolean isSchedulerRunning = 
this.jobRegisterService.isSchedulerRunning();
         final ApiRequestJsonSerializationSettings settings = 
this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
-        final SchedulerDetailData schedulerDetailData = new 
SchedulerDetailData(isSchedulerRunning);
+        final SchedulerDetailData schedulerDetailData = new 
SchedulerDetailData().setActive(isSchedulerRunning);
         return this.toApiJsonSerializer.serialize(settings, 
schedulerDetailData,
                 
SchedulerJobApiConstants.SCHEDULER_DETAIL_RESPONSE_DATA_PARAMETERS);
     }
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/data/JobDetailData.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/data/JobDetailData.java
index 6e235954f..e11b03dae 100755
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/data/JobDetailData.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/data/JobDetailData.java
@@ -19,43 +19,35 @@
 package org.apache.fineract.infrastructure.jobs.data;
 
 import java.util.Date;
-import lombok.Getter;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
 
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
 public class JobDetailData {
 
     @SuppressWarnings("unused")
-    private final Long jobId;
+    private Long jobId;
 
     @SuppressWarnings("unused")
-    private final String displayName;
+    private String displayName;
 
     @SuppressWarnings("unused")
-    private final Date nextRunTime;
+    private Date nextRunTime;
 
     @SuppressWarnings("unused")
-    private final String initializingError;
+    private String initializingError;
 
-    @Getter
-    private final String cronExpression;
+    private String cronExpression;
 
     @SuppressWarnings("unused")
-    private final boolean active;
+    private boolean active;
 
     @SuppressWarnings("unused")
-    private final boolean currentlyRunning;
+    private boolean currentlyRunning;
 
     @SuppressWarnings("unused")
-    private final JobDetailHistoryData lastRunHistory;
-
-    public JobDetailData(final Long jobId, final String displayName, final 
Date nextRunTime, final String initializingError,
-            final String cronExpression, final boolean active, final boolean 
currentlyRunning, final JobDetailHistoryData lastRunHistory) {
-        this.jobId = jobId;
-        this.displayName = displayName;
-        this.nextRunTime = nextRunTime;
-        this.initializingError = initializingError;
-        this.cronExpression = cronExpression;
-        this.active = active;
-        this.lastRunHistory = lastRunHistory;
-        this.currentlyRunning = currentlyRunning;
-    }
+    private JobDetailHistoryData lastRunHistory;
 }
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/data/JobDetailHistoryData.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/data/JobDetailHistoryData.java
index 9e508f62d..45e17b4f8 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/data/JobDetailHistoryData.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/data/JobDetailHistoryData.java
@@ -19,38 +19,33 @@
 package org.apache.fineract.infrastructure.jobs.data;
 
 import java.util.Date;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
 
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
 public class JobDetailHistoryData {
 
     @SuppressWarnings("unused")
-    private final Long version;
+    private Long version;
 
     @SuppressWarnings("unused")
-    private final Date jobRunStartTime;
+    private Date jobRunStartTime;
 
     @SuppressWarnings("unused")
-    private final Date jobRunEndTime;
+    private Date jobRunEndTime;
 
     @SuppressWarnings("unused")
-    private final String status;
+    private String status;
 
     @SuppressWarnings("unused")
-    private final String jobRunErrorMessage;
+    private String jobRunErrorMessage;
 
     @SuppressWarnings("unused")
-    private final String triggerType;
+    private String triggerType;
 
     @SuppressWarnings("unused")
-    private final String jobRunErrorLog;
-
-    public JobDetailHistoryData(final Long version, final Date 
jobRunStartTime, final Date jobRunEndTime, final String status,
-            final String jobRunErrorMessage, final String triggerType, final 
String jobRunErrorLog) {
-        this.version = version;
-        this.jobRunStartTime = jobRunStartTime;
-        this.jobRunEndTime = jobRunEndTime;
-        this.status = status;
-        this.jobRunErrorMessage = jobRunErrorMessage;
-        this.triggerType = triggerType;
-        this.jobRunErrorLog = jobRunErrorLog;
-    }
+    private String jobRunErrorLog;
 }
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/data/SchedulerDetailData.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/data/SchedulerDetailData.java
index e624b6f89..2c641c79b 100755
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/data/SchedulerDetailData.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/data/SchedulerDetailData.java
@@ -18,12 +18,15 @@
  */
 package org.apache.fineract.infrastructure.jobs.data;
 
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
 public class SchedulerDetailData {
 
     @SuppressWarnings("unused")
-    private final boolean active;
-
-    public SchedulerDetailData(final boolean active) {
-        this.active = active;
-    }
+    private boolean active;
 }
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/JobParameter.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/JobParameter.java
index 553cb2131..abb6dfe36 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/JobParameter.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/JobParameter.java
@@ -22,10 +22,18 @@ import java.util.Objects;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.Table;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.experimental.Accessors;
 import 
org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
 
 @Entity
 @Table(name = "job_parameters")
+@Getter
+@Setter
+@NoArgsConstructor
+@Accessors(chain = true)
 public class JobParameter extends AbstractPersistableCustom {
 
     @Column(name = "job_id", nullable = false)
@@ -37,40 +45,8 @@ public class JobParameter extends AbstractPersistableCustom {
     @Column(name = "parameter_value", nullable = true)
     private String parameterValue;
 
-    public JobParameter() {}
-
-    public JobParameter(final Long jobId, final String parameterName, final 
String parameterValue) {
-        this.jobId = jobId;
-        this.parameterName = parameterName;
-        this.parameterValue = parameterValue;
-    }
-
     public static JobParameter getInstance(final Long jobId, final String 
parameterName, final String parameterValue) {
-        return new JobParameter(jobId, parameterName, parameterValue);
-    }
-
-    public Long getJobId() {
-        return jobId;
-    }
-
-    public void setJobId(final Long jobId) {
-        this.jobId = jobId;
-    }
-
-    public String getParameterName() {
-        return parameterName;
-    }
-
-    public void setParameterName(final String parameterName) {
-        this.parameterName = parameterName;
-    }
-
-    public String getParameterValue() {
-        return parameterValue;
-    }
-
-    public void setParameterValue(final String parameterValue) {
-        this.parameterValue = parameterValue;
+        return new 
JobParameter().setJobId(jobId).setParameterName(parameterName).setParameterValue(parameterValue);
     }
 
     @Override
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/ScheduledJobDetail.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/ScheduledJobDetail.java
index f3f44629c..f6dd6dbf2 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/ScheduledJobDetail.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/ScheduledJobDetail.java
@@ -26,6 +26,10 @@ import javax.persistence.Entity;
 import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.experimental.Accessors;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.fineract.infrastructure.core.api.JsonCommand;
 import 
org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
@@ -33,6 +37,10 @@ import 
org.apache.fineract.infrastructure.jobs.api.SchedulerJobApiConstants;
 
 @Entity
 @Table(name = "job")
+@Getter
+@Setter
+@NoArgsConstructor
+@Accessors(chain = true)
 public class ScheduledJobDetail extends AbstractPersistableCustom {
 
     @Column(name = "name")
@@ -89,82 +97,6 @@ public class ScheduledJobDetail extends 
AbstractPersistableCustom {
     @Column(name = "is_misfired")
     private boolean triggerMisfired;
 
-    protected ScheduledJobDetail() {
-
-    }
-
-    public String getJobName() {
-        return this.jobName;
-    }
-
-    public String getCronExpression() {
-        return this.cronExpression;
-    }
-
-    public Short getTaskPriority() {
-        return this.taskPriority;
-    }
-
-    public String getGroupName() {
-        return this.groupName;
-    }
-
-    public String getJobKey() {
-        return this.jobKey;
-    }
-
-    public Short getSchedulerGroup() {
-        return this.schedulerGroup;
-    }
-
-    public boolean isActiveSchedular() {
-        return this.activeSchedular;
-    }
-
-    public void updateCronExpression(final String cronExpression) {
-        this.cronExpression = cronExpression;
-    }
-
-    public void updatePreviousRunStartTime(final Date previousRunStartTime) {
-        this.previousRunStartTime = previousRunStartTime;
-    }
-
-    public Date getNextRunTime() {
-        return this.nextRunTime;
-    }
-
-    public void updateNextRunTime(final Date nextRunTime) {
-        this.nextRunTime = nextRunTime;
-    }
-
-    public void updateJobKey(final String jobKey) {
-        this.jobKey = jobKey;
-    }
-
-    public boolean getIsMismatchedJob() {
-        return this.isMismatchedJob;
-    }
-
-    public void setIsMismatchedJob(final boolean isMismatchedJob) {
-        this.isMismatchedJob = isMismatchedJob;
-    }
-
-    public void updateErrorLog(final String errorLog) {
-        this.errorLog = errorLog;
-    }
-
-    public boolean isCurrentlyRunning() {
-        return this.currentlyRunning;
-    }
-
-    public void updateCurrentlyRunningStatus(final boolean currentlyRunning) {
-        this.currentlyRunning = currentlyRunning;
-    }
-
-    public Integer getNodeId() {
-        return this.nodeId;
-    }
-
     public Map<String, Object> update(final JsonCommand command) {
         final Map<String, Object> actualChanges = new LinkedHashMap<>(9);
 
@@ -188,12 +120,4 @@ public class ScheduledJobDetail extends 
AbstractPersistableCustom {
         return actualChanges;
     }
 
-    public boolean isTriggerMisfired() {
-        return this.triggerMisfired;
-    }
-
-    public void updateTriggerMisfired(final boolean triggerMisfired) {
-        this.triggerMisfired = triggerMisfired;
-    }
-
 }
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/ScheduledJobRunHistory.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/ScheduledJobRunHistory.java
index c04ab9261..307c7cc7d 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/ScheduledJobRunHistory.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/ScheduledJobRunHistory.java
@@ -26,10 +26,18 @@ import javax.persistence.ManyToOne;
 import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.experimental.Accessors;
 import 
org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
 
 @Entity
 @Table(name = "job_run_history")
+@Getter
+@Setter
+@NoArgsConstructor
+@Accessors(chain = true)
 public class ScheduledJobRunHistory extends AbstractPersistableCustom {
 
     @ManyToOne
@@ -59,10 +67,6 @@ public class ScheduledJobRunHistory extends 
AbstractPersistableCustom {
     @Column(name = "error_log")
     private String errorLog;
 
-    public ScheduledJobRunHistory() {
-
-    }
-
     public ScheduledJobRunHistory(final ScheduledJobDetail scheduledJobDetail, 
final Long version, final Date startTime, final Date endTime,
             final String status, final String errorMessage, final String 
triggerType, final String errorLog) {
         this.scheduledJobDetail = scheduledJobDetail;
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/SchedulerDetail.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/SchedulerDetail.java
index 8f6598082..98015a2ac 100755
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/SchedulerDetail.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/SchedulerDetail.java
@@ -21,10 +21,18 @@ package org.apache.fineract.infrastructure.jobs.domain;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.Table;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.experimental.Accessors;
 import 
org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
 
 @Entity
 @Table(name = "scheduler_detail")
+@Getter
+@Setter
+@NoArgsConstructor
+@Accessors(chain = true)
 public class SchedulerDetail extends AbstractPersistableCustom {
 
     @Column(name = "execute_misfired_jobs")
@@ -35,32 +43,4 @@ public class SchedulerDetail extends 
AbstractPersistableCustom {
 
     @Column(name = "reset_scheduler_on_bootup")
     private boolean resetSchedulerOnBootup;
-
-    protected SchedulerDetail() {
-
-    }
-
-    public boolean isExecuteInstructionForMisfiredJobs() {
-        return this.executeInstructionForMisfiredJobs;
-    }
-
-    public void updateExecuteInstructionForMisfiredJobs(final boolean 
executeInstructionForMisfiredJobs) {
-        this.executeInstructionForMisfiredJobs = 
executeInstructionForMisfiredJobs;
-    }
-
-    public boolean isSuspended() {
-        return this.suspended;
-    }
-
-    public void updateSuspendedState(final boolean suspended) {
-        this.suspended = suspended;
-    }
-
-    public boolean isResetSchedulerOnBootup() {
-        return this.resetSchedulerOnBootup;
-    }
-
-    public void updateResetSchedulerOnBootup(final boolean 
resetSchedulerOnBootup) {
-        this.resetSchedulerOnBootup = resetSchedulerOnBootup;
-    }
 }
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobRegisterServiceImpl.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobRegisterServiceImpl.java
index 779632ee4..5209e5300 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobRegisterServiceImpl.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobRegisterServiceImpl.java
@@ -128,7 +128,7 @@ public class JobRegisterServiceImpl implements 
JobRegisterService, ApplicationLi
             
this.schedularWritePlatformService.saveOrUpdate(scheduledJobDetail);
         } catch (final Throwable throwable) {
             final String stackTrace = getStackTraceAsString(throwable);
-            scheduledJobDetail.updateErrorLog(stackTrace);
+            scheduledJobDetail.setErrorLog(stackTrace);
             
this.schedularWritePlatformService.saveOrUpdate(scheduledJobDetail);
         }
     }
@@ -137,7 +137,7 @@ public class JobRegisterServiceImpl implements 
JobRegisterService, ApplicationLi
     public void pauseScheduler() {
         final SchedulerDetail schedulerDetail = 
this.schedularWritePlatformService.retriveSchedulerDetail();
         if (!schedulerDetail.isSuspended()) {
-            schedulerDetail.updateSuspendedState(true);
+            schedulerDetail.setSuspended(true);
             
this.schedularWritePlatformService.updateSchedulerDetail(schedulerDetail);
         }
     }
@@ -146,16 +146,16 @@ public class JobRegisterServiceImpl implements 
JobRegisterService, ApplicationLi
     public void startScheduler() {
         final SchedulerDetail schedulerDetail = 
this.schedularWritePlatformService.retriveSchedulerDetail();
         if (schedulerDetail.isSuspended()) {
-            schedulerDetail.updateSuspendedState(false);
+            schedulerDetail.setSuspended(false);
             
this.schedularWritePlatformService.updateSchedulerDetail(schedulerDetail);
             if (schedulerDetail.isExecuteInstructionForMisfiredJobs()) {
                 final List<ScheduledJobDetail> scheduledJobDetails = 
this.schedularWritePlatformService
                         .retrieveAllJobs(fineractProperties.getNodeId());
                 for (final ScheduledJobDetail jobDetail : scheduledJobDetails) 
{
-                    if (jobDetail.isTriggerMisfired() || 
jobDetail.getIsMismatchedJob()) {
+                    if (jobDetail.isTriggerMisfired() || 
jobDetail.isMismatchedJob()) {
                         if (jobDetail.isActiveSchedular()) {
                             executeJob(jobDetail, 
SchedulerServiceConstants.TRIGGER_TYPE_CRON);
-                            jobDetail.setIsMismatchedJob(false);
+                            jobDetail.setMismatchedJob(false);
                         }
                         final String schedulerName = 
getSchedulerName(jobDetail);
                         final Scheduler scheduler = 
this.schedulers.get(schedulerName);
@@ -166,14 +166,14 @@ public class JobRegisterServiceImpl implements 
JobRegisterService, ApplicationLi
                                 final List<? extends Trigger> triggers = 
scheduler.getTriggersOfJob(jobKey);
                                 for (final Trigger trigger : triggers) {
                                     if (trigger.getNextFireTime() != null && 
trigger.getNextFireTime().after(jobDetail.getNextRunTime())) {
-                                        
jobDetail.updateNextRunTime(trigger.getNextFireTime());
+                                        
jobDetail.setNextRunTime(trigger.getNextFireTime());
                                     }
                                 }
                             } catch (final SchedulerException e) {
                                 log.error("Error occured.", e);
                             }
                         }
-                        jobDetail.updateTriggerMisfired(false);
+                        jobDetail.setTriggerMisfired(false);
                         
this.schedularWritePlatformService.saveOrUpdate(jobDetail);
                     }
                 }
@@ -188,7 +188,7 @@ public class JobRegisterServiceImpl implements 
JobRegisterService, ApplicationLi
         if (nodeIdStored.equals(fineractProperties.getNodeId()) || 
nodeIdStored.equals("0")) {
             rescheduleJob(scheduledJobDetail);
         } else {
-            scheduledJobDetail.setIsMismatchedJob(true);
+            scheduledJobDetail.setMismatchedJob(true);
             
this.schedularWritePlatformService.saveOrUpdate(scheduledJobDetail);
             throw new JobNodeIdMismatchingException(nodeIdStored, 
fineractProperties.getNodeId());
         }
@@ -204,10 +204,10 @@ public class JobRegisterServiceImpl implements 
JobRegisterService, ApplicationLi
 
         if (nodeIdStored.equals(fineractProperties.getNodeId()) || 
nodeIdStored.equals("0")) {
             executeJob(scheduledJobDetail, null);
-            scheduledJobDetail.setIsMismatchedJob(false);
+            scheduledJobDetail.setMismatchedJob(false);
             
this.schedularWritePlatformService.saveOrUpdate(scheduledJobDetail);
         } else {
-            scheduledJobDetail.setIsMismatchedJob(true);
+            scheduledJobDetail.setMismatchedJob(true);
             
this.schedularWritePlatformService.saveOrUpdate(scheduledJobDetail);
             throw new JobNodeIdMismatchingException(nodeIdStored, 
fineractProperties.getNodeId());
         }
@@ -232,25 +232,25 @@ public class JobRegisterServiceImpl implements 
JobRegisterService, ApplicationLi
     public void scheduleJob(final ScheduledJobDetail scheduledJobDetails) {
         try {
             final JobDetail jobDetail = createJobDetail(scheduledJobDetails);
-            
scheduledJobDetails.updateJobKey(getJobKeyAsString(jobDetail.getKey()));
+            
scheduledJobDetails.setJobKey(getJobKeyAsString(jobDetail.getKey()));
             if (!scheduledJobDetails.isActiveSchedular()) {
-                scheduledJobDetails.updateNextRunTime(null);
-                scheduledJobDetails.updateCurrentlyRunningStatus(false);
+                scheduledJobDetails.setNextRunTime(null);
+                scheduledJobDetails.setCurrentlyRunning(false);
                 return;
             }
 
             final Trigger trigger = createTrigger(scheduledJobDetails, 
jobDetail);
             final Scheduler scheduler = getScheduler(scheduledJobDetails);
             scheduler.scheduleJob(jobDetail, trigger);
-            scheduledJobDetails.updateNextRunTime(trigger.getNextFireTime());
-            scheduledJobDetails.updateErrorLog(null);
+            scheduledJobDetails.setNextRunTime(trigger.getNextFireTime());
+            scheduledJobDetails.setErrorLog(null);
         } catch (final Throwable throwable) {
-            scheduledJobDetails.updateNextRunTime(null);
+            scheduledJobDetails.setNextRunTime(null);
             final String stackTrace = getStackTraceAsString(throwable);
-            scheduledJobDetails.updateErrorLog(stackTrace);
+            scheduledJobDetails.setErrorLog(stackTrace);
             log.error("Could not schedule job: {}", 
scheduledJobDetails.getJobName(), throwable);
         }
-        scheduledJobDetails.updateCurrentlyRunningStatus(false);
+        scheduledJobDetails.setCurrentlyRunning(false);
     }
 
     @Override
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobSchedulerServiceImpl.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobSchedulerServiceImpl.java
index fa140e7d6..654efc063 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobSchedulerServiceImpl.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobSchedulerServiceImpl.java
@@ -62,12 +62,12 @@ public class JobSchedulerServiceImpl implements 
ApplicationListener<ContextRefre
                     .retrieveAllJobs(fineractProperties.getNodeId());
             for (final ScheduledJobDetail jobDetails : scheduledJobDetails) {
                 jobRegisterService.scheduleJob(jobDetails);
-                jobDetails.updateTriggerMisfired(false);
+                jobDetails.setTriggerMisfired(false);
                 schedularWritePlatformService.saveOrUpdate(jobDetails);
             }
             final SchedulerDetail schedulerDetail = 
schedularWritePlatformService.retriveSchedulerDetail();
             if (schedulerDetail.isResetSchedulerOnBootup()) {
-                schedulerDetail.updateSuspendedState(false);
+                schedulerDetail.setSuspended(false);
                 
schedularWritePlatformService.updateSchedulerDetail(schedulerDetail);
             }
         }
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedularWritePlatformServiceJpaRepositoryImpl.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedularWritePlatformServiceJpaRepositoryImpl.java
index 51bbf5acf..b9c81fdc4 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedularWritePlatformServiceJpaRepositoryImpl.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedularWritePlatformServiceJpaRepositoryImpl.java
@@ -142,10 +142,10 @@ public class 
SchedularWritePlatformServiceJpaRepositoryImpl implements Schedular
         }
         final SchedulerDetail schedulerDetail = retriveSchedulerDetail();
         if (triggerType.equals(SchedulerServiceConstants.TRIGGER_TYPE_CRON) && 
schedulerDetail.isSuspended()) {
-            scheduledJobDetail.updateTriggerMisfired(true);
+            scheduledJobDetail.setTriggerMisfired(true);
             isStopExecution = true;
         } else if (!isStopExecution) {
-            scheduledJobDetail.updateCurrentlyRunningStatus(true);
+            scheduledJobDetail.setCurrentlyRunning(true);
         }
         this.scheduledJobDetailsRepository.save(scheduledJobDetail);
         return isStopExecution;
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerJobListener.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerJobListener.java
index fc3bbd663..8fa314ac1 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerJobListener.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerJobListener.java
@@ -107,14 +107,15 @@ public class SchedulerJobListener implements JobListener {
         }
         if (SchedulerServiceConstants.TRIGGER_TYPE_CRON.equals(triggerType) && 
trigger.getNextFireTime() != null
                 && 
trigger.getNextFireTime().after(scheduledJobDetails.getNextRunTime())) {
-            scheduledJobDetails.updateNextRunTime(trigger.getNextFireTime());
+            scheduledJobDetails.setNextRunTime(trigger.getNextFireTime());
         }
 
-        scheduledJobDetails.updatePreviousRunStartTime(context.getFireTime());
-        scheduledJobDetails.updateCurrentlyRunningStatus(false);
+        scheduledJobDetails.setPreviousRunStartTime(context.getFireTime());
+        scheduledJobDetails.setCurrentlyRunning(false);
 
-        final ScheduledJobRunHistory runHistory = new 
ScheduledJobRunHistory(scheduledJobDetails, version, context.getFireTime(),
-                new Date(), status, errorMessage, triggerType, errorLog);
+        final ScheduledJobRunHistory runHistory = new 
ScheduledJobRunHistory().setScheduledJobDetail(scheduledJobDetails)
+                
.setVersion(version).setStartTime(context.getFireTime()).setEndTime(new 
Date()).setStatus(status)
+                
.setErrorMessage(errorMessage).setTriggerType(triggerType).setErrorLog(errorLog);
         // scheduledJobDetails.addRunHistory(runHistory);
 
         this.schedularService.saveOrUpdate(scheduledJobDetails, runHistory);
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerJobRunnerReadServiceImpl.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerJobRunnerReadServiceImpl.java
index 10cce9a94..291ccb56a 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerJobRunnerReadServiceImpl.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerJobRunnerReadServiceImpl.java
@@ -185,11 +185,13 @@ public class SchedulerJobRunnerReadServiceImpl implements 
SchedulerJobRunnerRead
 
             JobDetailHistoryData lastRunHistory = null;
             if (version > 0) {
-                lastRunHistory = new JobDetailHistoryData(version, 
jobRunStartTime, jobRunEndTime, status, jobRunErrorMessage, triggerType,
-                        jobRunErrorLog);
+                lastRunHistory = new 
JobDetailHistoryData().setVersion(version).setJobRunStartTime(jobRunStartTime)
+                        
.setJobRunEndTime(jobRunEndTime).setStatus(status).setJobRunErrorMessage(jobRunErrorMessage)
+                        
.setTriggerType(triggerType).setJobRunErrorLog(jobRunErrorLog);
             }
-            final JobDetailData jobDetail = new JobDetailData(id, displayName, 
nextRunTime, initializingError, cronExpression, active,
-                    currentlyRunning, lastRunHistory);
+            final JobDetailData jobDetail = new 
JobDetailData().setJobId(id).setDisplayName(displayName).setNextRunTime(nextRunTime)
+                    
.setInitializingError(initializingError).setCronExpression(cronExpression).setActive(active)
+                    
.setCurrentlyRunning(currentlyRunning).setLastRunHistory(lastRunHistory);
             return jobDetail;
         }
 
@@ -220,8 +222,9 @@ public class SchedulerJobRunnerReadServiceImpl implements 
SchedulerJobRunnerRead
             final String jobRunErrorMessage = 
rs.getString("jobRunErrorMessage");
             final String triggerType = rs.getString("triggerType");
             final String jobRunErrorLog = rs.getString("jobRunErrorLog");
-            final JobDetailHistoryData jobDetailHistory = new 
JobDetailHistoryData(version, jobRunStartTime, jobRunEndTime, status,
-                    jobRunErrorMessage, triggerType, jobRunErrorLog);
+            final JobDetailHistoryData jobDetailHistory = new 
JobDetailHistoryData().setVersion(version).setJobRunStartTime(jobRunStartTime)
+                    
.setJobRunEndTime(jobRunEndTime).setStatus(status).setJobRunErrorMessage(jobRunErrorMessage).setTriggerType(triggerType)
+                    .setJobRunErrorLog(jobRunErrorLog);
             return jobDetailHistory;
         }
 

Reply via email to