mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge branch 'master' of https://github.com/wso2/carbon-device-mgt into das-ext
This commit is contained in:
commit
7c7b300c79
@ -33,65 +33,67 @@ public interface GadgetDataServiceDAO {
|
|||||||
*/
|
*/
|
||||||
int getTotalDeviceCount() throws GadgetDataServiceDAOException;
|
int getTotalDeviceCount() throws GadgetDataServiceDAOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to get active device count from a particular tenant.
|
||||||
|
*
|
||||||
|
* @return active device count.
|
||||||
|
*/
|
||||||
int getActiveDeviceCount() throws GadgetDataServiceDAOException;
|
int getActiveDeviceCount() throws GadgetDataServiceDAOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to get inactive device count from a particular tenant.
|
||||||
|
*
|
||||||
|
* @return inactive device count.
|
||||||
|
*/
|
||||||
int getInactiveDeviceCount() throws GadgetDataServiceDAOException;
|
int getInactiveDeviceCount() throws GadgetDataServiceDAOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to get removed device count from a particular tenant.
|
||||||
|
*
|
||||||
|
* @return removed device count.
|
||||||
|
*/
|
||||||
int getRemovedDeviceCount() throws GadgetDataServiceDAOException;
|
int getRemovedDeviceCount() throws GadgetDataServiceDAOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to get non-compliant device count.
|
* Method to get non-compliant device count from a particular tenant.
|
||||||
*
|
*
|
||||||
* @return Non-compliant device count.
|
* @return Non-compliant device count.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unused")
|
|
||||||
int getNonCompliantDeviceCount() throws GadgetDataServiceDAOException;
|
int getNonCompliantDeviceCount() throws GadgetDataServiceDAOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to get unmonitored device count.
|
* Method to get unmonitored device count from a particular tenant.
|
||||||
*
|
*
|
||||||
* @return Unmonitored device count.
|
* @return Unmonitored device count.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unused")
|
|
||||||
int getUnmonitoredDeviceCount() throws GadgetDataServiceDAOException;
|
int getUnmonitoredDeviceCount() throws GadgetDataServiceDAOException;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
PaginationResult getNonCompliantDeviceCountsByFeatures(PaginationRequest paginationRequest) throws GadgetDataServiceDAOException;
|
PaginationResult getNonCompliantDeviceCountsByFeatures(PaginationRequest paginationRequest) throws GadgetDataServiceDAOException;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
int getDeviceCount(Map<String, Object> filters) throws GadgetDataServiceDAOException;
|
int getDeviceCount(Map<String, Object> filters) throws GadgetDataServiceDAOException;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
int getFeatureNonCompliantDeviceCount(String nonCompliantFeatureCode,
|
int getFeatureNonCompliantDeviceCount(String nonCompliantFeatureCode,
|
||||||
Map<String, Object> filters) throws GadgetDataServiceDAOException;
|
Map<String, Object> filters) throws GadgetDataServiceDAOException;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
Map<String, Integer> getDeviceCountsByPlatforms(Map<String, Object> filters) throws GadgetDataServiceDAOException;
|
Map<String, Integer> getDeviceCountsByPlatforms(Map<String, Object> filters) throws GadgetDataServiceDAOException;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
Map<String, Integer> getFeatureNonCompliantDeviceCountsByPlatforms(String nonCompliantFeatureCode,
|
Map<String, Integer> getFeatureNonCompliantDeviceCountsByPlatforms(String nonCompliantFeatureCode,
|
||||||
Map<String, Object> filters) throws GadgetDataServiceDAOException;
|
Map<String, Object> filters) throws GadgetDataServiceDAOException;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
Map<String, Integer> getDeviceCountsByOwnershipTypes(Map<String, Object> filters)
|
Map<String, Integer> getDeviceCountsByOwnershipTypes(Map<String, Object> filters)
|
||||||
throws GadgetDataServiceDAOException;
|
throws GadgetDataServiceDAOException;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
Map<String, Integer> getFeatureNonCompliantDeviceCountsByOwnershipTypes(String nonCompliantFeatureCode,
|
Map<String, Integer> getFeatureNonCompliantDeviceCountsByOwnershipTypes(String nonCompliantFeatureCode,
|
||||||
Map<String, Object> filters) throws GadgetDataServiceDAOException;
|
Map<String, Object> filters) throws GadgetDataServiceDAOException;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
PaginationResult getDevicesWithDetails(Map<String, Object> filters,
|
PaginationResult getDevicesWithDetails(Map<String, Object> filters,
|
||||||
PaginationRequest paginationRequest) throws GadgetDataServiceDAOException;
|
PaginationRequest paginationRequest) throws GadgetDataServiceDAOException;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
PaginationResult getFeatureNonCompliantDevicesWithDetails(String nonCompliantFeatureCode,
|
PaginationResult getFeatureNonCompliantDevicesWithDetails(String nonCompliantFeatureCode,
|
||||||
Map<String, Object> filters, PaginationRequest paginationRequest) throws GadgetDataServiceDAOException;
|
Map<String, Object> filters, PaginationRequest paginationRequest) throws GadgetDataServiceDAOException;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
List<Map<String, Object>> getDevicesWithDetails(Map<String, Object> filters) throws GadgetDataServiceDAOException;
|
List<Map<String, Object>> getDevicesWithDetails(Map<String, Object> filters) throws GadgetDataServiceDAOException;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
List<Map<String, Object>> getFeatureNonCompliantDevicesWithDetails(String nonCompliantFeatureCode,
|
List<Map<String, Object>> getFeatureNonCompliantDevicesWithDetails(String nonCompliantFeatureCode,
|
||||||
Map<String, Object> filters) throws GadgetDataServiceDAOException;
|
Map<String, Object> filters) throws GadgetDataServiceDAOException;
|
||||||
|
|
||||||
|
|||||||
@ -411,7 +411,6 @@ class GadgetDataServiceDAOImpl implements GadgetDataServiceDAO {
|
|||||||
PreparedStatement stmt = null;
|
PreparedStatement stmt = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
|
||||||
Map<String, Object> filteredDeviceWithDetails = new HashMap<>();
|
|
||||||
List<Map<String, Object>> filteredDevicesWithDetails = new ArrayList<>();
|
List<Map<String, Object>> filteredDevicesWithDetails = new ArrayList<>();
|
||||||
int totalRecordsCount = 0;
|
int totalRecordsCount = 0;
|
||||||
try {
|
try {
|
||||||
@ -448,7 +447,9 @@ class GadgetDataServiceDAOImpl implements GadgetDataServiceDAO {
|
|||||||
// executing query
|
// executing query
|
||||||
rs = stmt.executeQuery();
|
rs = stmt.executeQuery();
|
||||||
// fetching query results
|
// fetching query results
|
||||||
|
Map<String, Object> filteredDeviceWithDetails;
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
|
filteredDeviceWithDetails = new HashMap<>();
|
||||||
filteredDeviceWithDetails.put("device-id", rs.getInt("DEVICE_ID"));
|
filteredDeviceWithDetails.put("device-id", rs.getInt("DEVICE_ID"));
|
||||||
filteredDeviceWithDetails.put("platform", rs.getString("PLATFORM"));
|
filteredDeviceWithDetails.put("platform", rs.getString("PLATFORM"));
|
||||||
filteredDeviceWithDetails.put("ownership", rs.getString("OWNERSHIP"));
|
filteredDeviceWithDetails.put("ownership", rs.getString("OWNERSHIP"));
|
||||||
@ -559,7 +560,6 @@ class GadgetDataServiceDAOImpl implements GadgetDataServiceDAO {
|
|||||||
PreparedStatement stmt = null;
|
PreparedStatement stmt = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
|
||||||
Map<String, Object> filteredDeviceWithDetails = new HashMap<>();
|
|
||||||
List<Map<String, Object>> filteredDevicesWithDetails = new ArrayList<>();
|
List<Map<String, Object>> filteredDevicesWithDetails = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
con = this.getConnection();
|
con = this.getConnection();
|
||||||
@ -589,7 +589,9 @@ class GadgetDataServiceDAOImpl implements GadgetDataServiceDAO {
|
|||||||
// executing query
|
// executing query
|
||||||
rs = stmt.executeQuery();
|
rs = stmt.executeQuery();
|
||||||
// fetching query results
|
// fetching query results
|
||||||
|
Map<String, Object> filteredDeviceWithDetails;
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
|
filteredDeviceWithDetails = new HashMap<>();
|
||||||
filteredDeviceWithDetails.put("device-id", rs.getInt("DEVICE_ID"));
|
filteredDeviceWithDetails.put("device-id", rs.getInt("DEVICE_ID"));
|
||||||
filteredDeviceWithDetails.put("platform", rs.getString("PLATFORM"));
|
filteredDeviceWithDetails.put("platform", rs.getString("PLATFORM"));
|
||||||
filteredDeviceWithDetails.put("ownership", rs.getString("OWNERSHIP"));
|
filteredDeviceWithDetails.put("ownership", rs.getString("OWNERSHIP"));
|
||||||
|
|||||||
@ -270,12 +270,32 @@ class GadgetDataServiceImpl implements GadgetDataService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> getDevicesWithDetails(Map<String, Object> filters) {
|
public List<Map<String, Object>> getDevicesWithDetails(Map<String, Object> filters) {
|
||||||
return null;
|
List<Map<String, Object>> devicesWithDetails = null;
|
||||||
|
try {
|
||||||
|
GadgetDataServiceDAOFactory.openConnection();
|
||||||
|
devicesWithDetails = GadgetDataServiceDAOFactory.getGadgetDataServiceDAO().getDevicesWithDetails(filters);
|
||||||
|
} catch (GadgetDataServiceDAOException | SQLException e) {
|
||||||
|
return null;
|
||||||
|
} finally {
|
||||||
|
GadgetDataServiceDAOFactory.closeConnection();
|
||||||
|
}
|
||||||
|
return devicesWithDetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> getFeatureNonCompliantDevicesWithDetails(String nonCompliantFeatureCode, Map<String, Object> filters) {
|
public List<Map<String, Object>> getFeatureNonCompliantDevicesWithDetails(String nonCompliantFeatureCode,
|
||||||
return null;
|
Map<String, Object> filters) {
|
||||||
|
List<Map<String, Object>> featureNonCompliantDevicesWithDetails = null;
|
||||||
|
try {
|
||||||
|
GadgetDataServiceDAOFactory.openConnection();
|
||||||
|
featureNonCompliantDevicesWithDetails = GadgetDataServiceDAOFactory.getGadgetDataServiceDAO().
|
||||||
|
getFeatureNonCompliantDevicesWithDetails(nonCompliantFeatureCode, filters);
|
||||||
|
} catch (GadgetDataServiceDAOException | SQLException e) {
|
||||||
|
return null;
|
||||||
|
} finally {
|
||||||
|
GadgetDataServiceDAOFactory.closeConnection();
|
||||||
|
}
|
||||||
|
return featureNonCompliantDevicesWithDetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user