dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #41627
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21221: Introduced enum ScheduledTaskStatus for scheduled tasks
------------------------------------------------------------
revno: 21221
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-11-27 16:15:24 +0100
message:
Introduced enum ScheduledTaskStatus for scheduled tasks
added:
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/ScheduledTaskStatus.java
modified:
dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/scheduling/CaseAggregateConditionSchedulingManager.java
dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/scheduling/DefaultCaseAggregateConditionSchedulingManager.java
dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/scheduling/DefaultProgramSchedulingManager.java
dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/scheduling/ProgramSchedulingManager.java
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/DefaultSchedulingManager.java
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/SchedulingManager.java
dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/scheduling/SchedulingManagerTest.java
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/Scheduler.java
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/SpringScheduler.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/scheduling/ScheduleTasksAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/schedule/GetScheduleAggQueryBuilderParamsAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/schedule/GetScheduleParamsAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/schedule/ScheduleCaseAggregateConditionAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/schedule/ScheduleSendMessageTasksAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/scheduleSendMessage.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/viewScheduledCaseAggTasks.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/scheduling/CaseAggregateConditionSchedulingManager.java'
--- dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/scheduling/CaseAggregateConditionSchedulingManager.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/scheduling/CaseAggregateConditionSchedulingManager.java 2015-11-27 15:15:24 +0000
@@ -30,6 +30,8 @@
import java.util.Map;
+import org.hisp.dhis.system.scheduling.ScheduledTaskStatus;
+
/**
* @author Chau Thu Tran
*
@@ -53,5 +55,5 @@
Map<String, String> getScheduledTasks();
- String getTaskStatus();
+ ScheduledTaskStatus getTaskStatus();
}
=== modified file 'dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/scheduling/DefaultCaseAggregateConditionSchedulingManager.java'
--- dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/scheduling/DefaultCaseAggregateConditionSchedulingManager.java 2015-10-06 18:35:24 +0000
+++ dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/scheduling/DefaultCaseAggregateConditionSchedulingManager.java 2015-11-27 15:15:24 +0000
@@ -28,13 +28,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import static org.hisp.dhis.system.scheduling.Scheduler.STATUS_NOT_STARTED;
-
import java.util.HashMap;
import java.util.Map;
import org.hisp.dhis.setting.Setting;
import org.hisp.dhis.setting.SystemSettingManager;
+import org.hisp.dhis.system.scheduling.ScheduledTaskStatus;
import org.hisp.dhis.system.scheduling.Scheduler;
/**
@@ -134,13 +133,13 @@
}
@Override
- public String getTaskStatus()
+ public ScheduledTaskStatus getTaskStatus()
{
Map<String, String> keyCronMap = getScheduledTasks();
if ( keyCronMap.size() == 0 )
{
- return STATUS_NOT_STARTED;
+ return ScheduledTaskStatus.NOT_STARTED;
}
return scheduler.getTaskStatus( keyCronMap.keySet().iterator().next() );
=== modified file 'dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/scheduling/DefaultProgramSchedulingManager.java'
--- dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/scheduling/DefaultProgramSchedulingManager.java 2015-10-06 18:35:24 +0000
+++ dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/scheduling/DefaultProgramSchedulingManager.java 2015-11-27 15:15:24 +0000
@@ -28,13 +28,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import static org.hisp.dhis.system.scheduling.Scheduler.STATUS_NOT_STARTED;
-
import java.util.HashMap;
import java.util.Map;
import org.hisp.dhis.setting.Setting;
import org.hisp.dhis.setting.SystemSettingManager;
+import org.hisp.dhis.system.scheduling.ScheduledTaskStatus;
import org.hisp.dhis.system.scheduling.Scheduler;
/**
@@ -130,13 +129,13 @@
}
@Override
- public String getTaskStatus()
+ public ScheduledTaskStatus getTaskStatus()
{
Map<String, String> keyCronMap = getScheduledTasks();
if ( keyCronMap.size() == 0 )
{
- return STATUS_NOT_STARTED;
+ return ScheduledTaskStatus.NOT_STARTED;
}
return scheduler.getTaskStatus( keyCronMap.keySet().iterator().next() );
=== modified file 'dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/scheduling/ProgramSchedulingManager.java'
--- dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/scheduling/ProgramSchedulingManager.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/scheduling/ProgramSchedulingManager.java 2015-11-27 15:15:24 +0000
@@ -30,6 +30,8 @@
import java.util.Map;
+import org.hisp.dhis.system.scheduling.ScheduledTaskStatus;
+
/**
* @author Chau Thu Tran
*
@@ -38,7 +40,7 @@
public interface ProgramSchedulingManager
{
final String TASK_SENDING_MESSAGE = "sendingMessageTask";
-
+
void scheduleTasks();
void scheduleTasks( Map<String, String> keyCronMap );
@@ -49,5 +51,5 @@
Map<String, String> getScheduledTasks();
- String getTaskStatus();
+ ScheduledTaskStatus getTaskStatus();
}
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/DefaultSchedulingManager.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/DefaultSchedulingManager.java 2015-10-06 18:35:24 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/DefaultSchedulingManager.java 2015-11-27 15:15:24 +0000
@@ -28,8 +28,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import static org.hisp.dhis.system.scheduling.Scheduler.STATUS_NOT_STARTED;
-
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -38,6 +36,7 @@
import org.hisp.dhis.common.ListMap;
import org.hisp.dhis.setting.Setting;
import org.hisp.dhis.setting.SystemSettingManager;
+import org.hisp.dhis.system.scheduling.ScheduledTaskStatus;
import org.hisp.dhis.system.scheduling.Scheduler;
/**
@@ -135,13 +134,13 @@
}
@Override
- public String getTaskStatus()
+ public ScheduledTaskStatus getTaskStatus()
{
ListMap<String, String> cronKeyMap = getCronKeyMap();
if ( cronKeyMap.size() == 0 )
{
- return STATUS_NOT_STARTED;
+ return ScheduledTaskStatus.NOT_STARTED;
}
String firstTask = cronKeyMap.keySet().iterator().next();
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/SchedulingManager.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/SchedulingManager.java 2015-10-08 23:03:40 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/SchedulingManager.java 2015-11-27 15:15:24 +0000
@@ -29,6 +29,7 @@
*/
import org.hisp.dhis.common.ListMap;
+import org.hisp.dhis.system.scheduling.ScheduledTaskStatus;
import java.util.Set;
@@ -74,8 +75,7 @@
Set<String> getScheduledKeys();
/**
- * Gets the task status. Can be STATUS_RUNNING, STATUS_DONE, STATUS_STOPPED,
- * STATUS_NOT_STARTED.
+ * Gets the task status.
*/
- String getTaskStatus();
+ ScheduledTaskStatus getTaskStatus();
}
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/scheduling/SchedulingManagerTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/scheduling/SchedulingManagerTest.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/scheduling/SchedulingManagerTest.java 2015-11-27 15:15:24 +0000
@@ -39,7 +39,7 @@
import org.hisp.dhis.DhisSpringTest;
import org.hisp.dhis.common.ListMap;
-import org.hisp.dhis.system.scheduling.Scheduler;
+import org.hisp.dhis.system.scheduling.ScheduledTaskStatus;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -68,7 +68,7 @@
assertTrue( cronKeyMap.containsKey( CRON_DAILY_0AM ) );
assertEquals( 3, cronKeyMap.get( CRON_DAILY_0AM ).size() );
- assertEquals( Scheduler.STATUS_RUNNING, schedulingManager.getTaskStatus() );
+ assertEquals( ScheduledTaskStatus.RUNNING, schedulingManager.getTaskStatus() );
}
@Test
@@ -78,15 +78,15 @@
cronKeyMap.putValue( CRON_DAILY_0AM, TASK_RESOURCE_TABLE );
cronKeyMap.putValue( CRON_DAILY_0AM, TASK_ANALYTICS_ALL );
- assertEquals( Scheduler.STATUS_NOT_STARTED, schedulingManager.getTaskStatus() );
+ assertEquals( ScheduledTaskStatus.NOT_STARTED, schedulingManager.getTaskStatus() );
schedulingManager.scheduleTasks( cronKeyMap );
- assertEquals( Scheduler.STATUS_RUNNING, schedulingManager.getTaskStatus() );
+ assertEquals( ScheduledTaskStatus.RUNNING, schedulingManager.getTaskStatus() );
schedulingManager.stopTasks();
- assertEquals( Scheduler.STATUS_NOT_STARTED, schedulingManager.getTaskStatus() );
+ assertEquals( ScheduledTaskStatus.NOT_STARTED, schedulingManager.getTaskStatus() );
}
@Test
=== added file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/ScheduledTaskStatus.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/ScheduledTaskStatus.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/ScheduledTaskStatus.java 2015-11-27 15:15:24 +0000
@@ -0,0 +1,52 @@
+package org.hisp.dhis.system.scheduling;
+
+/*
+ * Copyright (c) 2004-2015, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+* @author Lars Helge Overland
+*/
+public enum ScheduledTaskStatus
+{
+ RUNNING( "running" ),
+ DONE( "done" ),
+ STOPPED( "stopped" ),
+ NOT_STARTED( "not_started" );
+
+ private final String key;
+
+ private ScheduledTaskStatus( String key )
+ {
+ this.key = key;
+ }
+
+ public String getKey()
+ {
+ return key;
+ }
+}
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/Scheduler.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/Scheduler.java 2015-10-13 22:07:31 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/Scheduler.java 2015-11-27 15:15:24 +0000
@@ -46,11 +46,6 @@
String CRON_EVERY_15MIN = "0 0/15 * * * ?";
String CRON_TEST = "0 * * * * ?";
- String STATUS_RUNNING = "running";
- String STATUS_DONE = "done";
- String STATUS_STOPPED = "stopped";
- String STATUS_NOT_STARTED = "not_started";
-
/**
* Execute the given task immediately.
*
@@ -101,5 +96,5 @@
* @param key the task key.
* @return the task status.
*/
- String getTaskStatus( String key );
+ ScheduledTaskStatus getTaskStatus( String key );
}
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/SpringScheduler.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/SpringScheduler.java 2015-10-07 13:48:07 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/SpringScheduler.java 2015-11-27 15:15:24 +0000
@@ -142,25 +142,25 @@
}
@Override
- public String getTaskStatus( String key )
+ public ScheduledTaskStatus getTaskStatus( String key )
{
ScheduledFuture<?> future = futures.get( key );
if ( future == null )
{
- return STATUS_NOT_STARTED;
+ return ScheduledTaskStatus.NOT_STARTED;
}
else if ( future.isCancelled() )
{
- return STATUS_STOPPED;
+ return ScheduledTaskStatus.STOPPED;
}
else if ( future.isDone() )
{
- return STATUS_DONE;
+ return ScheduledTaskStatus.DONE;
}
else
{
- return STATUS_RUNNING;
+ return ScheduledTaskStatus.RUNNING;
}
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/scheduling/ScheduleTasksAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/scheduling/ScheduleTasksAction.java 2015-10-06 17:53:30 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/scheduling/ScheduleTasksAction.java 2015-11-27 15:15:24 +0000
@@ -37,7 +37,6 @@
import static org.hisp.dhis.system.scheduling.Scheduler.CRON_DAILY_0AM;
import static org.hisp.dhis.system.scheduling.Scheduler.CRON_EVERY_15MIN;
import static org.hisp.dhis.system.scheduling.Scheduler.CRON_EVERY_MIN;
-import static org.hisp.dhis.system.scheduling.Scheduler.STATUS_RUNNING;
import java.util.Collection;
import java.util.Date;
@@ -52,7 +51,7 @@
import org.hisp.dhis.scheduling.SchedulingManager;
import org.hisp.dhis.setting.Setting;
import org.hisp.dhis.setting.SystemSettingManager;
-import org.hisp.dhis.system.scheduling.Scheduler;
+import org.hisp.dhis.system.scheduling.ScheduledTaskStatus;
import org.springframework.beans.factory.annotation.Autowired;
import com.opensymphony.xwork2.Action;
@@ -149,9 +148,9 @@
// Output
// -------------------------------------------------------------------------
- private String status;
+ private ScheduledTaskStatus status;
- public String getStatus()
+ public ScheduledTaskStatus getStatus()
{
return status;
}
@@ -207,7 +206,7 @@
{
if ( schedule )
{
- if ( Scheduler.STATUS_RUNNING.equals( schedulingManager.getTaskStatus() ) )
+ if ( ScheduledTaskStatus.RUNNING.equals( schedulingManager.getTaskStatus() ) )
{
schedulingManager.stopTasks();
}
@@ -312,7 +311,7 @@
}
status = schedulingManager.getTaskStatus();
- running = STATUS_RUNNING.equals( status );
+ running = ScheduledTaskStatus.RUNNING.equals( status );
levels = organisationUnitService.getOrganisationUnitLevels();
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm 2015-09-15 16:57:32 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm 2015-11-27 15:15:24 +0000
@@ -81,4 +81,4 @@
</form>
-<span id="info">$i18n.getString( "scheduling_is" ) $!i18n.getString( $!status )</span>
+<span id="info">$i18n.getString( "scheduling_is" ) $!i18n.getString( $!status.key )</span>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/schedule/GetScheduleAggQueryBuilderParamsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/schedule/GetScheduleAggQueryBuilderParamsAction.java 2015-10-06 17:44:37 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/schedule/GetScheduleAggQueryBuilderParamsAction.java 2015-11-27 15:15:24 +0000
@@ -31,15 +31,12 @@
import org.hisp.dhis.scheduling.CaseAggregateConditionSchedulingManager;
import org.hisp.dhis.setting.Setting;
import org.hisp.dhis.setting.SystemSettingManager;
-import org.hisp.dhis.system.scheduling.Scheduler;
+import org.hisp.dhis.system.scheduling.ScheduledTaskStatus;
import com.opensymphony.xwork2.Action;
/**
* @author Chau Thu Tran
- *
- * @version GetScheduleAggQueryBuilderParamsAction.java 1:47:08 PM Oct 12, 2012
- * $
*/
public class GetScheduleAggQueryBuilderParamsAction
implements Action
@@ -66,9 +63,9 @@
// Output
// -------------------------------------------------------------------------
- private String status;
+ private ScheduledTaskStatus status;
- public String getStatus()
+ public ScheduledTaskStatus getStatus()
{
return status;
}
@@ -99,7 +96,7 @@
status = schedulingManager.getTaskStatus();
- running = Scheduler.STATUS_RUNNING.equals( status );
+ running = ScheduledTaskStatus.RUNNING.equals( status );
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/schedule/GetScheduleParamsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/schedule/GetScheduleParamsAction.java 2015-10-06 17:44:37 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/schedule/GetScheduleParamsAction.java 2015-11-27 15:15:24 +0000
@@ -31,7 +31,7 @@
import org.hisp.dhis.scheduling.ProgramSchedulingManager;
import org.hisp.dhis.setting.Setting;
import org.hisp.dhis.setting.SystemSettingManager;
-import org.hisp.dhis.system.scheduling.Scheduler;
+import org.hisp.dhis.system.scheduling.ScheduledTaskStatus;
import com.opensymphony.xwork2.Action;
@@ -72,9 +72,9 @@
return timeSendingMessage;
}
- private String status;
+ private ScheduledTaskStatus status;
- public String getStatus()
+ public ScheduledTaskStatus getStatus()
{
return status;
}
@@ -97,7 +97,7 @@
timeSendingMessage = (String)systemSettingManager.getSystemSetting( Setting.TIME_FOR_SENDING_MESSAGE );
status = schedulingManager.getTaskStatus();
- running = Scheduler.STATUS_RUNNING.equals( status );
+ running = ScheduledTaskStatus.RUNNING.equals( status );
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/schedule/ScheduleCaseAggregateConditionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/schedule/ScheduleCaseAggregateConditionAction.java 2015-10-06 18:35:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/schedule/ScheduleCaseAggregateConditionAction.java 2015-11-27 15:15:24 +0000
@@ -34,6 +34,7 @@
import org.hisp.dhis.scheduling.CaseAggregateConditionSchedulingManager;
import org.hisp.dhis.setting.Setting;
import org.hisp.dhis.setting.SystemSettingManager;
+import org.hisp.dhis.system.scheduling.ScheduledTaskStatus;
import org.hisp.dhis.system.scheduling.Scheduler;
import com.opensymphony.xwork2.Action;
@@ -79,9 +80,9 @@
// Output
// -------------------------------------------------------------------------
- private String status;
+ private ScheduledTaskStatus status;
- public String getStatus()
+ public ScheduledTaskStatus getStatus()
{
return status;
}
@@ -114,7 +115,7 @@
}
else
{
- if ( Scheduler.STATUS_RUNNING.equals( schedulingManager.getTaskStatus() ) )
+ if ( ScheduledTaskStatus.RUNNING.equals( schedulingManager.getTaskStatus() ) )
{
schedulingManager.stopTasks();
}
@@ -134,7 +135,7 @@
status = schedulingManager.getTaskStatus();
- running = Scheduler.STATUS_RUNNING.equals( status );
+ running = ScheduledTaskStatus.RUNNING.equals( status );
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/schedule/ScheduleSendMessageTasksAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/schedule/ScheduleSendMessageTasksAction.java 2015-10-06 18:35:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/schedule/ScheduleSendMessageTasksAction.java 2015-11-27 15:15:24 +0000
@@ -38,7 +38,7 @@
import org.hisp.dhis.setting.Setting;
import org.hisp.dhis.setting.SystemSettingManager;
import org.hisp.dhis.system.notification.Notifier;
-import org.hisp.dhis.system.scheduling.Scheduler;
+import org.hisp.dhis.system.scheduling.ScheduledTaskStatus;
import org.hisp.dhis.user.CurrentUserService;
import com.opensymphony.xwork2.Action;
@@ -112,9 +112,9 @@
// Output
// -------------------------------------------------------------------------
- private String status;
+ private ScheduledTaskStatus status;
- public String getStatus()
+ public ScheduledTaskStatus getStatus()
{
return status;
}
@@ -145,7 +145,7 @@
}
else
{
- if ( Scheduler.STATUS_RUNNING.equals( schedulingManager.getTaskStatus() ) )
+ if ( ScheduledTaskStatus.RUNNING.equals( schedulingManager.getTaskStatus() ) )
{
schedulingManager.stopTasks();
}
@@ -178,7 +178,7 @@
}
status = schedulingManager.getTaskStatus();
- running = Scheduler.STATUS_RUNNING.equals( status );
+ running = ScheduledTaskStatus.RUNNING.equals( status );
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/scheduleSendMessage.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/scheduleSendMessage.vm 2013-04-11 06:26:56 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/scheduleSendMessage.vm 2015-11-27 15:15:24 +0000
@@ -26,7 +26,7 @@
</tbody>
</table>
- <span id="info">$i18n.getString( "scheduling_is" ) $!i18n.getString( $!status )</span>
+ <span id="info">$i18n.getString( "scheduling_is" ) $!i18n.getString( $!status.key )</span>
<table id="notificationTable" class="notificationTable" style="display:none">
<col width="120">
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/viewScheduledCaseAggTasks.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/viewScheduledCaseAggTasks.vm 2013-12-17 01:29:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/viewScheduledCaseAggTasks.vm 2015-11-27 15:15:24 +0000
@@ -46,7 +46,7 @@
</table>
</form>
-<span id="info">$i18n.getString( "scheduling_is" ) $!i18n.getString( $!status )</span>
+<span id="info">$i18n.getString( "scheduling_is" ) $!i18n.getString( $!status.key )</span>
<table id="notificationTable" class="notificationTable" style="display:none">
<col width="120">