|
|
@ -19,11 +19,10 @@
|
|
|
|
package org.wso2.carbon.device.mgt.analytics.dashboard.dao;
|
|
|
|
package org.wso2.carbon.device.mgt.analytics.dashboard.dao;
|
|
|
|
|
|
|
|
|
|
|
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|
|
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|
|
|
import org.wso2.carbon.device.mgt.analytics.dashboard.dao.bean.DetailedDeviceEntry;
|
|
|
|
import org.wso2.carbon.device.mgt.analytics.dashboard.bean.DetailedDeviceEntry;
|
|
|
|
import org.wso2.carbon.device.mgt.analytics.dashboard.dao.bean.DeviceCountByGroupEntry;
|
|
|
|
import org.wso2.carbon.device.mgt.analytics.dashboard.bean.DeviceCountByGroupEntry;
|
|
|
|
import org.wso2.carbon.device.mgt.analytics.dashboard.dao.bean.FilterSet;
|
|
|
|
import org.wso2.carbon.device.mgt.analytics.dashboard.bean.FilterSet;
|
|
|
|
import org.wso2.carbon.device.mgt.analytics.dashboard.dao.exception.DataAccessLayerException;
|
|
|
|
import org.wso2.carbon.device.mgt.analytics.dashboard.exception.InvalidParameterValueException;
|
|
|
|
import org.wso2.carbon.device.mgt.analytics.dashboard.dao.exception.InvalidParameterValueException;
|
|
|
|
|
|
|
|
import org.wso2.carbon.device.mgt.core.dao.util.DeviceManagementDAOUtil;
|
|
|
|
import org.wso2.carbon.device.mgt.core.dao.util.DeviceManagementDAOUtil;
|
|
|
|
|
|
|
|
|
|
|
|
import java.sql.Connection;
|
|
|
|
import java.sql.Connection;
|
|
|
@ -38,7 +37,7 @@ import java.util.Map;
|
|
|
|
public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceDAO {
|
|
|
|
public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceDAO {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public DeviceCountByGroupEntry getTotalDeviceCount() throws DataAccessLayerException {
|
|
|
|
public DeviceCountByGroupEntry getTotalDeviceCount() throws SQLException {
|
|
|
|
int totalDeviceCount;
|
|
|
|
int totalDeviceCount;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
totalDeviceCount = this.getFilteredDeviceCount(null);
|
|
|
|
totalDeviceCount = this.getFilteredDeviceCount(null);
|
|
|
@ -56,7 +55,7 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public DeviceCountByGroupEntry getDeviceCount(FilterSet filterSet)
|
|
|
|
public DeviceCountByGroupEntry getDeviceCount(FilterSet filterSet)
|
|
|
|
throws InvalidParameterValueException, DataAccessLayerException {
|
|
|
|
throws InvalidParameterValueException, SQLException {
|
|
|
|
|
|
|
|
|
|
|
|
int filteredDeviceCount = this.getFilteredDeviceCount(filterSet);
|
|
|
|
int filteredDeviceCount = this.getFilteredDeviceCount(filterSet);
|
|
|
|
|
|
|
|
|
|
|
@ -69,7 +68,7 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private int getFilteredDeviceCount(FilterSet filterSet)
|
|
|
|
private int getFilteredDeviceCount(FilterSet filterSet)
|
|
|
|
throws InvalidParameterValueException, DataAccessLayerException {
|
|
|
|
throws InvalidParameterValueException, SQLException {
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> filters = this.extractDatabaseFiltersFromBean(filterSet);
|
|
|
|
Map<String, Object> filters = this.extractDatabaseFiltersFromBean(filterSet);
|
|
|
|
|
|
|
|
|
|
|
@ -80,8 +79,8 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
int filteredDeviceCount = 0;
|
|
|
|
int filteredDeviceCount = 0;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
con = this.getConnection();
|
|
|
|
con = this.getConnection();
|
|
|
|
String sql = "SELECT COUNT(DEVICE_ID) AS DEVICE_COUNT FROM " + GadgetDataServiceDAOConstants.DatabaseView.
|
|
|
|
String sql = "SELECT COUNT(DEVICE_ID) AS DEVICE_COUNT FROM " +
|
|
|
|
DEVICES_VIEW_1 + " WHERE TENANT_ID = ?";
|
|
|
|
GadgetDataServiceDAOConstants.DatabaseView.DEVICES_VIEW_1 + " WHERE TENANT_ID = ?";
|
|
|
|
// appending filters to support advanced filtering options
|
|
|
|
// appending filters to support advanced filtering options
|
|
|
|
// [1] appending filter columns
|
|
|
|
// [1] appending filter columns
|
|
|
|
if (filters != null && filters.size() > 0) {
|
|
|
|
if (filters != null && filters.size() > 0) {
|
|
|
@ -109,9 +108,6 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
while (rs.next()) {
|
|
|
|
while (rs.next()) {
|
|
|
|
filteredDeviceCount = rs.getInt("DEVICE_COUNT");
|
|
|
|
filteredDeviceCount = rs.getInt("DEVICE_COUNT");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
|
|
|
throw new DataAccessLayerException("Error in either getting database connection, " +
|
|
|
|
|
|
|
|
"running SQL query or fetching results.", e);
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -120,7 +116,7 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public DeviceCountByGroupEntry getFeatureNonCompliantDeviceCount(String nonCompliantFeatureCode,
|
|
|
|
public DeviceCountByGroupEntry getFeatureNonCompliantDeviceCount(String nonCompliantFeatureCode,
|
|
|
|
FilterSet filterSet) throws InvalidParameterValueException, DataAccessLayerException {
|
|
|
|
FilterSet filterSet) throws InvalidParameterValueException, SQLException {
|
|
|
|
|
|
|
|
|
|
|
|
if (nonCompliantFeatureCode == null || nonCompliantFeatureCode.isEmpty()) {
|
|
|
|
if (nonCompliantFeatureCode == null || nonCompliantFeatureCode.isEmpty()) {
|
|
|
|
throw new InvalidParameterValueException("Non-compliant feature code should not be either null or empty.");
|
|
|
|
throw new InvalidParameterValueException("Non-compliant feature code should not be either null or empty.");
|
|
|
@ -135,8 +131,8 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
int filteredDeviceCount = 0;
|
|
|
|
int filteredDeviceCount = 0;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
con = this.getConnection();
|
|
|
|
con = this.getConnection();
|
|
|
|
String sql = "SELECT COUNT(DEVICE_ID) AS DEVICE_COUNT FROM " + GadgetDataServiceDAOConstants.DatabaseView.
|
|
|
|
String sql = "SELECT COUNT(DEVICE_ID) AS DEVICE_COUNT FROM " +
|
|
|
|
DEVICES_VIEW_2 + " WHERE TENANT_ID = ? AND FEATURE_CODE = ?";
|
|
|
|
GadgetDataServiceDAOConstants.DatabaseView.DEVICES_VIEW_2 + " WHERE TENANT_ID = ? AND FEATURE_CODE = ?";
|
|
|
|
// appending filters to support advanced filtering options
|
|
|
|
// appending filters to support advanced filtering options
|
|
|
|
// [1] appending filter columns
|
|
|
|
// [1] appending filter columns
|
|
|
|
if (filters != null && filters.size() > 0) {
|
|
|
|
if (filters != null && filters.size() > 0) {
|
|
|
@ -165,9 +161,6 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
while (rs.next()) {
|
|
|
|
while (rs.next()) {
|
|
|
|
filteredDeviceCount = rs.getInt("DEVICE_COUNT");
|
|
|
|
filteredDeviceCount = rs.getInt("DEVICE_COUNT");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
|
|
|
throw new DataAccessLayerException("Error in either getting database connection, " +
|
|
|
|
|
|
|
|
"running SQL query or fetching results.", e);
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -181,7 +174,7 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<DeviceCountByGroupEntry> getDeviceCountsByConnectivityStatuses() throws DataAccessLayerException {
|
|
|
|
public List<DeviceCountByGroupEntry> getDeviceCountsByConnectivityStatuses() throws SQLException {
|
|
|
|
Connection con;
|
|
|
|
Connection con;
|
|
|
|
PreparedStatement stmt = null;
|
|
|
|
PreparedStatement stmt = null;
|
|
|
|
ResultSet rs = null;
|
|
|
|
ResultSet rs = null;
|
|
|
@ -206,9 +199,6 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
deviceCountByConnectivityStatus.setDeviceCount(rs.getInt("DEVICE_COUNT"));
|
|
|
|
deviceCountByConnectivityStatus.setDeviceCount(rs.getInt("DEVICE_COUNT"));
|
|
|
|
deviceCountsByConnectivityStatuses.add(deviceCountByConnectivityStatus);
|
|
|
|
deviceCountsByConnectivityStatuses.add(deviceCountByConnectivityStatus);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
|
|
|
throw new DataAccessLayerException("Error in either getting database connection, " +
|
|
|
|
|
|
|
|
"running SQL query or fetching results.", e);
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -216,7 +206,7 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<DeviceCountByGroupEntry> getDeviceCountsByPotentialVulnerabilities() throws DataAccessLayerException {
|
|
|
|
public List<DeviceCountByGroupEntry> getDeviceCountsByPotentialVulnerabilities() throws SQLException {
|
|
|
|
// getting non-compliant device count
|
|
|
|
// getting non-compliant device count
|
|
|
|
DeviceCountByGroupEntry nonCompliantDeviceCount = new DeviceCountByGroupEntry();
|
|
|
|
DeviceCountByGroupEntry nonCompliantDeviceCount = new DeviceCountByGroupEntry();
|
|
|
|
nonCompliantDeviceCount.setGroup(GadgetDataServiceDAOConstants.PotentialVulnerability.NON_COMPLIANT);
|
|
|
|
nonCompliantDeviceCount.setGroup(GadgetDataServiceDAOConstants.PotentialVulnerability.NON_COMPLIANT);
|
|
|
@ -236,7 +226,7 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
return deviceCountsByPotentialVulnerabilities;
|
|
|
|
return deviceCountsByPotentialVulnerabilities;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private int getNonCompliantDeviceCount() throws DataAccessLayerException {
|
|
|
|
private int getNonCompliantDeviceCount() throws SQLException {
|
|
|
|
FilterSet filterSet = new FilterSet();
|
|
|
|
FilterSet filterSet = new FilterSet();
|
|
|
|
filterSet.setPotentialVulnerability(GadgetDataServiceDAOConstants.PotentialVulnerability.NON_COMPLIANT);
|
|
|
|
filterSet.setPotentialVulnerability(GadgetDataServiceDAOConstants.PotentialVulnerability.NON_COMPLIANT);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -246,7 +236,7 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private int getUnmonitoredDeviceCount() throws DataAccessLayerException {
|
|
|
|
private int getUnmonitoredDeviceCount() throws SQLException {
|
|
|
|
FilterSet filterSet = new FilterSet();
|
|
|
|
FilterSet filterSet = new FilterSet();
|
|
|
|
filterSet.setPotentialVulnerability(GadgetDataServiceDAOConstants.PotentialVulnerability.UNMONITORED);
|
|
|
|
filterSet.setPotentialVulnerability(GadgetDataServiceDAOConstants.PotentialVulnerability.UNMONITORED);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -258,7 +248,7 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<DeviceCountByGroupEntry> getDeviceCountsByPlatforms(FilterSet filterSet)
|
|
|
|
public List<DeviceCountByGroupEntry> getDeviceCountsByPlatforms(FilterSet filterSet)
|
|
|
|
throws InvalidParameterValueException, DataAccessLayerException {
|
|
|
|
throws InvalidParameterValueException, SQLException {
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> filters = this.extractDatabaseFiltersFromBean(filterSet);
|
|
|
|
Map<String, Object> filters = this.extractDatabaseFiltersFromBean(filterSet);
|
|
|
|
|
|
|
|
|
|
|
@ -304,9 +294,6 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
filteredDeviceCountByPlatform.setDeviceCount(rs.getInt("DEVICE_COUNT"));
|
|
|
|
filteredDeviceCountByPlatform.setDeviceCount(rs.getInt("DEVICE_COUNT"));
|
|
|
|
filteredDeviceCountsByPlatforms.add(filteredDeviceCountByPlatform);
|
|
|
|
filteredDeviceCountsByPlatforms.add(filteredDeviceCountByPlatform);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
|
|
|
throw new DataAccessLayerException("Error in either getting database connection, " +
|
|
|
|
|
|
|
|
"running SQL query or fetching results.", e);
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -316,7 +303,7 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<DeviceCountByGroupEntry>
|
|
|
|
public List<DeviceCountByGroupEntry>
|
|
|
|
getFeatureNonCompliantDeviceCountsByPlatforms(String nonCompliantFeatureCode,
|
|
|
|
getFeatureNonCompliantDeviceCountsByPlatforms(String nonCompliantFeatureCode,
|
|
|
|
FilterSet filterSet) throws InvalidParameterValueException, DataAccessLayerException {
|
|
|
|
FilterSet filterSet) throws InvalidParameterValueException, SQLException {
|
|
|
|
|
|
|
|
|
|
|
|
if (nonCompliantFeatureCode == null || nonCompliantFeatureCode.isEmpty()) {
|
|
|
|
if (nonCompliantFeatureCode == null || nonCompliantFeatureCode.isEmpty()) {
|
|
|
|
throw new InvalidParameterValueException("Non-compliant feature code should not be either null or empty.");
|
|
|
|
throw new InvalidParameterValueException("Non-compliant feature code should not be either null or empty.");
|
|
|
@ -368,9 +355,6 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
filteredDeviceCountByPlatform.setDeviceCount(rs.getInt("DEVICE_COUNT"));
|
|
|
|
filteredDeviceCountByPlatform.setDeviceCount(rs.getInt("DEVICE_COUNT"));
|
|
|
|
filteredDeviceCountsByPlatforms.add(filteredDeviceCountByPlatform);
|
|
|
|
filteredDeviceCountsByPlatforms.add(filteredDeviceCountByPlatform);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
|
|
|
throw new DataAccessLayerException("Error in either getting database connection, " +
|
|
|
|
|
|
|
|
"running SQL query or fetching results.", e);
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -379,7 +363,7 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<DeviceCountByGroupEntry> getDeviceCountsByOwnershipTypes(FilterSet filterSet)
|
|
|
|
public List<DeviceCountByGroupEntry> getDeviceCountsByOwnershipTypes(FilterSet filterSet)
|
|
|
|
throws InvalidParameterValueException, DataAccessLayerException {
|
|
|
|
throws InvalidParameterValueException, SQLException {
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> filters = this.extractDatabaseFiltersFromBean(filterSet);
|
|
|
|
Map<String, Object> filters = this.extractDatabaseFiltersFromBean(filterSet);
|
|
|
|
|
|
|
|
|
|
|
@ -426,9 +410,6 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
filteredDeviceCountByOwnershipType.setDeviceCount(rs.getInt("DEVICE_COUNT"));
|
|
|
|
filteredDeviceCountByOwnershipType.setDeviceCount(rs.getInt("DEVICE_COUNT"));
|
|
|
|
filteredDeviceCountsByOwnershipTypes.add(filteredDeviceCountByOwnershipType);
|
|
|
|
filteredDeviceCountsByOwnershipTypes.add(filteredDeviceCountByOwnershipType);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
|
|
|
throw new DataAccessLayerException("Error in either getting database connection, " +
|
|
|
|
|
|
|
|
"running SQL query or fetching results.", e);
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -438,7 +419,7 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<DeviceCountByGroupEntry>
|
|
|
|
public List<DeviceCountByGroupEntry>
|
|
|
|
getFeatureNonCompliantDeviceCountsByOwnershipTypes(String nonCompliantFeatureCode,
|
|
|
|
getFeatureNonCompliantDeviceCountsByOwnershipTypes(String nonCompliantFeatureCode,
|
|
|
|
FilterSet filterSet) throws InvalidParameterValueException, DataAccessLayerException {
|
|
|
|
FilterSet filterSet) throws InvalidParameterValueException, SQLException {
|
|
|
|
|
|
|
|
|
|
|
|
if (nonCompliantFeatureCode == null || nonCompliantFeatureCode.isEmpty()) {
|
|
|
|
if (nonCompliantFeatureCode == null || nonCompliantFeatureCode.isEmpty()) {
|
|
|
|
throw new InvalidParameterValueException("Non-compliant feature code should not be either null or empty.");
|
|
|
|
throw new InvalidParameterValueException("Non-compliant feature code should not be either null or empty.");
|
|
|
@ -490,9 +471,6 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
filteredDeviceCountByOwnershipType.setDeviceCount(rs.getInt("DEVICE_COUNT"));
|
|
|
|
filteredDeviceCountByOwnershipType.setDeviceCount(rs.getInt("DEVICE_COUNT"));
|
|
|
|
filteredDeviceCountsByOwnershipTypes.add(filteredDeviceCountByOwnershipType);
|
|
|
|
filteredDeviceCountsByOwnershipTypes.add(filteredDeviceCountByOwnershipType);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
|
|
|
throw new DataAccessLayerException("Error in either getting database connection, " +
|
|
|
|
|
|
|
|
"running SQL query or fetching results.", e);
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -501,7 +479,7 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<DetailedDeviceEntry> getDevicesWithDetails(FilterSet filterSet)
|
|
|
|
public List<DetailedDeviceEntry> getDevicesWithDetails(FilterSet filterSet)
|
|
|
|
throws InvalidParameterValueException, DataAccessLayerException {
|
|
|
|
throws InvalidParameterValueException, SQLException {
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> filters = this.extractDatabaseFiltersFromBean(filterSet);
|
|
|
|
Map<String, Object> filters = this.extractDatabaseFiltersFromBean(filterSet);
|
|
|
|
|
|
|
|
|
|
|
@ -549,9 +527,6 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
filteredDeviceWithDetails.setConnectivityStatus(rs.getString("CONNECTIVITY_STATUS"));
|
|
|
|
filteredDeviceWithDetails.setConnectivityStatus(rs.getString("CONNECTIVITY_STATUS"));
|
|
|
|
filteredDevicesWithDetails.add(filteredDeviceWithDetails);
|
|
|
|
filteredDevicesWithDetails.add(filteredDeviceWithDetails);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
|
|
|
throw new DataAccessLayerException("Error in either getting database connection, " +
|
|
|
|
|
|
|
|
"running SQL query or fetching results.", e);
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -560,7 +535,7 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<DetailedDeviceEntry> getFeatureNonCompliantDevicesWithDetails(String nonCompliantFeatureCode,
|
|
|
|
public List<DetailedDeviceEntry> getFeatureNonCompliantDevicesWithDetails(String nonCompliantFeatureCode,
|
|
|
|
FilterSet filterSet) throws InvalidParameterValueException, DataAccessLayerException {
|
|
|
|
FilterSet filterSet) throws InvalidParameterValueException, SQLException {
|
|
|
|
|
|
|
|
|
|
|
|
if (nonCompliantFeatureCode == null || nonCompliantFeatureCode.isEmpty()) {
|
|
|
|
if (nonCompliantFeatureCode == null || nonCompliantFeatureCode.isEmpty()) {
|
|
|
|
throw new InvalidParameterValueException("Non-compliant feature code should not be either null or empty.");
|
|
|
|
throw new InvalidParameterValueException("Non-compliant feature code should not be either null or empty.");
|
|
|
@ -614,9 +589,6 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD
|
|
|
|
filteredDeviceWithDetails.setConnectivityStatus(rs.getString("CONNECTIVITY_STATUS"));
|
|
|
|
filteredDeviceWithDetails.setConnectivityStatus(rs.getString("CONNECTIVITY_STATUS"));
|
|
|
|
filteredDevicesWithDetails.add(filteredDeviceWithDetails);
|
|
|
|
filteredDevicesWithDetails.add(filteredDeviceWithDetails);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
|
|
|
throw new DataAccessLayerException("Error in either getting database connection, " +
|
|
|
|
|
|
|
|
"running SQL query or fetching results.", e);
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|