From dcf0f5039d0ee27dac9b730e487317529137bec8 Mon Sep 17 00:00:00 2001 From: Dulitha Wijewantha Date: Tue, 12 May 2015 18:18:46 +0530 Subject: [PATCH 1/8] * Increased field length* Increased field length* Increased field length* Increased field length* Increased field length* Increased field length* Increased field length* Increased field length --- .../src/test/resources/sql/CreateH2TestDB.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/sql/CreateH2TestDB.sql b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/sql/CreateH2TestDB.sql index 3005bc42bc..4db13d70f7 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/sql/CreateH2TestDB.sql +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/sql/CreateH2TestDB.sql @@ -140,7 +140,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE_POLICY ( CREATE TABLE IF NOT EXISTS DM_PROFILE_FEATURES ( ID INT(11) NOT NULL AUTO_INCREMENT, PROFILE_ID INT(11) NOT NULL, - FEATURE_CODE VARCHAR(10) NOT NULL, + FEATURE_CODE VARCHAR(30) NOT NULL, DEVICE_TYPE_ID INT NOT NULL, CONTENT BLOB NULL DEFAULT NULL, PRIMARY KEY (ID), From 2b195618c6aaba95e6e7352b34c78bed9b44aa44 Mon Sep 17 00:00:00 2001 From: prabathabey Date: Wed, 13 May 2015 19:54:23 +0530 Subject: [PATCH 2/8] Making components in carbon-devicemgt repository use Carbon kernel 4.4.0 based dependencies --- pom.xml | 52 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/pom.xml b/pom.xml index 66efc3f230..b60609f367 100644 --- a/pom.xml +++ b/pom.xml @@ -1078,29 +1078,40 @@ false + + wso2-staging + WSO2 Staging Repository + http://maven.wso2.org/nexus/content/repositories/orgwso2carbonapimgt-004/ + + true + daily + ignore + + 6.1.1 - 4.3.0 + 4.4.0 1.5.4 1.3 [1.6.1.wso2v11, 1.7.0) 1.6.1.wso2v11 + 1.1.0-wso2v10 1.0.0.Final 1.5.4 - - 0.9.0 - 1.0.0 - 1.2.0 - 1.1.0 - 1.1.0 + + 0.10.0 + 1.3.0 + 1.3.0 + 1.3.0 + 1.3.0 - + 4.3.1 4.3.0 6.8 @@ -1118,32 +1129,31 @@ 7.0.34.wso2v2 - 4.3.1 + 4.4.0 - - 4.3.3 + + 4.4.0 + + 4.4.0 - - 4.3.3 + + 4.4.1 - - 4.3.0 + + 4.4.1 - - 4.3.0 - - 1.1.0-wso2v10 + 1.2.11-wso2v5 [1.2.11.wso2v5, 1.3.0) 1.2.11.wso2v5 - + 0.9.2-SNAPSHOT 4.3.6 - 1.3.1 + 1.4.0 2.6.1 From d76501cf15a2f0e16f4fea5577bc79e984c903b5 Mon Sep 17 00:00:00 2001 From: prabathabey Date: Wed, 13 May 2015 20:14:26 +0530 Subject: [PATCH 3/8] Fixing startup issues caused by not properly updating the Carbon-commons version in the parent pom of carbon-devicemgt repository --- .../src/main/resources/conf/cdm-config.xml | 35 ------------- .../main/resources/conf/license-config.xml | 50 ------------------- .../resources/conf/notification-messages.xml | 32 ------------ .../conf/user-api-publisher-config.xml | 30 ----------- .../src/main/resources/p2.inf | 7 +-- pom.xml | 6 ++- 6 files changed, 5 insertions(+), 155 deletions(-) delete mode 100644 features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/cdm-config.xml delete mode 100644 features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/license-config.xml delete mode 100644 features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/notification-messages.xml delete mode 100644 features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/user-api-publisher-config.xml diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/cdm-config.xml b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/cdm-config.xml deleted file mode 100644 index 0991207a54..0000000000 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/cdm-config.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - jdbc/DM_DS - - - - 8 - 100 - 20 - 1000 - - - - diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/license-config.xml b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/license-config.xml deleted file mode 100644 index e182e58bb9..0000000000 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/license-config.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - wso2 - android - 1.0.0 - 1.0.0 - 01-01-2014 - 31-12-2035 - - - - wso2 - ios - 1.0.0 - 1.0.0 - 01-01-2014 - 31-12-2035 - - - - wso2 - windows - 1.0.0 - 1.0.0 - 01-01-2014 - 31-12-2035 - - - - \ No newline at end of file diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/notification-messages.xml b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/notification-messages.xml deleted file mode 100644 index 563b4a58c0..0000000000 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/notification-messages.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - -
Dear {title} {user-name},
- You have been registered to the WSO2 MDM. Below is the link to enroll. - {downloadUrl} -
-Best Regards, -WSO2 Carbon Team -http://www.wso2.com -
- Enrol your device with WSO2 MDM -
-
\ No newline at end of file diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/user-api-publisher-config.xml b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/user-api-publisher-config.xml deleted file mode 100644 index 3221092ae9..0000000000 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/user-api-publisher-config.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - appmanager - admin - enrollment - 1.0.0 - http://localhost:9763/ - http,https - - - diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/p2.inf b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/p2.inf index 36ac4e31ef..a7f67523c6 100644 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/p2.inf +++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/p2.inf @@ -1,7 +1,2 @@ instructions.configure = \ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/conf/cdm-config.xml,target:${installFolder}/../../conf/cdm-config.xml,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/conf/notification-messages.xml,target:${installFolder}/../../conf/notification-messages.xml,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/conf/license-config.xml,target:${installFolder}/../../conf/etc/license-config.xml,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/conf/user-api-publisher-config.xml,target:${installFolder}/../../conf/etc/user-api-publisher-config.xml,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/dbscripts/cdm,target:${installFolder}/../../../dbscripts/cdm,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/rxts/license.rxt,target:${installFolder}/../../../repository/resources/rxts/license.rxt,overwrite:true);\ \ No newline at end of file +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/conf/webapp-authenticator-config.xml,target:${installFolder}/../../conf/etc/webapp-authenticator-config.xml,overwrite:true);\ \ No newline at end of file diff --git a/pom.xml b/pom.xml index b60609f367..a325bcaede 100644 --- a/pom.xml +++ b/pom.xml @@ -1150,9 +1150,11 @@ 0.9.2-SNAPSHOT - 4.3.6 - + + 4.4.0 + + 1.4.0 From acc159d132f7cfa6a789e32069d8e736e54b4256 Mon Sep 17 00:00:00 2001 From: Dulitha Wijewantha Date: Wed, 13 May 2015 22:04:15 +0530 Subject: [PATCH 4/8] * Refactored addPolicy --- .../carbon/policy/mgt/common/PolicyAdministratorPoint.java | 2 ++ .../wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java | 2 +- .../policy/mgt/core/impl/PolicyAdministratorPointImpl.java | 4 ++++ .../carbon/policy/mgt/core/mgt/impl/PolicyManagerImpl.java | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/PolicyAdministratorPoint.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/PolicyAdministratorPoint.java index 7d1e7244ab..53f8411bbc 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/PolicyAdministratorPoint.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/PolicyAdministratorPoint.java @@ -62,6 +62,8 @@ public interface PolicyAdministratorPoint { List getPolicies() throws PolicyManagementException; + Policy getPolicy(int policyId) throws PolicyManagementException; + /** * This method gives the device specific policy. * diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java index 27edad84f5..eef48b2710 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java @@ -445,11 +445,11 @@ public class PolicyDAOImpl implements PolicyDAO { resultSet = stmt.executeQuery(); while (resultSet.next()) { - policy.setId(policyId); policy.setPolicyName(resultSet.getString("NAME")); policy.setTenantId(resultSet.getInt("TENANT_ID")); policy.setPriorityId(resultSet.getInt("PRIORITY")); + policy.setProfileId(resultSet.getInt("PROFILE_ID")); } return policy; diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyAdministratorPointImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyAdministratorPointImpl.java index 0029b26983..c1c8f73d92 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyAdministratorPointImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyAdministratorPointImpl.java @@ -83,6 +83,10 @@ public class PolicyAdministratorPointImpl implements PolicyAdministratorPoint { return policyManager.getPolicies(); } + @Override public Policy getPolicy(int policyId) throws PolicyManagementException { + return policyManager.getPolicy(policyId); + } + @Override public List getPoliciesOfDevice(DeviceIdentifier deviceIdentifier) throws PolicyManagementException { return policyManager.getPoliciesOfDevice(deviceIdentifier); diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/PolicyManagerImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/PolicyManagerImpl.java index 811a7f087c..fb8b27c2fe 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/PolicyManagerImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/PolicyManagerImpl.java @@ -372,7 +372,7 @@ public class PolicyManagerImpl implements PolicyManager { policyDAO.getTimesOfPolicy(policy); policyDAO.getLocationsOfPolicy(policy); - Profile profile = profileDAO.getProfiles(policy.getProfile().getProfileId()); + Profile profile = profileDAO.getProfiles(policy.getProfileId()); policy.setProfile(profile); policy.setRoles(roleNames); From afbf6a9bf8d5b9081378fd42c4db3cb834bc74c4 Mon Sep 17 00:00:00 2001 From: prabathabey Date: Wed, 13 May 2015 22:14:50 +0530 Subject: [PATCH 5/8] Fixing issues related to webapp-authenticator-config.xml not getting copied into the MDM distribution --- .../src/main/resources/p2.inf | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/p2.inf b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/p2.inf index a7f67523c6..91ac161b4e 100644 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/p2.inf +++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/p2.inf @@ -1,2 +1,2 @@ instructions.configure = \ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/conf/webapp-authenticator-config.xml,target:${installFolder}/../../conf/etc/webapp-authenticator-config.xml,overwrite:true);\ \ No newline at end of file +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.webapp.authenticator.framework.server_${feature.version}/conf/webapp-authenticator-config.xml,target:${installFolder}/../../conf/etc/webapp-authenticator-config.xml,overwrite:true);\ \ No newline at end of file diff --git a/pom.xml b/pom.xml index a325bcaede..087a6647e3 100644 --- a/pom.xml +++ b/pom.xml @@ -1151,7 +1151,7 @@ 0.9.2-SNAPSHOT - + 4.4.0 From d5cafe843dcf29e8e0eb7b0cb2130e6fb418731a Mon Sep 17 00:00:00 2001 From: prabathabey Date: Wed, 13 May 2015 22:36:03 +0530 Subject: [PATCH 6/8] Fixing issues related to webapp-authenticator-config.xml not getting copied into the MDM distribution --- .../main/resources/conf/webapp-authenticator-config.xml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/webapp-authenticator-config.xml diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/webapp-authenticator-config.xml b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/webapp-authenticator-config.xml new file mode 100644 index 0000000000..d4c9638d49 --- /dev/null +++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/webapp-authenticator-config.xml @@ -0,0 +1,8 @@ + + + + OAuth + org.wso2.carbon.webapp.authenticator.framework.authenticator.OAuthAuthenticator + + + From bf62561b00108d2c83798c3befb248a4926713ed Mon Sep 17 00:00:00 2001 From: manoj Date: Wed, 13 May 2015 23:34:03 +0530 Subject: [PATCH 7/8] Change Next operations method to accept parameter device id --- .../operation/mgt/OperationManagerImpl.java | 22 +++++++++++++++---- .../core/operation/mgt/dao/OperationDAO.java | 2 +- .../mgt/dao/impl/OperationDAOImpl.java | 8 +++---- .../mgt/dao/impl/ProfileOperationDAOImpl.java | 1 - 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java index 5000bd56a6..6e66527c58 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java @@ -20,6 +20,7 @@ package org.wso2.carbon.device.mgt.core.operation.mgt; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; @@ -195,20 +196,33 @@ public class OperationManagerImpl implements OperationManager { } @Override - public Operation getNextPendingOperation(DeviceIdentifier deviceId) throws OperationManagementException { + public Operation getNextPendingOperation(DeviceIdentifier deviceIdentifier) throws OperationManagementException { if (log.isDebugEnabled()) { - log.debug("device identifier id:[" + deviceId.getId() + "] type:[" + deviceId.getType() + "]"); + log.debug("device identifier id:[" + deviceIdentifier.getId() + "] type:[" + deviceIdentifier.getType() + "]"); } Operation operation = null; + Device device; try { + device = deviceManagementService.getCoreDevice(deviceIdentifier); + + if (device == null) { + throw new OperationManagementException("Device not found for given device " + + "Identifier:" + deviceIdentifier.getId() + " and given type" + deviceIdentifier.getType()); + } org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation dtoOperation = operationDAO - .getNextOperation(deviceId); + .getNextOperation(device.getId()); if (dtoOperation != null) { operation = OperationDAOUtil.convertOperation(dtoOperation); } return operation; - } catch (OperationManagementDAOException e) { + } catch (DeviceManagementException deviceMgtException) { + String errorMsg = "Error occurred while retrieving the device " + + "for device Identifier type -'" + deviceIdentifier.getType() + "' and device Id '" + + deviceIdentifier.getId(); + log.error(errorMsg, deviceMgtException); + throw new OperationManagementException(errorMsg, deviceMgtException); + } catch (OperationManagementDAOException e) { throw new OperationManagementException("Error occurred while retrieving next pending operation", e); } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationDAO.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationDAO.java index bd7699e670..07572f98c7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationDAO.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationDAO.java @@ -42,6 +42,6 @@ public interface OperationDAO { List getOperationsForStatus(Operation.Status status) throws OperationManagementDAOException; - Operation getNextOperation(DeviceIdentifier deviceId) throws OperationManagementDAOException; + Operation getNextOperation(int deviceId) throws OperationManagementDAOException; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationDAOImpl.java index 9b996e1069..fdf39f8ddf 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationDAOImpl.java @@ -462,7 +462,7 @@ public class OperationDAOImpl implements OperationDAO { } @Override - public Operation getNextOperation(DeviceIdentifier deviceId) throws OperationManagementDAOException { + public Operation getNextOperation(int deviceId) throws OperationManagementDAOException { PreparedStatement stmt = null; ResultSet rs = null; @@ -483,9 +483,9 @@ public class OperationDAOImpl implements OperationDAO { "o.ID =po.OPERATION_ID LEFT OUTER JOIN DM_COMMAND_OPERATION co ON co.OPERATION_ID=o.ID " + "ORDER BY o.CREATED_TIMESTAMP ASC LIMIT 1"); - stmt.setString(1, deviceId.getType()); - stmt.setString(2, deviceId.getId()); - stmt.setString(3, Operation.Status.PENDING.toString()); + stmt.setString(1, Operation.Status.PENDING.toString()); + stmt.setInt(2, deviceId); + rs = stmt.executeQuery(); Operation operation = null; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java index f59fe6452d..f23e77eafa 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java @@ -59,7 +59,6 @@ public class ProfileOperationDAOImpl extends OperationDAOImpl { return operationId; } - @Override public Operation getNextOperation(DeviceIdentifier deviceId) throws OperationManagementDAOException { PreparedStatement stmt = null; From 5eed51c3dc1be8aadb460586ea0bfcce7e7f4aa2 Mon Sep 17 00:00:00 2001 From: prabathabey Date: Thu, 14 May 2015 18:13:24 +0530 Subject: [PATCH 8/8] Fixing issues surfaced while logging into the management console of the product as a result of an anomaly in the webapp authenticator framework --- .../framework/WebappAuthenticatorFrameworkValve.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticatorFrameworkValve.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticatorFrameworkValve.java index e14480d822..66982112bd 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticatorFrameworkValve.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticatorFrameworkValve.java @@ -44,9 +44,11 @@ public class WebappAuthenticatorFrameworkValve extends CarbonTomcatValve { case SUCCESS: case CONTINUE: this.getNext().invoke(request, response, compositeValve); + break; case FAILURE: AuthenticationFrameworkUtil.handleResponse(request, response, HttpServletResponse.SC_UNAUTHORIZED, "Failed to authorize the incoming request"); + break; } }