From c092542b8e39b093c3e36d43498c0ac5201778f1 Mon Sep 17 00:00:00 2001 From: buddhinipun Date: Wed, 8 Jun 2016 17:46:19 +0530 Subject: [PATCH] changes to mac device --- .../api/DeviceTypeServiceImpl.java | 20 +++++++------------ .../infocollector/Collector.java | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/modules/samples/connectedlap/component/api/src/main/java/org.wso2/connectedlap/api/DeviceTypeServiceImpl.java b/modules/samples/connectedlap/component/api/src/main/java/org.wso2/connectedlap/api/DeviceTypeServiceImpl.java index 16a743e7..8ed7de14 100644 --- a/modules/samples/connectedlap/component/api/src/main/java/org.wso2/connectedlap/api/DeviceTypeServiceImpl.java +++ b/modules/samples/connectedlap/component/api/src/main/java/org.wso2/connectedlap/api/DeviceTypeServiceImpl.java @@ -337,25 +337,19 @@ public class DeviceTypeServiceImpl implements DeviceTypeService { String summeryTableName; switch (sensorName) { case "battery" : - summeryTableName = DeviceTypeConstants.DEVICE_BATTERY_STATS; - break; + return DeviceTypeConstants.DEVICE_BATTERY_STATS; case "charger": - summeryTableName = DeviceTypeConstants.DEVICE_CHARGER_STATS; - break; + return DeviceTypeConstants.DEVICE_CHARGER_STATS; case "cpu": - summeryTableName = DeviceTypeConstants.DEVICE_CPU_STATS; - break; + return DeviceTypeConstants.DEVICE_CPU_STATS; case "network": - summeryTableName = DeviceTypeConstants.DEVICE_NETWORK_STATS; - break; + return DeviceTypeConstants.DEVICE_NETWORK_STATS; case "memory": - summeryTableName = DeviceTypeConstants.DEVICE_MEMORY_STATS; - break; + return DeviceTypeConstants.DEVICE_MEMORY_STATS; case "harddisc": - summeryTableName = DeviceTypeConstants.DEVICE_HARD_DISC_STATS; - break; + return DeviceTypeConstants.DEVICE_HARD_DISC_STATS; default: - summeryTableName = ""; + return null; } summeryTableName= summeryTableName.replaceAll("\\u200B",""); return summeryTableName; diff --git a/modules/samples/connectedlap/component/laptopagent/src/main/java/org/wso2/agent/resourcemonitor/infocollector/Collector.java b/modules/samples/connectedlap/component/laptopagent/src/main/java/org/wso2/agent/resourcemonitor/infocollector/Collector.java index cbac0710..74a1e059 100644 --- a/modules/samples/connectedlap/component/laptopagent/src/main/java/org/wso2/agent/resourcemonitor/infocollector/Collector.java +++ b/modules/samples/connectedlap/component/laptopagent/src/main/java/org/wso2/agent/resourcemonitor/infocollector/Collector.java @@ -68,7 +68,7 @@ public class Collector { BashRunner bashRunner = new BashRunner(); systemUsage.setMacaddress(bashRunner.runScript(this.OS, 0,suPassword)); systemUsage.setProcessor_usage(Float.valueOf(bashRunner.runScript(this.OS, 10,suPassword))); - systemUsage.setMemory_usage(Float.valueOf(bashRunner.runScript(this.OS, 11,suPassword))); + //systemUsage.setMemory_usage(Float.valueOf(bashRunner.runScript(this.OS, 11,suPassword))); systemUsage.setStorage_usage(Float.valueOf(bashRunner.runScript(this.OS, 12,suPassword))); systemUsage.setBattery_percentage(Float.valueOf(bashRunner.runScript(this.OS, 13,suPassword))); systemUsage.setBattery_pluggedin(Byte.valueOf(bashRunner.runScript(this.OS, 14,suPassword)));