From 641cc58bbf86f1f0a2deb642ee395917ec66f06b Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Wed, 7 Dec 2016 14:37:10 +0530 Subject: [PATCH] Fixing enrollment broken issue --- .../mgt/core/service/DeviceManagementProviderService.java | 6 ++++++ .../core/service/DeviceManagementProviderServiceImpl.java | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java index 317f875b1cc..626203c304d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java @@ -220,6 +220,12 @@ public interface DeviceManagementProviderService { boolean setActive(DeviceIdentifier deviceId, boolean status) throws DeviceManagementException; + /** + * Returns the device of specified id. + * @param deviceId device Id + * @return Device returns null when device is not avaialble. + * @throws DeviceManagementException + */ Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException; Device getDevice(DeviceIdentifier deviceId, Date since) throws DeviceManagementException; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index fff5607ecfe..d0b4f58a36b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -828,7 +828,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv if (log.isDebugEnabled()) { log.debug(msg); } - throw new DeviceManagementException(msg); + return null; } DeviceInfo info = deviceInfoDAO.getDeviceInformation(device.getId()); DeviceLocation location = deviceInfoDAO.getDeviceLocation(device.getId());