Adding temporary development code bits for dashboard analytics feature

revert-70aa11f8
dilanua 9 years ago
parent 1486e4ab8c
commit 053d14b317

@ -52,10 +52,21 @@ public interface GadgetDataService {
@SuppressWarnings("unused") @SuppressWarnings("unused")
int getDeviceCount(Map<String, Object> filters); int getDeviceCount(Map<String, Object> filters);
@SuppressWarnings("unused")
int getFeatureNonCompliantDeviceCount(String nonCompliantFeatureCode, Map<String, Object> filters);
@SuppressWarnings("unused") @SuppressWarnings("unused")
Map<String, Integer> getDeviceCountsByPlatforms(Map<String, Object> filters); Map<String, Integer> getDeviceCountsByPlatforms(Map<String, Object> filters);
@SuppressWarnings("unused")
Map<String, Integer> getFeatureNonCompliantDeviceCountsByPlatforms(String nonCompliantFeatureCode,
Map<String, Object> filters);
@SuppressWarnings("unused") @SuppressWarnings("unused")
Map<String, Integer> getDeviceCountsByOwnershipTypes(Map<String, Object> filters); Map<String, Integer> getDeviceCountsByOwnershipTypes(Map<String, Object> filters);
@SuppressWarnings("unused")
Map<String, Integer> getFeatureNonCompliantDeviceCountsByOwnershipTypes(String nonCompliantFeatureCode,
Map<String, Object> filters);
} }

@ -42,8 +42,7 @@ class GadgetDataServiceImpl implements GadgetDataService {
int totalDeviceCount; int totalDeviceCount;
try { try {
GadgetDataServiceDAOFactory.openConnection(); GadgetDataServiceDAOFactory.openConnection();
totalDeviceCount = GadgetDataServiceDAOFactory. totalDeviceCount = GadgetDataServiceDAOFactory.getGadgetDataServiceDAO().getTotalDeviceCount();
getGadgetDataServiceDAO().getTotalDeviceCount();
} catch (GadgetDataServiceDAOException | SQLException e) { } catch (GadgetDataServiceDAOException | SQLException e) {
totalDeviceCount = -1; totalDeviceCount = -1;
return totalDeviceCount; return totalDeviceCount;
@ -58,8 +57,7 @@ class GadgetDataServiceImpl implements GadgetDataService {
int activeDeviceCount; int activeDeviceCount;
try { try {
GadgetDataServiceDAOFactory.openConnection(); GadgetDataServiceDAOFactory.openConnection();
activeDeviceCount = GadgetDataServiceDAOFactory. activeDeviceCount = GadgetDataServiceDAOFactory.getGadgetDataServiceDAO().getActiveDeviceCount();
getGadgetDataServiceDAO().getActiveDeviceCount();
} catch (GadgetDataServiceDAOException | SQLException e) { } catch (GadgetDataServiceDAOException | SQLException e) {
activeDeviceCount = -1; activeDeviceCount = -1;
return activeDeviceCount; return activeDeviceCount;
@ -74,8 +72,7 @@ class GadgetDataServiceImpl implements GadgetDataService {
int inactiveDeviceCount; int inactiveDeviceCount;
try { try {
GadgetDataServiceDAOFactory.openConnection(); GadgetDataServiceDAOFactory.openConnection();
inactiveDeviceCount = GadgetDataServiceDAOFactory. inactiveDeviceCount = GadgetDataServiceDAOFactory.getGadgetDataServiceDAO().getInactiveDeviceCount();
getGadgetDataServiceDAO().getInactiveDeviceCount();
} catch (GadgetDataServiceDAOException | SQLException e) { } catch (GadgetDataServiceDAOException | SQLException e) {
inactiveDeviceCount = -1; inactiveDeviceCount = -1;
return inactiveDeviceCount; return inactiveDeviceCount;
@ -90,8 +87,7 @@ class GadgetDataServiceImpl implements GadgetDataService {
int removedDeviceCount; int removedDeviceCount;
try { try {
GadgetDataServiceDAOFactory.openConnection(); GadgetDataServiceDAOFactory.openConnection();
removedDeviceCount = GadgetDataServiceDAOFactory. removedDeviceCount = GadgetDataServiceDAOFactory.getGadgetDataServiceDAO().getRemovedDeviceCount();
getGadgetDataServiceDAO().getRemovedDeviceCount();
} catch (GadgetDataServiceDAOException | SQLException e) { } catch (GadgetDataServiceDAOException | SQLException e) {
removedDeviceCount = -1; removedDeviceCount = -1;
return removedDeviceCount; return removedDeviceCount;
@ -106,8 +102,7 @@ class GadgetDataServiceImpl implements GadgetDataService {
int nonCompliantDeviceCount; int nonCompliantDeviceCount;
try { try {
GadgetDataServiceDAOFactory.openConnection(); GadgetDataServiceDAOFactory.openConnection();
nonCompliantDeviceCount = GadgetDataServiceDAOFactory. nonCompliantDeviceCount = GadgetDataServiceDAOFactory.getGadgetDataServiceDAO().getNonCompliantDeviceCount();
getGadgetDataServiceDAO().getNonCompliantDeviceCount();
} catch (GadgetDataServiceDAOException | SQLException e) { } catch (GadgetDataServiceDAOException | SQLException e) {
nonCompliantDeviceCount = -1; nonCompliantDeviceCount = -1;
return nonCompliantDeviceCount; return nonCompliantDeviceCount;
@ -122,8 +117,7 @@ class GadgetDataServiceImpl implements GadgetDataService {
int unmonitoredDeviceCount; int unmonitoredDeviceCount;
try { try {
GadgetDataServiceDAOFactory.openConnection(); GadgetDataServiceDAOFactory.openConnection();
unmonitoredDeviceCount = GadgetDataServiceDAOFactory. unmonitoredDeviceCount = GadgetDataServiceDAOFactory.getGadgetDataServiceDAO().getUnmonitoredDeviceCount();
getGadgetDataServiceDAO().getUnmonitoredDeviceCount();
} catch (GadgetDataServiceDAOException | SQLException e) { } catch (GadgetDataServiceDAOException | SQLException e) {
unmonitoredDeviceCount = -1; unmonitoredDeviceCount = -1;
return unmonitoredDeviceCount; return unmonitoredDeviceCount;
@ -153,8 +147,7 @@ class GadgetDataServiceImpl implements GadgetDataService {
int deviceCount; int deviceCount;
try { try {
GadgetDataServiceDAOFactory.openConnection(); GadgetDataServiceDAOFactory.openConnection();
deviceCount = GadgetDataServiceDAOFactory. deviceCount = GadgetDataServiceDAOFactory.getGadgetDataServiceDAO().getDeviceCount(filters);
getGadgetDataServiceDAO().getDeviceCount(filters);
} catch (GadgetDataServiceDAOException | SQLException e) { } catch (GadgetDataServiceDAOException | SQLException e) {
deviceCount = -1; deviceCount = -1;
return deviceCount; return deviceCount;
@ -164,13 +157,29 @@ class GadgetDataServiceImpl implements GadgetDataService {
return deviceCount; return deviceCount;
} }
@Override
public int getFeatureNonCompliantDeviceCount(String nonCompliantFeatureCode, Map<String, Object> filters) {
int featureNonCompliantDeviceCount;
try {
GadgetDataServiceDAOFactory.openConnection();
featureNonCompliantDeviceCount = GadgetDataServiceDAOFactory.
getGadgetDataServiceDAO().getFeatureNonCompliantDeviceCount(nonCompliantFeatureCode, filters);
} catch (GadgetDataServiceDAOException | SQLException e) {
featureNonCompliantDeviceCount = -1;
return featureNonCompliantDeviceCount;
} finally {
GadgetDataServiceDAOFactory.closeConnection();
}
return featureNonCompliantDeviceCount;
}
@Override @Override
public Map<String, Integer> getDeviceCountsByPlatforms(Map<String, Object> filters) { public Map<String, Integer> getDeviceCountsByPlatforms(Map<String, Object> filters) {
Map<String, Integer> deviceCountsByPlatforms = null; Map<String, Integer> deviceCountsByPlatforms = null;
try { try {
GadgetDataServiceDAOFactory.openConnection(); GadgetDataServiceDAOFactory.openConnection();
deviceCountsByPlatforms = GadgetDataServiceDAOFactory. deviceCountsByPlatforms = GadgetDataServiceDAOFactory.getGadgetDataServiceDAO().
getGadgetDataServiceDAO().getDeviceCountsByPlatforms(filters); getDeviceCountsByPlatforms(filters);
} catch (GadgetDataServiceDAOException | SQLException e) { } catch (GadgetDataServiceDAOException | SQLException e) {
return null; return null;
} finally { } finally {
@ -179,13 +188,29 @@ class GadgetDataServiceImpl implements GadgetDataService {
return deviceCountsByPlatforms; return deviceCountsByPlatforms;
} }
@Override
public Map<String, Integer> getFeatureNonCompliantDeviceCountsByPlatforms(String nonCompliantFeatureCode,
Map<String, Object> filters) {
Map<String, Integer> featureNonCompliantDeviceCountsByPlatforms = null;
try {
GadgetDataServiceDAOFactory.openConnection();
featureNonCompliantDeviceCountsByPlatforms = GadgetDataServiceDAOFactory.
getGadgetDataServiceDAO().getFeatureNonCompliantDeviceCountsByPlatforms(nonCompliantFeatureCode, filters);
} catch (GadgetDataServiceDAOException | SQLException e) {
return null;
} finally {
GadgetDataServiceDAOFactory.closeConnection();
}
return featureNonCompliantDeviceCountsByPlatforms;
}
@Override @Override
public Map<String, Integer> getDeviceCountsByOwnershipTypes(Map<String, Object> filters) { public Map<String, Integer> getDeviceCountsByOwnershipTypes(Map<String, Object> filters) {
Map<String, Integer> deviceCountsByOwnershipTypes = null; Map<String, Integer> deviceCountsByOwnershipTypes = null;
try { try {
GadgetDataServiceDAOFactory.openConnection(); GadgetDataServiceDAOFactory.openConnection();
deviceCountsByOwnershipTypes = GadgetDataServiceDAOFactory. deviceCountsByOwnershipTypes = GadgetDataServiceDAOFactory.getGadgetDataServiceDAO().
getGadgetDataServiceDAO().getDeviceCountsByOwnershipTypes(filters); getDeviceCountsByOwnershipTypes(filters);
} catch (GadgetDataServiceDAOException | SQLException e) { } catch (GadgetDataServiceDAOException | SQLException e) {
return null; return null;
} finally { } finally {
@ -194,4 +219,21 @@ class GadgetDataServiceImpl implements GadgetDataService {
return deviceCountsByOwnershipTypes; return deviceCountsByOwnershipTypes;
} }
@Override
public Map<String, Integer> getFeatureNonCompliantDeviceCountsByOwnershipTypes(String nonCompliantFeatureCode,
Map<String, Object> filters) {
Map<String, Integer> featureNonCompliantDeviceCountsByOwnershipTypes = null;
try {
GadgetDataServiceDAOFactory.openConnection();
featureNonCompliantDeviceCountsByOwnershipTypes =
GadgetDataServiceDAOFactory.getGadgetDataServiceDAO().
getFeatureNonCompliantDeviceCountsByOwnershipTypes(nonCompliantFeatureCode, filters);
} catch (GadgetDataServiceDAOException | SQLException e) {
return null;
} finally {
GadgetDataServiceDAOFactory.closeConnection();
}
return featureNonCompliantDeviceCountsByOwnershipTypes;
}
} }

Loading…
Cancel
Save