From 23138855a77799c489b8b3ce69e7285f929ea819 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Sun, 23 Oct 2016 01:24:58 +0530 Subject: [PATCH] added changes in feature extraction for device types --- .../plugin/impl/feature/AndroidSenseFeatureManager.java | 5 +++-- .../arduino/plugin/impl/feature/ArduinoFeatureManager.java | 5 +++-- .../plugin/impl/feature/RaspberrypiFeatureManager.java | 5 +++-- .../plugin/impl/feature/VirtualFirealarmFeatureManager.java | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/plugin/impl/feature/AndroidSenseFeatureManager.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/plugin/impl/feature/AndroidSenseFeatureManager.java index 1fb947ae65..2545e8159f 100644 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/plugin/impl/feature/AndroidSenseFeatureManager.java +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/plugin/impl/feature/AndroidSenseFeatureManager.java @@ -17,6 +17,7 @@ package org.wso2.carbon.device.mgt.iot.androidsense.plugin.impl.feature; import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.DeviceTypeIdentifier; import org.wso2.carbon.device.mgt.common.Feature; import org.wso2.carbon.device.mgt.common.FeatureManager; import org.wso2.carbon.device.mgt.extensions.feature.mgt.GenericFeatureManager; @@ -38,13 +39,13 @@ public class AndroidSenseFeatureManager implements FeatureManager { @Override public Feature getFeature(String name) throws DeviceManagementException { GenericFeatureManager genericFeatureManager = GenericFeatureManager.getInstance(); - return genericFeatureManager.getFeature(AndroidSenseConstants.DEVICE_TYPE, name); + return genericFeatureManager.getFeature(new DeviceTypeIdentifier(AndroidSenseConstants.DEVICE_TYPE), name); } @Override public List getFeatures() throws DeviceManagementException { GenericFeatureManager genericFeatureManager = GenericFeatureManager.getInstance(); - return genericFeatureManager.getFeatures(AndroidSenseConstants.DEVICE_TYPE); + return genericFeatureManager.getFeatures(new DeviceTypeIdentifier(AndroidSenseConstants.DEVICE_TYPE)); } @Override diff --git a/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/plugin/impl/feature/ArduinoFeatureManager.java b/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/plugin/impl/feature/ArduinoFeatureManager.java index d693f8e5bc..5ffdbcfe10 100644 --- a/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/plugin/impl/feature/ArduinoFeatureManager.java +++ b/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/plugin/impl/feature/ArduinoFeatureManager.java @@ -17,6 +17,7 @@ package org.wso2.carbon.device.mgt.iot.arduino.plugin.impl.feature; import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.DeviceTypeIdentifier; import org.wso2.carbon.device.mgt.common.Feature; import org.wso2.carbon.device.mgt.common.FeatureManager; import org.wso2.carbon.device.mgt.extensions.feature.mgt.GenericFeatureManager; @@ -38,13 +39,13 @@ public class ArduinoFeatureManager implements FeatureManager { @Override public Feature getFeature(String name) throws DeviceManagementException { GenericFeatureManager genericFeatureManager = GenericFeatureManager.getInstance(); - return genericFeatureManager.getFeature(ArduinoConstants.DEVICE_TYPE, name); + return genericFeatureManager.getFeature(new DeviceTypeIdentifier(ArduinoConstants.DEVICE_TYPE), name); } @Override public List getFeatures() throws DeviceManagementException { GenericFeatureManager genericFeatureManager = GenericFeatureManager.getInstance(); - return genericFeatureManager.getFeatures(ArduinoConstants.DEVICE_TYPE); + return genericFeatureManager.getFeatures(new DeviceTypeIdentifier(ArduinoConstants.DEVICE_TYPE)); } @Override diff --git a/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/plugin/impl/feature/RaspberrypiFeatureManager.java b/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/plugin/impl/feature/RaspberrypiFeatureManager.java index 755b7ae0d5..5cbe715e39 100644 --- a/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/plugin/impl/feature/RaspberrypiFeatureManager.java +++ b/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/plugin/impl/feature/RaspberrypiFeatureManager.java @@ -16,6 +16,7 @@ package org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.impl.feature; import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.DeviceTypeIdentifier; import org.wso2.carbon.device.mgt.common.Feature; import org.wso2.carbon.device.mgt.common.FeatureManager; import org.wso2.carbon.device.mgt.extensions.feature.mgt.GenericFeatureManager; @@ -37,13 +38,13 @@ public class RaspberrypiFeatureManager implements FeatureManager { @Override public Feature getFeature(String name) throws DeviceManagementException { GenericFeatureManager genericFeatureManager = GenericFeatureManager.getInstance(); - return genericFeatureManager.getFeature(RaspberrypiConstants.DEVICE_TYPE, name); + return genericFeatureManager.getFeature(new DeviceTypeIdentifier(RaspberrypiConstants.DEVICE_TYPE), name); } @Override public List getFeatures() throws DeviceManagementException { GenericFeatureManager genericFeatureManager = GenericFeatureManager.getInstance(); - return genericFeatureManager.getFeatures(RaspberrypiConstants.DEVICE_TYPE); + return genericFeatureManager.getFeatures(new DeviceTypeIdentifier(RaspberrypiConstants.DEVICE_TYPE)); } @Override diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/impl/feature/VirtualFirealarmFeatureManager.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/impl/feature/VirtualFirealarmFeatureManager.java index 7290b61794..23159ebfda 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/impl/feature/VirtualFirealarmFeatureManager.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/impl/feature/VirtualFirealarmFeatureManager.java @@ -16,6 +16,7 @@ package org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.impl.feature; import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.DeviceTypeIdentifier; import org.wso2.carbon.device.mgt.common.Feature; import org.wso2.carbon.device.mgt.common.FeatureManager; import org.wso2.carbon.device.mgt.extensions.feature.mgt.GenericFeatureManager; @@ -37,13 +38,13 @@ public class VirtualFirealarmFeatureManager implements FeatureManager{ @Override public Feature getFeature(String name) throws DeviceManagementException { GenericFeatureManager genericFeatureManager = GenericFeatureManager.getInstance(); - return genericFeatureManager.getFeature(VirtualFireAlarmConstants.DEVICE_TYPE, name); + return genericFeatureManager.getFeature(new DeviceTypeIdentifier(VirtualFireAlarmConstants.DEVICE_TYPE), name); } @Override public List getFeatures() throws DeviceManagementException { GenericFeatureManager genericFeatureManager = GenericFeatureManager.getInstance(); - return genericFeatureManager.getFeatures(VirtualFireAlarmConstants.DEVICE_TYPE); + return genericFeatureManager.getFeatures(new DeviceTypeIdentifier(VirtualFireAlarmConstants.DEVICE_TYPE)); } @Override