dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #36244
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18560: System info, added last analytics success time
------------------------------------------------------------
revno: 18560
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-03-10 13:37:21 +0100
message:
System info, added last analytics success time
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/system/DefaultSystemService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/system/SystemInfo.java
--
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-core/src/main/java/org/hisp/dhis/system/DefaultSystemService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/system/DefaultSystemService.java 2015-02-27 10:04:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/system/DefaultSystemService.java 2015-03-10 12:37:21 +0000
@@ -28,26 +28,29 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import static org.hisp.dhis.setting.SystemSettingManager.KEY_LAST_SUCCESSFUL_ANALYTICS_TABLES_UPDATE;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Properties;
+
import org.apache.commons.io.IOUtils;
import org.hisp.dhis.calendar.CalendarService;
import org.hisp.dhis.configuration.Configuration;
import org.hisp.dhis.configuration.ConfigurationService;
import org.hisp.dhis.external.location.LocationManager;
import org.hisp.dhis.external.location.LocationManagerException;
+import org.hisp.dhis.setting.SystemSettingManager;
import org.hisp.dhis.system.database.DatabaseInfoProvider;
import org.hisp.dhis.system.util.SystemUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Properties;
-
/**
* @author Lars Helge Overland
*/
@@ -65,7 +68,10 @@
@Autowired
private CalendarService calendarService;
-
+
+ @Autowired
+ private SystemSettingManager systemSettingManager;
+
private SystemInfo systemInfo = null;
// -------------------------------------------------------------------------
@@ -86,6 +92,7 @@
systemInfo.setCalendar( calendarService.getSystemCalendar().name() );
systemInfo.setDateFormat( calendarService.getSystemDateFormat().getJs() );
+ systemInfo.setLastAnalyticsTableSuccess( (Date) systemSettingManager.getSystemSetting( KEY_LAST_SUCCESSFUL_ANALYTICS_TABLES_UPDATE ) );
// ---------------------------------------------------------------------
// Version
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/system/SystemInfo.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/system/SystemInfo.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/system/SystemInfo.java 2015-03-10 12:37:21 +0000
@@ -28,13 +28,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import java.util.Date;
+
+import org.hisp.dhis.common.DxfNamespaces;
+import org.hisp.dhis.system.database.DatabaseInfo;
+
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-import org.hisp.dhis.common.DxfNamespaces;
-import org.hisp.dhis.system.database.DatabaseInfo;
-
-import java.util.Date;
/**
* @author Lars Helge Overland
@@ -42,6 +43,10 @@
@JacksonXmlRootElement( localName = "systemInfo", namespace = DxfNamespaces.DXF_2_0 )
public class SystemInfo
{
+ // -------------------------------------------------------------------------
+ // Transient properties
+ // -------------------------------------------------------------------------
+
private String contextPath;
private String userAgent;
@@ -49,6 +54,12 @@
private String calendar;
private String dateFormat;
+
+ private Date lastAnalyticsTableSuccess;
+
+ // -------------------------------------------------------------------------
+ // Stable properties
+ // -------------------------------------------------------------------------
private String version;
@@ -162,6 +173,18 @@
@JsonProperty
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+ public Date getLastAnalyticsTableSuccess()
+ {
+ return lastAnalyticsTableSuccess;
+ }
+
+ public void setLastAnalyticsTableSuccess( Date lastAnalyticsTableSuccess )
+ {
+ this.lastAnalyticsTableSuccess = lastAnalyticsTableSuccess;
+ }
+
+ @JsonProperty
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public String getVersion()
{
return version;