refactored WindowsFeatureImpl

revert-dabc3590
hasuniea 9 years ago
parent a277fd53c2
commit 1abb674b7e

@ -23,6 +23,7 @@ import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
import org.wso2.carbon.device.mgt.mobile.dao.*;
import org.wso2.carbon.device.mgt.mobile.impl.windows.dao.impl.WindowsDeviceDAOImpl;
import org.wso2.carbon.device.mgt.mobile.impl.windows.dao.impl.WindowsFeatureDAOImpl;
import javax.sql.DataSource;
import java.sql.Connection;
@ -61,7 +62,7 @@ public class WindowsDAOFactory extends MobileDeviceManagementDAOFactory
@Override
public MobileFeatureDAO getMobileFeatureDao() {
return null;
return new WindowsFeatureDAOImpl();
}
@Override

@ -187,7 +187,7 @@ public class WindowsFeatureDAOImpl implements MobileFeatureDAO {
public MobileFeature getFeatureByCode(String mblFeatureCode) throws MobileDeviceManagementDAOException {
PreparedStatement stmt = null;
ResultSet rs = null;
Connection conn = null;
Connection conn;
try {
conn = WindowsDAOFactory.getConnection();
@ -226,15 +226,15 @@ public class WindowsFeatureDAOImpl implements MobileFeatureDAO {
public List<MobileFeature> getAllFeatures() throws MobileDeviceManagementDAOException {
PreparedStatement stmt = null;
ResultSet rs = null;
Connection conn = null;
List<MobileFeature> features = new ArrayList<MobileFeature>();
Connection conn;
List<MobileFeature> features = new ArrayList<>();
try {
conn = WindowsDAOFactory.getConnection();
String sql = "SELECT FEATURE_ID, CODE, NAME, DESCRIPTION FROM WINDOWS_FEATURE";
stmt = conn.prepareStatement(sql);
rs = stmt.executeQuery();
MobileFeature mobileFeature = null;
MobileFeature mobileFeature;
while (rs.next()) {
mobileFeature = new MobileFeature();

@ -40,6 +40,9 @@ VALUES
('INSTALL_STORE_APPLICATION', 'Install Public App', 'Install Public App'),
('REMOVE_APPLICATION', 'Uninstall App', 'Uninstall App'),
('DEVICE_LOCK', 'Device Lock', 'Device Lock'),
('DEVICE_RING', 'Ring', 'Ring the device'),
('DISENROLL', 'DisEnroll', 'DisEnroll the device'),
('LOCKRESET', 'LockReset', 'Lock Reset device'),
('CELLULAR', 'Cellular', 'Cellular'),
('APN', 'APN', 'APN'),
('RESTRICTION', 'Restrictions', 'Restrictions operation'),
@ -61,5 +64,5 @@ VALUES
('VPN', 'VPN', 'VPN operation'),
('PER_APP_VPN', 'Per App VPN', 'Per app VPN operation'),
('APP_TO_PER_APP_VPN_MAPPING', 'VPN App mapping', 'App to per app VPN mapping operation'),
('ENTERPRISE_WIPE', 'Enterprise Wipe', 'Enterprise wipe operation'),
('WIPE_DATA', 'Enterprise Wipe', 'Enterprise wipe operation'),
('APP_LOCK', 'App lock', 'App lock operation');

@ -522,7 +522,7 @@
<properties>
<!--Carbon kernel versions-->
<carbon.kernel.version>4.4.1</carbon.kernel.version>
<carbon.kernel.version>4.4.2</carbon.kernel.version>
<carbon.kernel.version.range>[4.4.0, 4.5.0)</carbon.kernel.version.range>
<carbon.p2.plugin.version>1.5.4</carbon.p2.plugin.version>

Loading…
Cancel
Save