fetch command operation enable property

revert-70aa11f8
manoj 10 years ago
parent e59e59e496
commit a46aff84fd

@ -36,7 +36,6 @@ public class OperationManagementDAOFactory {
private static DataSource dataSource; private static DataSource dataSource;
private static final Log log = LogFactory.getLog(OperationManagementDAOFactory.class); private static final Log log = LogFactory.getLog(OperationManagementDAOFactory.class);
private static ThreadLocal<Connection> currentConnection = new ThreadLocal<Connection>(); private static ThreadLocal<Connection> currentConnection = new ThreadLocal<Connection>();
private static final Object LOCK = new Object();
public static OperationDAO getCommandOperationDAO() { public static OperationDAO getCommandOperationDAO() {
return new CommandOperationDAOImpl(); return new CommandOperationDAOImpl();
@ -67,6 +66,7 @@ public class OperationManagementDAOFactory {
} }
public static void beginTransaction() throws OperationManagementDAOException { public static void beginTransaction() throws OperationManagementDAOException {
try { try {
currentConnection.set(dataSource.getConnection()); currentConnection.set(dataSource.getConnection());
} catch (SQLException e) { } catch (SQLException e) {
@ -75,6 +75,7 @@ public class OperationManagementDAOFactory {
} }
public static Connection getConnection() throws OperationManagementDAOException { public static Connection getConnection() throws OperationManagementDAOException {
if (currentConnection.get() == null) { if (currentConnection.get() == null) {
try { try {
currentConnection.set(dataSource.getConnection()); currentConnection.set(dataSource.getConnection());

@ -289,6 +289,9 @@ public class OperationDAOImpl implements OperationDAO {
} }
operation.setStatus(Operation.Status.valueOf(rs.getString("STATUS"))); operation.setStatus(Operation.Status.valueOf(rs.getString("STATUS")));
operation.setCode(rs.getString("OPERATION_CODE")); operation.setCode(rs.getString("OPERATION_CODE"));
if (rs.getObject("ENABLED") != null) {
operation.setEnabled(rs.getBoolean("ENABLED"));
}
} }
operationList.add(operation); operationList.add(operation);
} }

@ -81,6 +81,7 @@ public class OperationDAOUtil {
operation.setId(dtoOperation.getId()); operation.setId(dtoOperation.getId());
operation.setPayLoad(dtoOperation.getPayLoad()); operation.setPayLoad(dtoOperation.getPayLoad());
operation.setReceivedTimeStamp(dtoOperation.getReceivedTimeStamp()); operation.setReceivedTimeStamp(dtoOperation.getReceivedTimeStamp());
operation.setEnabled(dtoOperation.isEnabled());
return operation; return operation;
} }

@ -17,7 +17,8 @@
~ under the License. ~ under the License.
--> -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
@ -98,20 +99,28 @@
</properties> </properties>
</adviceFile> </adviceFile>
<bundles> <bundles>
<bundleDef>org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.core:${carbon.device.mgt.version} <bundleDef>
org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.core:${carbon.device.mgt.version}
</bundleDef> </bundleDef>
<bundleDef>org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.common:${carbon.device.mgt.version} <bundleDef>
org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.common:${carbon.device.mgt.version}
</bundleDef> </bundleDef>
<bundleDef> <bundleDef>
org.wso2.carbon.commons:org.wso2.carbon.email.verification org.wso2.carbon.commons:org.wso2.carbon.email.verification
</bundleDef> </bundleDef>
<bundleDef>org.wso2.carbon.identity:org.wso2.carbon.identity.oauth.stub:${carbon.identity.version} <bundleDef>
org.wso2.carbon.identity:org.wso2.carbon.identity.oauth.stub:${carbon.identity.version}
</bundleDef> </bundleDef>
</bundles> </bundles>
<importFeatures> <importFeatures>
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef> <importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
<importFeatureDef>org.wso2.carbon.governance.metadata:${carbon.governance.version}</importFeatureDef> </importFeatureDef>
<importFeatureDef>org.wso2.carbon.apimgt.core:${carbon.api.mgt.version}</importFeatureDef> <importFeatureDef>org.wso2.carbon.governance.metadata:${carbon.governance.version}
</importFeatureDef>
<importFeatureDef>org.wso2.carbon.apimgt.core:${carbon.api.mgt.version}
</importFeatureDef>
<importFeatureDef>org.wso2.carbon.transaction.manager:${carbon.commons.version}
</importFeatureDef>
</importFeatures> </importFeatures>
</configuration> </configuration>
</execution> </execution>

@ -17,14 +17,38 @@
~ under the License. ~ under the License.
--> -->
<APIPublisherConfig> <APIPublisherConfig>
<APIs> <APIs>
<API> <API>
<Name>appmanager</Name> <Name>appmanager</Name>
<Owner>admin</Owner> <Owner>admin</Owner>
<Context>/devices</Context> <Context>devices</Context>
<Version>1.0.0</Version> <Version>1.0.0</Version>
<Endpoint>http://localhost:9763/</Endpoint> <Endpoint>http://localhost:9763/</Endpoint>
<Transports>http,https</Transports> <Transports>http,https</Transports>
</API> </API>
</APIs> <API>
<Name>enrollment</Name>
<Owner>admin</Owner>
<Context>enroll</Context>
<Version>1.0.0</Version>
<Endpoint>http://localhost:9763/cdm-android-api/enrollment/</Endpoint>
<Transports>http,https</Transports>
</API>
<API>
<Name>license</Name>
<Owner>admin</Owner>
<Context>license</Context>
<Version>1.0.0</Version>
<Endpoint>http://localhost:9763/cdm-android-api/devices/license</Endpoint>
<Transports>http,https</Transports>
</API>
<API>
<Name>operation</Name>
<Owner>admin</Owner>
<Context>operation</Context>
<Version>1.0.0</Version>
<Endpoint>http://localhost:9763/cdm-android-ap/operations/</Endpoint>
<Transports>http,https</Transports>
</API>
</APIs>
</APIPublisherConfig> </APIPublisherConfig>

@ -877,7 +877,6 @@
<version>${cxf.version}</version> <version>${cxf.version}</version>
</dependency> </dependency>
<!-- End of CXF dependencies --> <!-- End of CXF dependencies -->
<!-- Transaction Mgt features --> <!-- Transaction Mgt features -->
<dependency> <dependency>
<groupId>org.wso2.carbon.commons</groupId> <groupId>org.wso2.carbon.commons</groupId>
@ -891,7 +890,6 @@
<version>${carbon.commons.version}</version> <version>${carbon.commons.version}</version>
</dependency> </dependency>
<!-- End of transaction Mgt features --> <!-- End of transaction Mgt features -->
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>

Loading…
Cancel
Save