From 47572d08f555999d1ecb9f5d9ebdbd444fd32dd6 Mon Sep 17 00:00:00 2001 From: prabathabey Date: Mon, 25 Apr 2016 20:29:11 +0530 Subject: [PATCH 1/4] Removing obsolete dependencies to ApplicationManager interface from DeviceManagementService SPI --- .../common/spi/DeviceManagementService.java | 5 +-- .../mgt/core/TestDeviceManagementService.java | 35 ------------------- 2 files changed, 3 insertions(+), 37 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagementService.java index 143fd1e8db..80bf030305 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagementService.java @@ -30,7 +30,7 @@ import java.util.List; * Composite interface that acts as the SPI exposing all device management as well as application management * functionalities. */ -public interface DeviceManagementService extends ApplicationManager { +public interface DeviceManagementService { /** * Method to retrieve the provider type that implements DeviceManager interface. @@ -58,6 +58,7 @@ public interface DeviceManagementService extends ApplicationManager { ApplicationManager getApplicationManager(); - void notifyOperationToDevices(Operation operation, List deviceIds) throws DeviceManagementException; + void notifyOperationToDevices(Operation operation, + List deviceIds) throws DeviceManagementException; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManagementService.java index c94a00fe8d..c3f15b7711 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManagementService.java @@ -74,39 +74,4 @@ public class TestDeviceManagementService implements DeviceManagementService { } - @Override - public Application[] getApplications(String domain, int pageNumber, int size) - throws ApplicationManagementException { - return new Application[0]; - } - - @Override - public void updateApplicationStatus(DeviceIdentifier deviceId, Application application, String status) - throws ApplicationManagementException { - - } - - @Override - public String getApplicationStatus(DeviceIdentifier deviceId, Application application) - throws ApplicationManagementException { - return null; - } - - @Override - public void installApplicationForDevices(Operation operation, List deviceIdentifiers) - throws ApplicationManagementException { - - } - - @Override - public void installApplicationForUsers(Operation operation, List userNameList) - throws ApplicationManagementException { - - } - - @Override - public void installApplicationForUserRoles(Operation operation, List userRoleList) - throws ApplicationManagementException { - - } } From f2ba20baeb5d1cfc71ad75d64a4ba4282ef15123 Mon Sep 17 00:00:00 2001 From: prabathabey Date: Mon, 25 Apr 2016 20:42:10 +0530 Subject: [PATCH 2/4] Code cleanup --- .../device/mgt/core/TestDeviceManagementService.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManagementService.java index c3f15b7711..1e8c533d7e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManagementService.java @@ -17,17 +17,12 @@ */ package org.wso2.carbon.device.mgt.core; -import org.wso2.carbon.device.mgt.common.*; -import org.wso2.carbon.device.mgt.common.app.mgt.Application; -import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; +import org.wso2.carbon.device.mgt.common.DeviceIdentifier; +import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.DeviceManager; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager; -import org.wso2.carbon.device.mgt.common.license.mgt.License; -import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; -import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; -import org.wso2.carbon.device.mgt.core.common.TestDataHolder; -import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import java.util.List; From a10a693507081539f03767dde61708a4e2b232a7 Mon Sep 17 00:00:00 2001 From: prabathabey Date: Mon, 25 Apr 2016 21:07:57 +0530 Subject: [PATCH 3/4] Fixing find bugs reported issues --- .../org/wso2/carbon/device/mgt/common/EnrolmentInfo.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/EnrolmentInfo.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/EnrolmentInfo.java index 7b3ff89d1f..eb37127d2e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/EnrolmentInfo.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/EnrolmentInfo.java @@ -118,4 +118,10 @@ public class EnrolmentInfo implements Serializable { } return false; } + + @Override + public int hashCode() { + return owner.hashCode() ^ ownership.hashCode(); + } + } From aef892fece0b5a32ebc00c1d7d4870a4e46564e6 Mon Sep 17 00:00:00 2001 From: prabathabey Date: Mon, 25 Apr 2016 21:08:14 +0530 Subject: [PATCH 4/4] Code cleanup --- .../mgt/TenantConfiguration.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/configuration/mgt/TenantConfiguration.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/configuration/mgt/TenantConfiguration.java index 3f326d2000..ece6a23a78 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/configuration/mgt/TenantConfiguration.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/configuration/mgt/TenantConfiguration.java @@ -28,29 +28,29 @@ import java.util.List; /** * Represents the tenant configuration for a device platform. */ -@XmlRootElement(name="tenantConfiguration") +@XmlRootElement(name = "tenantConfiguration") @XmlAccessorType(XmlAccessType.NONE) -public class TenantConfiguration implements Serializable{ +public class TenantConfiguration implements Serializable { - @XmlElement(name="type") - private String type; - @XmlElement(name="configuration") - private List configuration; + @XmlElement(name = "type") + private String type; + @XmlElement(name = "configuration") + private List configuration; - public String getType() { - return type; - } + public String getType() { + return type; + } - public void setType(String type) { - this.type = type; - } + public void setType(String type) { + this.type = type; + } - public List getConfiguration() { - return configuration; - } + public List getConfiguration() { + return configuration; + } - public void setConfiguration(List configuration) { - this.configuration = configuration; - } + public void setConfiguration(List configuration) { + this.configuration = configuration; + } }