From 7358a5145b1237839a31df3e73a7e7c280a2fb5d Mon Sep 17 00:00:00 2001 From: Dilshan Edirisuriya Date: Tue, 17 Feb 2015 19:51:01 +0530 Subject: [PATCH 01/15] Implementing iOS plugin services --- .../impl/ios/IOSDeviceManagerService.java | 21 ++++++++++++++++++- 1 file changed, 20 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 0a2f4172f..ae030bbaf 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 @@ -18,8 +18,14 @@ package org.wso2.carbon.device.mgt.mobile.impl.ios; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.*; import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService; +import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOException; +import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOFactory; +import org.wso2.carbon.device.mgt.mobile.dto.MobileDevice; +import org.wso2.carbon.device.mgt.mobile.util.MobileDeviceManagementUtil; import java.util.List; @@ -28,6 +34,8 @@ import java.util.List; */ public class IOSDeviceManagerService implements DeviceManagerService { + private static final Log log = LogFactory.getLog(IOSDeviceManagerService.class); + @Override public String getProviderType() { return DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_IOS; @@ -35,7 +43,18 @@ public class IOSDeviceManagerService implements DeviceManagerService { @Override public boolean enrollDevice(Device device) throws DeviceManagementException { - return true; + boolean status; + MobileDevice mobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(device); + try { + status = MobileDeviceManagementDAOFactory.getMobileDeviceDAO().addMobileDevice( + mobileDevice); + } catch (MobileDeviceManagementDAOException e) { + String msg = "Error while enrolling the iOS device : " + + device.getDeviceIdentifier(); + log.error(msg, e); + throw new DeviceManagementException(msg, e); + } + return status; } @Override From bbd6ff8343bf0b9cbb6aa82821145db0fffcf2df Mon Sep 17 00:00:00 2001 From: Dilshan Edirisuriya Date: Thu, 19 Feb 2015 15:29:29 +0530 Subject: [PATCH 02/15] Implementing isEnrolled method --- .../impl/ios/IOSDeviceManagerService.java | 19 ++++++++++++++++++- 1 file changed, 18 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 ae030bbaf..0fa0a2e4e 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 @@ -69,7 +69,24 @@ public class IOSDeviceManagerService implements DeviceManagerService { @Override public boolean isEnrolled(DeviceIdentifier deviceId) throws DeviceManagementException { - return true; + boolean isEnrolled = false; + try { + if (log.isDebugEnabled()) { + log.debug("Checking the enrollment of iOS device : " + deviceId.getId()); + } + MobileDevice mobileDevice = + MobileDeviceManagementDAOFactory.getMobileDeviceDAO().getMobileDevice( + deviceId.getId()); + if (mobileDevice != null) { + isEnrolled = true; + } + } catch (MobileDeviceManagementDAOException e) { + String msg = "Error while checking the enrollment status of iOS device : " + + deviceId.getId(); + log.error(msg, e); + throw new DeviceManagementException(msg, e); + } + return isEnrolled; } @Override From 3d75d58782f9f1ef3d715d450b51b8a2304516f3 Mon Sep 17 00:00:00 2001 From: harshanL Date: Thu, 19 Feb 2015 17:35:37 +0530 Subject: [PATCH 03/15] Changed mobile-device database schema & DAO layer --- .../pom.xml | 20 ++++-- .../mobile/dao/impl/MobileDeviceDAOImpl.java | 46 +++++++++---- .../device/mgt/mobile/dto/MobileDevice.java | 46 +++++++++++-- .../util/MobileDeviceManagementUtil.java | 18 ++++- .../impl/dao/MobileDeviceDAOTestSuite.java | 65 +++++++++++++++---- ...ileDeviceOperationMappingDAOTestSuite.java | 10 ++- .../src/test/resources/sql/CreateH2TestDB.sql | 6 +- 7 files changed, 167 insertions(+), 44 deletions(-) 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 1f219c779..9371b178d 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 @@ -53,21 +53,27 @@ ${project.artifactId} ${project.artifactId} ${carbon.mobile.device.mgt.version} - Device Management Mobile Impl Bundle - - - org.wso2.carbon.device.mgt.mobile.internal - + Device Management Mobile Impl Bundle + org.wso2.carbon.device.mgt.mobile.internal org.osgi.framework, org.osgi.service.component, org.apache.commons.logging, + javax.xml.bind.*, + javax.naming, + javax.sql, + javax.xml.bind.annotation, + javax.xml.parsers, + org.w3c.dom, + org.wso2.carbon.core, + org.wso2.carbon.utils.*, + org.wso2.carbon.device.mgt.common.*, + org.wso2.carbon.apimgt.*; !org.wso2.carbon.device.mgt.mobile.internal, - org.wso2.carbon.device.mgt.mobile.* + org.wso2.carbon.device.mgt.mobile.*, - * diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/impl/MobileDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/impl/MobileDeviceDAOImpl.java index 1c882515f..a74e4b383 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/impl/MobileDeviceDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/impl/MobileDeviceDAOImpl.java @@ -53,15 +53,16 @@ public class MobileDeviceDAOImpl implements MobileDeviceDAO { try { conn = this.getConnection(); String selectDBQuery = - "SELECT MOBILE_DEVICE_ID, REG_ID, IMEI, IMSI, OS_VERSION,DEVICE_MODEL, VENDOR, " + - "LATITUDE, LONGITUDE FROM MBL_DEVICE WHERE MOBILE_DEVICE_ID = ?"; + "SELECT MOBILE_DEVICE_ID, PUSH_TOKEN, IMEI, IMSI, OS_VERSION,DEVICE_MODEL, VENDOR, " + + "LATITUDE, LONGITUDE, CHALLENGE, SERIAL, TOKEN, UNLOCK_TOKEN FROM MBL_DEVICE" + + " WHERE MOBILE_DEVICE_ID = ?"; stmt = conn.prepareStatement(selectDBQuery); stmt.setString(1, mblDeviceId); ResultSet resultSet = stmt.executeQuery(); if (resultSet.next()) { mobileDevice = new MobileDevice(); mobileDevice.setMobileDeviceId(resultSet.getString(1)); - mobileDevice.setRegId(resultSet.getString(2)); + mobileDevice.setPushToken(resultSet.getString(2)); mobileDevice.setImei(resultSet.getString(3)); mobileDevice.setImsi(resultSet.getString(4)); mobileDevice.setOsVersion(resultSet.getString(5)); @@ -69,6 +70,10 @@ public class MobileDeviceDAOImpl implements MobileDeviceDAO { mobileDevice.setVendor(resultSet.getString(7)); mobileDevice.setLatitude(resultSet.getString(8)); mobileDevice.setLongitude(resultSet.getString(9)); + mobileDevice.setChallenge(resultSet.getString(10)); + mobileDevice.setSerial(resultSet.getString(11)); + mobileDevice.setToken(resultSet.getString(12)); + mobileDevice.setUnlockToken(resultSet.getString(13)); if (log.isDebugEnabled()) { log.debug("Mobile device " + mblDeviceId + " data has fetched from MDM database."); } @@ -93,12 +98,13 @@ public class MobileDeviceDAOImpl implements MobileDeviceDAO { try { conn = this.getConnection(); String createDBQuery = - "INSERT INTO MBL_DEVICE(MOBILE_DEVICE_ID, REG_ID, IMEI, IMSI, OS_VERSION," + - "DEVICE_MODEL, VENDOR, LATITUDE, LONGITUDE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"; + "INSERT INTO MBL_DEVICE(MOBILE_DEVICE_ID, PUSH_TOKEN, IMEI, IMSI, OS_VERSION," + + "DEVICE_MODEL, VENDOR, LATITUDE, LONGITUDE, CHALLENGE, SERIAL, TOKEN, " + + "UNLOCK_TOKEN) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; stmt = conn.prepareStatement(createDBQuery); stmt.setString(1, mobileDevice.getMobileDeviceId()); - stmt.setString(2, mobileDevice.getRegId()); + stmt.setString(2, mobileDevice.getPushToken()); stmt.setString(3, mobileDevice.getImei()); stmt.setString(4, mobileDevice.getImsi()); stmt.setString(5, mobileDevice.getOsVersion()); @@ -106,6 +112,10 @@ public class MobileDeviceDAOImpl implements MobileDeviceDAO { stmt.setString(7, mobileDevice.getVendor()); stmt.setString(8, mobileDevice.getLatitude()); stmt.setString(9, mobileDevice.getLongitude()); + stmt.setString(10, mobileDevice.getChallenge()); + stmt.setString(11, mobileDevice.getSerial()); + stmt.setString(12, mobileDevice.getToken()); + stmt.setString(13, mobileDevice.getUnlockToken()); int rows = stmt.executeUpdate(); if (rows > 0) { status = true; @@ -134,11 +144,11 @@ public class MobileDeviceDAOImpl implements MobileDeviceDAO { try { conn = this.getConnection(); String updateDBQuery = - "UPDATE MBL_DEVICE SET REG_ID = ?, IMEI = ?, IMSI = ?, OS_VERSION = ?," + - "DEVICE_MODEL = ?, VENDOR = ? , LATITUDE = ?, LONGITUDE = ? " + - "WHERE MOBILE_DEVICE_ID = ?"; + "UPDATE MBL_DEVICE SET PUSH_TOKEN = ?, IMEI = ?, IMSI = ?, OS_VERSION = ?," + + "DEVICE_MODEL = ?, VENDOR = ? , LATITUDE = ?, LONGITUDE = ?, CHALLENGE = ?," + + "SERIAL = ?, TOKEN = ?, UNLOCK_TOKEN = ? WHERE MOBILE_DEVICE_ID = ?"; stmt = conn.prepareStatement(updateDBQuery); - stmt.setString(1, mobileDevice.getRegId()); + stmt.setString(1, mobileDevice.getPushToken()); stmt.setString(2, mobileDevice.getImei()); stmt.setString(3, mobileDevice.getImsi()); stmt.setString(4, mobileDevice.getOsVersion()); @@ -146,7 +156,11 @@ public class MobileDeviceDAOImpl implements MobileDeviceDAO { stmt.setString(6, mobileDevice.getVendor()); stmt.setString(7, mobileDevice.getLatitude()); stmt.setString(8, mobileDevice.getLongitude()); - stmt.setString(9, mobileDevice.getMobileDeviceId()); + stmt.setString(9, mobileDevice.getChallenge()); + stmt.setString(10, mobileDevice.getSerial()); + stmt.setString(11, mobileDevice.getToken()); + stmt.setString(12, mobileDevice.getUnlockToken()); + stmt.setString(13, mobileDevice.getMobileDeviceId()); int rows = stmt.executeUpdate(); if (rows > 0) { status = true; @@ -204,14 +218,14 @@ public class MobileDeviceDAOImpl implements MobileDeviceDAO { try { conn = this.getConnection(); String selectDBQuery = - "SELECT MOBILE_DEVICE_ID, REG_ID, IMEI, IMSI, OS_VERSION,DEVICE_MODEL, VENDOR," + - "LATITUDE, LONGITUDE FROM MBL_DEVICE"; + "SELECT MOBILE_DEVICE_ID, PUSH_TOKEN, IMEI, IMSI, OS_VERSION,DEVICE_MODEL, VENDOR," + + "LATITUDE, LONGITUDE, CHALLENGE, SERIAL, TOKEN, UNLOCK_TOKEN FROM MBL_DEVICE"; stmt = conn.prepareStatement(selectDBQuery); ResultSet resultSet = stmt.executeQuery(); while (resultSet.next()) { mobileDevice = new MobileDevice(); mobileDevice.setMobileDeviceId(resultSet.getString(1)); - mobileDevice.setRegId(resultSet.getString(2)); + mobileDevice.setPushToken(resultSet.getString(2)); mobileDevice.setImei(resultSet.getString(3)); mobileDevice.setImsi(resultSet.getString(4)); mobileDevice.setOsVersion(resultSet.getString(5)); @@ -219,6 +233,10 @@ public class MobileDeviceDAOImpl implements MobileDeviceDAO { mobileDevice.setVendor(resultSet.getString(7)); mobileDevice.setLatitude(resultSet.getString(8)); mobileDevice.setLongitude(resultSet.getString(9)); + mobileDevice.setChallenge(resultSet.getString(10)); + mobileDevice.setSerial(resultSet.getString(11)); + mobileDevice.setToken(resultSet.getString(12)); + mobileDevice.setUnlockToken(resultSet.getString(13)); mobileDevices.add(mobileDevice); } if (log.isDebugEnabled()) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dto/MobileDevice.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dto/MobileDevice.java index b05a624e3..fab7845a1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dto/MobileDevice.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dto/MobileDevice.java @@ -26,7 +26,7 @@ import java.io.Serializable; public class MobileDevice implements Serializable { private String mobileDeviceId; - private String regId; + private String pushToken; private String imei; private String imsi; private String osVersion; @@ -34,6 +34,42 @@ public class MobileDevice implements Serializable { private String vendor; private String latitude; private String longitude; + private String serial; + private String unlockToken; + private String token; + private String challenge; + + public String getUnlockToken() { + return unlockToken; + } + + public void setUnlockToken(String unlockToken) { + this.unlockToken = unlockToken; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public String getChallenge() { + return challenge; + } + + public void setChallenge(String challenge) { + this.challenge = challenge; + } + + public String getSerial() { + return serial; + } + + public void setSerial(String serial) { + this.serial = serial; + } public String getMobileDeviceId() { return mobileDeviceId; @@ -43,12 +79,12 @@ public class MobileDevice implements Serializable { this.mobileDeviceId = mobileDeviceId; } - public String getRegId() { - return regId; + public String getPushToken() { + return pushToken; } - public void setRegId(String regId) { - this.regId = regId; + public void setPushToken(String pushToken) { + this.pushToken = pushToken; } public String getImei() { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/util/MobileDeviceManagementUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/util/MobileDeviceManagementUtil.java index 66fa5900d..952e40b4f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/util/MobileDeviceManagementUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/util/MobileDeviceManagementUtil.java @@ -42,12 +42,16 @@ public class MobileDeviceManagementUtil { private static final Log log = LogFactory.getLog(MobileDeviceManagementUtil.class); private static final String MOBILE_DEVICE_IMEI = "imei"; private static final String MOBILE_DEVICE_IMSI = "imsi"; - private static final String MOBILE_DEVICE_REG_ID = "regId"; + private static final String MOBILE_DEVICE_PUSH_TOKEN = "pushToken"; private static final String MOBILE_DEVICE_VENDOR = "vendor"; private static final String MOBILE_DEVICE_OS_VERSION = "osVersion"; private static final String MOBILE_DEVICE_MODEL = "model"; private static final String MOBILE_DEVICE_LATITUDE = "latitude"; private static final String MOBILE_DEVICE_LONGITUDE = "longitude"; + private static final String MOBILE_DEVICE_TOKEN = "token"; + private static final String MOBILE_DEVICE_SERIAL = "serial"; + private static final String MOBILE_DEVICE_UNLOCK_TOKEN = "unlockToken"; + private static final String MOBILE_DEVICE_CHALLENGE = "challenge"; public static Document convertToDocument(File file) throws DeviceManagementException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); @@ -87,12 +91,16 @@ public class MobileDeviceManagementUtil { mobileDevice.setMobileDeviceId(device.getDeviceIdentifier()); mobileDevice.setImei(getPropertyValue(device, MOBILE_DEVICE_IMEI)); mobileDevice.setImsi(getPropertyValue(device, MOBILE_DEVICE_IMSI)); - mobileDevice.setRegId(getPropertyValue(device, MOBILE_DEVICE_REG_ID)); + mobileDevice.setPushToken(getPropertyValue(device, MOBILE_DEVICE_PUSH_TOKEN)); mobileDevice.setModel(getPropertyValue(device, MOBILE_DEVICE_MODEL)); mobileDevice.setOsVersion(getPropertyValue(device, MOBILE_DEVICE_OS_VERSION)); mobileDevice.setVendor(getPropertyValue(device, MOBILE_DEVICE_VENDOR)); mobileDevice.setLatitude(getPropertyValue(device, MOBILE_DEVICE_LATITUDE)); mobileDevice.setLongitude(getPropertyValue(device, MOBILE_DEVICE_LONGITUDE)); + mobileDevice.setChallenge(getPropertyValue(device, MOBILE_DEVICE_CHALLENGE)); + mobileDevice.setToken(getPropertyValue(device, MOBILE_DEVICE_TOKEN)); + mobileDevice.setSerial(getPropertyValue(device, MOBILE_DEVICE_SERIAL)); + mobileDevice.setUnlockToken(getPropertyValue(device, MOBILE_DEVICE_UNLOCK_TOKEN)); } return mobileDevice; } @@ -104,12 +112,16 @@ public class MobileDeviceManagementUtil { List propertyList = new ArrayList(); propertyList.add(getProperty(MOBILE_DEVICE_IMEI, mobileDevice.getImei())); propertyList.add(getProperty(MOBILE_DEVICE_IMSI, mobileDevice.getImsi())); - propertyList.add(getProperty(MOBILE_DEVICE_REG_ID, mobileDevice.getRegId())); + propertyList.add(getProperty(MOBILE_DEVICE_PUSH_TOKEN, mobileDevice.getPushToken())); propertyList.add(getProperty(MOBILE_DEVICE_MODEL, mobileDevice.getModel())); propertyList.add(getProperty(MOBILE_DEVICE_OS_VERSION, mobileDevice.getOsVersion())); propertyList.add(getProperty(MOBILE_DEVICE_VENDOR, mobileDevice.getVendor())); propertyList.add(getProperty(MOBILE_DEVICE_LATITUDE, mobileDevice.getLatitude())); propertyList.add(getProperty(MOBILE_DEVICE_LONGITUDE, mobileDevice.getLongitude())); + propertyList.add(getProperty(MOBILE_DEVICE_CHALLENGE, mobileDevice.getChallenge())); + propertyList.add(getProperty(MOBILE_DEVICE_TOKEN, mobileDevice.getToken())); + propertyList.add(getProperty(MOBILE_DEVICE_SERIAL, mobileDevice.getSerial())); + propertyList.add(getProperty(MOBILE_DEVICE_UNLOCK_TOKEN, mobileDevice.getUnlockToken())); device.setProperties(propertyList); device.setDeviceIdentifier(mobileDevice.getMobileDeviceId()); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/test/java/org/wso2/carbon/device/mgt/mobile/impl/dao/MobileDeviceDAOTestSuite.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/test/java/org/wso2/carbon/device/mgt/mobile/impl/dao/MobileDeviceDAOTestSuite.java index da7b502a3..f148d4794 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/test/java/org/wso2/carbon/device/mgt/mobile/impl/dao/MobileDeviceDAOTestSuite.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/test/java/org/wso2/carbon/device/mgt/mobile/impl/dao/MobileDeviceDAOTestSuite.java @@ -51,10 +51,14 @@ public class MobileDeviceDAOTestSuite { public static final String TEST_MOBILE_MODEL = "S5"; public static final String TEST_MOBILE_VENDOR = "samsung"; public static final String TEST_MOBILE_UPDATED_VENDOR = "sony"; - public static final String TEST_MOBILE_REG_ID = "2414"; + public static final String TEST_MOBILE_PUSH_TOKEN = "2414"; public static final String TEST_MOBILE_OS_VERSION = "5.0.0"; public static final String TEST_MOBILE_LATITUDE = "6.93N"; public static final String TEST_MOBILE_LONGITUDE = "80.60E"; + public static final String TEST_MOBILE_TOKEN = "2412K2HKHK24K12H4"; + public static final String TEST_MOBILE_SERIAL = "24124IIH4I2K4"; + public static final String TEST_MOBILE_CHALLENGE = "ASFASFSAFASFATWTWQTTQWTWQTQWTQWTWQT"; + public static final String TEST_MOBILE_UNLOCK_TOKEN = "FAFWQUWFUQWYWQYRWQURYUURUWQUWRUWRUWE"; private TestDBConfiguration testDBConfiguration; private MobileDeviceDAOImpl mblDeviceDAO; @@ -93,23 +97,28 @@ public class MobileDeviceDAOTestSuite { mobileDevice.setImsi(TEST_MOBILE_IMSI); mobileDevice.setModel(TEST_MOBILE_MODEL); mobileDevice.setVendor(TEST_MOBILE_VENDOR); - mobileDevice.setRegId(TEST_MOBILE_REG_ID); + mobileDevice.setPushToken(TEST_MOBILE_PUSH_TOKEN); mobileDevice.setOsVersion(TEST_MOBILE_OS_VERSION); mobileDevice.setLatitude(TEST_MOBILE_LATITUDE); mobileDevice.setLongitude(TEST_MOBILE_LONGITUDE); + mobileDevice.setToken(TEST_MOBILE_TOKEN); + mobileDevice.setSerial(TEST_MOBILE_SERIAL); + mobileDevice.setChallenge(TEST_MOBILE_CHALLENGE); + mobileDevice.setUnlockToken(TEST_MOBILE_UNLOCK_TOKEN); boolean added = mblDeviceDAO.addMobileDevice(mobileDevice); try { conn = DriverManager.getConnection(testDBConfiguration.getConnectionURL()); String selectDBQuery = - "SELECT MOBILE_DEVICE_ID, REG_ID, IMEI, IMSI, OS_VERSION,DEVICE_MODEL, VENDOR, " + - "LATITUDE, LONGITUDE FROM MBL_DEVICE WHERE MOBILE_DEVICE_ID = ?"; + "SELECT MOBILE_DEVICE_ID, PUSH_TOKEN, IMEI, IMSI, OS_VERSION,DEVICE_MODEL, VENDOR, " + + "LATITUDE, LONGITUDE, CHALLENGE, SERIAL, TOKEN, UNLOCK_TOKEN FROM MBL_DEVICE " + + "WHERE MOBILE_DEVICE_ID = ?"; preparedStatement = conn.prepareStatement(selectDBQuery); preparedStatement.setString(1, TEST_MOBILE_DEVICE_ID); ResultSet resultSet = preparedStatement.executeQuery(); if (resultSet.next()) { testMblDevice.setMobileDeviceId(resultSet.getString(1)); - testMblDevice.setRegId(resultSet.getString(2)); + testMblDevice.setPushToken(resultSet.getString(2)); testMblDevice.setImei(resultSet.getString(3)); testMblDevice.setImsi(resultSet.getString(4)); testMblDevice.setOsVersion(resultSet.getString(5)); @@ -117,6 +126,10 @@ public class MobileDeviceDAOTestSuite { testMblDevice.setVendor(resultSet.getString(7)); testMblDevice.setLatitude(resultSet.getString(8)); testMblDevice.setLongitude(resultSet.getString(9)); + testMblDevice.setChallenge(resultSet.getString(10)); + testMblDevice.setSerial(resultSet.getString(11)); + testMblDevice.setToken(resultSet.getString(12)); + testMblDevice.setUnlockToken(resultSet.getString(13)); } } catch (SQLException e) { String msg = "Error in retrieving Mobile Device data "; @@ -140,10 +153,18 @@ public class MobileDeviceDAOTestSuite { "MobileDevice model has persisted "); Assert.assertEquals(TEST_MOBILE_OS_VERSION, testMblDevice.getOsVersion(), "MobileDevice os-version has persisted "); - Assert.assertEquals(TEST_MOBILE_REG_ID, testMblDevice.getRegId(), + Assert.assertEquals(TEST_MOBILE_PUSH_TOKEN, testMblDevice.getPushToken(), "MobileDevice reg-id has persisted "); Assert.assertEquals(TEST_MOBILE_VENDOR, testMblDevice.getVendor(), "MobileDevice vendor has persisted "); + Assert.assertEquals(TEST_MOBILE_CHALLENGE, testMblDevice.getChallenge(), + "MobileDevice challenge has persisted "); + Assert.assertEquals(TEST_MOBILE_SERIAL, testMblDevice.getSerial(), + "MobileDevice serial has persisted"); + Assert.assertEquals(TEST_MOBILE_UNLOCK_TOKEN, testMblDevice.getUnlockToken(), + "MobileDevice unlock-token has persisted"); + Assert.assertEquals(TEST_MOBILE_TOKEN, testMblDevice.getToken(), + "MobileDevice token has persisted"); } @Test(dependsOnMethods = { "addMobileDeviceTest" }) @@ -164,10 +185,18 @@ public class MobileDeviceDAOTestSuite { "MobileDevice model has persisted "); Assert.assertEquals(TEST_MOBILE_OS_VERSION, testMblDevice.getOsVersion(), "MobileDevice os-version has persisted "); - Assert.assertEquals(TEST_MOBILE_REG_ID, testMblDevice.getRegId(), + Assert.assertEquals(TEST_MOBILE_PUSH_TOKEN, testMblDevice.getPushToken(), "MobileDevice reg-id has persisted "); Assert.assertEquals(TEST_MOBILE_VENDOR, testMblDevice.getVendor(), "MobileDevice vendor has persisted "); + Assert.assertEquals(TEST_MOBILE_CHALLENGE, testMblDevice.getChallenge(), + "MobileDevice challenge has persisted "); + Assert.assertEquals(TEST_MOBILE_SERIAL, testMblDevice.getSerial(), + "MobileDevice serial has persisted"); + Assert.assertEquals(TEST_MOBILE_UNLOCK_TOKEN, testMblDevice.getUnlockToken(), + "MobileDevice unlock-token has persisted"); + Assert.assertEquals(TEST_MOBILE_TOKEN, testMblDevice.getToken(), + "MobileDevice token has persisted"); } @Test(dependsOnMethods = { "addMobileDeviceTest" }) @@ -192,23 +221,28 @@ public class MobileDeviceDAOTestSuite { mobileDevice.setImsi(TEST_MOBILE_IMSI); mobileDevice.setModel(TEST_MOBILE_MODEL); mobileDevice.setVendor(TEST_MOBILE_UPDATED_VENDOR); - mobileDevice.setRegId(TEST_MOBILE_REG_ID); + mobileDevice.setPushToken(TEST_MOBILE_PUSH_TOKEN); mobileDevice.setOsVersion(TEST_MOBILE_OS_VERSION); mobileDevice.setLatitude(TEST_MOBILE_LATITUDE); mobileDevice.setLongitude(TEST_MOBILE_LONGITUDE); + mobileDevice.setToken(TEST_MOBILE_TOKEN); + mobileDevice.setSerial(TEST_MOBILE_SERIAL); + mobileDevice.setChallenge(TEST_MOBILE_CHALLENGE); + mobileDevice.setUnlockToken(TEST_MOBILE_UNLOCK_TOKEN); boolean updated = mblDeviceDAO.updateMobileDevice(mobileDevice); try { conn = DriverManager.getConnection(testDBConfiguration.getConnectionURL()); String selectDBQuery = - "SELECT MOBILE_DEVICE_ID, REG_ID, IMEI, IMSI, OS_VERSION,DEVICE_MODEL, VENDOR, " + - "LATITUDE, LONGITUDE FROM MBL_DEVICE WHERE MOBILE_DEVICE_ID = ?"; + "SELECT MOBILE_DEVICE_ID, PUSH_TOKEN, IMEI, IMSI, OS_VERSION,DEVICE_MODEL, VENDOR, " + + "LATITUDE, LONGITUDE, CHALLENGE, SERIAL, TOKEN, UNLOCK_TOKEN FROM MBL_DEVICE " + + "WHERE MOBILE_DEVICE_ID = ?"; preparedStatement = conn.prepareStatement(selectDBQuery); preparedStatement.setString(1, TEST_MOBILE_DEVICE_ID); ResultSet resultSet = preparedStatement.executeQuery(); if (resultSet.next()) { testMblDevice.setMobileDeviceId(resultSet.getString(1)); - testMblDevice.setRegId(resultSet.getString(2)); + testMblDevice.setPushToken(resultSet.getString(2)); testMblDevice.setImei(resultSet.getString(3)); testMblDevice.setImsi(resultSet.getString(4)); testMblDevice.setOsVersion(resultSet.getString(5)); @@ -216,6 +250,10 @@ public class MobileDeviceDAOTestSuite { testMblDevice.setVendor(resultSet.getString(7)); testMblDevice.setLatitude(resultSet.getString(8)); testMblDevice.setLongitude(resultSet.getString(9)); + testMblDevice.setChallenge(resultSet.getString(10)); + testMblDevice.setSerial(resultSet.getString(11)); + testMblDevice.setToken(resultSet.getString(12)); + testMblDevice.setUnlockToken(resultSet.getString(13)); } } catch (SQLException e) { String msg = "Error in retrieving Mobile Device data "; @@ -240,8 +278,9 @@ public class MobileDeviceDAOTestSuite { try { conn = DriverManager.getConnection(testDBConfiguration.getConnectionURL()); String selectDBQuery = - "SELECT MOBILE_DEVICE_ID, REG_ID, IMEI, IMSI, OS_VERSION,DEVICE_MODEL, VENDOR, " + - "LATITUDE, LONGITUDE FROM MBL_DEVICE WHERE MOBILE_DEVICE_ID = ?"; + "SELECT MOBILE_DEVICE_ID, PUSH_TOKEN, IMEI, IMSI, OS_VERSION,DEVICE_MODEL, VENDOR, " + + "LATITUDE, LONGITUDE, CHALLENGE, SERIAL, TOKEN, UNLOCK_TOKEN FROM MBL_DEVICE " + + "WHERE MOBILE_DEVICE_ID = ?"; preparedStatement = conn.prepareStatement(selectDBQuery); preparedStatement.setString(1, TEST_MOBILE_DEVICE_ID); ResultSet resultSet = preparedStatement.executeQuery(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/test/java/org/wso2/carbon/device/mgt/mobile/impl/dao/MobileDeviceOperationMappingDAOTestSuite.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/test/java/org/wso2/carbon/device/mgt/mobile/impl/dao/MobileDeviceOperationMappingDAOTestSuite.java index cd9342806..6c39be232 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/test/java/org/wso2/carbon/device/mgt/mobile/impl/dao/MobileDeviceOperationMappingDAOTestSuite.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/test/java/org/wso2/carbon/device/mgt/mobile/impl/dao/MobileDeviceOperationMappingDAOTestSuite.java @@ -59,6 +59,10 @@ public class MobileDeviceOperationMappingDAOTestSuite { public static final String TEST_MOBILE_OS_VERSION = "5.0.0"; public static final String TEST_MOBILE_LATITUDE = "6.93N"; public static final String TEST_MOBILE_LONGITUDE = "80.60E"; + public static final String TEST_MOBILE_TOKEN = "2412K2HKHK24K12H4"; + public static final String TEST_MOBILE_SERIAL = "24124IIH4I2K4"; + public static final String TEST_MOBILE_CHALLENGE = "ASFASFSAFASFATWTWQTTQWTWQTQWTQWTWQT"; + public static final String TEST_MOBILE_UNLOCK_TOKEN = "FAFWQUWFUQWYWQYRWQURYUURUWQUWRUWRUWE"; public static final String TEST_MBL_OPR_FEATURE_CODE1 = "LOCK"; public static final String TEST_MBL_OPR_FEATURE_CODE2 = "WIPE"; public static final long TEST_MBL_OPR_CREATED_DATE = new java.util.Date().getTime(); @@ -112,10 +116,14 @@ public class MobileDeviceOperationMappingDAOTestSuite { mobileDevice.setImsi(TEST_MOBILE_IMSI); mobileDevice.setModel(TEST_MOBILE_MODEL); mobileDevice.setVendor(TEST_MOBILE_VENDOR); - mobileDevice.setRegId(TEST_MOBILE_REG_ID); + mobileDevice.setPushToken(TEST_MOBILE_REG_ID); mobileDevice.setOsVersion(TEST_MOBILE_OS_VERSION); mobileDevice.setLatitude(TEST_MOBILE_LATITUDE); mobileDevice.setLongitude(TEST_MOBILE_LONGITUDE); + mobileDevice.setToken(TEST_MOBILE_TOKEN); + mobileDevice.setSerial(TEST_MOBILE_SERIAL); + mobileDevice.setChallenge(TEST_MOBILE_CHALLENGE); + mobileDevice.setUnlockToken(TEST_MOBILE_UNLOCK_TOKEN); mblDeviceDAO.addMobileDevice(mobileDevice); //Add an Operation to the db diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/test/resources/sql/CreateH2TestDB.sql b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/test/resources/sql/CreateH2TestDB.sql index a49b86f4b..a33e6d477 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/test/resources/sql/CreateH2TestDB.sql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/test/resources/sql/CreateH2TestDB.sql @@ -4,7 +4,7 @@ -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `MBL_DEVICE` ( `MOBILE_DEVICE_ID` VARCHAR(45) NOT NULL , - `REG_ID` VARCHAR(45) NULL DEFAULT NULL , + `PUSH_TOKEN` VARCHAR(45) NULL DEFAULT NULL , `IMEI` VARCHAR(45) NULL DEFAULT NULL , `IMSI` VARCHAR(45) NULL DEFAULT NULL , `OS_VERSION` VARCHAR(45) NULL DEFAULT NULL , @@ -12,6 +12,10 @@ CREATE TABLE IF NOT EXISTS `MBL_DEVICE` ( `VENDOR` VARCHAR(45) NULL DEFAULT NULL , `LATITUDE` VARCHAR(45) NULL DEFAULT NULL, `LONGITUDE` VARCHAR(45) NULL DEFAULT NULL, + `CHALLENGE` VARCHAR(45) NULL DEFAULT NULL, + `TOKEN` VARCHAR(500) NULL DEFAULT NULL, + `UNLOCK_TOKEN` VARCHAR(500) NULL DEFAULT NULL, + `SERIAL` VARCHAR(45) NULL DEFAULT NULL, PRIMARY KEY (`MOBILE_DEVICE_ID`) ); From de7e87af626ac49dedb6844effd68e0c1cd68c54 Mon Sep 17 00:00:00 2001 From: Dilshan Edirisuriya Date: Thu, 19 Feb 2015 19:02:30 +0530 Subject: [PATCH 04/15] Modify Enrollment implemented --- .../mobile/impl/ios/IOSDeviceManagerService.java | 16 +++++++++++++++- 1 file changed, 15 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 0fa0a2e4e..d39bc806d 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 @@ -59,7 +59,21 @@ public class IOSDeviceManagerService implements DeviceManagerService { @Override public boolean modifyEnrollment(Device device) throws DeviceManagementException { - return true; + boolean status; + MobileDevice mobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(device); + try { + if (log.isDebugEnabled()) { + log.debug("Modifying the iOS device enrollment data"); + } + status = MobileDeviceManagementDAOFactory.getMobileDeviceDAO() + .updateMobileDevice(mobileDevice); + } catch (MobileDeviceManagementDAOException e) { + String msg = "Error while updating the enrollment of the iOS device : " + + device.getDeviceIdentifier(); + log.error(msg, e); + throw new DeviceManagementException(msg, e); + } + return status; } @Override From dc33b8e69dc95e2e14698859c63451f6673176ac Mon Sep 17 00:00:00 2001 From: Dilshan Edirisuriya Date: Fri, 20 Feb 2015 16:49:37 +0530 Subject: [PATCH 05/15] 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 d39bc806d..986495982 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 From 22287690418e4b56d5c241ec1fb90153a5f06088 Mon Sep 17 00:00:00 2001 From: Geeth Munasinghe Date: Tue, 24 Feb 2015 18:22:17 +0530 Subject: [PATCH 06/15] Adding the feature.property file and changing the carbon-device-mgt components version --- features/etc/feature.properties | 241 ++++++++++++++++++++++++++++++++ pom.xml | 2 +- 2 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 features/etc/feature.properties diff --git a/features/etc/feature.properties b/features/etc/feature.properties new file mode 100644 index 000000000..a84f4e33e --- /dev/null +++ b/features/etc/feature.properties @@ -0,0 +1,241 @@ +################################################################################ +# Copyright 2015 WSO2, Inc. (http://wso2.com) +# +# WSO2 Inc. Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +################################################################################ + +providerName=WSO2 Inc. + +########################## license properties ################################## +licenseURL=http://www.apache.org/licenses/LICENSE-2.0 + +license=\ + Apache License\n\ + Version 2.0, January 2004\n\ + http://www.apache.org/licenses/\n\ +\n\ + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\ +\n\ + 1. Definitions.\n\ +\n\ + "License" shall mean the terms and conditions for use, reproduction,\n\ + and distribution as defined by Sections 1 through 9 of this document.\n\ +\n\ + "Licensor" shall mean the copyright owner or entity authorized by\n\ + the copyright owner that is granting the License.\n\ +\n\ + "Legal Entity" shall mean the union of the acting entity and all\n\ + other entities that control, are controlled by, or are under common\n\ + control with that entity. For the purposes of this definition,\n\ + "control" means (i) the power, direct or indirect, to cause the\n\ + direction or management of such entity, whether by contract or\n\ + otherwise, or (ii) ownership of fifty percent (50%) or more of the\n\ + outstanding shares, or (iii) beneficial ownership of such entity.\n\ +\n\ + "You" (or "Your") shall mean an individual or Legal Entity\n\ + exercising permissions granted by this License.\n\ +\n\ + "Source" form shall mean the preferred form for making modifications,\n\ + including but not limited to software source code, documentation\n\ + source, and configuration files.\n\ +\n\ + "Object" form shall mean any form resulting from mechanical\n\ + transformation or translation of a Source form, including but\n\ + not limited to compiled object code, generated documentation,\n\ + and conversions to other media types.\n\ +\n\ + "Work" shall mean the work of authorship, whether in Source or\n\ + Object form, made available under the License, as indicated by a\n\ + copyright notice that is included in or attached to the work\n\ + (an example is provided in the Appendix below).\n\ +\n\ + "Derivative Works" shall mean any work, whether in Source or Object\n\ + form, that is based on (or derived from) the Work and for which the\n\ + editorial revisions, annotations, elaborations, or other modifications\n\ + represent, as a whole, an original work of authorship. For the purposes\n\ + of this License, Derivative Works shall not include works that remain\n\ + separable from, or merely link (or bind by name) to the interfaces of,\n\ + the Work and Derivative Works thereof.\n\ +\n\ + "Contribution" shall mean any work of authorship, including\n\ + the original version of the Work and any modifications or additions\n\ + to that Work or Derivative Works thereof, that is intentionally\n\ + submitted to Licensor for inclusion in the Work by the copyright owner\n\ + or by an individual or Legal Entity authorized to submit on behalf of\n\ + the copyright owner. For the purposes of this definition, "submitted"\n\ + means any form of electronic, verbal, or written communication sent\n\ + to the Licensor or its representatives, including but not limited to\n\ + communication on electronic mailing lists, source code control systems,\n\ + and issue tracking systems that are managed by, or on behalf of, the\n\ + Licensor for the purpose of discussing and improving the Work, but\n\ + excluding communication that is conspicuously marked or otherwise\n\ + designated in writing by the copyright owner as "Not a Contribution."\n\ +\n\ + "Contributor" shall mean Licensor and any individual or Legal Entity\n\ + on behalf of whom a Contribution has been received by Licensor and\n\ + subsequently incorporated within the Work.\n\ +\n\ + 2. Grant of Copyright License. Subject to the terms and conditions of\n\ + this License, each Contributor hereby grants to You a perpetual,\n\ + worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n\ + copyright license to reproduce, prepare Derivative Works of,\n\ + publicly display, publicly perform, sublicense, and distribute the\n\ + Work and such Derivative Works in Source or Object form.\n\ +\n\ + 3. Grant of Patent License. Subject to the terms and conditions of\n\ + this License, each Contributor hereby grants to You a perpetual,\n\ + worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n\ + (except as stated in this section) patent license to make, have made,\n\ + use, offer to sell, sell, import, and otherwise transfer the Work,\n\ + where such license applies only to those patent claims licensable\n\ + by such Contributor that are necessarily infringed by their\n\ + Contribution(s) alone or by combination of their Contribution(s)\n\ + with the Work to which such Contribution(s) was submitted. If You\n\ + institute patent litigation against any entity (including a\n\ + cross-claim or counterclaim in a lawsuit) alleging that the Work\n\ + or a Contribution incorporated within the Work constitutes direct\n\ + or contributory patent infringement, then any patent licenses\n\ + granted to You under this License for that Work shall terminate\n\ + as of the date such litigation is filed.\n\ +\n\ + 4. Redistribution. You may reproduce and distribute copies of the\n\ + Work or Derivative Works thereof in any medium, with or without\n\ + modifications, and in Source or Object form, provided that You\n\ + meet the following conditions:\n\ +\n\ + (a) You must give any other recipients of the Work or\n\ + Derivative Works a copy of this License; and\n\ +\n\ + (b) You must cause any modified files to carry prominent notices\n\ + stating that You changed the files; and\n\ +\n\ + (c) You must retain, in the Source form of any Derivative Works\n\ + that You distribute, all copyright, patent, trademark, and\n\ + attribution notices from the Source form of the Work,\n\ + excluding those notices that do not pertain to any part of\n\ + the Derivative Works; and\n\ +\n\ + (d) If the Work includes a "NOTICE" text file as part of its\n\ + distribution, then any Derivative Works that You distribute must\n\ + include a readable copy of the attribution notices contained\n\ + within such NOTICE file, excluding those notices that do not\n\ + pertain to any part of the Derivative Works, in at least one\n\ + of the following places: within a NOTICE text file distributed\n\ + as part of the Derivative Works; within the Source form or\n\ + documentation, if provided along with the Derivative Works; or,\n\ + within a display generated by the Derivative Works, if and\n\ + wherever such third-party notices normally appear. The contents\n\ + of the NOTICE file are for informational purposes only and\n\ + do not modify the License. You may add Your own attribution\n\ + notices within Derivative Works that You distribute, alongside\n\ + or as an addendum to the NOTICE text from the Work, provided\n\ + that such additional attribution notices cannot be construed\n\ + as modifying the License.\n\ +\n\ + You may add Your own copyright statement to Your modifications and\n\ + may provide additional or different license terms and conditions\n\ + for use, reproduction, or distribution of Your modifications, or\n\ + for any such Derivative Works as a whole, provided Your use,\n\ + reproduction, and distribution of the Work otherwise complies with\n\ + the conditions stated in this License.\n\ +\n\ + 5. Submission of Contributions. Unless You explicitly state otherwise,\n\ + any Contribution intentionally submitted for inclusion in the Work\n\ + by You to the Licensor shall be under the terms and conditions of\n\ + this License, without any additional terms or conditions.\n\ + Notwithstanding the above, nothing herein shall supersede or modify\n\ + the terms of any separate license agreement you may have executed\n\ + with Licensor regarding such Contributions.\n\ +\n\ + 6. Trademarks. This License does not grant permission to use the trade\n\ + names, trademarks, service marks, or product names of the Licensor,\n\ + except as required for reasonable and customary use in describing the\n\ + origin of the Work and reproducing the content of the NOTICE file.\n\ +\n\ + 7. Disclaimer of Warranty. Unless required by applicable law or\n\ + agreed to in writing, Licensor provides the Work (and each\n\ + Contributor provides its Contributions) on an "AS IS" BASIS,\n\ + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n\ + implied, including, without limitation, any warranties or conditions\n\ + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n\ + PARTICULAR PURPOSE. You are solely responsible for determining the\n\ + appropriateness of using or redistributing the Work and assume any\n\ + risks associated with Your exercise of permissions under this License.\n\ +\n\ + 8. Limitation of Liability. In no event and under no legal theory,\n\ + whether in tort (including negligence), contract, or otherwise,\n\ + unless required by applicable law (such as deliberate and grossly\n\ + negligent acts) or agreed to in writing, shall any Contributor be\n\ + liable to You for damages, including any direct, indirect, special,\n\ + incidental, or consequential damages of any character arising as a\n\ + result of this License or out of the use or inability to use the\n\ + Work (including but not limited to damages for loss of goodwill,\n\ + work stoppage, computer failure or malfunction, or any and all\n\ + other commercial damages or losses), even if such Contributor\n\ + has been advised of the possibility of such damages.\n\ +\n\ + 9. Accepting Warranty or Additional Liability. While redistributing\n\ + the Work or Derivative Works thereof, You may choose to offer,\n\ + and charge a fee for, acceptance of support, warranty, indemnity,\n\ + or other liability obligations and/or rights consistent with this\n\ + License. However, in accepting such obligations, You may act only\n\ + on Your own behalf and on Your sole responsibility, not on behalf\n\ + of any other Contributor, and only if You agree to indemnify,\n\ + defend, and hold each Contributor harmless for any liability\n\ + incurred by, or claims asserted against, such Contributor by reason\n\ + of your accepting any such warranty or additional liability.\n\ +\n\ + END OF TERMS AND CONDITIONS\n\ +\n\ + APPENDIX: How to apply the Apache License to your work.\n\ +\n\ + To apply the Apache License to your work, attach the following\n\ + boilerplate notice, with the fields enclosed by brackets "[]"\n\ + replaced with your own identifying information. (Don't include\n\ + the brackets!) The text should be enclosed in the appropriate\n\ + comment syntax for the file format. We also recommend that a\n\ + file or class name and description of purpose be included on the\n\ + same "printed page" as the copyright notice for easier\n\ + identification within third-party archives.\n\ +\n\ + Copyright [yyyy] [name of copyright owner]\n\ +\n\ + Licensed under the Apache License, Version 2.0 (the "License");\n\ + you may not use this file except in compliance with the License.\n\ + You may obtain a copy of the License at\n\ +\n\ + http://www.apache.org/licenses/LICENSE-2.0\n\ +\n\ + Unless required by applicable law or agreed to in writing, software\n\ + distributed under the License is distributed on an "AS IS" BASIS,\n\ + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\ + See the License for the specific language governing permissions and\n\ + limitations under the License.\n + +######################### copyright properties ################################# +copyrightURL=TODO + +copyright=\ +Copyright (c) WSO2 Inc. (http://wso2.com)\n\ +\n\ +WSO2 Inc. Licensed under the Apache License, Version 2.0 (the "License");\n\ +you may not use this file except in compliance with the License.\n\ +You may obtain a copy of the License at\n\ +\n\ +http://www.apache.org/licenses/LICENSE-2.0\n\ +\n\ +Unless required by applicable law or agreed to in writing, software\n\ +distributed under the License is distributed on an "AS IS" BASIS,\n\ +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\ +See the License for the specific language governing permissions and\n\ +limitations under the License.\n diff --git a/pom.xml b/pom.xml index 79c294056..779ba4216 100644 --- a/pom.xml +++ b/pom.xml @@ -472,7 +472,7 @@ 4.3.0 - 0.9.0 + 0.9.1 1.9.1-SNAPSHOT From 610485dd24b05d96d92a1b50c061ede7509f9e92 Mon Sep 17 00:00:00 2001 From: Geeth Munasinghe Date: Tue, 24 Feb 2015 18:32:31 +0530 Subject: [PATCH 07/15] [maven-release-plugin] prepare release v1.9.1 --- .../org.wso2.carbon.device.mgt.mobile.impl/pom.xml | 8 +++----- components/device-mgt/pom.xml | 8 +++----- .../org.wso2.carbon.device.mgt.mobile.feature/pom.xml | 4 ++-- features/device-mgt/pom.xml | 4 ++-- pom.xml | 10 ++++------ 5 files changed, 14 insertions(+), 20 deletions(-) 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 9371b178d..268acf381 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 @@ -18,20 +18,18 @@ ~ under the License. --> - + device-mgt org.wso2.carbon.devicemgt-plugins - 1.9.1-SNAPSHOT + 1.9.1 ../pom.xml 4.0.0 org.wso2.carbon.devicemgt-plugins org.wso2.carbon.device.mgt.mobile.impl - 1.9.1-SNAPSHOT + 1.9.1 bundle WSO2 Carbon - Mobile Device Management Impl WSO2 Carbon - Mobile Device Management Impl diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml index 73957bbe7..3f9651575 100644 --- a/components/device-mgt/pom.xml +++ b/components/device-mgt/pom.xml @@ -17,21 +17,19 @@ ~ under the License. --> - + org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 1.9.1-SNAPSHOT + 1.9.1 ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt-plugins device-mgt - 1.9.1-SNAPSHOT + 1.9.1 pom WSO2 Carbon - Mobile Device Management Component http://wso2.org diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml index 718ea3b79..f90f20c71 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins device-mgt-feature - 1.9.1-SNAPSHOT + 1.9.1 ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.mobile.feature pom - 1.9.1-SNAPSHOT + 1.9.1 WSO2 Carbon - Mobile Implementation of Device Management http://wso2.org This feature contains the core bundles required for Mobile Device Management functionality diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml index fb77ecbff..8f4dcb1a7 100644 --- a/features/device-mgt/pom.xml +++ b/features/device-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 1.9.1-SNAPSHOT + 1.9.1 ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt-plugins device-mgt-feature - 1.9.1-SNAPSHOT + 1.9.1 pom WSO2 Carbon - Device Management Feature http://wso2.org diff --git a/pom.xml b/pom.xml index 779ba4216..41b561a3d 100644 --- a/pom.xml +++ b/pom.xml @@ -17,15 +17,13 @@ ~ under the License. --> - + 4.0.0 org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent pom - 1.9.1-SNAPSHOT + 1.9.1 WSO2 Carbon - Device Management Plugins Parent http://wso2.org WSO2 Carbon - Device Management Plugins Parent @@ -475,7 +473,7 @@ 0.9.1 - 1.9.1-SNAPSHOT + 1.9.1 1.3.1 @@ -493,7 +491,7 @@ scm:git:https://github.com/wso2/carbon-device-mgt-plugins.git scm:git:https://github.com/wso2/carbon-device-mgt-plugins.git - HEAD + v1.9.1 From f7e3b95c76ffc6062fc07ffc45b677729a45889b Mon Sep 17 00:00:00 2001 From: Geeth Munasinghe Date: Tue, 24 Feb 2015 18:32:40 +0530 Subject: [PATCH 08/15] [maven-release-plugin] prepare for next development iteration --- .../org.wso2.carbon.device.mgt.mobile.impl/pom.xml | 4 ++-- components/device-mgt/pom.xml | 4 ++-- .../org.wso2.carbon.device.mgt.mobile.feature/pom.xml | 4 ++-- features/device-mgt/pom.xml | 4 ++-- pom.xml | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) 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 268acf381..1208edd03 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 @@ -22,14 +22,14 @@ device-mgt org.wso2.carbon.devicemgt-plugins - 1.9.1 + 1.9.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt-plugins org.wso2.carbon.device.mgt.mobile.impl - 1.9.1 + 1.9.2-SNAPSHOT bundle WSO2 Carbon - Mobile Device Management Impl WSO2 Carbon - Mobile Device Management Impl diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml index 3f9651575..e447bf442 100644 --- a/components/device-mgt/pom.xml +++ b/components/device-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 1.9.1 + 1.9.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt-plugins device-mgt - 1.9.1 + 1.9.2-SNAPSHOT pom WSO2 Carbon - Mobile Device Management Component http://wso2.org diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml index f90f20c71..967a957f6 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins device-mgt-feature - 1.9.1 + 1.9.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.mobile.feature pom - 1.9.1 + 1.9.2-SNAPSHOT WSO2 Carbon - Mobile Implementation of Device Management http://wso2.org This feature contains the core bundles required for Mobile Device Management functionality diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml index 8f4dcb1a7..ef44a4053 100644 --- a/features/device-mgt/pom.xml +++ b/features/device-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 1.9.1 + 1.9.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt-plugins device-mgt-feature - 1.9.1 + 1.9.2-SNAPSHOT pom WSO2 Carbon - Device Management Feature http://wso2.org diff --git a/pom.xml b/pom.xml index 41b561a3d..f000ec01a 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent pom - 1.9.1 + 1.9.2-SNAPSHOT WSO2 Carbon - Device Management Plugins Parent http://wso2.org WSO2 Carbon - Device Management Plugins Parent @@ -473,7 +473,7 @@ 0.9.1 - 1.9.1 + 1.9.2-SNAPSHOT 1.3.1 @@ -491,7 +491,7 @@ scm:git:https://github.com/wso2/carbon-device-mgt-plugins.git scm:git:https://github.com/wso2/carbon-device-mgt-plugins.git - v1.9.1 + HEAD From a20c9dcec2e228c43979f7ed2fc5a21f0b17b867 Mon Sep 17 00:00:00 2001 From: Geeth Munasinghe Date: Tue, 24 Feb 2015 19:12:28 +0530 Subject: [PATCH 09/15] Changing the version of carbon-device-mgt to 0.9.1 and making this to re-release as 1.9.1 --- .../org.wso2.carbon.device.mgt.mobile.impl/pom.xml | 4 ++-- components/device-mgt/pom.xml | 4 ++-- .../org.wso2.carbon.device.mgt.mobile.feature/pom.xml | 4 ++-- features/device-mgt/pom.xml | 4 ++-- pom.xml | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) 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 1208edd03..9e0008495 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 @@ -22,14 +22,14 @@ device-mgt org.wso2.carbon.devicemgt-plugins - 1.9.2-SNAPSHOT + 1.9.1-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt-plugins org.wso2.carbon.device.mgt.mobile.impl - 1.9.2-SNAPSHOT + 1.9.1-SNAPSHOT bundle WSO2 Carbon - Mobile Device Management Impl WSO2 Carbon - Mobile Device Management Impl diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml index e447bf442..053ad179c 100644 --- a/components/device-mgt/pom.xml +++ b/components/device-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 1.9.2-SNAPSHOT + 1.9.1-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt-plugins device-mgt - 1.9.2-SNAPSHOT + 1.9.1-SNAPSHOT pom WSO2 Carbon - Mobile Device Management Component http://wso2.org diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml index 967a957f6..718ea3b79 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins device-mgt-feature - 1.9.2-SNAPSHOT + 1.9.1-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.mobile.feature pom - 1.9.2-SNAPSHOT + 1.9.1-SNAPSHOT WSO2 Carbon - Mobile Implementation of Device Management http://wso2.org This feature contains the core bundles required for Mobile Device Management functionality diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml index ef44a4053..fb77ecbff 100644 --- a/features/device-mgt/pom.xml +++ b/features/device-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 1.9.2-SNAPSHOT + 1.9.1-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt-plugins device-mgt-feature - 1.9.2-SNAPSHOT + 1.9.1-SNAPSHOT pom WSO2 Carbon - Device Management Feature http://wso2.org diff --git a/pom.xml b/pom.xml index f000ec01a..4d44e637e 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent pom - 1.9.2-SNAPSHOT + 1.9.1-SNAPSHOT WSO2 Carbon - Device Management Plugins Parent http://wso2.org WSO2 Carbon - Device Management Plugins Parent @@ -423,7 +423,7 @@ [4.3.0, 4.4.0) - 0.9.0 + 0.9.1 [0.8.0, 2.0.0) 1.5.4 @@ -473,7 +473,7 @@ 0.9.1 - 1.9.2-SNAPSHOT + 1.9.1-SNAPSHOT 1.3.1 From 805f6a1417e5a8dd01e340c465cc8d96ed786eac Mon Sep 17 00:00:00 2001 From: Geeth Munasinghe Date: Tue, 24 Feb 2015 19:15:07 +0530 Subject: [PATCH 10/15] [maven-release-plugin] prepare release v1.9.1 --- .../org.wso2.carbon.device.mgt.mobile.impl/pom.xml | 4 ++-- components/device-mgt/pom.xml | 4 ++-- .../org.wso2.carbon.device.mgt.mobile.feature/pom.xml | 4 ++-- features/device-mgt/pom.xml | 4 ++-- pom.xml | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) 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 9e0008495..268acf381 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 @@ -22,14 +22,14 @@ device-mgt org.wso2.carbon.devicemgt-plugins - 1.9.1-SNAPSHOT + 1.9.1 ../pom.xml 4.0.0 org.wso2.carbon.devicemgt-plugins org.wso2.carbon.device.mgt.mobile.impl - 1.9.1-SNAPSHOT + 1.9.1 bundle WSO2 Carbon - Mobile Device Management Impl WSO2 Carbon - Mobile Device Management Impl diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml index 053ad179c..3f9651575 100644 --- a/components/device-mgt/pom.xml +++ b/components/device-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 1.9.1-SNAPSHOT + 1.9.1 ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt-plugins device-mgt - 1.9.1-SNAPSHOT + 1.9.1 pom WSO2 Carbon - Mobile Device Management Component http://wso2.org diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml index 718ea3b79..f90f20c71 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins device-mgt-feature - 1.9.1-SNAPSHOT + 1.9.1 ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.mobile.feature pom - 1.9.1-SNAPSHOT + 1.9.1 WSO2 Carbon - Mobile Implementation of Device Management http://wso2.org This feature contains the core bundles required for Mobile Device Management functionality diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml index fb77ecbff..8f4dcb1a7 100644 --- a/features/device-mgt/pom.xml +++ b/features/device-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 1.9.1-SNAPSHOT + 1.9.1 ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt-plugins device-mgt-feature - 1.9.1-SNAPSHOT + 1.9.1 pom WSO2 Carbon - Device Management Feature http://wso2.org diff --git a/pom.xml b/pom.xml index 4d44e637e..944aacdfe 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent pom - 1.9.1-SNAPSHOT + 1.9.1 WSO2 Carbon - Device Management Plugins Parent http://wso2.org WSO2 Carbon - Device Management Plugins Parent @@ -473,7 +473,7 @@ 0.9.1 - 1.9.1-SNAPSHOT + 1.9.1 1.3.1 @@ -491,7 +491,7 @@ scm:git:https://github.com/wso2/carbon-device-mgt-plugins.git scm:git:https://github.com/wso2/carbon-device-mgt-plugins.git - HEAD + v1.9.1 From 4bd7f2c6aa75e4d9679d88e7eeb1462518ea9d84 Mon Sep 17 00:00:00 2001 From: Geeth Munasinghe Date: Tue, 24 Feb 2015 19:15:15 +0530 Subject: [PATCH 11/15] [maven-release-plugin] prepare for next development iteration --- .../org.wso2.carbon.device.mgt.mobile.impl/pom.xml | 4 ++-- components/device-mgt/pom.xml | 4 ++-- .../org.wso2.carbon.device.mgt.mobile.feature/pom.xml | 4 ++-- features/device-mgt/pom.xml | 4 ++-- pom.xml | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) 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 268acf381..1208edd03 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 @@ -22,14 +22,14 @@ device-mgt org.wso2.carbon.devicemgt-plugins - 1.9.1 + 1.9.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt-plugins org.wso2.carbon.device.mgt.mobile.impl - 1.9.1 + 1.9.2-SNAPSHOT bundle WSO2 Carbon - Mobile Device Management Impl WSO2 Carbon - Mobile Device Management Impl diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml index 3f9651575..e447bf442 100644 --- a/components/device-mgt/pom.xml +++ b/components/device-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 1.9.1 + 1.9.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt-plugins device-mgt - 1.9.1 + 1.9.2-SNAPSHOT pom WSO2 Carbon - Mobile Device Management Component http://wso2.org diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml index f90f20c71..967a957f6 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins device-mgt-feature - 1.9.1 + 1.9.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.mobile.feature pom - 1.9.1 + 1.9.2-SNAPSHOT WSO2 Carbon - Mobile Implementation of Device Management http://wso2.org This feature contains the core bundles required for Mobile Device Management functionality diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml index 8f4dcb1a7..ef44a4053 100644 --- a/features/device-mgt/pom.xml +++ b/features/device-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 1.9.1 + 1.9.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt-plugins device-mgt-feature - 1.9.1 + 1.9.2-SNAPSHOT pom WSO2 Carbon - Device Management Feature http://wso2.org diff --git a/pom.xml b/pom.xml index 944aacdfe..462f42225 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent pom - 1.9.1 + 1.9.2-SNAPSHOT WSO2 Carbon - Device Management Plugins Parent http://wso2.org WSO2 Carbon - Device Management Plugins Parent @@ -473,7 +473,7 @@ 0.9.1 - 1.9.1 + 1.9.2-SNAPSHOT 1.3.1 @@ -491,7 +491,7 @@ scm:git:https://github.com/wso2/carbon-device-mgt-plugins.git scm:git:https://github.com/wso2/carbon-device-mgt-plugins.git - v1.9.1 + HEAD From 7798573751997a1e7c04a78761334ac0ddfd649a Mon Sep 17 00:00:00 2001 From: Dilshan Edirisuriya Date: Tue, 10 Mar 2015 12:33:18 +0530 Subject: [PATCH 12/15] Implementing operation manager for iOS --- .../impl/ios/IOSDeviceManagerService.java | 8 +- .../impl/ios/iOSMobileOperationManager.java | 127 ++++++++++++++++++ 2 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/iOSMobileOperationManager.java 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 986495982..ba22dd4e8 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 @@ -25,6 +25,7 @@ import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService; import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOException; import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOFactory; import org.wso2.carbon.device.mgt.mobile.dto.MobileDevice; +import org.wso2.carbon.device.mgt.mobile.impl.android.AndroidMobileOperationManager; import org.wso2.carbon.device.mgt.mobile.util.MobileDeviceManagementUtil; import java.util.List; @@ -35,6 +36,11 @@ import java.util.List; public class IOSDeviceManagerService implements DeviceManagerService { private static final Log log = LogFactory.getLog(IOSDeviceManagerService.class); + private OperationManager operationManager; + + public IOSDeviceManagerService() { + this.operationManager = new IOSMobileOperationManager(); + } @Override public String getProviderType() { @@ -145,7 +151,7 @@ public class IOSDeviceManagerService implements DeviceManagerService { @Override public OperationManager getOperationManager() throws DeviceManagementException { - return null; + return operationManager; } @Override diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/iOSMobileOperationManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/iOSMobileOperationManager.java new file mode 100644 index 000000000..3f5fb9564 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/iOSMobileOperationManager.java @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * you may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.device.mgt.mobile.impl.ios; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.device.mgt.common.DeviceIdentifier; +import org.wso2.carbon.device.mgt.common.Feature; +import org.wso2.carbon.device.mgt.common.FeatureManagementException; +import org.wso2.carbon.device.mgt.common.Operation; +import org.wso2.carbon.device.mgt.common.OperationManagementException; +import org.wso2.carbon.device.mgt.common.OperationManager; +import org.wso2.carbon.device.mgt.mobile.AbstractMobileOperationManager; +import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOException; +import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOFactory; +import org.wso2.carbon.device.mgt.mobile.dto.MobileDeviceOperationMapping; +import org.wso2.carbon.device.mgt.mobile.dto.MobileOperation; +import org.wso2.carbon.device.mgt.mobile.dto.MobileOperationProperty; +import org.wso2.carbon.device.mgt.mobile.util.MobileDeviceManagementUtil; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class IOSMobileOperationManager extends AbstractMobileOperationManager { + + private static final Log log = LogFactory.getLog(IOSMobileOperationManager.class); + private OperationManager operationManager; + @Override + public List getOperations(DeviceIdentifier deviceIdentifier) throws OperationManagementException { + return null; + } + + @Override + public boolean addOperation(Operation operation, List devices) + throws OperationManagementException { + + boolean status = false; + + try { + MobileDeviceOperationMapping mobileDeviceOperationMapping; + MobileOperation mobileOperation = MobileDeviceManagementUtil.convertToMobileOperation(operation); + int operationId = MobileDeviceManagementDAOFactory.getMobileOperationDAO(). + addMobileOperation(mobileOperation); + + if (operationId > 0) { + + for (MobileOperationProperty operationProperty : mobileOperation.getProperties()) { + operationProperty.setOperationId(operationId); + status = MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO(). + addMobileOperationProperty(operationProperty); + } + + for (DeviceIdentifier deviceIdentifier : devices) { + mobileDeviceOperationMapping = new MobileDeviceOperationMapping(); + mobileDeviceOperationMapping.setOperationId(operationId); + mobileDeviceOperationMapping.setDeviceId(deviceIdentifier.getId()); + mobileDeviceOperationMapping.setStatus(MobileDeviceOperationMapping.Status.NEW); + status = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO(). + addMobileDeviceOperationMapping(mobileDeviceOperationMapping); + } + + } + } catch (MobileDeviceManagementDAOException e) { + String msg = String.format("Error while adding operation %s to iOS device", operation.getCode()); + log.error(msg, e); + throw new OperationManagementException(msg, e); + } + + return status; + } + + @Override + public List getPendingOperations(DeviceIdentifier deviceIdentifier) throws OperationManagementException { + + List operations = new ArrayList(); + List mobileDeviceOperationMappings; + List operationProperties ; + MobileOperation mobileOperation; + + try { + mobileDeviceOperationMappings = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO(). + getAllPendingOperationMappingsOfMobileDevice(deviceIdentifier.getId()); + + for (MobileDeviceOperationMapping operation : mobileDeviceOperationMappings) { + + mobileOperation = MobileDeviceManagementDAOFactory.getMobileOperationDAO(). + getMobileOperation(operation.getOperationId()); + operationProperties = MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO(). + getAllMobileOperationPropertiesOfOperation(operation.getOperationId()); + mobileOperation.setProperties(operationProperties); + operations.add(MobileDeviceManagementUtil.convertMobileOperationToOperation(mobileOperation)); + operation.setStatus(MobileDeviceOperationMapping.Status.INPROGRESS); + operation.setSentDate(new Date().getTime()); + + MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO(). + updateMobileDeviceOperationMappingToInProgress(operation.getDeviceId(), + operation.getOperationId()); + } + } catch (MobileDeviceManagementDAOException e) { + String msg = "Error occurred when retrieving pending operations in iOS device " + deviceIdentifier.getId(); + log.error(msg, e); + throw new OperationManagementException(msg, e); + } + return operations; + } + + @Override + public List getFeaturesForDeviceType(String s) throws FeatureManagementException { + return null; + } +} From 2a5e5467ac1dce8a7e05095b183a964548543c4e Mon Sep 17 00:00:00 2001 From: Dilshan Edirisuriya Date: Tue, 10 Mar 2015 12:49:45 +0530 Subject: [PATCH 13/15] Removing import --- .../device/mgt/mobile/impl/ios/IOSDeviceManagerService.java | 1 - 1 file changed, 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 ba22dd4e8..52c50b6ce 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 @@ -25,7 +25,6 @@ import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService; import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOException; import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOFactory; import org.wso2.carbon.device.mgt.mobile.dto.MobileDevice; -import org.wso2.carbon.device.mgt.mobile.impl.android.AndroidMobileOperationManager; import org.wso2.carbon.device.mgt.mobile.util.MobileDeviceManagementUtil; import java.util.List; From dcd7274093b3cc9428400119e1751d216f4a0b8f Mon Sep 17 00:00:00 2001 From: Dilshan Edirisuriya Date: Tue, 10 Mar 2015 13:01:58 +0530 Subject: [PATCH 14/15] Removing IOS mobile operation manager --- .../impl/ios/iOSMobileOperationManager.java | 127 ------------------ 1 file changed, 127 deletions(-) delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/iOSMobileOperationManager.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/iOSMobileOperationManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/iOSMobileOperationManager.java deleted file mode 100644 index 3f5fb9564..000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/iOSMobileOperationManager.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * you may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.carbon.device.mgt.mobile.impl.ios; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.mgt.common.DeviceIdentifier; -import org.wso2.carbon.device.mgt.common.Feature; -import org.wso2.carbon.device.mgt.common.FeatureManagementException; -import org.wso2.carbon.device.mgt.common.Operation; -import org.wso2.carbon.device.mgt.common.OperationManagementException; -import org.wso2.carbon.device.mgt.common.OperationManager; -import org.wso2.carbon.device.mgt.mobile.AbstractMobileOperationManager; -import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOException; -import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOFactory; -import org.wso2.carbon.device.mgt.mobile.dto.MobileDeviceOperationMapping; -import org.wso2.carbon.device.mgt.mobile.dto.MobileOperation; -import org.wso2.carbon.device.mgt.mobile.dto.MobileOperationProperty; -import org.wso2.carbon.device.mgt.mobile.util.MobileDeviceManagementUtil; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class IOSMobileOperationManager extends AbstractMobileOperationManager { - - private static final Log log = LogFactory.getLog(IOSMobileOperationManager.class); - private OperationManager operationManager; - @Override - public List getOperations(DeviceIdentifier deviceIdentifier) throws OperationManagementException { - return null; - } - - @Override - public boolean addOperation(Operation operation, List devices) - throws OperationManagementException { - - boolean status = false; - - try { - MobileDeviceOperationMapping mobileDeviceOperationMapping; - MobileOperation mobileOperation = MobileDeviceManagementUtil.convertToMobileOperation(operation); - int operationId = MobileDeviceManagementDAOFactory.getMobileOperationDAO(). - addMobileOperation(mobileOperation); - - if (operationId > 0) { - - for (MobileOperationProperty operationProperty : mobileOperation.getProperties()) { - operationProperty.setOperationId(operationId); - status = MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO(). - addMobileOperationProperty(operationProperty); - } - - for (DeviceIdentifier deviceIdentifier : devices) { - mobileDeviceOperationMapping = new MobileDeviceOperationMapping(); - mobileDeviceOperationMapping.setOperationId(operationId); - mobileDeviceOperationMapping.setDeviceId(deviceIdentifier.getId()); - mobileDeviceOperationMapping.setStatus(MobileDeviceOperationMapping.Status.NEW); - status = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO(). - addMobileDeviceOperationMapping(mobileDeviceOperationMapping); - } - - } - } catch (MobileDeviceManagementDAOException e) { - String msg = String.format("Error while adding operation %s to iOS device", operation.getCode()); - log.error(msg, e); - throw new OperationManagementException(msg, e); - } - - return status; - } - - @Override - public List getPendingOperations(DeviceIdentifier deviceIdentifier) throws OperationManagementException { - - List operations = new ArrayList(); - List mobileDeviceOperationMappings; - List operationProperties ; - MobileOperation mobileOperation; - - try { - mobileDeviceOperationMappings = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO(). - getAllPendingOperationMappingsOfMobileDevice(deviceIdentifier.getId()); - - for (MobileDeviceOperationMapping operation : mobileDeviceOperationMappings) { - - mobileOperation = MobileDeviceManagementDAOFactory.getMobileOperationDAO(). - getMobileOperation(operation.getOperationId()); - operationProperties = MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO(). - getAllMobileOperationPropertiesOfOperation(operation.getOperationId()); - mobileOperation.setProperties(operationProperties); - operations.add(MobileDeviceManagementUtil.convertMobileOperationToOperation(mobileOperation)); - operation.setStatus(MobileDeviceOperationMapping.Status.INPROGRESS); - operation.setSentDate(new Date().getTime()); - - MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO(). - updateMobileDeviceOperationMappingToInProgress(operation.getDeviceId(), - operation.getOperationId()); - } - } catch (MobileDeviceManagementDAOException e) { - String msg = "Error occurred when retrieving pending operations in iOS device " + deviceIdentifier.getId(); - log.error(msg, e); - throw new OperationManagementException(msg, e); - } - return operations; - } - - @Override - public List getFeaturesForDeviceType(String s) throws FeatureManagementException { - return null; - } -} From 023902a8b96c84b7933d156d0e24d44f9392b4c3 Mon Sep 17 00:00:00 2001 From: Dilshan Edirisuriya Date: Tue, 10 Mar 2015 13:02:40 +0530 Subject: [PATCH 15/15] Adding IOS mobile operation manager --- .../impl/ios/IOSMobileOperationManager.java | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSMobileOperationManager.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSMobileOperationManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSMobileOperationManager.java new file mode 100644 index 000000000..3f5fb9564 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSMobileOperationManager.java @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * you may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.device.mgt.mobile.impl.ios; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.device.mgt.common.DeviceIdentifier; +import org.wso2.carbon.device.mgt.common.Feature; +import org.wso2.carbon.device.mgt.common.FeatureManagementException; +import org.wso2.carbon.device.mgt.common.Operation; +import org.wso2.carbon.device.mgt.common.OperationManagementException; +import org.wso2.carbon.device.mgt.common.OperationManager; +import org.wso2.carbon.device.mgt.mobile.AbstractMobileOperationManager; +import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOException; +import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOFactory; +import org.wso2.carbon.device.mgt.mobile.dto.MobileDeviceOperationMapping; +import org.wso2.carbon.device.mgt.mobile.dto.MobileOperation; +import org.wso2.carbon.device.mgt.mobile.dto.MobileOperationProperty; +import org.wso2.carbon.device.mgt.mobile.util.MobileDeviceManagementUtil; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class IOSMobileOperationManager extends AbstractMobileOperationManager { + + private static final Log log = LogFactory.getLog(IOSMobileOperationManager.class); + private OperationManager operationManager; + @Override + public List getOperations(DeviceIdentifier deviceIdentifier) throws OperationManagementException { + return null; + } + + @Override + public boolean addOperation(Operation operation, List devices) + throws OperationManagementException { + + boolean status = false; + + try { + MobileDeviceOperationMapping mobileDeviceOperationMapping; + MobileOperation mobileOperation = MobileDeviceManagementUtil.convertToMobileOperation(operation); + int operationId = MobileDeviceManagementDAOFactory.getMobileOperationDAO(). + addMobileOperation(mobileOperation); + + if (operationId > 0) { + + for (MobileOperationProperty operationProperty : mobileOperation.getProperties()) { + operationProperty.setOperationId(operationId); + status = MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO(). + addMobileOperationProperty(operationProperty); + } + + for (DeviceIdentifier deviceIdentifier : devices) { + mobileDeviceOperationMapping = new MobileDeviceOperationMapping(); + mobileDeviceOperationMapping.setOperationId(operationId); + mobileDeviceOperationMapping.setDeviceId(deviceIdentifier.getId()); + mobileDeviceOperationMapping.setStatus(MobileDeviceOperationMapping.Status.NEW); + status = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO(). + addMobileDeviceOperationMapping(mobileDeviceOperationMapping); + } + + } + } catch (MobileDeviceManagementDAOException e) { + String msg = String.format("Error while adding operation %s to iOS device", operation.getCode()); + log.error(msg, e); + throw new OperationManagementException(msg, e); + } + + return status; + } + + @Override + public List getPendingOperations(DeviceIdentifier deviceIdentifier) throws OperationManagementException { + + List operations = new ArrayList(); + List mobileDeviceOperationMappings; + List operationProperties ; + MobileOperation mobileOperation; + + try { + mobileDeviceOperationMappings = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO(). + getAllPendingOperationMappingsOfMobileDevice(deviceIdentifier.getId()); + + for (MobileDeviceOperationMapping operation : mobileDeviceOperationMappings) { + + mobileOperation = MobileDeviceManagementDAOFactory.getMobileOperationDAO(). + getMobileOperation(operation.getOperationId()); + operationProperties = MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO(). + getAllMobileOperationPropertiesOfOperation(operation.getOperationId()); + mobileOperation.setProperties(operationProperties); + operations.add(MobileDeviceManagementUtil.convertMobileOperationToOperation(mobileOperation)); + operation.setStatus(MobileDeviceOperationMapping.Status.INPROGRESS); + operation.setSentDate(new Date().getTime()); + + MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO(). + updateMobileDeviceOperationMappingToInProgress(operation.getDeviceId(), + operation.getOperationId()); + } + } catch (MobileDeviceManagementDAOException e) { + String msg = "Error occurred when retrieving pending operations in iOS device " + deviceIdentifier.getId(); + log.error(msg, e); + throw new OperationManagementException(msg, e); + } + return operations; + } + + @Override + public List getFeaturesForDeviceType(String s) throws FeatureManagementException { + return null; + } +}