Added OS build date

4.x.x
Chatura Dilan 9 years ago
parent 951d68a92d
commit 2befefc967

@ -57,6 +57,9 @@ public class DeviceInfo implements Serializable {
@ApiModelProperty(name = "osVersion", value = "Operating system version.", required = true)
private String osVersion;
@ApiModelProperty(name = "osBuildDate", value = "Operating system build date.", required = true)
private String osBuildDate;
@ApiModelProperty(name = "batteryLevel", value = "Battery level of the device.", required = true)
private Double batteryLevel;
@ -201,6 +204,19 @@ public class DeviceInfo implements Serializable {
this.osVersion = osVersion;
}
public String getOsBuildDate() {
if (osBuildDate != null) {
return osBuildDate;
} else {
return "";
}
}
public void setOsBuildDate(String osBuildDate) {
this.osBuildDate = osBuildDate;
}
public Double getBatteryLevel() {
if (batteryLevel != null) {
return batteryLevel;

@ -209,6 +209,7 @@ public final class DeviceManagementDAOUtil {
deviceInfo.setDeviceModel(rs.getString("DEVICE_MODEL"));
deviceInfo.setVendor(rs.getString("VENDOR"));
deviceInfo.setOsVersion(rs.getString("OS_VERSION"));
deviceInfo.setOsBuildDate(rs.getString("OS_BUILD_DATE"));
deviceInfo.setBatteryLevel(rs.getDouble("BATTERY_LEVEL"));
deviceInfo.setInternalTotalMemory(rs.getDouble("INTERNAL_TOTAL_MEMORY"));
deviceInfo.setInternalAvailableMemory(rs.getDouble("INTERNAL_AVAILABLE_MEMORY"));

@ -48,27 +48,28 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO {
conn = this.getConnection();
stmt = conn.prepareStatement("INSERT INTO DM_DEVICE_DETAIL (DEVICE_ID, DEVICE_MODEL, " +
"VENDOR, OS_VERSION, BATTERY_LEVEL, INTERNAL_TOTAL_MEMORY, INTERNAL_AVAILABLE_MEMORY, " +
"VENDOR, OS_VERSION, OS_BUILD_DATE, BATTERY_LEVEL, INTERNAL_TOTAL_MEMORY, INTERNAL_AVAILABLE_MEMORY, " +
"EXTERNAL_TOTAL_MEMORY, EXTERNAL_AVAILABLE_MEMORY, CONNECTION_TYPE, " +
"SSID, CPU_USAGE, TOTAL_RAM_MEMORY, AVAILABLE_RAM_MEMORY, PLUGGED_IN, UPDATE_TIMESTAMP) " +
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
stmt.setInt(1, deviceId);
stmt.setString(2, deviceInfo.getDeviceModel());
stmt.setString(3, deviceInfo.getVendor());
stmt.setString(4, deviceInfo.getOsVersion());
stmt.setDouble(5, deviceInfo.getBatteryLevel());
stmt.setDouble(6, deviceInfo.getInternalTotalMemory());
stmt.setDouble(7, deviceInfo.getInternalAvailableMemory());
stmt.setDouble(8, deviceInfo.getExternalTotalMemory());
stmt.setDouble(9, deviceInfo.getExternalAvailableMemory());
stmt.setString(10, deviceInfo.getConnectionType());
stmt.setString(11, deviceInfo.getSsid());
stmt.setDouble(12, deviceInfo.getCpuUsage());
stmt.setDouble(13, deviceInfo.getTotalRAMMemory());
stmt.setDouble(14, deviceInfo.getAvailableRAMMemory());
stmt.setBoolean(15, deviceInfo.isPluggedIn());
stmt.setLong(16, System.currentTimeMillis());
stmt.setString(5, deviceInfo.getOsBuildDate());
stmt.setDouble(6, deviceInfo.getBatteryLevel());
stmt.setDouble(7, deviceInfo.getInternalTotalMemory());
stmt.setDouble(8, deviceInfo.getInternalAvailableMemory());
stmt.setDouble(9, deviceInfo.getExternalTotalMemory());
stmt.setDouble(10, deviceInfo.getExternalAvailableMemory());
stmt.setString(11, deviceInfo.getConnectionType());
stmt.setString(12, deviceInfo.getSsid());
stmt.setDouble(13, deviceInfo.getCpuUsage());
stmt.setDouble(14, deviceInfo.getTotalRAMMemory());
stmt.setDouble(15, deviceInfo.getAvailableRAMMemory());
stmt.setBoolean(16, deviceInfo.isPluggedIn());
stmt.setLong(17, System.currentTimeMillis());
stmt.execute();
@ -131,6 +132,7 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO {
deviceInfo.setDeviceModel(rs.getString("DEVICE_MODEL"));
deviceInfo.setVendor(rs.getString("VENDOR"));
deviceInfo.setOsVersion(rs.getString("OS_VERSION"));
deviceInfo.setOsBuildDate(rs.getString("OS_BUILD_DATE"));
deviceInfo.setBatteryLevel(rs.getDouble("BATTERY_LEVEL"));
deviceInfo.setInternalTotalMemory(rs.getDouble("INTERNAL_TOTAL_MEMORY"));
deviceInfo.setInternalAvailableMemory(rs.getDouble("INTERNAL_AVAILABLE_MEMORY"));

@ -79,6 +79,7 @@ public class SearchDAOImpl implements SearchDAO {
deviceInfo.setInternalAvailableMemory(rs.getDouble("INTERNAL_AVAILABLE_MEMORY"));
deviceInfo.setInternalTotalMemory(rs.getDouble("EXTERNAL_TOTAL_MEMORY"));
deviceInfo.setOsVersion(rs.getString("OS_VERSION"));
deviceInfo.setOsBuildDate(rs.getString("OS_BUILD_DATE"));
deviceInfo.setPluggedIn(rs.getBoolean("PLUGGED_IN"));
deviceInfo.setSsid(rs.getString("SSID"));
deviceInfo.setTotalRAMMemory(rs.getDouble("TOTAL_RAM_MEMORY"));
@ -156,6 +157,7 @@ public class SearchDAOImpl implements SearchDAO {
deviceInfo.setInternalAvailableMemory(rs.getDouble("INTERNAL_AVAILABLE_MEMORY"));
deviceInfo.setInternalTotalMemory(rs.getDouble("EXTERNAL_TOTAL_MEMORY"));
deviceInfo.setOsVersion(rs.getString("OS_VERSION"));
deviceInfo.setOsBuildDate(rs.getString("OS_BUILD_DATE"));
deviceInfo.setPluggedIn(rs.getBoolean("PLUGGED_IN"));
deviceInfo.setSsid(rs.getString("SSID"));
deviceInfo.setTotalRAMMemory(rs.getDouble("TOTAL_RAM_MEMORY"));

@ -192,7 +192,7 @@ public class QueryBuilderImpl implements QueryBuilder {
return "SELECT D.ID, D.DESCRIPTION, D.NAME, \n" +
"D.DEVICE_TYPE_ID, D.DEVICE_IDENTIFICATION, DT.ID AS DEVICE_TYPE_ID, \n" +
"DT.NAME AS DEVICE_TYPE_NAME, DD.DEVICE_ID, DD.DEVICE_MODEL, DD.VENDOR, \n" +
"DD.OS_VERSION, DD.BATTERY_LEVEL, DD.INTERNAL_TOTAL_MEMORY, DD.INTERNAL_AVAILABLE_MEMORY,\n" +
"DD.OS_VERSION, DD.OS_BUILD_DATE, DD.BATTERY_LEVEL, DD.INTERNAL_TOTAL_MEMORY, DD.INTERNAL_AVAILABLE_MEMORY,\n" +
"DD.EXTERNAL_TOTAL_MEMORY, DD.EXTERNAL_AVAILABLE_MEMORY, DD.CONNECTION_TYPE, \n" +
"DD.SSID, DD.CPU_USAGE, DD.TOTAL_RAM_MEMORY, DD.AVAILABLE_RAM_MEMORY, \n" +
"DD.PLUGGED_IN, DD.UPDATE_TIMESTAMP, DL.LATITUDE, DL.LONGITUDE, DL.STREET1, DL.STREET2, DL.CITY, DL.ZIP, \n" +
@ -211,7 +211,7 @@ public class QueryBuilderImpl implements QueryBuilder {
return "SELECT D.ID, D.DESCRIPTION, D.NAME, \n" +
"D.DEVICE_TYPE_ID, D.DEVICE_IDENTIFICATION, DT.ID AS DEVICE_TYPE_ID, \n" +
"DT.NAME AS DEVICE_TYPE_NAME, DD.DEVICE_ID, DD.DEVICE_MODEL, DD.VENDOR, \n" +
"DD.OS_VERSION, DD.BATTERY_LEVEL, DD.INTERNAL_TOTAL_MEMORY, DD.INTERNAL_AVAILABLE_MEMORY,\n" +
"DD.OS_VERSION, DD.OS_BUILD_DATE, DD.BATTERY_LEVEL, DD.INTERNAL_TOTAL_MEMORY, DD.INTERNAL_AVAILABLE_MEMORY,\n" +
"DD.EXTERNAL_TOTAL_MEMORY, DD.EXTERNAL_AVAILABLE_MEMORY, DD.CONNECTION_TYPE, \n" +
"DD.SSID, DD.CPU_USAGE, DD.TOTAL_RAM_MEMORY, DD.AVAILABLE_RAM_MEMORY, \n" +
"DD.PLUGGED_IN, DD.UPDATE_TIMESTAMP, DL.LATITUDE, DL.LONGITUDE, DL.STREET1, DL.STREET2, DL.CITY, DL.ZIP, \n" +

@ -35,6 +35,7 @@ public class Utils {
genericColumnsMap.put("deviceModel", "DEVICE_MODEL");
genericColumnsMap.put("vendor", "VENDOR");
genericColumnsMap.put("osVersion", "OS_VERSION");
genericColumnsMap.put("osBuildDate", "OS_BUILD_DATE");
genericColumnsMap.put("batteryLevel", "BATTERY_LEVEL");
genericColumnsMap.put("internalTotalMemory", "INTERNAL_TOTAL_MEMORY");
genericColumnsMap.put("internalAvailableMemory", "INTERNAL_AVAILABLE_MEMORY");

@ -52,6 +52,7 @@ public class Utils {
deviceInfo.setMobileSignalStrength(0.67);
deviceInfo.setOperator("Dialog");
deviceInfo.setOsVersion("Lolipop");
deviceInfo.setOsBuildDate("1467366458");
deviceInfo.setPluggedIn(true);
deviceInfo.setSsid("SSSSSS");
deviceInfo.setTotalRAMMemory(4.00);

@ -469,6 +469,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_DETAIL (
DEVICE_MODEL VARCHAR(45) NULL,
VENDOR VARCHAR(45) NULL,
OS_VERSION VARCHAR(45) NULL,
OS_BUILD_DATE VARCHAR(100) NULL,
BATTERY_LEVEL DECIMAL(4) NULL,
INTERNAL_TOTAL_MEMORY DECIMAL(30,3) NULL,
INTERNAL_AVAILABLE_MEMORY DECIMAL(30,3) NULL,

@ -33,6 +33,7 @@ var DEVICE_VENDOR = "vendor";
var DEVICE_MODEL = "model";
var DEVICE_PRODUCT = "PRODUCT";
var DEVICE_OS_VERSION = "osVersion";
var DEVICE_OS_BUILD_DATE = "osBuildDate";
var DEVICE_PROPERTIES = "properties";
var DEVICE_ENROLLMENT_INFO = "enrolmentInfo";
var DEVICE_STATUS = "status";

@ -473,6 +473,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_DETAIL (
DEVICE_MODEL VARCHAR(45) NULL,
VENDOR VARCHAR(45) NULL,
OS_VERSION VARCHAR(45) NULL,
OS_BUILD_DATE VARCHAR(100) NULL,
BATTERY_LEVEL DECIMAL(4) NULL,
INTERNAL_TOTAL_MEMORY DECIMAL(30,3) NULL,
INTERNAL_AVAILABLE_MEMORY DECIMAL(30,3) NULL,

@ -473,6 +473,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_DETAIL (
DEVICE_MODEL VARCHAR(45) NULL,
VENDOR VARCHAR(45) NULL,
OS_VERSION VARCHAR(45) NULL,
OS_BUILD_DATE VARCHAR(100) NULL,
BATTERY_LEVEL DECIMAL(4) NULL,
INTERNAL_TOTAL_MEMORY DECIMAL(30,3) NULL,
INTERNAL_AVAILABLE_MEMORY DECIMAL(30,3) NULL,

@ -486,6 +486,7 @@ CREATE TABLE DM_DEVICE_DETAIL (
DEVICE_MODEL VARCHAR(45) NULL,
VENDOR VARCHAR(45) NULL,
OS_VERSION VARCHAR(45) NULL,
OS_BUILD_DATE VARCHAR(100) NULL,
BATTERY_LEVEL DECIMAL(4) NULL,
INTERNAL_TOTAL_MEMORY DECIMAL(30,3) NULL,
INTERNAL_AVAILABLE_MEMORY DECIMAL(30,3) NULL,

@ -507,6 +507,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_DETAIL (
DEVICE_MODEL VARCHAR(45) NULL,
VENDOR VARCHAR(45) NULL,
OS_VERSION VARCHAR(45) NULL,
OS_BUILD_DATE VARCHAR(100) NULL,
BATTERY_LEVEL DECIMAL(4) NULL,
INTERNAL_TOTAL_MEMORY DECIMAL(30,3) NULL,
INTERNAL_AVAILABLE_MEMORY DECIMAL(30,3) NULL,

@ -825,6 +825,7 @@ CREATE TABLE DM_DEVICE_DETAIL (
DEVICE_MODEL VARCHAR2(45) NULL,
VENDOR VARCHAR2(45) NULL,
OS_VERSION VARCHAR2(45) NULL,
OS_BUILD_DATE VARCHAR(100) NULL,
BATTERY_LEVEL NUMBER(4) NULL,
INTERNAL_TOTAL_MEMORY NUMBER(30,3) NULL,
INTERNAL_AVAILABLE_MEMORY NUMBER(30,3) NULL,

@ -416,6 +416,8 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_DETAIL (
DEVICE_MODEL VARCHAR(45) NULL,
VENDOR VARCHAR(45) NULL,
OS_VERSION VARCHAR(45) NULL,
OS_BUILD_DATE VARCHAR(100) NULL,
BATTERY_LEVEL DECIMAL(4) NULL,
INTERNAL_TOTAL_MEMORY DECIMAL(30,3) NULL,
INTERNAL_AVAILABLE_MEMORY DECIMAL(30,3) NULL,

Loading…
Cancel
Save