From dc33b8e69dc95e2e14698859c63451f6673176ac Mon Sep 17 00:00:00 2001 From: Dilshan Edirisuriya Date: Fri, 20 Feb 2015 16:49:37 +0530 Subject: [PATCH] Implementing getDevice in iOS --- .../mobile/impl/ios/IOSDeviceManagerService.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSDeviceManagerService.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSDeviceManagerService.java index d39bc806d7..986495982b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSDeviceManagerService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSDeviceManagerService.java @@ -121,7 +121,20 @@ public class IOSDeviceManagerService implements DeviceManagerService { @Override public Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException { - return null; + Device device; + try { + if (log.isDebugEnabled()) { + log.debug("Getting the details of iOS device : " + deviceId.getId()); + } + MobileDevice mobileDevice = MobileDeviceManagementDAOFactory.getMobileDeviceDAO(). + getMobileDevice(deviceId.getId()); + device = MobileDeviceManagementUtil.convertToDevice(mobileDevice); + } catch (MobileDeviceManagementDAOException e) { + String msg = "Error while fetching the iOS device : " + deviceId.getId(); + log.error(msg, e); + throw new DeviceManagementException(msg, e); + } + return device; } @Override