From a46aff84fd0bfd59816601d47cc0a6d6bddc5105 Mon Sep 17 00:00:00 2001 From: manoj Date: Fri, 24 Apr 2015 12:34:04 +0530 Subject: [PATCH] fetch command operation enable property --- .../dao/OperationManagementDAOFactory.java | 3 +- .../mgt/dao/impl/OperationDAOImpl.java | 3 ++ .../mgt/dao/util/OperationDAOUtil.java | 1 + .../pom.xml | 23 +++++++--- .../conf/user-api-publisher-config.xml | 44 ++++++++++++++----- pom.xml | 2 - 6 files changed, 56 insertions(+), 20 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationManagementDAOFactory.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationManagementDAOFactory.java index 960e5b8850..6879cd553b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationManagementDAOFactory.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationManagementDAOFactory.java @@ -36,7 +36,6 @@ public class OperationManagementDAOFactory { private static DataSource dataSource; private static final Log log = LogFactory.getLog(OperationManagementDAOFactory.class); private static ThreadLocal currentConnection = new ThreadLocal(); - private static final Object LOCK = new Object(); public static OperationDAO getCommandOperationDAO() { return new CommandOperationDAOImpl(); @@ -67,6 +66,7 @@ public class OperationManagementDAOFactory { } public static void beginTransaction() throws OperationManagementDAOException { + try { currentConnection.set(dataSource.getConnection()); } catch (SQLException e) { @@ -75,6 +75,7 @@ public class OperationManagementDAOFactory { } public static Connection getConnection() throws OperationManagementDAOException { + if (currentConnection.get() == null) { try { currentConnection.set(dataSource.getConnection()); 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 8b73a4fe8d..73c746b91c 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 @@ -289,6 +289,9 @@ public class OperationDAOImpl implements OperationDAO { } operation.setStatus(Operation.Status.valueOf(rs.getString("STATUS"))); operation.setCode(rs.getString("OPERATION_CODE")); + if (rs.getObject("ENABLED") != null) { + operation.setEnabled(rs.getBoolean("ENABLED")); + } } operationList.add(operation); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/util/OperationDAOUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/util/OperationDAOUtil.java index 3025496814..8cabc6d3bd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/util/OperationDAOUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/util/OperationDAOUtil.java @@ -81,6 +81,7 @@ public class OperationDAOUtil { operation.setId(dtoOperation.getId()); operation.setPayLoad(dtoOperation.getPayLoad()); operation.setReceivedTimeStamp(dtoOperation.getReceivedTimeStamp()); + operation.setEnabled(dtoOperation.isEnabled()); return operation; } diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml index 2b5c29a425..aa73445efc 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml @@ -17,7 +17,8 @@ ~ under the License. --> - + org.wso2.carbon.devicemgt @@ -98,20 +99,28 @@ - org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.core:${carbon.device.mgt.version} + + org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.core:${carbon.device.mgt.version} - org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.common:${carbon.device.mgt.version} + + org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.common:${carbon.device.mgt.version} org.wso2.carbon.commons:org.wso2.carbon.email.verification - org.wso2.carbon.identity:org.wso2.carbon.identity.oauth.stub:${carbon.identity.version} + + org.wso2.carbon.identity:org.wso2.carbon.identity.oauth.stub:${carbon.identity.version} - org.wso2.carbon.core.server:${carbon.kernel.version} - org.wso2.carbon.governance.metadata:${carbon.governance.version} - org.wso2.carbon.apimgt.core:${carbon.api.mgt.version} + org.wso2.carbon.core.server:${carbon.kernel.version} + + org.wso2.carbon.governance.metadata:${carbon.governance.version} + + org.wso2.carbon.apimgt.core:${carbon.api.mgt.version} + + org.wso2.carbon.transaction.manager:${carbon.commons.version} + diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/conf/user-api-publisher-config.xml b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/conf/user-api-publisher-config.xml index 8cc9771877..987ee7513a 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/conf/user-api-publisher-config.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/conf/user-api-publisher-config.xml @@ -17,14 +17,38 @@ ~ under the License. --> - - - appmanager - admin - /devices - 1.0.0 - http://localhost:9763/ - http,https - - + + + appmanager + admin + devices + 1.0.0 + http://localhost:9763/ + http,https + + + enrollment + admin + enroll + 1.0.0 + http://localhost:9763/cdm-android-api/enrollment/ + http,https + + + license + admin + license + 1.0.0 + http://localhost:9763/cdm-android-api/devices/license + http,https + + + operation + admin + operation + 1.0.0 + http://localhost:9763/cdm-android-ap/operations/ + http,https + + diff --git a/pom.xml b/pom.xml index 92474ab1ff..66efc3f230 100644 --- a/pom.xml +++ b/pom.xml @@ -877,7 +877,6 @@ ${cxf.version} - org.wso2.carbon.commons @@ -891,7 +890,6 @@ ${carbon.commons.version} -