From 4638d25ff112c4317872914e17ec1434127d185b Mon Sep 17 00:00:00 2001 From: prabathabey Date: Wed, 18 Mar 2015 22:00:19 +0530 Subject: [PATCH] Code cleanup --- .../device/mgt/common/FeatureManager.java | 2 +- .../common/operation/mgt/OperationManager.java | 18 ++++-------------- .../DeviceManagementServiceProviderImpl.java | 5 ----- .../operation/mgt/OperationManagerImpl.java | 5 ----- .../service/DeviceManagementServiceImpl.java | 5 ----- 5 files changed, 5 insertions(+), 30 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/FeatureManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/FeatureManager.java index 41f4211d418..16d2f4063f6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/FeatureManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/FeatureManager.java @@ -24,7 +24,7 @@ public interface FeatureManager { boolean addFeature(Feature feature) throws DeviceManagementException; - boolean getFeature(String name) throws DeviceManagementException; + Feature getFeature(String name) throws DeviceManagementException; List getFeatures() throws DeviceManagementException; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManager.java index 3f134c69ad5..a804eaa5148 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManager.java @@ -35,8 +35,8 @@ public interface OperationManager { * @throws OperationManagementException If some unusual behaviour is observed while adding the * operation */ - public boolean addOperation(Operation operation, List devices) - throws OperationManagementException; + public boolean addOperation(Operation operation, + List devices) throws OperationManagementException; /** * Method to retrieve the list of all operations to a device. @@ -45,8 +45,7 @@ public interface OperationManager { * @throws OperationManagementException If some unusual behaviour is observed while fetching the * operation list. */ - public List getOperations(DeviceIdentifier deviceId) - throws OperationManagementException; + public List getOperations(DeviceIdentifier deviceId) throws OperationManagementException; /** * Method to retrieve the list of available operations to a device. @@ -55,15 +54,6 @@ public interface OperationManager { * @throws OperationManagementException If some unusual behaviour is observed while fetching the * operation list. */ - public List getPendingOperations(DeviceIdentifier deviceId) - throws OperationManagementException; - - /** - * TODO: Move this into a separate FeatureManager - * @param deviceType - Device type - * @return a list of Feature objects. - * @throws org.wso2.carbon.device.mgt.common.FeatureManagementException - */ - public List getFeatures(String deviceType) throws FeatureManagementException; + public List getPendingOperations(DeviceIdentifier deviceId) throws OperationManagementException; } \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementServiceProviderImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementServiceProviderImpl.java index 79b628349be..7cabd1002b6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementServiceProviderImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementServiceProviderImpl.java @@ -247,9 +247,4 @@ public class DeviceManagementServiceProviderImpl implements DeviceManagementServ return operationManager.getPendingOperations(deviceId); } - @Override - public List getFeatures(String deviceType) throws FeatureManagementException { - return operationManager.getFeatures(deviceType); - } - } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java index 2dd3b844f71..398cd8f1316 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java @@ -85,11 +85,6 @@ public class OperationManagerImpl implements OperationManager { return null; } - @Override - public List getFeatures(String deviceType) throws FeatureManagementException { - return null; - } - private OperationDAO lookupOperationDAO(Operation operation) { if (operation instanceof CommandOperation) { return commandOperationDAO; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementServiceImpl.java index c7b69370310..6cbe38b6eb8 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementServiceImpl.java @@ -127,9 +127,4 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { return DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getPendingOperations(deviceId); } - @Override - public List getFeatures(String deviceType) throws FeatureManagementException { - return DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getFeatures(deviceType); - } - }