Compare commits

Invalid templates have been ignored

1 invalid template(s) found pull_request_template.md: frontmatter must start with a separator line

...

2 Commits

@ -490,5 +490,14 @@ public interface GroupDAO {
int getDeviceCount(String groupName, int tenantId) throws GroupManagementDAOException;
/**
* Retrieves the count of devices for a specific group, device type, and tenant.
*
* @param groupName the name of the group
* @param deviceTypeId the ID of the device type (e.g., Android, iOS, Windows)
* @param tenantId the ID of the tenant
* @return the count of devices for the given group, device type, and tenant
* @throws GroupManagementDAOException if an error occurs during the retrieval of the device count
*/
int getDeviceCountWithGroup(String groupName, int deviceTypeId, int tenantId) throws GroupManagementDAOException;
}

@ -392,6 +392,13 @@ public interface GroupManagementProviderService {
int getDeviceCount(String groupName) throws GroupManagementException;
/**
* Retrieves the count of devices for a specific group and device type.
*
* @param groupName the name of the group
* @param deviceTypeId the ID of the device type (e.g., Android, iOS, Windows)
* @return the count of devices for the given group and device type
* @throws GroupManagementException if an error occurs during the retrieval of the device count
*/
int getDeviceCountWithGroup(String groupName, int deviceTypeId) throws GroupManagementException;
}

@ -77,6 +77,7 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
private final GroupDAO groupDAO;
private final DeviceDAO deviceDAO;
/**
* Set groupDAO from GroupManagementDAOFactory when class instantiate.
*/
@ -1752,8 +1753,12 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
try {
GroupManagementDAOFactory.openConnection();
return groupDAO.getDeviceCountWithGroup(groupName,deviceTypeId, tenantId);
} catch (SQLException | GroupManagementDAOException e) {
String msg = "Error occurred while retrieving device count.";
} catch (SQLException e) {
String msg = "SQL error occurred while retrieving device count.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (GroupManagementDAOException e) {
String msg = "DAO error occurred while retrieving device count.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {

Loading…
Cancel
Save