Code refactoring.

This commit is contained in:
Vova Perebykivskyi 2016-11-09 18:31:42 +02:00
parent 09d6ef866a
commit 5a7c972d47
9 changed files with 19 additions and 6 deletions

View file

@ -40,6 +40,7 @@ public enum JobClassNameEnum {
SEND_EMAIL_TIMESHEET_DATA_MISSING("org.libreplan.importers.notifications.jobs", "SendEmailOnTimesheetDataMissingJob");
private String packageName;
private String name;
JobClassNameEnum(String packageName, String name) {

View file

@ -28,12 +28,13 @@ import org.springframework.scheduling.quartz.QuartzJobBean;
/**
* Sends E-mail to users with data that storing in notification_queue table
* and that are treat to {@link org.libreplan.business.email.entities.EmailTemplateEnum#TEMPLATE_MILESTONE_REACHED}
* and that are treat to {@link org.libreplan.business.email.entities.EmailTemplateEnum#TEMPLATE_MILESTONE_REACHED}.
*
* It is used!
* It is used in {@link org.libreplan.web.common.JobSchedulerModel}.
*
* @author Vova Perebykivskyi <vova@libreplan-enterprise.com>
*/
@SuppressWarnings("unused")
public class SendEmailOnMilestoneReachedJob extends QuartzJobBean {
@Override

View file

@ -29,10 +29,11 @@ import org.springframework.scheduling.quartz.QuartzJobBean;
* Sends E-mail to users with data that storing in notification_queue table and that are treat to
* {@link org.libreplan.business.email.entities.EmailTemplateEnum#TEMPLATE_RESOURCE_REMOVED_FROM_TASK}.
*
* It is used!
* It is used in {@link org.libreplan.web.common.JobSchedulerModel}.
*
* @author Vova Perebykivskyi <vova@libreplan-enterprise.com>
*/
@SuppressWarnings("unused")
public class SendEmailOnResourceRemovedFromTaskJob extends QuartzJobBean {
@Override

View file

@ -30,9 +30,11 @@ import org.springframework.scheduling.quartz.QuartzJobBean;
* Sends E-mail to users with data that storing in notification_queue table and that are treat to
* {@link org.libreplan.business.email.entities.EmailTemplateEnum#TEMPLATE_TASK_ASSIGNED_TO_RESOURCE}.
*
* It is used in {@link org.libreplan.web.common.JobSchedulerModel}.
*
* @author Vova Perebykivskyi <vova@libreplan-enterprise.com>
*/
@SuppressWarnings("unused")
public class SendEmailOnTaskAssignedToResourceJob extends QuartzJobBean {
@Override

View file

@ -29,8 +29,11 @@ import org.springframework.scheduling.quartz.QuartzJobBean;
* Sends E-mail to users with data that storing in notification_queue table and that are treat to
* {@link org.libreplan.business.email.entities.EmailTemplateEnum#TEMPLATE_TODAY_TASK_SHOULD_FINISH}.
*
* It is used in {@link org.libreplan.web.common.JobSchedulerModel}.
*
* @author Vova Perebykivskyi <vova@libreplan-enterprise.com>
*/
@SuppressWarnings("unused")
public class SendEmailOnTaskShouldFinishJob extends QuartzJobBean {
@Override

View file

@ -29,9 +29,11 @@ import org.springframework.scheduling.quartz.QuartzJobBean;
* Sends E-mail to users with data that storing in notification_queue table and that are treat to
* {@link org.libreplan.business.email.entities.EmailTemplateEnum#TEMPLATE_TODAY_TASK_SHOULD_START}.
*
* It is used in {@link org.libreplan.web.common.JobSchedulerModel}.
*
* @author Vova Perebykivskyi <vova@libreplan-enterprise.com>
*/
@SuppressWarnings("unused")
public class SendEmailOnTaskShouldStartJob extends QuartzJobBean {
@Override

View file

@ -29,8 +29,11 @@ import org.springframework.scheduling.quartz.QuartzJobBean;
* Sends E-mail to users with data that storing in notification_queue table and that are treat to
* {@link org.libreplan.business.email.entities.EmailTemplateEnum#TEMPLATE_ENTER_DATA_IN_TIMESHEET}.
*
* It is used in {@link org.libreplan.web.common.JobSchedulerModel}.
*
* @author Vova Perebykivskyi <vova@libreplan-enterprise.com>
*/
@SuppressWarnings("unused")
public class SendEmailOnTimesheetDataMissingJob extends QuartzJobBean {
@Override

View file

@ -112,7 +112,7 @@ public class SendEmailOnTaskShouldFinish implements IEmailNotificationJob {
DateTimeComparator dateTimeComparator = DateTimeComparator.getDateOnlyInstance();
List<TaskElement> tasks = taskElementDAO.getTaskElementsWithParentsWithoutMilestones();
for (TaskElement item : tasks){
for (TaskElement item : tasks) {
DateTime endDate = new DateTime(item.getEndDate());
if ( dateTimeComparator.compare(currentDate, endDate) == 0 ) {

View file

@ -17,7 +17,7 @@
<http auto-config="false" realm="LibrePlan Web Application" >
<!-- In Spring Security 4.1.0 it is useless to use hasRole() for single role because Spring calling hasAnyRole() anyway -->
<!-- In Spring Security 4.1.0 it is useless to use hasRole() for single role because Spring is calling hasAnyRole() anyway -->
<!-- Web services -->
<intercept-url pattern="/ws/rest/bounduser/**" access="hasAnyRole('ROLE_BOUND_USER')" method="GET" />