From 9697c1fa99354abc65cb5a673d8f7ddb114522ca Mon Sep 17 00:00:00 2001 From: harshanL Date: Wed, 10 Dec 2014 17:10:12 +0530 Subject: [PATCH 1/2] Added comments to the DeviceManagerService interface --- .../mgt/common/spi/DeviceManagerService.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagerService.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagerService.java index 319acca3c8..bc3cc6d270 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagerService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagerService.java @@ -62,8 +62,9 @@ public interface DeviceManagerService { * Method to retrieve the status of the registration process of a particular device. * * @param deviceId Fully qualified device identifier - * @return Status of enrollment - * @throws DeviceManagementException If some unusual behaviour is observed while enrolling a device + * @return Status of enrollment + * @throws DeviceManagementException If some unusual behaviour is observed while checking the enrollment + * status of the device */ boolean isEnrolled(DeviceIdentifier deviceId) throws DeviceManagementException; @@ -71,8 +72,9 @@ public interface DeviceManagerService { * Method to retrieve the status of a particular device. * * @param deviceId Fully qualified device identifier - * @return Returns if the device is active - * @throws DeviceManagementException If some unusual behaviour is observed while enrolling a device + * @return Returns if the device is active + * @throws DeviceManagementException If some unusual behaviour is observed while checking the status + * of the device */ boolean isActive(DeviceIdentifier deviceId) throws DeviceManagementException; @@ -82,7 +84,8 @@ public interface DeviceManagerService { * * @param deviceId Fully qualified device identifier * @param status Indicates whether the device is active - * @throws DeviceManagementException If some unusual behaviour is observed while enrolling a device + * @throws DeviceManagementException If some unusual behaviour is observed while updating the active status + * of the device */ boolean setActive(DeviceIdentifier deviceId, boolean status) throws DeviceManagementException; @@ -90,7 +93,8 @@ public interface DeviceManagerService { * Method to retrieve metadata of all devices registered within CDM corresponding to a particular device type. * * @param type Device Type - * @return List of metadata corresponding to all devices registered within CDM + * @return List of metadata corresponding to all devices registered within CDM + * @throws DeviceManagementException If some unusual behaviour is observed while obtaining the enrolled device list */ List getAllDevices(String type) throws DeviceManagementException; @@ -99,14 +103,14 @@ public interface DeviceManagerService { * * @param deviceId Fully qualified device identifier * @return Metadata corresponding to a particular device - * @throws DeviceManagementException If some unusual behaviour is observed while enrolling a device + * @throws DeviceManagementException If some unusual behaviour is observed obtaining the device object */ Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException; /** * Method to update device information. * @param device Updated device information related data - * @throws DeviceManagementException If some unusual behaviour is observed while enrolling a device + * @throws DeviceManagementException If some unusual behaviour is observed while updating the device info */ boolean updateDeviceInfo(Device device) throws DeviceManagementException; @@ -115,7 +119,8 @@ public interface DeviceManagerService { * * @param deviceId Fully qualified device identifier * @param ownershipType Type of ownership - * @throws DeviceManagementException If some unusual behaviour is observed while enrolling a device + * @throws DeviceManagementException If some unusual behaviour is observed while setting the ownership + * of the device */ boolean setOwnership(DeviceIdentifier deviceId, String ownershipType) throws DeviceManagementException; From c199f6fe69e408ee77919656ae3956ebac27501d Mon Sep 17 00:00:00 2001 From: prabathabey Date: Wed, 10 Dec 2014 17:53:54 +0530 Subject: [PATCH 2/2] Renaming MobileDeviceManagementServiceComponent.java as MobileDeviceManagementBundleActivator.java and adding missing Bundle-Activator header in org.wso2.carbon.device.mgt.mobile.impl pom --- .../device-mgt/org.wso2.carbon.device.mgt.mobile.impl/pom.xml | 1 + ...ponent.java => MobileDeviceManagementBundleActivator.java} | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) rename components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/{MobileDeviceManagementServiceComponent.java => MobileDeviceManagementBundleActivator.java} (96%) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/pom.xml index 043e0dd60e..8dd8ef138c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/pom.xml @@ -35,6 +35,7 @@ ${project.artifactId} ${project.version} Device Management Mobile Impl Bundle + org.wso2.carbon.device.mgt.mobile.impl.internal.MobileDeviceManagementBundleActivator org.wso2.carbon.device.mgt.mobile.impl.internal org.osgi.framework, diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/MobileDeviceManagementServiceComponent.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/MobileDeviceManagementBundleActivator.java similarity index 96% rename from components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/MobileDeviceManagementServiceComponent.java rename to components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/MobileDeviceManagementBundleActivator.java index 7978214969..e614119492 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/MobileDeviceManagementServiceComponent.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/MobileDeviceManagementBundleActivator.java @@ -26,9 +26,9 @@ import org.wso2.carbon.device.mgt.mobile.impl.android.AndroidDeviceManagerServic import org.wso2.carbon.device.mgt.mobile.impl.ios.IOSDeviceManagerService; import org.wso2.carbon.device.mgt.mobile.impl.windows.WindowsDeviceManagerService; -public class MobileDeviceManagementServiceComponent implements BundleActivator { +public class MobileDeviceManagementBundleActivator implements BundleActivator { - private static final Log log = LogFactory.getLog(MobileDeviceManagementServiceComponent.class); + private static final Log log = LogFactory.getLog(MobileDeviceManagementBundleActivator.class); private ServiceRegistration androidServiceRegRef; private ServiceRegistration iOSServiceRegRef; private ServiceRegistration windowsServiceRegRef;