|
|
|
@ -18,6 +18,7 @@
|
|
|
|
|
|
|
|
|
|
package io.entgra.device.mgt.core.device.mgt.core.service;
|
|
|
|
|
|
|
|
|
|
import io.entgra.device.mgt.core.device.mgt.common.*;
|
|
|
|
|
import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup;
|
|
|
|
|
import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroupConstants;
|
|
|
|
|
import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroupRoleWrapper;
|
|
|
|
@ -39,13 +40,8 @@ import org.apache.commons.logging.LogFactory;
|
|
|
|
|
import org.wso2.carbon.CarbonConstants;
|
|
|
|
|
import org.wso2.carbon.context.CarbonContext;
|
|
|
|
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|
|
|
|
import io.entgra.device.mgt.core.device.mgt.common.Device;
|
|
|
|
|
import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier;
|
|
|
|
|
import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants;
|
|
|
|
|
import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException;
|
|
|
|
|
import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException;
|
|
|
|
|
import io.entgra.device.mgt.core.device.mgt.common.GroupPaginationRequest;
|
|
|
|
|
import io.entgra.device.mgt.core.device.mgt.common.PaginationResult;
|
|
|
|
|
import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException;
|
|
|
|
|
import io.entgra.device.mgt.core.device.mgt.core.event.config.GroupAssignmentEventOperationExecutor;
|
|
|
|
|
import io.entgra.device.mgt.core.device.mgt.core.geo.task.GeoFenceEventOperationManager;
|
|
|
|
@ -1695,10 +1691,14 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
|
|
|
|
|
}
|
|
|
|
|
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
|
|
|
|
|
GroupDetailsDTO groupDetailsWithDevices;
|
|
|
|
|
List<String> allowingDeviceStatuses = new ArrayList<>();
|
|
|
|
|
allowingDeviceStatuses.add(EnrolmentInfo.Status.ACTIVE.toString());
|
|
|
|
|
allowingDeviceStatuses.add(EnrolmentInfo.Status.INACTIVE.toString());
|
|
|
|
|
allowingDeviceStatuses.add(EnrolmentInfo.Status.UNREACHABLE.toString());
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
GroupManagementDAOFactory.openConnection();
|
|
|
|
|
groupDetailsWithDevices = this.groupDAO.getGroupDetailsWithDevices(groupName, tenantId, offset, limit);
|
|
|
|
|
groupDetailsWithDevices = this.groupDAO.getGroupDetailsWithDevices(groupName, allowingDeviceStatuses, tenantId, offset, limit);
|
|
|
|
|
} catch (GroupManagementDAOException | SQLException e) {
|
|
|
|
|
String msg = "Error occurred while retrieving group details and device IDs for group: " + groupName;
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|