From 30da5afdab3d56b6bb7e1d517415f8880b237313 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Wed, 4 Mar 2020 13:10:45 +0530 Subject: [PATCH] Add hourly and daily usage to application bean --- .../mgt/common/app/mgt/Application.java | 20 +++++++++++++++++++ .../mgt/core/DeviceManagementConstants.java | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/app/mgt/Application.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/app/mgt/Application.java index ecbafd974c..38d7cf5d7b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/app/mgt/Application.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/app/mgt/Application.java @@ -53,6 +53,10 @@ public class Application implements Serializable { private int memoryUsage; @ApiModelProperty(name = "isActive", value = "Is the application actively running", required = true) private boolean isActive; + @ApiModelProperty(name = "hourlyUsage", value = "App hourly usage") + private long hourlyUsage; + @ApiModelProperty(name = "dailyUsage", value = "App daily usage") + private long dailyUsage; public String getType() { @@ -179,4 +183,20 @@ public class Application implements Serializable { public void setActive(boolean active) { isActive = active; } + + public long getHourlyUsage() { + return hourlyUsage; + } + + public void setHourlyUsage(long hourlyUsage) { + this.hourlyUsage = hourlyUsage; + } + + public long getDailyUsage() { + return dailyUsage; + } + + public void setDailyUsage(long dailyUsage) { + this.dailyUsage = dailyUsage; + } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java index def109fd04..0a61682060 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java @@ -144,8 +144,9 @@ public final class DeviceManagementConstants { private Report() { throw new AssertionError(); } + public static final String REPORTING_EVENT_HOST = "iot.reporting.event.host"; public static final String REPORTING_CONTEXT = "/event"; public static final String DEVICE_INFO_ENDPOINT = REPORTING_CONTEXT + "/device-info"; - public static final String REPORTING_EVENT_HOST = "iot.reporting.event.host"; + public static final String APP_USAGE_ENDPOINT = REPORTING_CONTEXT + "/app-usage"; } }