Device search in store uninstall modal

revert-70ac1926
MalshaPiumini 4 years ago
parent e0669d3898
commit 74c4f1004a

@ -22,6 +22,7 @@ import org.wso2.carbon.device.application.mgt.common.dto.ScheduledSubscriptionDT
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException;
import org.wso2.carbon.device.application.mgt.common.exception.SubscriptionManagementException; import org.wso2.carbon.device.application.mgt.common.exception.SubscriptionManagementException;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.PaginationRequest;
import org.wso2.carbon.device.mgt.common.PaginationResult; import org.wso2.carbon.device.mgt.common.PaginationResult;
import java.util.List; import java.util.List;
@ -127,13 +128,12 @@ public interface SubscriptionManager {
* This method used to get the app id ,device ids and pass them to DM service method. * This method used to get the app id ,device ids and pass them to DM service method.
* *
* @param appUUID UUID of the application release. * @param appUUID UUID of the application release.
* @param offsetValue offset value for get paginated request. * @param request paginated request object.
* @param limitValue limit value for get paginated request.
* @param status status of the devices. * @param status status of the devices.
* @return deviceDetails - device details for given application release. * @return deviceDetails - device details for given application release.
* @throws {@link ApplicationManagementException} Exception of the application management * @throws {@link ApplicationManagementException} Exception of the application management
*/ */
PaginationResult getAppInstalledDevices(int offsetValue, int limitValue, String appUUID, PaginationResult getAppInstalledDevices(PaginationRequest request, String appUUID,
List<String> status) throws ApplicationManagementException; List<String> status) throws ApplicationManagementException;
/*** /***

@ -65,10 +65,7 @@ import org.wso2.carbon.device.application.mgt.core.util.ConnectionManagerUtil;
import org.wso2.carbon.device.application.mgt.core.util.Constants; import org.wso2.carbon.device.application.mgt.core.util.Constants;
import org.wso2.carbon.device.application.mgt.core.util.HelperUtil; import org.wso2.carbon.device.application.mgt.core.util.HelperUtil;
import org.wso2.carbon.device.application.mgt.core.util.OAuthUtils; import org.wso2.carbon.device.application.mgt.core.util.OAuthUtils;
import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.*;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
import org.wso2.carbon.device.mgt.common.MDMAppConstants;
import org.wso2.carbon.device.mgt.common.app.mgt.App; import org.wso2.carbon.device.mgt.common.app.mgt.App;
import org.wso2.carbon.device.mgt.common.app.mgt.MobileAppTypes; import org.wso2.carbon.device.mgt.common.app.mgt.MobileAppTypes;
import org.wso2.carbon.device.mgt.common.app.mgt.android.CustomApplication; import org.wso2.carbon.device.mgt.common.app.mgt.android.CustomApplication;
@ -88,7 +85,6 @@ import org.wso2.carbon.device.mgt.core.util.MDMIOSOperationUtil;
import org.wso2.carbon.device.mgt.core.util.MDMWindowsOperationUtil; import org.wso2.carbon.device.mgt.core.util.MDMWindowsOperationUtil;
import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo; import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo;
import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.device.mgt.common.PaginationResult;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import java.io.BufferedReader; import java.io.BufferedReader;
@ -1223,7 +1219,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
} }
@Override @Override
public PaginationResult getAppInstalledDevices(int offsetValue, int limitValue, String appUUID, List<String> status) public PaginationResult getAppInstalledDevices(PaginationRequest request, String appUUID, List<String> status)
throws ApplicationManagementException { throws ApplicationManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
DeviceManagementProviderService deviceManagementProviderService = HelperUtil DeviceManagementProviderService deviceManagementProviderService = HelperUtil
@ -1262,8 +1258,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
} }
//pass the device id list to device manager service method //pass the device id list to device manager service method
try { try {
PaginationResult deviceDetails = deviceManagementProviderService PaginationResult deviceDetails = deviceManagementProviderService.getAppSubscribedDevices
.getAppSubscribedDevices(offsetValue, limitValue, deviceIdList, status); (request, deviceIdList, status);
if (deviceDetails == null) { if (deviceDetails == null) {
String msg = "Couldn't found an subscribed devices details for device ids: " + deviceIdList; String msg = "Couldn't found an subscribed devices details for device ids: " + deviceIdList;
@ -1344,6 +1340,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
@Override @Override
public PaginationResult getAppSubscriptionDetails(int offsetValue, int limitValue, String appUUID) public PaginationResult getAppSubscriptionDetails(int offsetValue, int limitValue, String appUUID)
throws ApplicationManagementException { throws ApplicationManagementException {
PaginationRequest request = new PaginationRequest(offsetValue, limitValue);
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
DeviceManagementProviderService deviceManagementProviderService = HelperUtil DeviceManagementProviderService deviceManagementProviderService = HelperUtil
.getDeviceManagementProviderService(); .getDeviceManagementProviderService();
@ -1378,7 +1375,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
try { try {
//pass the device id list to device manager service method //pass the device id list to device manager service method
PaginationResult paginationResult = deviceManagementProviderService PaginationResult paginationResult = deviceManagementProviderService
.getAppSubscribedDevices(offsetValue, limitValue, deviceIdList, null); .getAppSubscribedDevices(request, deviceIdList, null);
List<DeviceSubscriptionData> deviceSubscriptionDataList = new ArrayList<>(); List<DeviceSubscriptionData> deviceSubscriptionDataList = new ArrayList<>();
if (!paginationResult.getData().isEmpty()) { if (!paginationResult.getData().isEmpty()) {

@ -32,6 +32,7 @@ import org.wso2.carbon.device.application.mgt.common.ErrorResponse;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.Size;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.Consumes; import javax.ws.rs.Consumes;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
@ -337,6 +338,28 @@ public interface SubscriptionManagementAPI {
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
Response getAppInstalledDevices( Response getAppInstalledDevices(
@ApiParam(
name = "name",
value = "The device name. For example, Nexus devices can have names, suhc as shamu, bullhead or angler.",
required = false)
@Size(max = 45)
String name,
@ApiParam(
name = "user",
value = "The username of the owner of the device.",
required = false)
@QueryParam("user")
String user,
@ApiParam(
name = "ownership",
allowableValues = "BYOD, COPE",
value = "Provide the ownership status of the device. The following values can be assigned:\n" +
"- BYOD: Bring Your Own Device\n" +
"- COPE: Corporate-Owned, Personally-Enabled",
required = false)
@QueryParam("ownership")
@Size(max = 45)
String ownership,
@ApiParam( @ApiParam(
name="uuid", name="uuid",
value="uuid of the application release.", value="uuid of the application release.",

@ -33,6 +33,7 @@ import org.wso2.carbon.device.application.mgt.common.BasicUserInfo;
import org.wso2.carbon.device.application.mgt.common.BasicUserInfoList; import org.wso2.carbon.device.application.mgt.common.BasicUserInfoList;
import org.wso2.carbon.device.application.mgt.common.RoleList; import org.wso2.carbon.device.application.mgt.common.RoleList;
import org.wso2.carbon.device.application.mgt.common.DeviceGroupList; import org.wso2.carbon.device.application.mgt.common.DeviceGroupList;
import org.wso2.carbon.device.mgt.common.PaginationRequest;
import org.wso2.carbon.device.mgt.common.PaginationResult; import org.wso2.carbon.device.mgt.common.PaginationResult;
import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException;
import org.wso2.carbon.device.application.mgt.core.exception.ForbiddenException; import org.wso2.carbon.device.application.mgt.core.exception.ForbiddenException;
@ -273,6 +274,9 @@ public class SubscriptionManagementAPIImpl implements SubscriptionManagementAPI{
@Produces("application/json") @Produces("application/json")
@Path("/{uuid}/devices") @Path("/{uuid}/devices")
public Response getAppInstalledDevices( public Response getAppInstalledDevices(
@QueryParam("name") String name,
@QueryParam("user") String user,
@QueryParam("ownership") String ownership,
@PathParam("uuid") String uuid, @PathParam("uuid") String uuid,
@DefaultValue("0") @DefaultValue("0")
@QueryParam("offset") int offset, @QueryParam("offset") int offset,
@ -281,8 +285,17 @@ public class SubscriptionManagementAPIImpl implements SubscriptionManagementAPI{
@QueryParam("status") List<String> status) { @QueryParam("status") List<String> status) {
try { try {
SubscriptionManager subscriptionManager = APIUtil.getSubscriptionManager(); SubscriptionManager subscriptionManager = APIUtil.getSubscriptionManager();
PaginationResult subscribedDeviceDetails = subscriptionManager PaginationRequest request = new PaginationRequest(offset, limit);
.getAppInstalledDevices(offset, limit, uuid, status); if (name != null && !name.isEmpty()) {
request.setDeviceName(name);
}
if (user != null && !user.isEmpty()) {
request.setOwner(user);
}
if (ownership != null && !ownership.isEmpty()) {
request.setOwnership(ownership);
}
PaginationResult subscribedDeviceDetails = subscriptionManager.getAppInstalledDevices(request, uuid, status);
DeviceList devices = new DeviceList(); DeviceList devices = new DeviceList();
devices.setList((List<Device>) subscribedDeviceDetails.getData()); devices.setList((List<Device>) subscribedDeviceDetails.getData());
devices.setCount(subscribedDeviceDetails.getRecordsTotal()); devices.setCount(subscribedDeviceDetails.getRecordsTotal());

@ -651,16 +651,15 @@ public interface DeviceDAO {
/** /**
* This method is used to get the details of subscribed devices. * This method is used to get the details of subscribed devices.
* *
* @param deviceIds device ids of the subscribed devices. * @param deviceIds device ids of the subscribed devices.
* @param tenantId Id of the current tenant. * @param tenantId Id of the current tenant.
* @param offsetValue offset value for get paginated request. * @param request paginated request object.
* @param limitValue limit value for get paginated request. * @param status status of the devices.
* @param status status of the devices.
* @return devices - subscribed device details list * @return devices - subscribed device details list
* @throws DeviceManagementDAOException if connections establishment fails. * @throws DeviceManagementDAOException if connections establishment fails.
*/ */
List<Device> getSubscribedDevices(int offsetValue, int limitValue, List<Integer> deviceIds, List<Device> getSubscribedDevices(PaginationRequest request, List<Integer> deviceIds, int tenantId,
int tenantId, List<String> status) throws DeviceManagementDAOException; List<String> status) throws DeviceManagementDAOException;
/** /**
* @param deviceIds device ids of the subscribed devices. * @param deviceIds device ids of the subscribed devices.

@ -877,16 +877,24 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
} }
@Override @Override
public List<Device> getSubscribedDevices(int offsetValue, int limitValue, public List<Device> getSubscribedDevices(PaginationRequest request, List<Integer> deviceIds, int tenantId,
List<Integer> deviceIds, int tenantId, List<String> status) List<String> status)
throws DeviceManagementDAOException { throws DeviceManagementDAOException {
Connection conn; Connection conn;
int limitValue = request.getRowCount();
int offsetValue = request.getStartIndex();
String name = request.getDeviceName();
String user = request.getOwner();
String ownership = request.getOwnership();
try { try {
conn = this.getConnection(); conn = this.getConnection();
int index = 1; int index = 1;
boolean isStatusProvided = false; boolean isStatusProvided = false;
boolean isDeviceNameProvided = false;
boolean isOwnerProvided = false;
boolean isOwnershipProvided = false;
StringJoiner joiner = new StringJoiner(",", StringJoiner joiner = new StringJoiner(",",
"SELECT " "SELECT "
+ "DM_DEVICE.ID AS DEVICE_ID, " + "DM_DEVICE.ID AS DEVICE_ID, "
@ -914,6 +922,18 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
deviceIds.stream().map(ignored -> "?").forEach(joiner::add); deviceIds.stream().map(ignored -> "?").forEach(joiner::add);
String query = joiner.toString(); String query = joiner.toString();
if (name != null && !name.isEmpty()) {
query += " AND DM_DEVICE.NAME LIKE ?";
isDeviceNameProvided = true;
}
if (ownership != null && !ownership.isEmpty()) {
query += " AND e.OWNERSHIP = ?";
isOwnershipProvided = true;
}
if (user != null && !user.isEmpty()) {
query += " AND e.OWNER = ?";
isOwnerProvided = true;
}
if (status != null && !status.isEmpty()) { if (status != null && !status.isEmpty()) {
query += buildStatusQuery(status); query += buildStatusQuery(status);
isStatusProvided = true; isStatusProvided = true;
@ -926,8 +946,16 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
for (Integer deviceId : deviceIds) { for (Integer deviceId : deviceIds) {
ps.setObject(index++, deviceId); ps.setObject(index++, deviceId);
} }
ps.setInt(index++, tenantId); ps.setInt(index++, tenantId);
if (isDeviceNameProvided) {
ps.setString(index++, name + "%");
}
if (isOwnershipProvided) {
ps.setString(index++, ownership);
}
if (isOwnerProvided) {
ps.setString(index++, user);
}
if (isStatusProvided) { if (isStatusProvided) {
for (String deviceStatus : status) { for (String deviceStatus : status) {
ps.setString(index++, deviceStatus); ps.setString(index++, deviceStatus);

@ -847,16 +847,23 @@ public class OracleDeviceDAOImpl extends AbstractDeviceDAOImpl {
} }
@Override @Override
public List<Device> getSubscribedDevices(int offsetValue, int limitValue, public List<Device> getSubscribedDevices(PaginationRequest request, List<Integer> deviceIds, int tenantId,
List<Integer> deviceIds, int tenantId, List<String> status) List<String> status)
throws DeviceManagementDAOException { throws DeviceManagementDAOException {
Connection conn; Connection conn;
int limitValue = request.getRowCount();
int offsetValue = request.getStartIndex();
String name = request.getDeviceName();
String user = request.getOwner();
String ownership = request.getOwnership();
try { try {
conn = this.getConnection(); conn = this.getConnection();
int index = 1; int index = 1;
boolean isStatusProvided = false; boolean isStatusProvided = false;
boolean isDeviceNameProvided = false;
boolean isOwnerProvided = false;
boolean isOwnershipProvided = false;
StringJoiner joiner = new StringJoiner(",", StringJoiner joiner = new StringJoiner(",",
"SELECT " "SELECT "
+ "DM_DEVICE.ID AS DEVICE_ID, " + "DM_DEVICE.ID AS DEVICE_ID, "
@ -884,6 +891,18 @@ public class OracleDeviceDAOImpl extends AbstractDeviceDAOImpl {
deviceIds.stream().map(ignored -> "?").forEach(joiner::add); deviceIds.stream().map(ignored -> "?").forEach(joiner::add);
String query = joiner.toString(); String query = joiner.toString();
if (name != null && !name.isEmpty()) {
query += " AND DM_DEVICE.NAME LIKE ?";
isDeviceNameProvided = true;
}
if (ownership != null && !ownership.isEmpty()) {
query += " AND e.OWNERSHIP = ?";
isOwnershipProvided = true;
}
if (user != null && !user.isEmpty()) {
query += " AND e.OWNER = ?";
isOwnerProvided = true;
}
if (status != null && !status.isEmpty()) { if (status != null && !status.isEmpty()) {
query += buildStatusQuery(status); query += buildStatusQuery(status);
isStatusProvided = true; isStatusProvided = true;
@ -898,6 +917,15 @@ public class OracleDeviceDAOImpl extends AbstractDeviceDAOImpl {
} }
ps.setInt(index++, tenantId); ps.setInt(index++, tenantId);
if (isDeviceNameProvided) {
ps.setString(index++, name + "%");
}
if (isOwnershipProvided) {
ps.setString(index++, ownership);
}
if (isOwnerProvided) {
ps.setString(index++, user);
}
if (isStatusProvided) { if (isStatusProvided) {
for (String deviceStatus : status) { for (String deviceStatus : status) {
ps.setString(index++, deviceStatus); ps.setString(index++, deviceStatus);

@ -827,16 +827,23 @@ public class PostgreSQLDeviceDAOImpl extends AbstractDeviceDAOImpl {
} }
@Override @Override
public List<Device> getSubscribedDevices(int offsetValue, int limitValue, public List<Device> getSubscribedDevices(PaginationRequest request, List<Integer> deviceIds, int tenantId,
List<Integer> deviceIds, int tenantId, List<String> status) List<String> status)
throws DeviceManagementDAOException { throws DeviceManagementDAOException {
Connection conn; Connection conn;
int limitValue = request.getRowCount();
int offsetValue = request.getStartIndex();
String name = request.getDeviceName();
String user = request.getOwner();
String ownership = request.getOwnership();
try { try {
conn = this.getConnection(); conn = this.getConnection();
int index = 1; int index = 1;
boolean isStatusProvided = false; boolean isStatusProvided = false;
boolean isDeviceNameProvided = false;
boolean isOwnerProvided = false;
boolean isOwnershipProvided = false;
StringJoiner joiner = new StringJoiner(",", StringJoiner joiner = new StringJoiner(",",
"SELECT " "SELECT "
+ "DM_DEVICE.ID AS DEVICE_ID, " + "DM_DEVICE.ID AS DEVICE_ID, "
@ -864,6 +871,18 @@ public class PostgreSQLDeviceDAOImpl extends AbstractDeviceDAOImpl {
deviceIds.stream().map(ignored -> "?").forEach(joiner::add); deviceIds.stream().map(ignored -> "?").forEach(joiner::add);
String query = joiner.toString(); String query = joiner.toString();
if (name != null && !name.isEmpty()) {
query += " AND DM_DEVICE.NAME LIKE ?";
isDeviceNameProvided = true;
}
if (ownership != null && !ownership.isEmpty()) {
query += " AND e.OWNERSHIP = ?";
isOwnershipProvided = true;
}
if (user != null && !user.isEmpty()) {
query += " AND e.OWNER = ?";
isOwnerProvided = true;
}
if (status != null && !status.isEmpty()) { if (status != null && !status.isEmpty()) {
query += buildStatusQuery(status); query += buildStatusQuery(status);
isStatusProvided = true; isStatusProvided = true;
@ -878,6 +897,15 @@ public class PostgreSQLDeviceDAOImpl extends AbstractDeviceDAOImpl {
} }
ps.setInt(index++, tenantId); ps.setInt(index++, tenantId);
if (isDeviceNameProvided) {
ps.setString(index++, name + "%");
}
if (isOwnershipProvided) {
ps.setString(index++, ownership);
}
if (isOwnerProvided) {
ps.setString(index++, user);
}
if (isStatusProvided) { if (isStatusProvided) {
for (String deviceStatus : status) { for (String deviceStatus : status) {
ps.setString(index++, deviceStatus); ps.setString(index++, deviceStatus);

@ -693,16 +693,23 @@ public class SQLServerDeviceDAOImpl extends AbstractDeviceDAOImpl {
} }
@Override @Override
public List<Device> getSubscribedDevices(int offsetValue, int limitValue, public List<Device> getSubscribedDevices(PaginationRequest request,
List<Integer> deviceIds, int tenantId, List<String> status) List<Integer> deviceIds, int tenantId, List<String> status)
throws DeviceManagementDAOException { throws DeviceManagementDAOException {
Connection conn; Connection conn;
int limitValue = request.getRowCount();
int offsetValue = request.getStartIndex();
String name = request.getDeviceName();
String user = request.getOwner();
String ownership = request.getOwnership();
try { try {
conn = this.getConnection(); conn = this.getConnection();
int index = 1; int index = 1;
boolean isStatusProvided = false; boolean isStatusProvided = false;
boolean isDeviceNameProvided = false;
boolean isOwnerProvided = false;
boolean isOwnershipProvided = false;
StringJoiner joiner = new StringJoiner(",", StringJoiner joiner = new StringJoiner(",",
"SELECT " "SELECT "
+ "DM_DEVICE.ID AS DEVICE_ID, " + "DM_DEVICE.ID AS DEVICE_ID, "
@ -730,6 +737,18 @@ public class SQLServerDeviceDAOImpl extends AbstractDeviceDAOImpl {
deviceIds.stream().map(ignored -> "?").forEach(joiner::add); deviceIds.stream().map(ignored -> "?").forEach(joiner::add);
String query = joiner.toString(); String query = joiner.toString();
if (name != null && !name.isEmpty()) {
query += " AND DM_DEVICE.NAME LIKE ?";
isDeviceNameProvided = true;
}
if (ownership != null && !ownership.isEmpty()) {
query += " AND e.OWNERSHIP = ?";
isOwnershipProvided = true;
}
if (user != null && !user.isEmpty()) {
query += " AND e.OWNER = ?";
isOwnerProvided = true;
}
if (status != null && !status.isEmpty()) { if (status != null && !status.isEmpty()) {
query += buildStatusQuery(status); query += buildStatusQuery(status);
isStatusProvided = true; isStatusProvided = true;
@ -744,6 +763,15 @@ public class SQLServerDeviceDAOImpl extends AbstractDeviceDAOImpl {
} }
ps.setInt(index++, tenantId); ps.setInt(index++, tenantId);
if (isDeviceNameProvided) {
ps.setString(index++, name + "%");
}
if (isOwnershipProvided) {
ps.setString(index++, ownership);
}
if (isOwnerProvided) {
ps.setString(index++, user);
}
if (isStatusProvided) { if (isStatusProvided) {
for (String deviceStatus : status) { for (String deviceStatus : status) {
ps.setString(index++, deviceStatus); ps.setString(index++, deviceStatus);

@ -905,14 +905,13 @@ public interface DeviceManagementProviderService {
* This method retrieves a list of subscribed devices. * This method retrieves a list of subscribed devices.
* *
* @param devicesIds devices ids of the subscribed devices. * @param devicesIds devices ids of the subscribed devices.
* @param offsetValue offset value for get paginated request. * @param request paginated request object.
* @param limitValue limit value for get paginated request. * @param status status of the devices.
* @param status status of the devices.
* @return {@link PaginationResult} * @return {@link PaginationResult}
* @throws DeviceManagementException if any service level or DAO level error occurs. * @throws DeviceManagementException if any service level or DAO level error occurs.
*/ */
PaginationResult getAppSubscribedDevices(int offsetValue, int limitValue, PaginationResult getAppSubscribedDevices(PaginationRequest request, List<Integer> devicesIds, List<String> status)
List<Integer> devicesIds, List<String> status) throws DeviceManagementException; throws DeviceManagementException;
/** /**
* This method is used to get a list of applications installed in all enrolled devices * This method is used to get a list of applications installed in all enrolled devices

@ -4156,9 +4156,8 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
} }
@Override @Override
public PaginationResult getAppSubscribedDevices(int offsetValue, int limitValue, List<Integer> devicesIds, public PaginationResult getAppSubscribedDevices(PaginationRequest request, List<Integer> devicesIds,
List<String> status) throws DeviceManagementException { List<String> status) throws DeviceManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Getting all devices details for device ids: " + devicesIds); log.debug("Getting all devices details for device ids: " + devicesIds);
@ -4167,8 +4166,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
List<Device> subscribedDeviceDetails; List<Device> subscribedDeviceDetails;
try { try {
DeviceManagementDAOFactory.openConnection(); DeviceManagementDAOFactory.openConnection();
subscribedDeviceDetails = deviceDAO subscribedDeviceDetails = deviceDAO.getSubscribedDevices(request, devicesIds, tenantId, status);
.getSubscribedDevices(offsetValue, limitValue, devicesIds, tenantId, status);
if (subscribedDeviceDetails.isEmpty()) { if (subscribedDeviceDetails.isEmpty()) {
paginationResult.setData(new ArrayList<>()); paginationResult.setData(new ArrayList<>());
paginationResult.setRecordsFiltered(0); paginationResult.setRecordsFiltered(0);

Loading…
Cancel
Save