Sync with master

pull/458/head
tcdlpds 4 months ago
commit 211ed7a489

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>grafana-mgt</artifactId> <artifactId>grafana-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>grafana-mgt</artifactId> <artifactId>grafana-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>grafana-mgt</artifactId> <artifactId>grafana-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>analytics-mgt</artifactId> <artifactId>analytics-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -20,7 +20,7 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>application-mgt</artifactId> <artifactId>application-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -18,6 +18,7 @@
package io.entgra.device.mgt.core.application.mgt.common; package io.entgra.device.mgt.core.application.mgt.common;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class CategorizedSubscriptionResult { public class CategorizedSubscriptionResult {
@ -60,6 +61,33 @@ public class CategorizedSubscriptionResult {
this.subscribedDevices = subscribedDevices; this.subscribedDevices = subscribedDevices;
} }
public CategorizedSubscriptionResult(List<DeviceSubscriptionData> devices, String tabActionStatus) {
switch (tabActionStatus) {
case "COMPLETED":
this.installedDevices = devices;
break;
case "PENDING":
this.pendingDevices = devices;
break;
case "ERROR":
this.errorDevices = devices;
break;
case "NEW":
this.newDevices = devices;
break;
case "SUBSCRIBED":
this.subscribedDevices = devices;
break;
default:
this.installedDevices = new ArrayList<>();
this.pendingDevices = new ArrayList<>();
this.errorDevices = new ArrayList<>();
this.newDevices = new ArrayList<>();
this.subscribedDevices = new ArrayList<>();
break;
}
}
public List<DeviceSubscriptionData> getInstalledDevices() { public List<DeviceSubscriptionData> getInstalledDevices() {
return installedDevices; return installedDevices;
} }
@ -100,4 +128,3 @@ public class CategorizedSubscriptionResult {
this.subscribedDevices = subscribedDevices; this.subscribedDevices = subscribedDevices;
} }
} }

@ -233,8 +233,9 @@ public interface SubscriptionManager {
* @return {@link SubscriptionsDTO} which contains the details of subscriptions. * @return {@link SubscriptionsDTO} which contains the details of subscriptions.
* @throws ApplicationManagementException if an error occurs while fetching the group details * @throws ApplicationManagementException if an error occurs while fetching the group details
*/ */
List<SubscriptionsDTO> getGroupsSubscriptionDetailsByUUID(String uuid, String subscriptionStatus, int offset, int limit) public List<SubscriptionsDTO> getGroupsSubscriptionDetailsByUUID(String uuid, String subscriptionStatus,
throws ApplicationManagementException; PaginationRequest request, int offset,
int limit) throws ApplicationManagementException;
/** /**
* Retrieves the user details associated with a given app release UUID. * Retrieves the user details associated with a given app release UUID.
@ -246,8 +247,8 @@ public interface SubscriptionManager {
* @return {@link SubscriptionsDTO} which contains the details of subscriptions. * @return {@link SubscriptionsDTO} which contains the details of subscriptions.
* @throws ApplicationManagementException if an error occurs while fetching the user details * @throws ApplicationManagementException if an error occurs while fetching the user details
*/ */
List<SubscriptionsDTO> getUserSubscriptionsByUUID(String uuid, String subscriptionStatus, int offset, int limit) List<SubscriptionsDTO> getUserSubscriptionsByUUID(String uuid, String subscriptionStatus, PaginationRequest request,
throws ApplicationManagementException; int offset, int limit) throws ApplicationManagementException;
/** /**
* Retrieves the Role details associated with a given app release UUID. * Retrieves the Role details associated with a given app release UUID.
@ -259,8 +260,8 @@ public interface SubscriptionManager {
* @return {@link SubscriptionsDTO} which contains the details of subscriptions. * @return {@link SubscriptionsDTO} which contains the details of subscriptions.
* @throws ApplicationManagementException if an error occurs while fetching the role details * @throws ApplicationManagementException if an error occurs while fetching the role details
*/ */
List<SubscriptionsDTO> getRoleSubscriptionsByUUID(String uuid, String subscriptionStatus, int offset, int limit) List<SubscriptionsDTO> getRoleSubscriptionsByUUID(String uuid, String subscriptionStatus, PaginationRequest request,
throws ApplicationManagementException; int offset, int limit) throws ApplicationManagementException;
/** /**
* Retrieves the Device Subscription details associated with a given app release UUID. * Retrieves the Device Subscription details associated with a given app release UUID.
@ -272,8 +273,9 @@ public interface SubscriptionManager {
* @return {@link DeviceSubscriptionResponseDTO} which contains the details of device subscriptions. * @return {@link DeviceSubscriptionResponseDTO} which contains the details of device subscriptions.
* @throws ApplicationManagementException if an error occurs while fetching the device subscription details * @throws ApplicationManagementException if an error occurs while fetching the device subscription details
*/ */
DeviceSubscriptionResponseDTO getDeviceSubscriptionsDetailsByUUID(String uuid, String subscriptionStatus, int offset, int limit) DeviceSubscriptionResponseDTO getDeviceSubscriptionsDetailsByUUID(String uuid, String subscriptionStatus,
throws ApplicationManagementException; PaginationRequest request, int offset,
int limit) throws ApplicationManagementException;
/** /**
* Retrieves the All Device details associated with a given app release UUID. * Retrieves the All Device details associated with a given app release UUID.
@ -285,8 +287,9 @@ public interface SubscriptionManager {
* @return {@link DeviceSubscriptionResponseDTO} which contains the details of device subscriptions. * @return {@link DeviceSubscriptionResponseDTO} which contains the details of device subscriptions.
* @throws ApplicationManagementException if an error occurs while fetching the subscription details * @throws ApplicationManagementException if an error occurs while fetching the subscription details
*/ */
DeviceSubscriptionResponseDTO getAllSubscriptionDetailsByUUID(String uuid, String subscriptionStatus, int offset, int limit) DeviceSubscriptionResponseDTO getAllSubscriptionDetailsByUUID(String uuid, String subscriptionStatus,
throws ApplicationManagementException; PaginationRequest request, int offset,
int limit) throws ApplicationManagementException;
/** /**
* This method is responsible for retrieving device subscription details related to the given UUID. * This method is responsible for retrieving device subscription details related to the given UUID.

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>application-mgt</artifactId> <artifactId>application-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -390,12 +390,16 @@ public interface SubscriptionDAO {
* @param appReleaseId the appReleaseId of the application release. * @param appReleaseId the appReleaseId of the application release.
* @param unsubscribe the Status of the subscription. * @param unsubscribe the Status of the subscription.
* @param tenantId id of the current tenant. * @param tenantId id of the current tenant.
* @param actionStatus Status of the action
* @param actionType type of the action
* @param actionTriggeredBy subscribed by
* @param deviceIds deviceIds deviceIds to retrieve data. * @param deviceIds deviceIds deviceIds to retrieve data.
* @return {@link DeviceOperationDTO} which contains the details of device subscriptions. * @return {@link DeviceOperationDTO} which contains the details of device subscriptions.
* @throws ApplicationManagementDAOException if connection establishment or SQL execution fails. * @throws ApplicationManagementDAOException if connection establishment or SQL execution fails.
*/ */
List<DeviceSubscriptionDTO> getSubscriptionDetailsByDeviceIds(int appReleaseId, boolean unsubscribe, int tenantId, List<Integer> deviceIds) List<DeviceSubscriptionDTO> getSubscriptionDetailsByDeviceIds(int appReleaseId, boolean unsubscribe, int tenantId,
throws ApplicationManagementDAOException; List<Integer> deviceIds, String actionStatus, String actionType,
String actionTriggeredBy, String tabActionStatus) throws ApplicationManagementDAOException;
/** /**
* This method is used to get the details of device subscriptions related to a UUID. * This method is used to get the details of device subscriptions related to a UUID.
@ -403,13 +407,16 @@ public interface SubscriptionDAO {
* @param appReleaseId the appReleaseId of the application release. * @param appReleaseId the appReleaseId of the application release.
* @param unsubscribe the Status of the subscription. * @param unsubscribe the Status of the subscription.
* @param tenantId id of the current tenant. * @param tenantId id of the current tenant.
* @param actionStatus Status of the action
* @param actionType type of the action
* @param actionTriggeredBy subscribed by
* @param offset the offset for the data set * @param offset the offset for the data set
* @param limit the limit for the data set * @param limit the limit for the data set
* @return {@link DeviceOperationDTO} which contains the details of device subscriptions. * @return {@link DeviceOperationDTO} which contains the details of device subscriptions.
* @throws ApplicationManagementDAOException if connection establishment or SQL execution fails. * @throws ApplicationManagementDAOException if connection establishment or SQL execution fails.
*/ */
List<DeviceSubscriptionDTO> getAllSubscriptionsDetails(int appReleaseId, boolean unsubscribe, int tenantId, int offset, int limit) List<DeviceSubscriptionDTO> getAllSubscriptionsDetails(int appReleaseId, boolean unsubscribe, int tenantId, String actionStatus, String actionType,
throws ApplicationManagementDAOException; String actionTriggeredBy, int offset, int limit) throws ApplicationManagementDAOException;
/** /**
* This method is used to get the counts of all subscription types related to a UUID. * This method is used to get the counts of all subscription types related to a UUID.

@ -1912,8 +1912,9 @@ public class GenericSubscriptionDAOImpl extends AbstractDAOImpl implements Subsc
} }
@Override @Override
public List<DeviceSubscriptionDTO> getSubscriptionDetailsByDeviceIds(int appReleaseId, boolean unsubscribe, int tenantId, List<Integer> deviceIds) public List<DeviceSubscriptionDTO> getSubscriptionDetailsByDeviceIds(int appReleaseId, boolean unsubscribe, int tenantId,
throws ApplicationManagementDAOException { List<Integer> deviceIds, String actionStatus, String actionType,
String actionTriggeredBy, String tabActionStatus) throws ApplicationManagementDAOException {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Getting device subscriptions for the application release id " + appReleaseId log.debug("Getting device subscriptions for the application release id " + appReleaseId
+ " and device ids " + deviceIds + " from the database"); + " and device ids " + deviceIds + " from the database");
@ -1921,7 +1922,7 @@ public class GenericSubscriptionDAOImpl extends AbstractDAOImpl implements Subsc
try { try {
Connection conn = this.getDBConnection(); Connection conn = this.getDBConnection();
String subscriptionStatusTime = unsubscribe ? "DS.UNSUBSCRIBED_TIMESTAMP" : "DS.SUBSCRIBED_TIMESTAMP"; String subscriptionStatusTime = unsubscribe ? "DS.UNSUBSCRIBED_TIMESTAMP" : "DS.SUBSCRIBED_TIMESTAMP";
String sql = "SELECT " StringBuilder sql = new StringBuilder("SELECT "
+ "DS.ID AS ID, " + "DS.ID AS ID, "
+ "DS.SUBSCRIBED_BY AS SUBSCRIBED_BY, " + "DS.SUBSCRIBED_BY AS SUBSCRIBED_BY, "
+ "DS.SUBSCRIBED_TIMESTAMP AS SUBSCRIBED_AT, " + "DS.SUBSCRIBED_TIMESTAMP AS SUBSCRIBED_AT, "
@ -1933,16 +1934,39 @@ public class GenericSubscriptionDAOImpl extends AbstractDAOImpl implements Subsc
+ "DS.DM_DEVICE_ID AS DEVICE_ID " + "DS.DM_DEVICE_ID AS DEVICE_ID "
+ "FROM AP_DEVICE_SUBSCRIPTION DS " + "FROM AP_DEVICE_SUBSCRIPTION DS "
+ "WHERE DS.AP_APP_RELEASE_ID = ? AND DS.UNSUBSCRIBED = ? AND DS.TENANT_ID = ? AND DS.DM_DEVICE_ID IN (" + + "WHERE DS.AP_APP_RELEASE_ID = ? AND DS.UNSUBSCRIBED = ? AND DS.TENANT_ID = ? AND DS.DM_DEVICE_ID IN (" +
deviceIds.stream().map(id -> "?").collect(Collectors.joining(",")) + ") " deviceIds.stream().map(id -> "?").collect(Collectors.joining(",")) + ") ");
+ "ORDER BY " + subscriptionStatusTime + " DESC";
try (PreparedStatement ps = conn.prepareStatement(sql)) { if (actionStatus != null && !actionStatus.isEmpty()) {
ps.setInt(1, appReleaseId); sql.append(" AND DS.STATUS = ? ");
ps.setBoolean(2, unsubscribe); }
ps.setInt(3, tenantId); if (actionType != null && !actionType.isEmpty()) {
sql.append(" AND DS.ACTION_TRIGGERED_FROM = ? ");
}
if (actionTriggeredBy != null && !actionTriggeredBy.isEmpty()) {
sql.append(" AND DS.SUBSCRIBED_BY LIKE ? ");
}
sql.append("ORDER BY ").append(subscriptionStatusTime).append(" DESC");
try (PreparedStatement ps = conn.prepareStatement(sql.toString())) {
int paramIdx = 1;
ps.setInt(paramIdx++, appReleaseId);
ps.setBoolean(paramIdx++, unsubscribe);
ps.setInt(paramIdx++, tenantId);
for (int i = 0; i < deviceIds.size(); i++) { for (int i = 0; i < deviceIds.size(); i++) {
ps.setInt(4 + i, deviceIds.get(i)); ps.setInt(paramIdx++, deviceIds.get(i));
}
if (actionStatus != null && !actionStatus.isEmpty()) {
ps.setString(paramIdx++, actionStatus);
}
if (actionType != null && !actionType.isEmpty()) {
ps.setString(paramIdx++, actionType);
} }
if (actionTriggeredBy != null && !actionTriggeredBy.isEmpty()) {
ps.setString(paramIdx++, "%" + actionTriggeredBy + "%");
}
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Successfully retrieved device subscriptions for application release id " log.debug("Successfully retrieved device subscriptions for application release id "
@ -1981,6 +2005,7 @@ public class GenericSubscriptionDAOImpl extends AbstractDAOImpl implements Subsc
@Override @Override
public List<DeviceSubscriptionDTO> getAllSubscriptionsDetails(int appReleaseId, boolean unsubscribe, int tenantId, public List<DeviceSubscriptionDTO> getAllSubscriptionsDetails(int appReleaseId, boolean unsubscribe, int tenantId,
String actionStatus, String actionType, String actionTriggeredBy,
int offset, int limit) throws ApplicationManagementDAOException { int offset, int limit) throws ApplicationManagementDAOException {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Getting device subscriptions for the application release id " + appReleaseId log.debug("Getting device subscriptions for the application release id " + appReleaseId
@ -1988,7 +2013,8 @@ public class GenericSubscriptionDAOImpl extends AbstractDAOImpl implements Subsc
} }
String subscriptionStatusTime = unsubscribe ? "DS.UNSUBSCRIBED_TIMESTAMP" : "DS.SUBSCRIBED_TIMESTAMP"; String subscriptionStatusTime = unsubscribe ? "DS.UNSUBSCRIBED_TIMESTAMP" : "DS.SUBSCRIBED_TIMESTAMP";
String sql = "SELECT " String actionTriggeredColumn = unsubscribe ? "DS.UNSUBSCRIBED_BY" : "DS.SUBSCRIBED_BY";
StringBuilder sql = new StringBuilder("SELECT "
+ "DS.ID AS ID, " + "DS.ID AS ID, "
+ "DS.SUBSCRIBED_BY AS SUBSCRIBED_BY, " + "DS.SUBSCRIBED_BY AS SUBSCRIBED_BY, "
+ "DS.SUBSCRIBED_TIMESTAMP AS SUBSCRIBED_AT, " + "DS.SUBSCRIBED_TIMESTAMP AS SUBSCRIBED_AT, "
@ -1996,21 +2022,45 @@ public class GenericSubscriptionDAOImpl extends AbstractDAOImpl implements Subsc
+ "DS.UNSUBSCRIBED_BY AS UNSUBSCRIBED_BY, " + "DS.UNSUBSCRIBED_BY AS UNSUBSCRIBED_BY, "
+ "DS.UNSUBSCRIBED_TIMESTAMP AS UNSUBSCRIBED_AT, " + "DS.UNSUBSCRIBED_TIMESTAMP AS UNSUBSCRIBED_AT, "
+ "DS.ACTION_TRIGGERED_FROM AS ACTION_TRIGGERED_FROM, " + "DS.ACTION_TRIGGERED_FROM AS ACTION_TRIGGERED_FROM, "
+ "DS.STATUS AS STATUS," + "DS.STATUS AS STATUS, "
+ "DS.DM_DEVICE_ID AS DEVICE_ID " + "DS.DM_DEVICE_ID AS DEVICE_ID "
+ "FROM AP_DEVICE_SUBSCRIPTION DS " + "FROM AP_DEVICE_SUBSCRIPTION DS "
+ "WHERE DS.AP_APP_RELEASE_ID = ? AND DS.UNSUBSCRIBED = ? AND DS.TENANT_ID=? " + "WHERE DS.AP_APP_RELEASE_ID = ? AND DS.UNSUBSCRIBED = ? AND DS.TENANT_ID = ? ");
+ "ORDER BY " + subscriptionStatusTime + " DESC "
+ "LIMIT ? OFFSET ?"; if (actionStatus != null && !actionStatus.isEmpty()) {
sql.append(" AND DS.STATUS = ? ");
}
if (actionType != null && !actionType.isEmpty()) {
sql.append(" AND DS.ACTION_TRIGGERED_FROM = ? ");
}
if (actionTriggeredBy != null && !actionTriggeredBy.isEmpty()) {
sql.append(" AND ").append(actionTriggeredColumn).append(" LIKE ? ");
}
sql.append("ORDER BY ").append(subscriptionStatusTime).append(" DESC ")
.append("LIMIT ? OFFSET ?");
try { try {
Connection conn = this.getDBConnection(); Connection conn = this.getDBConnection();
try (PreparedStatement ps = conn.prepareStatement(sql)) { try (PreparedStatement ps = conn.prepareStatement(sql.toString())) {
ps.setInt(1, appReleaseId); int paramIdx = 1;
ps.setBoolean(2, unsubscribe); ps.setInt(paramIdx++, appReleaseId);
ps.setInt(3, tenantId); ps.setBoolean(paramIdx++, unsubscribe);
ps.setInt(4, limit); ps.setInt(paramIdx++, tenantId);
ps.setInt(5, offset);
if (actionStatus != null && !actionStatus.isEmpty()) {
ps.setString(paramIdx++, actionStatus);
}
if (actionType != null && !actionType.isEmpty()) {
ps.setString(paramIdx++, actionType);
}
if (actionTriggeredBy != null && !actionTriggeredBy.isEmpty()) {
ps.setString(paramIdx++, "%" + actionTriggeredBy + "%");
}
ps.setInt(paramIdx++, limit);
ps.setInt(paramIdx++, offset);
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Successfully retrieved device subscriptions for application release id " log.debug("Successfully retrieved device subscriptions for application release id "
@ -2041,7 +2091,7 @@ public class GenericSubscriptionDAOImpl extends AbstractDAOImpl implements Subsc
log.error(msg, e); log.error(msg, e);
throw new ApplicationManagementDAOException(msg, e); throw new ApplicationManagementDAOException(msg, e);
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while while running SQL to get device subscription data for application ID: " + appReleaseId; String msg = "Error occurred while running SQL to get device subscription data for application ID: " + appReleaseId;
log.error(msg, e); log.error(msg, e);
throw new ApplicationManagementDAOException(msg, e); throw new ApplicationManagementDAOException(msg, e);
} }

@ -1734,12 +1734,12 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
} }
@Override @Override
public List<SubscriptionsDTO> getGroupsSubscriptionDetailsByUUID(String uuid, String subscriptionStatus, int offset, public List<SubscriptionsDTO> getGroupsSubscriptionDetailsByUUID(
int limit) throws ApplicationManagementException { String uuid, String subscriptionStatus, PaginationRequest request, int offset, int limit)
throws ApplicationManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
boolean unsubscribe = subscriptionStatus.equals("unsubscribed"); boolean unsubscribe = subscriptionStatus.equals("unsubscribed");
String groupName;
String status;
try { try {
ConnectionManagerUtil.openDBConnection(); ConnectionManagerUtil.openDBConnection();
@ -1763,12 +1763,18 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
GroupManagementProviderService groupManagementProviderService = HelperUtil.getGroupManagementProviderService(); GroupManagementProviderService groupManagementProviderService = HelperUtil.getGroupManagementProviderService();
for (GroupSubscriptionDTO groupDetail : groupDetails) { for (GroupSubscriptionDTO groupDetail : groupDetails) {
groupName = groupDetail.getGroupName();
if (StringUtils.isNotBlank(request.getGroupName()) && !request.getGroupName().equals(groupDetail.getGroupName())) {
continue;
}
String groupName = StringUtils.isNotBlank(request.getGroupName()) ? request.getGroupName() : groupDetail.getGroupName();
// Retrieve group details and device IDs for the group using the service layer // Retrieve group details and device IDs for the group using the service layer
GroupDetailsDTO groupDetailWithDevices = GroupDetailsDTO groupDetailWithDevices =
groupManagementProviderService.getGroupDetailsWithDevices(groupName, applicationDTO.getDeviceTypeId(), groupManagementProviderService.getGroupDetailsWithDevices(
offset, limit); groupName, applicationDTO.getDeviceTypeId(), request.getOwner(),
request.getDeviceName(), request.getDeviceStatus(), offset, limit);
SubscriptionsDTO groupDetailDTO = new SubscriptionsDTO(); SubscriptionsDTO groupDetailDTO = new SubscriptionsDTO();
groupDetailDTO.setId(groupDetailWithDevices.getGroupId()); groupDetailDTO.setId(groupDetailWithDevices.getGroupId());
@ -1791,24 +1797,29 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
List<Integer> deviceIds = groupDetailWithDevices.getDeviceIds(); List<Integer> deviceIds = groupDetailWithDevices.getDeviceIds();
Map<String, Integer> statusCounts = new HashMap<>(); Map<String, Integer> statusCounts = new HashMap<>();
statusCounts.put("PENDING", 0);
statusCounts.put("COMPLETED", 0); statusCounts.put("COMPLETED", 0);
statusCounts.put("ERROR", 0); statusCounts.put("ERROR", 0);
statusCounts.put("PENDING", 0);
statusCounts.put("NEW", 0); statusCounts.put("NEW", 0);
statusCounts.put("SUBSCRIBED", 0); statusCounts.put("SUBSCRIBED", 0);
// Get subscribed devices if unsubscribed devices are requested
List<DeviceSubscriptionDTO> subscribedDeviceSubscriptions = new ArrayList<>();
if (unsubscribe) {
subscribedDeviceSubscriptions = subscriptionDAO.getSubscriptionDetailsByDeviceIds(
appReleaseId, !unsubscribe, tenantId, deviceIds);
}
for (Integer deviceId : deviceIds) { for (Integer deviceId : deviceIds) {
List<DeviceSubscriptionDTO> deviceSubscriptions = subscriptionDAO.getSubscriptionDetailsByDeviceIds( // Get subscribed devices if unsubscribed devices are requested
groupDetail.getAppReleaseId(), unsubscribe, tenantId, deviceIds); List<DeviceSubscriptionDTO> deviceSubscriptions;
if (unsubscribe) {
deviceSubscriptions = subscriptionDAO.getSubscriptionDetailsByDeviceIds(
appReleaseId, !unsubscribe, tenantId, deviceIds,
request.getActionStatus(), request.getActionType(), request.getActionTriggeredBy(), request.getTabActionStatus());
} else {
deviceSubscriptions = subscriptionDAO.getSubscriptionDetailsByDeviceIds(
groupDetail.getAppReleaseId(), false, tenantId, deviceIds,
request.getActionStatus(), request.getActionType(), request.getActionTriggeredBy(), request.getTabActionStatus());
}
List<DeviceSubscriptionDTO> filteredDeviceSubscriptions = deviceSubscriptions.stream()
.filter(subscription -> StringUtils.isBlank(request.getTabActionStatus()) || subscription.getStatus().equals(request.getTabActionStatus()))
.collect(Collectors.toList());
boolean isNewDevice = true; boolean isNewDevice = true;
for (DeviceSubscriptionDTO subscription : deviceSubscriptions) { for (DeviceSubscriptionDTO subscription : filteredDeviceSubscriptions) {
if (subscription.getDeviceId() == deviceId) { if (subscription.getDeviceId() == deviceId) {
DeviceSubscriptionData deviceDetail = new DeviceSubscriptionData(); DeviceSubscriptionData deviceDetail = new DeviceSubscriptionData();
deviceDetail.setDeviceId(subscription.getDeviceId()); deviceDetail.setDeviceId(subscription.getDeviceId());
@ -1826,7 +1837,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
deviceDetail.setType(groupDetailWithDevices.getDeviceTypes().get(deviceId)); deviceDetail.setType(groupDetailWithDevices.getDeviceTypes().get(deviceId));
deviceDetail.setDeviceIdentifier(groupDetailWithDevices.getDeviceIdentifiers().get(deviceId)); deviceDetail.setDeviceIdentifier(groupDetailWithDevices.getDeviceIdentifiers().get(deviceId));
status = subscription.getStatus(); String status = subscription.getStatus();
switch (status) { switch (status) {
case "COMPLETED": case "COMPLETED":
installedDevices.add(deviceDetail); installedDevices.add(deviceDetail);
@ -1844,13 +1855,17 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
pendingDevices.add(deviceDetail); pendingDevices.add(deviceDetail);
statusCounts.put("PENDING", statusCounts.get("PENDING") + 1); statusCounts.put("PENDING", statusCounts.get("PENDING") + 1);
break; break;
default:
newDevices.add(deviceDetail);
statusCounts.put("NEW", statusCounts.get("NEW") + 1);
break;
} }
isNewDevice = false; isNewDevice = false;
} }
} }
if (isNewDevice) { if (isNewDevice) {
boolean isSubscribedDevice = false; boolean isSubscribedDevice = false;
for (DeviceSubscriptionDTO subscribedDevice : subscribedDeviceSubscriptions) { for (DeviceSubscriptionDTO subscribedDevice : deviceSubscriptions) {
if (subscribedDevice.getDeviceId() == deviceId) { if (subscribedDevice.getDeviceId() == deviceId) {
DeviceSubscriptionData subscribedDeviceDetail = new DeviceSubscriptionData(); DeviceSubscriptionData subscribedDeviceDetail = new DeviceSubscriptionData();
subscribedDeviceDetail.setDeviceId(subscribedDevice.getDeviceId()); subscribedDeviceDetail.setDeviceId(subscribedDevice.getDeviceId());
@ -1892,17 +1907,38 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
statusPercentages.put(entry.getKey(), Double.valueOf(formattedPercentage)); statusPercentages.put(entry.getKey(), Double.valueOf(formattedPercentage));
} }
CategorizedSubscriptionResult categorizedSubscriptionResult; List<DeviceSubscriptionData> requestedDevices = new ArrayList<>();
if (subscribedDevices.isEmpty()) { if (StringUtils.isNotBlank(request.getTabActionStatus())) {
categorizedSubscriptionResult = switch (request.getTabActionStatus()) {
new CategorizedSubscriptionResult(installedDevices, pendingDevices, errorDevices, newDevices); case "COMPLETED":
requestedDevices = installedDevices;
break;
case "PENDING":
requestedDevices = pendingDevices;
break;
case "ERROR":
requestedDevices = errorDevices;
break;
case "NEW":
requestedDevices = newDevices;
break;
case "SUBSCRIBED":
requestedDevices = subscribedDevices;
break;
}
groupDetailDTO.setDevices(new CategorizedSubscriptionResult(requestedDevices, request.getTabActionStatus()));
} else { } else {
categorizedSubscriptionResult = CategorizedSubscriptionResult categorizedSubscriptionResult;
new CategorizedSubscriptionResult(installedDevices, pendingDevices, errorDevices, newDevices, subscribedDevices); if (subscribedDevices.isEmpty()) {
categorizedSubscriptionResult =
new CategorizedSubscriptionResult(installedDevices, pendingDevices, errorDevices, newDevices);
} else {
categorizedSubscriptionResult =
new CategorizedSubscriptionResult(installedDevices, pendingDevices, errorDevices, newDevices, subscribedDevices);
}
groupDetailDTO.setDevices(categorizedSubscriptionResult);
} }
groupDetailDTO.setDevices(categorizedSubscriptionResult);
groupDetailDTO.setStatusPercentages(statusPercentages); groupDetailDTO.setStatusPercentages(statusPercentages);
groupDetailsWithDevices.add(groupDetailDTO); groupDetailsWithDevices.add(groupDetailDTO);
} }
@ -1925,11 +1961,11 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
} }
@Override @Override
public List<SubscriptionsDTO> getUserSubscriptionsByUUID(String uuid, String subscriptionStatus, int offset, int limit) public List<SubscriptionsDTO> getUserSubscriptionsByUUID(String uuid, String subscriptionStatus,
PaginationRequest request, int offset, int limit)
throws ApplicationManagementException { throws ApplicationManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
boolean unsubscribe = subscriptionStatus.equals("unsubscribed"); boolean unsubscribe = subscriptionStatus.equals("unsubscribed");
String userName;
String status; String status;
try { try {
@ -1954,11 +1990,17 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
DeviceManagementProviderService deviceManagementProviderService = HelperUtil.getDeviceManagementProviderService(); DeviceManagementProviderService deviceManagementProviderService = HelperUtil.getDeviceManagementProviderService();
for (SubscriptionsDTO userSubscription : userSubscriptions) { for (SubscriptionsDTO userSubscription : userSubscriptions) {
userName = userSubscription.getName();
if (StringUtils.isNotBlank(request.getUserName()) && !request.getUserName().equals(userSubscription.getName())) {
continue;
}
String userName = StringUtils.isNotBlank(request.getUserName()) ? request.getUserName() : userSubscription.getName();
// Retrieve owner details and device IDs for the user using the service layer // Retrieve owner details and device IDs for the user using the service layer
OwnerWithDeviceDTO ownerDetailsWithDevices = OwnerWithDeviceDTO ownerDetailsWithDevices =
deviceManagementProviderService.getOwnersWithDeviceIds(userName, applicationDTO.getDeviceTypeId()); deviceManagementProviderService.getOwnersWithDeviceIds(userName, applicationDTO.getDeviceTypeId(),
request.getOwner(), request.getDeviceName(), request.getDeviceStatus());
SubscriptionsDTO userSubscriptionDTO = new SubscriptionsDTO(); SubscriptionsDTO userSubscriptionDTO = new SubscriptionsDTO();
userSubscriptionDTO.setName(userSubscription.getName()); userSubscriptionDTO.setName(userSubscription.getName());
@ -1989,14 +2031,17 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
List<DeviceSubscriptionDTO> subscribedDeviceSubscriptions = new ArrayList<>(); List<DeviceSubscriptionDTO> subscribedDeviceSubscriptions = new ArrayList<>();
if (unsubscribe) { if (unsubscribe) {
subscribedDeviceSubscriptions = subscriptionDAO.getSubscriptionDetailsByDeviceIds( subscribedDeviceSubscriptions = subscriptionDAO.getSubscriptionDetailsByDeviceIds(
appReleaseId, !unsubscribe, tenantId, deviceIds); appReleaseId, !unsubscribe, tenantId, deviceIds, request.getActionStatus(), request.getActionType(),
request.getActionTriggeredBy(), request.getTabActionStatus());
} }
for (Integer deviceId : deviceIds) { for (Integer deviceId : deviceIds) {
List<DeviceSubscriptionDTO> deviceSubscriptions = subscriptionDAO.getSubscriptionDetailsByDeviceIds( List<DeviceSubscriptionDTO> deviceSubscriptions = subscriptionDAO.getSubscriptionDetailsByDeviceIds(
userSubscription.getAppReleaseId(), unsubscribe, tenantId, deviceIds); userSubscription.getAppReleaseId(), unsubscribe, tenantId, deviceIds, request.getActionStatus(), request.getActionType(),
request.getActionTriggeredBy(), request.getTabActionStatus());
OwnerWithDeviceDTO ownerWithDeviceByDeviceId = OwnerWithDeviceDTO ownerWithDeviceByDeviceId =
deviceManagementProviderService.getOwnerWithDeviceByDeviceId(deviceId); deviceManagementProviderService.getOwnerWithDeviceByDeviceId(deviceId, request.getOwner(), request.getDeviceName(),
request.getDeviceStatus());
if (ownerWithDeviceByDeviceId == null) { if (ownerWithDeviceByDeviceId == null) {
continue; continue;
} }
@ -2086,20 +2131,42 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
statusPercentages.put(entry.getKey(), Double.valueOf(formattedPercentage)); statusPercentages.put(entry.getKey(), Double.valueOf(formattedPercentage));
} }
CategorizedSubscriptionResult categorizedSubscriptionResult; List<DeviceSubscriptionData> requestedDevices = new ArrayList<>();
if (subscribedDevices.isEmpty()) { if (StringUtils.isNotBlank(request.getTabActionStatus())) {
categorizedSubscriptionResult = switch (request.getTabActionStatus()) {
new CategorizedSubscriptionResult(installedDevices, pendingDevices, errorDevices, newDevices); case "COMPLETED":
requestedDevices = installedDevices;
break;
case "PENDING":
requestedDevices = pendingDevices;
break;
case "ERROR":
requestedDevices = errorDevices;
break;
case "NEW":
requestedDevices = newDevices;
break;
case "SUBSCRIBED":
requestedDevices = subscribedDevices;
break;
}
userSubscriptionDTO.setDevices(new CategorizedSubscriptionResult(requestedDevices, request.getTabActionStatus()));
} else { } else {
categorizedSubscriptionResult = CategorizedSubscriptionResult categorizedSubscriptionResult;
new CategorizedSubscriptionResult(installedDevices, pendingDevices, errorDevices, newDevices, subscribedDevices); if (subscribedDevices.isEmpty()) {
} categorizedSubscriptionResult =
userSubscriptionDTO.setDevices(categorizedSubscriptionResult); new CategorizedSubscriptionResult(installedDevices, pendingDevices, errorDevices, newDevices);
userSubscriptionDTO.setStatusPercentages(statusPercentages); } else {
categorizedSubscriptionResult =
new CategorizedSubscriptionResult(installedDevices, pendingDevices, errorDevices, newDevices,
subscribedDevices);
}
userSubscriptionDTO.setDevices(categorizedSubscriptionResult);
userSubscriptionDTO.setStatusPercentages(statusPercentages);
}
userSubscriptionsWithDevices.add(userSubscriptionDTO); userSubscriptionsWithDevices.add(userSubscriptionDTO);
} }
return userSubscriptionsWithDevices; return userSubscriptionsWithDevices;
} catch (ApplicationManagementDAOException e) { } catch (ApplicationManagementDAOException e) {
String msg = "Error occurred while getting user subscriptions for the application release UUID: " + uuid; String msg = "Error occurred while getting user subscriptions for the application release UUID: " + uuid;
@ -2117,7 +2184,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
} }
@Override @Override
public List<SubscriptionsDTO> getRoleSubscriptionsByUUID(String uuid, String subscriptionStatus, int offset, int limit) public List<SubscriptionsDTO> getRoleSubscriptionsByUUID(String uuid, String subscriptionStatus,
PaginationRequest request, int offset, int limit)
throws ApplicationManagementException { throws ApplicationManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
boolean unsubscribe = subscriptionStatus.equals("unsubscribed"); boolean unsubscribe = subscriptionStatus.equals("unsubscribed");
@ -2146,7 +2214,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
DeviceManagementProviderService deviceManagementProviderService = HelperUtil.getDeviceManagementProviderService(); DeviceManagementProviderService deviceManagementProviderService = HelperUtil.getDeviceManagementProviderService();
for (SubscriptionsDTO roleSubscription : roleSubscriptions) { for (SubscriptionsDTO roleSubscription : roleSubscriptions) {
roleName = roleSubscription.getName();
roleName = StringUtils.isNotBlank(request.getRoleName()) ? request.getRoleName() : roleSubscription.getName();
SubscriptionsDTO roleSubscriptionDTO = new SubscriptionsDTO(); SubscriptionsDTO roleSubscriptionDTO = new SubscriptionsDTO();
roleSubscriptionDTO.setName(roleSubscription.getName()); roleSubscriptionDTO.setName(roleSubscription.getName());
@ -2175,7 +2244,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
for (String user : users) { for (String user : users) {
OwnerWithDeviceDTO ownerDetailsWithDevices; OwnerWithDeviceDTO ownerDetailsWithDevices;
try { try {
ownerDetailsWithDevices = deviceManagementProviderService.getOwnersWithDeviceIds(user, applicationDTO.getDeviceTypeId()); ownerDetailsWithDevices = deviceManagementProviderService.getOwnersWithDeviceIds(user, applicationDTO.getDeviceTypeId(),
request.getOwner(), request.getDeviceName(), request.getDeviceStatus());
} catch (DeviceManagementDAOException e) { } catch (DeviceManagementDAOException e) {
throw new ApplicationManagementException("Error retrieving owner details with devices for user: " + user, e); throw new ApplicationManagementException("Error retrieving owner details with devices for user: " + user, e);
} }
@ -2186,17 +2256,20 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
List<DeviceSubscriptionDTO> subscribedDeviceSubscriptions = new ArrayList<>(); List<DeviceSubscriptionDTO> subscribedDeviceSubscriptions = new ArrayList<>();
if (unsubscribe) { if (unsubscribe) {
subscribedDeviceSubscriptions = subscriptionDAO.getSubscriptionDetailsByDeviceIds( subscribedDeviceSubscriptions = subscriptionDAO.getSubscriptionDetailsByDeviceIds(
appReleaseId, !unsubscribe, tenantId, deviceIds); appReleaseId, !unsubscribe, tenantId, deviceIds, request.getActionStatus(), request.getActionType(),
request.getActionTriggeredBy(), request.getTabActionStatus());
} }
OwnerWithDeviceDTO ownerWithDeviceByDeviceId = OwnerWithDeviceDTO ownerWithDeviceByDeviceId =
deviceManagementProviderService.getOwnerWithDeviceByDeviceId(deviceId); deviceManagementProviderService.getOwnerWithDeviceByDeviceId(deviceId, request.getOwner(), request.getDeviceName(),
request.getDeviceStatus());
if (ownerWithDeviceByDeviceId == null) { if (ownerWithDeviceByDeviceId == null) {
continue; continue;
} }
List<DeviceSubscriptionDTO> deviceSubscriptions; List<DeviceSubscriptionDTO> deviceSubscriptions;
try { try {
deviceSubscriptions = subscriptionDAO.getSubscriptionDetailsByDeviceIds( deviceSubscriptions = subscriptionDAO.getSubscriptionDetailsByDeviceIds(
roleSubscription.getAppReleaseId(), unsubscribe, tenantId, deviceIds); roleSubscription.getAppReleaseId(), unsubscribe, tenantId, deviceIds, request.getActionStatus(),
request.getActionType(), request.getActionTriggeredBy(), request.getTabActionStatus());
} catch (ApplicationManagementDAOException e) { } catch (ApplicationManagementDAOException e) {
throw new ApplicationManagementException("Error retrieving device subscriptions", e); throw new ApplicationManagementException("Error retrieving device subscriptions", e);
} }
@ -2289,18 +2362,41 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
statusPercentages.put(entry.getKey(), Double.valueOf(formattedPercentage)); statusPercentages.put(entry.getKey(), Double.valueOf(formattedPercentage));
} }
CategorizedSubscriptionResult categorizedSubscriptionResult; List<DeviceSubscriptionData> requestedDevices = new ArrayList<>();
if (subscribedDevices.isEmpty()) { if (StringUtils.isNotBlank(request.getTabActionStatus())) {
categorizedSubscriptionResult = switch (request.getTabActionStatus()) {
new CategorizedSubscriptionResult(installedDevices, pendingDevices, errorDevices, newDevices); case "COMPLETED":
requestedDevices = installedDevices;
break;
case "PENDING":
requestedDevices = pendingDevices;
break;
case "ERROR":
requestedDevices = errorDevices;
break;
case "NEW":
requestedDevices = newDevices;
break;
case "SUBSCRIBED":
requestedDevices = subscribedDevices;
break;
}
roleSubscriptionDTO.setDevices(new CategorizedSubscriptionResult(requestedDevices, request.getTabActionStatus()));
} else { } else {
categorizedSubscriptionResult = CategorizedSubscriptionResult categorizedSubscriptionResult;
new CategorizedSubscriptionResult(installedDevices, pendingDevices, errorDevices, newDevices, subscribedDevices); if (subscribedDevices.isEmpty()) {
categorizedSubscriptionResult =
new CategorizedSubscriptionResult(installedDevices, pendingDevices, errorDevices, newDevices);
} else {
categorizedSubscriptionResult =
new CategorizedSubscriptionResult(installedDevices, pendingDevices, errorDevices, newDevices,
subscribedDevices);
}
roleSubscriptionDTO.setDevices(categorizedSubscriptionResult);
roleSubscriptionDTO.setStatusPercentages(statusPercentages);
roleSubscriptionDTO.setDeviceCount(totalDevices);
} }
roleSubscriptionDTO.setDevices(categorizedSubscriptionResult);
roleSubscriptionDTO.setStatusPercentages(statusPercentages);
roleSubscriptionDTO.setDeviceCount(totalDevices);
roleSubscriptionsWithDevices.add(roleSubscriptionDTO); roleSubscriptionsWithDevices.add(roleSubscriptionDTO);
} }
@ -2332,7 +2428,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
} }
@Override @Override
public DeviceSubscriptionResponseDTO getDeviceSubscriptionsDetailsByUUID(String uuid, String subscriptionStatus, int offset, public DeviceSubscriptionResponseDTO getDeviceSubscriptionsDetailsByUUID(String uuid, String subscriptionStatus, PaginationRequest request, int offset,
int limit) throws ApplicationManagementException { int limit) throws ApplicationManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
@ -2362,7 +2458,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
} }
List<DeviceDetailsDTO> allDevices = List<DeviceDetailsDTO> allDevices =
deviceManagementProviderService.getDevicesByTenantId(tenantId, applicationDTO.getDeviceTypeId()); deviceManagementProviderService.getDevicesByTenantId(tenantId, applicationDTO.getDeviceTypeId(),
request.getOwner(), request.getDeviceStatus());
List<Integer> deviceIds = allDevices.stream() List<Integer> deviceIds = allDevices.stream()
.map(DeviceDetailsDTO::getDeviceId) .map(DeviceDetailsDTO::getDeviceId)
@ -2387,9 +2484,11 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
.collect(Collectors.toMap(DeviceDetailsDTO::getDeviceId, Function.identity())); .collect(Collectors.toMap(DeviceDetailsDTO::getDeviceId, Function.identity()));
List<DeviceSubscriptionDTO> allSubscriptionsForUnSubscribed = List<DeviceSubscriptionDTO> allSubscriptionsForUnSubscribed =
subscriptionDAO.getSubscriptionDetailsByDeviceIds(appReleaseId, !unsubscribe, tenantId, deviceIds); subscriptionDAO.getSubscriptionDetailsByDeviceIds(appReleaseId, !unsubscribe, tenantId, deviceIds, request.getActionStatus(),
request.getActionType(), request.getActionTriggeredBy(), request.getTabActionStatus());
List<DeviceSubscriptionDTO> allSubscriptionsForSubscribed = List<DeviceSubscriptionDTO> allSubscriptionsForSubscribed =
subscriptionDAO.getSubscriptionDetailsByDeviceIds(appReleaseId, unsubscribe, tenantId, deviceIds); subscriptionDAO.getSubscriptionDetailsByDeviceIds(appReleaseId, unsubscribe, tenantId, deviceIds, request.getActionStatus(),
request.getActionType(), request.getActionTriggeredBy(), request.getTabActionStatus());
Map<Integer, DeviceSubscriptionDTO> allSubscriptionForUnSubscribedMap = allSubscriptionsForUnSubscribed.stream() Map<Integer, DeviceSubscriptionDTO> allSubscriptionForUnSubscribedMap = allSubscriptionsForUnSubscribed.stream()
.collect(Collectors.toMap(DeviceSubscriptionDTO::getDeviceId, Function.identity())); .collect(Collectors.toMap(DeviceSubscriptionDTO::getDeviceId, Function.identity()));
Map<Integer, DeviceSubscriptionDTO> allSubscriptionForSubscribedMap = allSubscriptionsForSubscribed.stream() Map<Integer, DeviceSubscriptionDTO> allSubscriptionForSubscribedMap = allSubscriptionsForSubscribed.stream()
@ -2398,11 +2497,12 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
for (DeviceDetailsDTO device : allDevices) { for (DeviceDetailsDTO device : allDevices) {
Integer deviceId = device.getDeviceId(); Integer deviceId = device.getDeviceId();
OwnerWithDeviceDTO ownerWithDevice = OwnerWithDeviceDTO ownerWithDevice =
deviceManagementProviderService.getOwnerWithDeviceByDeviceId(deviceId); deviceManagementProviderService.getOwnerWithDeviceByDeviceId(deviceId, request.getOwner(), request.getDeviceName(),
if (ownerWithDevice == null) { request.getDeviceStatus());
if (ownerWithDevice == null || (request.getDeviceName() != null && !request.getDeviceName().isEmpty() &&
(ownerWithDevice.getDeviceNames() == null || !ownerWithDevice.getDeviceNames().contains(request.getDeviceName())))) {
continue; continue;
} }
if (deviceSubscriptionMap.containsKey(deviceId)) { if (deviceSubscriptionMap.containsKey(deviceId)) {
DeviceSubscriptionDTO subscription = deviceSubscriptionMap.get(deviceId); DeviceSubscriptionDTO subscription = deviceSubscriptionMap.get(deviceId);
DeviceSubscriptionData deviceDetail = new DeviceSubscriptionData(); DeviceSubscriptionData deviceDetail = new DeviceSubscriptionData();
@ -2491,14 +2591,35 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
statusPercentages.put(entry.getKey(), Double.valueOf(formattedPercentage)); statusPercentages.put(entry.getKey(), Double.valueOf(formattedPercentage));
} }
CategorizedSubscriptionResult categorizedSubscriptionResult; List<DeviceSubscriptionData> requestedDevices = new ArrayList<>();
if (subscribedDevices.isEmpty()) { if (StringUtils.isNotBlank(request.getTabActionStatus())) {
categorizedSubscriptionResult = switch (request.getTabActionStatus()) {
new CategorizedSubscriptionResult(installedDevices, pendingDevices, errorDevices, newDevices); case "COMPLETED":
requestedDevices = installedDevices;
break;
case "PENDING":
requestedDevices = pendingDevices;
break;
case "ERROR":
requestedDevices = errorDevices;
break;
case "NEW":
requestedDevices = newDevices;
break;
case "SUBSCRIBED":
requestedDevices = subscribedDevices;
break;
}
} else { } else {
categorizedSubscriptionResult = requestedDevices.addAll(installedDevices);
new CategorizedSubscriptionResult(installedDevices, pendingDevices, errorDevices, newDevices, subscribedDevices); requestedDevices.addAll(pendingDevices);
requestedDevices.addAll(errorDevices);
requestedDevices.addAll(newDevices);
requestedDevices.addAll(subscribedDevices);
} }
CategorizedSubscriptionResult categorizedSubscriptionResult =
new CategorizedSubscriptionResult(installedDevices, pendingDevices, errorDevices, newDevices, subscribedDevices);
DeviceSubscriptionResponseDTO deviceSubscriptionResponse = DeviceSubscriptionResponseDTO deviceSubscriptionResponse =
new DeviceSubscriptionResponseDTO(totalDevices, statusPercentages, categorizedSubscriptionResult); new DeviceSubscriptionResponseDTO(totalDevices, statusPercentages, categorizedSubscriptionResult);
@ -2520,8 +2641,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
} }
@Override @Override
public DeviceSubscriptionResponseDTO getAllSubscriptionDetailsByUUID(String uuid, String subscriptionStatus, int offset, int limit) public DeviceSubscriptionResponseDTO getAllSubscriptionDetailsByUUID(String uuid, String subscriptionStatus, PaginationRequest request,
throws ApplicationManagementException { int offset, int limit) throws ApplicationManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
boolean unsubscribe = subscriptionStatus.equals("unsubscribed"); boolean unsubscribe = subscriptionStatus.equals("unsubscribed");
@ -2538,7 +2659,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
int appReleaseId = applicationReleaseDTO.getId(); int appReleaseId = applicationReleaseDTO.getId();
List<DeviceSubscriptionDTO> allSubscriptions = List<DeviceSubscriptionDTO> allSubscriptions =
subscriptionDAO.getAllSubscriptionsDetails(appReleaseId, unsubscribe, tenantId, offset, limit); subscriptionDAO.getAllSubscriptionsDetails(appReleaseId, unsubscribe, tenantId, request.getActionStatus(),
request.getActionType(), request.getActionTriggeredBy(), offset, limit);
// empty response for no subscriptions // empty response for no subscriptions
if (allSubscriptions.isEmpty()) { if (allSubscriptions.isEmpty()) {
@ -2564,16 +2686,18 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
statusCounts.put("NEW", 0); statusCounts.put("NEW", 0);
List<DeviceDetailsDTO> allDevices = List<DeviceDetailsDTO> allDevices =
deviceManagementProviderService.getDevicesByTenantId(tenantId, applicationDTO.getDeviceTypeId()); deviceManagementProviderService.getDevicesByTenantId(tenantId, applicationDTO.getDeviceTypeId(), request.getOwner(),
request.getDeviceStatus());
for (DeviceDetailsDTO device : allDevices) { for (DeviceDetailsDTO device : allDevices) {
Integer deviceId = device.getDeviceId(); Integer deviceId = device.getDeviceId();
OwnerWithDeviceDTO ownerWithDevice = OwnerWithDeviceDTO ownerWithDevice =
deviceManagementProviderService.getOwnerWithDeviceByDeviceId(deviceId); deviceManagementProviderService.getOwnerWithDeviceByDeviceId(deviceId, request.getOwner(), request.getDeviceName(),
if (ownerWithDevice == null) { request.getDeviceStatus());
if (ownerWithDevice == null || (request.getDeviceName() != null && !request.getDeviceName().isEmpty() &&
(ownerWithDevice.getDeviceNames() == null || !ownerWithDevice.getDeviceNames().contains(request.getDeviceName())))) {
continue; continue;
} }
if (allSubscriptionMap.containsKey(deviceId)) { if (allSubscriptionMap.containsKey(deviceId)) {
DeviceSubscriptionDTO subscription = allSubscriptionMap.get(deviceId); DeviceSubscriptionDTO subscription = allSubscriptionMap.get(deviceId);
DeviceSubscriptionData deviceDetail = new DeviceSubscriptionData(); DeviceSubscriptionData deviceDetail = new DeviceSubscriptionData();
@ -2632,6 +2756,29 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
statusPercentages.put(entry.getKey(), Double.valueOf(formattedPercentage)); statusPercentages.put(entry.getKey(), Double.valueOf(formattedPercentage));
} }
List<DeviceSubscriptionData> requestedDevices = new ArrayList<>();
if (StringUtils.isNotBlank(request.getTabActionStatus())) {
switch (request.getTabActionStatus()) {
case "COMPLETED":
requestedDevices = installedDevices;
break;
case "PENDING":
requestedDevices = pendingDevices;
break;
case "ERROR":
requestedDevices = errorDevices;
break;
case "NEW":
requestedDevices = newDevices;
break;
}
} else {
requestedDevices.addAll(installedDevices);
requestedDevices.addAll(pendingDevices);
requestedDevices.addAll(errorDevices);
requestedDevices.addAll(newDevices);
}
CategorizedSubscriptionResult categorizedSubscriptionResult = CategorizedSubscriptionResult categorizedSubscriptionResult =
new CategorizedSubscriptionResult(installedDevices, pendingDevices, errorDevices, newDevices); new CategorizedSubscriptionResult(installedDevices, pendingDevices, errorDevices, newDevices);
DeviceSubscriptionResponseDTO result = DeviceSubscriptionResponseDTO result =

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>cea-mgt</artifactId> <artifactId>cea-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -23,7 +23,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>cea-mgt</artifactId> <artifactId>cea-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>cea-mgt</artifactId> <artifactId>cea-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>cea-mgt</artifactId> <artifactId>cea-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -37,6 +37,14 @@ public class PaginationRequest {
private Date since; private Date since;
private String filter; private String filter;
private String serialNumber; private String serialNumber;
private String groupName;
private String roleName;
private String userName;
private String deviceStatus;
private String tabActionStatus;
private String actionStatus;
private String actionType;
private String actionTriggeredBy;
private Map<String, String> customProperty = new HashMap<>(); private Map<String, String> customProperty = new HashMap<>();
private Map<String, Object> property = new HashMap<>(); private Map<String, Object> property = new HashMap<>();
private List<String> statusList = new ArrayList<>(); private List<String> statusList = new ArrayList<>();
@ -216,4 +224,68 @@ public class PaginationRequest {
+ this.ownership + "' Status '" + this.statusList + "' owner '" + this.owner + "' groupId: " + this.groupId + this.ownership + "' Status '" + this.statusList + "' owner '" + this.owner + "' groupId: " + this.groupId
+ " start index: " + this.startIndex + ", SortColumns: " + this.sortColumn; + " start index: " + this.startIndex + ", SortColumns: " + this.sortColumn;
} }
public String getDeviceStatus() {
return deviceStatus;
}
public void setDeviceStatus(String deviceStatus) {
this.deviceStatus = deviceStatus;
}
public String getActionStatus() {
return actionStatus;
}
public void setActionStatus(String actionStatus) {
this.actionStatus = actionStatus;
}
public String getActionType() {
return actionType;
}
public void setActionType(String actionType) {
this.actionType = actionType;
}
public String getActionTriggeredBy() {
return actionTriggeredBy;
}
public void setActionTriggeredBy(String actionTriggeredBy) {
this.actionTriggeredBy = actionTriggeredBy;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getTabActionStatus() {
return tabActionStatus;
}
public void setTabActionStatus(String tabActionStatus) {
this.tabActionStatus = tabActionStatus;
}
} }

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -102,21 +102,27 @@ public interface EnrollmentDAO {
* @param owner the owner whose device IDs need to be retrieved * @param owner the owner whose device IDs need to be retrieved
* @param allowingDeviceStatuses statuses of devices need to be retrieved * @param allowingDeviceStatuses statuses of devices need to be retrieved
* @param tenantId the ID of the tenant * @param tenantId the ID of the tenant
* @param deviceOwner owner of the device
* @param deviceName name of the device
* @param deviceStatus status of the device
* @return {@link OwnerWithDeviceDTO} which contains a list of devices related to a user * @return {@link OwnerWithDeviceDTO} which contains a list of devices related to a user
* @throws DeviceManagementDAOException if an error occurs while fetching the data * @throws DeviceManagementDAOException if an error occurs while fetching the data
*/ */
OwnerWithDeviceDTO getOwnersWithDevices(String owner, List<String> allowingDeviceStatuses, int tenantId, int deviceTypeId) OwnerWithDeviceDTO getOwnersWithDevices(String owner, List<String> allowingDeviceStatuses, int tenantId, int deviceTypeId,
throws DeviceManagementDAOException; String deviceOwner, String deviceName, String deviceStatus) throws DeviceManagementDAOException;
/** /**
* Retrieves a list of device IDs with owners and device status. * Retrieves a list of device IDs with owners and device status.
* *
* @param deviceId the deviceId of the device which user need to be retrieved * @param deviceId the deviceId of the device which user need to be retrieved
* @param tenantId the ID of the tenant * @param tenantId the ID of the tenant
* @param deviceOwner owner of the device
* @param deviceName name of the device
* @param deviceStatus status of the device
* @return {@link OwnerWithDeviceDTO} which contains a list of devices * @return {@link OwnerWithDeviceDTO} which contains a list of devices
* @throws DeviceManagementDAOException if an error occurs while fetching the data * @throws DeviceManagementDAOException if an error occurs while fetching the data
*/ */
OwnerWithDeviceDTO getOwnerWithDeviceByDeviceId(int deviceId, int tenantId) OwnerWithDeviceDTO getOwnerWithDeviceByDeviceId(int deviceId, int tenantId, String deviceOwner, String deviceName, String deviceStatus)
throws DeviceManagementDAOException; throws DeviceManagementDAOException;
/** /**
@ -125,9 +131,11 @@ public interface EnrollmentDAO {
* @param tenantId the ID of the tenant * @param tenantId the ID of the tenant
* @param allowingDeviceStatuses the allowed device statuses of devices * @param allowingDeviceStatuses the allowed device statuses of devices
* @param deviceTypeId the device type id * @param deviceTypeId the device type id
* @param deviceOwner owner of the device
* @param deviceStatus status of the device
* @return {@link OwnerWithDeviceDTO} which contains a list of devices related to a user * @return {@link OwnerWithDeviceDTO} which contains a list of devices related to a user
* @throws DeviceManagementDAOException if an error occurs while fetching the data * @throws DeviceManagementDAOException if an error occurs while fetching the data
*/ */
List<DeviceDetailsDTO> getDevicesByTenantId(int tenantId, List<String> allowingDeviceStatuses, int deviceTypeId) List<DeviceDetailsDTO> getDevicesByTenantId(int tenantId, List<String> allowingDeviceStatuses, int deviceTypeId, String deviceOwner,
throws DeviceManagementDAOException; String deviceStatus) throws DeviceManagementDAOException;
} }

@ -476,13 +476,16 @@ public interface GroupDAO {
* @param allowingDeviceStatuses the statuses of devices * @param allowingDeviceStatuses the statuses of devices
* @param deviceTypeId the device type id * @param deviceTypeId the device type id
* @param tenantId Tenant ID * @param tenantId Tenant ID
* @param deviceOwner owner of the device
* @param deviceName name of the device
* @param deviceStatus status of the device
* @param offset the offset for the data set * @param offset the offset for the data set
* @param limit the limit for the data set * @param limit the limit for the data set
* @return {@link GroupDetailsDTO} which containing group details and a list of device IDs * @return {@link GroupDetailsDTO} which containing group details and a list of device IDs
* @throws GroupManagementDAOException if an error occurs while retrieving the group details and devices * @throws GroupManagementDAOException if an error occurs while retrieving the group details and devices
*/ */
GroupDetailsDTO getGroupDetailsWithDevices(String groupName, List<String> allowingDeviceStatuses, int deviceTypeId, GroupDetailsDTO getGroupDetailsWithDevices(String groupName, List<String> allowingDeviceStatuses, int deviceTypeId,
int tenantId, int offset, int limit) int tenantId, String deviceOwner, String deviceName, String deviceStatus, int offset, int limit)
throws GroupManagementDAOException; throws GroupManagementDAOException;
} }

@ -563,8 +563,9 @@ public abstract class AbstractEnrollmentDAOImpl implements EnrollmentDAO {
} }
@Override @Override
public OwnerWithDeviceDTO getOwnersWithDevices(String owner, List<String> allowingDeviceStatuses, int tenantId, int deviceTypeId) public OwnerWithDeviceDTO getOwnersWithDevices(String owner, List<String> allowingDeviceStatuses, int tenantId,
throws DeviceManagementDAOException { int deviceTypeId, String deviceOwner, String deviceName,
String deviceStatus) throws DeviceManagementDAOException {
Connection conn = null; Connection conn = null;
OwnerWithDeviceDTO ownerDetails = new OwnerWithDeviceDTO(); OwnerWithDeviceDTO ownerDetails = new OwnerWithDeviceDTO();
List<Integer> deviceIds = new ArrayList<>(); List<Integer> deviceIds = new ArrayList<>();
@ -578,20 +579,48 @@ public abstract class AbstractEnrollmentDAOImpl implements EnrollmentDAO {
} }
} }
String sql = "SELECT e.DEVICE_ID, e.OWNER, e.STATUS AS DEVICE_STATUS, d.NAME AS DEVICE_NAME, e.DEVICE_TYPE AS DEVICE_TYPE, e.DEVICE_IDENTIFICATION AS DEVICE_IDENTIFICATION " + StringBuilder sql = new StringBuilder(
"SELECT e.DEVICE_ID, " +
"e.OWNER, " +
"e.STATUS AS DEVICE_STATUS, " +
"d.NAME AS DEVICE_NAME, " +
"e.DEVICE_TYPE AS DEVICE_TYPE, " +
"e.DEVICE_IDENTIFICATION AS DEVICE_IDENTIFICATION " +
"FROM DM_ENROLMENT e " + "FROM DM_ENROLMENT e " +
"JOIN DM_DEVICE d ON e.DEVICE_ID = d.ID " + "JOIN DM_DEVICE d ON e.DEVICE_ID = d.ID " +
"WHERE e.OWNER = ? AND e.TENANT_ID = ? AND d.DEVICE_TYPE_ID = ? AND e.STATUS IN (" + deviceFilters.toString() + ")"; "WHERE e.OWNER = ? AND e.TENANT_ID = ? AND d.DEVICE_TYPE_ID = ? AND e.STATUS IN (" + deviceFilters + ")");
if (deviceOwner != null && !deviceOwner.isEmpty()) {
sql.append(" AND e.OWNER LIKE ?");
}
if (deviceName != null && !deviceName.isEmpty()) {
sql.append(" AND d.NAME LIKE ?");
}
if (deviceStatus != null && !deviceStatus.isEmpty()) {
sql.append(" AND e.STATUS = ?");
}
try { try {
conn = this.getConnection(); conn = this.getConnection();
try (PreparedStatement stmt = conn.prepareStatement(sql)) { try (PreparedStatement stmt = conn.prepareStatement(sql.toString())) {
stmt.setString(1, owner); int index = 1;
stmt.setInt(2, tenantId); stmt.setString(index++, owner);
stmt.setInt(3, deviceTypeId); stmt.setInt(index++, tenantId);
for (int i = 0; i < allowingDeviceStatuses.size(); i++) { stmt.setInt(index++, deviceTypeId);
stmt.setString(4 + i, allowingDeviceStatuses.get(i)); for (String status : allowingDeviceStatuses) {
stmt.setString(index++, status);
}
if (deviceOwner != null && !deviceOwner.isEmpty()) {
stmt.setString(index++, "%" + deviceOwner + "%");
}
if (deviceName != null && !deviceName.isEmpty()) {
stmt.setString(index++, "%" + deviceName + "%");
}
if (deviceStatus != null && !deviceStatus.isEmpty()) {
stmt.setString(index++, deviceStatus);
} }
try (ResultSet rs = stmt.executeQuery()) { try (ResultSet rs = stmt.executeQuery()) {
while (rs.next()) { while (rs.next()) {
if (ownerDetails.getUserName() == null) { if (ownerDetails.getUserName() == null) {
@ -599,8 +628,8 @@ public abstract class AbstractEnrollmentDAOImpl implements EnrollmentDAO {
} }
ownerDetails.setDeviceStatus(rs.getString("DEVICE_STATUS")); ownerDetails.setDeviceStatus(rs.getString("DEVICE_STATUS"));
ownerDetails.setDeviceNames(rs.getString("DEVICE_NAME")); ownerDetails.setDeviceNames(rs.getString("DEVICE_NAME"));
ownerDetails.setDeviceTypes("DEVICE_TYPE"); ownerDetails.setDeviceTypes(rs.getString("DEVICE_TYPE"));
ownerDetails.setDeviceIdentifiers("DEVICE_IDENTIFICATION"); ownerDetails.setDeviceIdentifiers(rs.getString("DEVICE_IDENTIFICATION"));
deviceIds.add(rs.getInt("DEVICE_ID")); deviceIds.add(rs.getInt("DEVICE_ID"));
deviceCount++; deviceCount++;
} }
@ -617,25 +646,55 @@ public abstract class AbstractEnrollmentDAOImpl implements EnrollmentDAO {
} }
@Override @Override
public OwnerWithDeviceDTO getOwnerWithDeviceByDeviceId(int deviceId, int tenantId) public OwnerWithDeviceDTO getOwnerWithDeviceByDeviceId(int deviceId, int tenantId, String deviceOwner, String deviceName,
throws DeviceManagementDAOException { String deviceStatus) throws DeviceManagementDAOException {
OwnerWithDeviceDTO deviceOwnerWithStatus = new OwnerWithDeviceDTO(); OwnerWithDeviceDTO deviceOwnerWithStatus = new OwnerWithDeviceDTO();
Connection conn = null; Connection conn = null;
String sql = "SELECT e.DEVICE_ID, e.OWNER, e.STATUS AS DEVICE_STATUS, d.NAME AS DEVICE_NAME, e.DEVICE_TYPE, e.DEVICE_IDENTIFICATION " + List<Integer> deviceIds = new ArrayList<>();
StringBuilder sql = new StringBuilder(
"SELECT e.DEVICE_ID, " +
"e.OWNER, " +
"e.STATUS AS DEVICE_STATUS, " +
"d.NAME AS DEVICE_NAME, " +
"e.DEVICE_TYPE, " +
"e.DEVICE_IDENTIFICATION " +
"FROM DM_ENROLMENT e " + "FROM DM_ENROLMENT e " +
"JOIN DM_DEVICE d ON e.DEVICE_ID = d.ID " + "JOIN DM_DEVICE d ON e.DEVICE_ID = d.ID " +
"WHERE e.DEVICE_ID = ? AND e.TENANT_ID = ?"; "WHERE e.DEVICE_ID = ? AND e.TENANT_ID = ?");
if (deviceOwner != null && !deviceOwner.isEmpty()) {
sql.append(" AND e.OWNER LIKE ?");
}
if (deviceName != null && !deviceName.isEmpty()) {
sql.append(" AND d.NAME LIKE ?");
}
if (deviceStatus != null && !deviceStatus.isEmpty()) {
sql.append(" AND e.STATUS = ?");
}
try { try {
conn = this.getConnection(); conn = this.getConnection();
try (PreparedStatement stmt = conn.prepareStatement(sql)) { try (PreparedStatement stmt = conn.prepareStatement(sql.toString())) {
stmt.setInt(1, deviceId); int paramIndex = 1;
stmt.setInt(2, tenantId); stmt.setInt(paramIndex++, deviceId);
stmt.setInt(paramIndex++, tenantId);
// Set filter parameters if provided
if (deviceOwner != null && !deviceOwner.isEmpty()) {
stmt.setString(paramIndex++, "%" + deviceOwner + "%");
}
if (deviceName != null && !deviceName.isEmpty()) {
stmt.setString(paramIndex++, "%" + deviceName + "%");
}
if (deviceStatus != null && !deviceStatus.isEmpty()) {
stmt.setString(paramIndex++, deviceStatus);
}
try (ResultSet rs = stmt.executeQuery()) { try (ResultSet rs = stmt.executeQuery()) {
if (rs.next()) { if (rs.next()) {
deviceOwnerWithStatus.setUserName(rs.getString("OWNER")); deviceOwnerWithStatus.setUserName(rs.getString("OWNER"));
deviceOwnerWithStatus.setDeviceStatus(rs.getString("DEVICE_STATUS")); deviceOwnerWithStatus.setDeviceStatus(rs.getString("DEVICE_STATUS"));
List<Integer> deviceIds = new ArrayList<>();
deviceIds.add(rs.getInt("DEVICE_ID")); deviceIds.add(rs.getInt("DEVICE_ID"));
deviceOwnerWithStatus.setDeviceIds(deviceIds); deviceOwnerWithStatus.setDeviceIds(deviceIds);
deviceOwnerWithStatus.setDeviceNames(rs.getString("DEVICE_NAME")); deviceOwnerWithStatus.setDeviceNames(rs.getString("DEVICE_NAME"));
@ -653,8 +712,8 @@ public abstract class AbstractEnrollmentDAOImpl implements EnrollmentDAO {
} }
@Override @Override
public List<DeviceDetailsDTO> getDevicesByTenantId(int tenantId, List<String> allowingDeviceStatuses, int deviceTypeId) public List<DeviceDetailsDTO> getDevicesByTenantId(int tenantId, List<String> allowingDeviceStatuses, int deviceTypeId,
throws DeviceManagementDAOException { String deviceOwner, String deviceStatus) throws DeviceManagementDAOException {
List<DeviceDetailsDTO> devices = new ArrayList<>(); List<DeviceDetailsDTO> devices = new ArrayList<>();
if (allowingDeviceStatuses.isEmpty()) { if (allowingDeviceStatuses.isEmpty()) {
return devices; return devices;
@ -668,15 +727,23 @@ public abstract class AbstractEnrollmentDAOImpl implements EnrollmentDAO {
} }
} }
String sql = "SELECT e.DEVICE_ID, e.OWNER, e.STATUS, e.DEVICE_TYPE, e.DEVICE_IDENTIFICATION " + StringBuilder sql = new StringBuilder("SELECT e.DEVICE_ID, e.OWNER, e.STATUS, e.DEVICE_TYPE, e.DEVICE_IDENTIFICATION " +
"FROM DM_ENROLMENT e " + "FROM DM_ENROLMENT e " +
"JOIN DM_DEVICE d ON e.DEVICE_ID = d.ID " + "JOIN DM_DEVICE d ON e.DEVICE_ID = d.ID " +
"WHERE e.TENANT_ID = ? AND e.STATUS IN (" + deviceFilters.toString() + ") AND d.DEVICE_TYPE_ID = ?"; "WHERE e.TENANT_ID = ? AND e.STATUS IN (" + deviceFilters.toString() + ") AND d.DEVICE_TYPE_ID = ?");
if (deviceOwner != null && !deviceOwner.isEmpty()) {
sql.append(" AND e.OWNER LIKE ?");
}
if (deviceStatus != null && !deviceStatus.isEmpty()) {
sql.append(" AND e.STATUS = ?");
}
Connection conn = null; Connection conn = null;
try { try {
conn = this.getConnection(); conn = this.getConnection();
try (PreparedStatement stmt = conn.prepareStatement(sql)) { try (PreparedStatement stmt = conn.prepareStatement(sql.toString())) {
int index = 1; int index = 1;
stmt.setInt(index++, tenantId); stmt.setInt(index++, tenantId);
for (String status : allowingDeviceStatuses) { for (String status : allowingDeviceStatuses) {
@ -684,6 +751,13 @@ public abstract class AbstractEnrollmentDAOImpl implements EnrollmentDAO {
} }
stmt.setInt(index++, deviceTypeId); stmt.setInt(index++, deviceTypeId);
if (deviceOwner != null && !deviceOwner.isEmpty()) {
stmt.setString(index++, "%" + deviceOwner + "%");
}
if (deviceStatus != null && !deviceStatus.isEmpty()) {
stmt.setString(index++, deviceStatus);
}
try (ResultSet rs = stmt.executeQuery()) { try (ResultSet rs = stmt.executeQuery()) {
while (rs.next()) { while (rs.next()) {
DeviceDetailsDTO device = new DeviceDetailsDTO(); DeviceDetailsDTO device = new DeviceDetailsDTO();
@ -703,4 +777,5 @@ public abstract class AbstractEnrollmentDAOImpl implements EnrollmentDAO {
} }
return devices; return devices;
} }
} }

@ -1441,8 +1441,8 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO {
} }
@Override @Override
public GroupDetailsDTO getGroupDetailsWithDevices(String groupName, List<String> allowedStatuses, int deviceTypeId, public GroupDetailsDTO getGroupDetailsWithDevices(String groupName, List<String> allowedStatuses, int deviceTypeId, int tenantId,
int tenantId, int offset, int limit) String deviceOwner, String deviceName, String deviceStatus, int offset, int limit)
throws GroupManagementDAOException { throws GroupManagementDAOException {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Request received in DAO Layer to get group details and device IDs for group: " + groupName); log.debug("Request received in DAO Layer to get group details and device IDs for group: " + groupName);
@ -1455,15 +1455,15 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO {
Map<Integer, String> deviceTypes = new HashMap<>(); Map<Integer, String> deviceTypes = new HashMap<>();
Map<Integer, String> deviceIdentifiers = new HashMap<>(); Map<Integer, String> deviceIdentifiers = new HashMap<>();
StringBuilder deviceFilters = new StringBuilder(); StringBuilder statusPlaceholders = new StringBuilder();
for (int i = 0; i < allowedStatuses.size(); i++) { for (int i = 0; i < allowedStatuses.size(); i++) {
deviceFilters.append("?"); statusPlaceholders.append("?");
if (i < allowedStatuses.size() - 1) { if (i < allowedStatuses.size() - 1) {
deviceFilters.append(","); statusPlaceholders.append(",");
} }
} }
String sql = StringBuilder sql = new StringBuilder(
"SELECT " + "SELECT " +
" g.ID AS GROUP_ID, " + " g.ID AS GROUP_ID, " +
" g.GROUP_NAME, " + " g.GROUP_NAME, " +
@ -1483,13 +1483,24 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO {
" g.GROUP_NAME = ? " + " g.GROUP_NAME = ? " +
" AND g.TENANT_ID = ? " + " AND g.TENANT_ID = ? " +
" AND d.DEVICE_TYPE_ID = ? " + " AND d.DEVICE_TYPE_ID = ? " +
" AND e.STATUS IN (" + deviceFilters.toString() + ") " + " AND e.STATUS IN (" + statusPlaceholders + ")");
"LIMIT ? OFFSET ?";
if (deviceOwner != null && !deviceOwner.isEmpty()) {
sql.append(" AND e.OWNER LIKE ?");
}
if (deviceName != null && !deviceName.isEmpty()) {
sql.append(" AND d.NAME LIKE ?");
}
if (deviceStatus != null && !deviceStatus.isEmpty()) {
sql.append(" AND e.STATUS = ?");
}
sql.append(" LIMIT ? OFFSET ?");
Connection conn = null; Connection conn = null;
try { try {
conn = GroupManagementDAOFactory.getConnection(); conn = GroupManagementDAOFactory.getConnection();
try (PreparedStatement stmt = conn.prepareStatement(sql)) { try (PreparedStatement stmt = conn.prepareStatement(sql.toString())) {
int index = 1; int index = 1;
stmt.setString(index++, groupName); stmt.setString(index++, groupName);
stmt.setInt(index++, tenantId); stmt.setInt(index++, tenantId);
@ -1497,6 +1508,17 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO {
for (String status : allowedStatuses) { for (String status : allowedStatuses) {
stmt.setString(index++, status); stmt.setString(index++, status);
} }
if (deviceOwner != null && !deviceOwner.isEmpty()) {
stmt.setString(index++, "%" + deviceOwner + "%");
}
if (deviceName != null && !deviceName.isEmpty()) {
stmt.setString(index++, "%" + deviceName + "%");
}
if (deviceStatus != null && !deviceStatus.isEmpty()) {
stmt.setString(index++, deviceStatus);
}
stmt.setInt(index++, limit); stmt.setInt(index++, limit);
stmt.setInt(index++, offset); stmt.setInt(index++, offset);
@ -1516,15 +1538,15 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO {
deviceIdentifiers.put(deviceId, rs.getString("DEVICE_IDENTIFICATION")); deviceIdentifiers.put(deviceId, rs.getString("DEVICE_IDENTIFICATION"));
} }
} }
groupDetails.setDeviceIds(deviceIds);
groupDetails.setDeviceCount(deviceIds.size());
groupDetails.setDeviceOwners(deviceOwners);
groupDetails.setDeviceStatuses(deviceStatuses);
groupDetails.setDeviceNames(deviceNames);
groupDetails.setDeviceTypes(deviceTypes);
groupDetails.setDeviceIdentifiers(deviceIdentifiers);
return groupDetails;
} }
groupDetails.setDeviceIds(deviceIds);
groupDetails.setDeviceCount(deviceIds.size());
groupDetails.setDeviceOwners(deviceOwners);
groupDetails.setDeviceStatuses(deviceStatuses);
groupDetails.setDeviceNames(deviceNames);
groupDetails.setDeviceTypes(deviceTypes);
groupDetails.setDeviceIdentifiers(deviceIdentifiers);
return groupDetails;
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while retrieving group details and device IDs for group: " + groupName; String msg = "Error occurred while retrieving group details and device IDs for group: " + groupName;
log.error(msg, e); log.error(msg, e);

@ -1074,29 +1074,40 @@ public interface DeviceManagementProviderService {
* Get owner details and device IDs for a given owner and tenant. * Get owner details and device IDs for a given owner and tenant.
* *
* @param owner the name of the owner. * @param owner the name of the owner.
* @param deviceTypeId the device type id * @param deviceTypeId the device type id]
* @param deviceOwner owner of the device
* @param deviceName name of the device
* @param deviceStatus status of the device
* @return {@link OwnerWithDeviceDTO} which contains a list of devices related to a user. * @return {@link OwnerWithDeviceDTO} which contains a list of devices related to a user.
* @throws DeviceManagementException if an error occurs while fetching owner details. * @throws DeviceManagementException if an error occurs while fetching owner details.
*/ */
OwnerWithDeviceDTO getOwnersWithDeviceIds(String owner, int deviceTypeId) throws DeviceManagementDAOException; OwnerWithDeviceDTO getOwnersWithDeviceIds(String owner, int deviceTypeId, String deviceOwner, String deviceName, String deviceStatus)
throws DeviceManagementDAOException;
/** /**
* Get owner details and device IDs for a given owner and tenant. * Get owner details and device IDs for a given owner and tenant.
* *
* @param deviceId the deviceId of the device. * @param deviceId the deviceId of the device.
* @param deviceOwner owner of the device
* @param deviceName name of the device
* @param deviceStatus status of the device
* @return {@link OwnerWithDeviceDTO} which contains a list of devices related to a user. * @return {@link OwnerWithDeviceDTO} which contains a list of devices related to a user.
* @throws DeviceManagementException if an error occurs while fetching owner details. * @throws DeviceManagementException if an error occurs while fetching owner details.
*/ */
OwnerWithDeviceDTO getOwnerWithDeviceByDeviceId(int deviceId) throws DeviceManagementDAOException; OwnerWithDeviceDTO getOwnerWithDeviceByDeviceId(int deviceId, String deviceOwner, String deviceName, String deviceStatus)
throws DeviceManagementDAOException;
/** /**
* Get owner details and device IDs for a given owner and tenant. * Get owner details and device IDs for a given owner and tenant.
* @param tenantId the tenant id which devices need to be retried * @param tenantId the tenant id which devices need to be retried
* @param deviceTypeId the device type id * @param deviceTypeId the device type id
* @param deviceOwner owner of the device
* @param deviceStatus status of the device
* @return {@link DeviceDetailsDTO} which contains devices details. * @return {@link DeviceDetailsDTO} which contains devices details.
* @throws DeviceManagementException if an error occurs while fetching owner details. * @throws DeviceManagementException if an error occurs while fetching owner details.
*/ */
List<DeviceDetailsDTO> getDevicesByTenantId(int tenantId, int deviceTypeId) throws DeviceManagementDAOException; List<DeviceDetailsDTO> getDevicesByTenantId(int tenantId, int deviceTypeId, String deviceOwner, String deviceStatus)
throws DeviceManagementDAOException;
/** /**
* Get operation details by operation code. * Get operation details by operation code.

@ -5362,7 +5362,8 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
} }
@Override @Override
public OwnerWithDeviceDTO getOwnersWithDeviceIds(String owner, int deviceTypeId) throws DeviceManagementDAOException { public OwnerWithDeviceDTO getOwnersWithDeviceIds(String owner, int deviceTypeId, String deviceOwner, String deviceName, String deviceStatus)
throws DeviceManagementDAOException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
OwnerWithDeviceDTO ownerWithDeviceDTO; OwnerWithDeviceDTO ownerWithDeviceDTO;
@ -5373,7 +5374,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
try { try {
DeviceManagementDAOFactory.openConnection(); DeviceManagementDAOFactory.openConnection();
ownerWithDeviceDTO = this.enrollmentDAO.getOwnersWithDevices(owner, allowingDeviceStatuses, tenantId, deviceTypeId); ownerWithDeviceDTO = this.enrollmentDAO.getOwnersWithDevices(owner, allowingDeviceStatuses, tenantId, deviceTypeId, deviceOwner, deviceName, deviceStatus);
if (ownerWithDeviceDTO == null) { if (ownerWithDeviceDTO == null) {
String msg = "No data found for owner: " + owner; String msg = "No data found for owner: " + owner;
log.error(msg); log.error(msg);
@ -5397,13 +5398,14 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
@Override @Override
public OwnerWithDeviceDTO getOwnerWithDeviceByDeviceId(int deviceId) throws DeviceManagementDAOException { public OwnerWithDeviceDTO getOwnerWithDeviceByDeviceId(int deviceId, String deviceOwner, String deviceName, String deviceStatus)
throws DeviceManagementDAOException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
OwnerWithDeviceDTO deviceOwnerWithStatus; OwnerWithDeviceDTO deviceOwnerWithStatus;
try { try {
DeviceManagementDAOFactory.openConnection(); DeviceManagementDAOFactory.openConnection();
deviceOwnerWithStatus = enrollmentDAO.getOwnerWithDeviceByDeviceId(deviceId, tenantId); deviceOwnerWithStatus = enrollmentDAO.getOwnerWithDeviceByDeviceId(deviceId, tenantId, deviceOwner, deviceName, deviceStatus);
if (deviceOwnerWithStatus == null) { if (deviceOwnerWithStatus == null) {
throw new DeviceManagementDAOException("No data found for device ID: " + deviceId); throw new DeviceManagementDAOException("No data found for device ID: " + deviceId);
} }
@ -5424,7 +5426,8 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
} }
@Override @Override
public List<DeviceDetailsDTO> getDevicesByTenantId(int tenantId, int deviceTypeId) throws DeviceManagementDAOException { public List<DeviceDetailsDTO> getDevicesByTenantId(int tenantId, int deviceTypeId, String deviceOwner, String deviceStatus)
throws DeviceManagementDAOException {
List<DeviceDetailsDTO> devices; List<DeviceDetailsDTO> devices;
List<String> allowingDeviceStatuses = new ArrayList<>(); List<String> allowingDeviceStatuses = new ArrayList<>();
allowingDeviceStatuses.add(EnrolmentInfo.Status.ACTIVE.toString()); allowingDeviceStatuses.add(EnrolmentInfo.Status.ACTIVE.toString());
@ -5432,7 +5435,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
allowingDeviceStatuses.add(EnrolmentInfo.Status.UNREACHABLE.toString()); allowingDeviceStatuses.add(EnrolmentInfo.Status.UNREACHABLE.toString());
try { try {
DeviceManagementDAOFactory.openConnection(); DeviceManagementDAOFactory.openConnection();
devices = enrollmentDAO.getDevicesByTenantId(tenantId, allowingDeviceStatuses, deviceTypeId); devices = enrollmentDAO.getDevicesByTenantId(tenantId, allowingDeviceStatuses, deviceTypeId, deviceOwner, deviceStatus);
if (devices == null || devices.isEmpty()) { if (devices == null || devices.isEmpty()) {
String msg = "No devices found for tenant ID: " + tenantId; String msg = "No devices found for tenant ID: " + tenantId;
log.error(msg); log.error(msg);

@ -378,11 +378,15 @@ public interface GroupManagementProviderService {
* *
* @param groupName the name of the group. * @param groupName the name of the group.
* @param deviceTypeId the device type id * @param deviceTypeId the device type id
* @param deviceOwner owner of the device
* @param deviceName name of the device
* @param deviceStatus status of the device
* @param offset the offset for the data set * @param offset the offset for the data set
* @param limit the limit for the data set * @param limit the limit for the data set
* @return {@link GroupDetailsDTO} which containing group details and a list of device IDs * @return {@link GroupDetailsDTO} which containing group details and a list of device IDs
* @throws GroupManagementException if an error occurs while fetching group details. * @throws GroupManagementException if an error occurs while fetching group details.
*/ */
GroupDetailsDTO getGroupDetailsWithDevices(String groupName, int deviceTypeId, int offset, int limit) throws GroupManagementException; GroupDetailsDTO getGroupDetailsWithDevices(String groupName, int deviceTypeId, String deviceOwner, String deviceName, String deviceStatus,
int offset, int limit) throws GroupManagementException;
} }

@ -17,7 +17,12 @@
*/ */
package io.entgra.device.mgt.core.device.mgt.core.service; 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.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.GroupPaginationRequest;
import io.entgra.device.mgt.core.device.mgt.common.PaginationResult;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; 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.exceptions.DeviceNotFoundException;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException;
@ -26,6 +31,7 @@ import io.entgra.device.mgt.core.device.mgt.core.geo.task.GeoFenceEventOperation
import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder;
import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationMgtConstants; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationMgtConstants;
import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil;
import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo;
import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; 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.DeviceGroupConstants;
import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroupRoleWrapper; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroupRoleWrapper;
@ -1690,8 +1696,8 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
} }
@Override @Override
public GroupDetailsDTO getGroupDetailsWithDevices(String groupName, int deviceTypeId, int offset, int limit) public GroupDetailsDTO getGroupDetailsWithDevices(String groupName, int deviceTypeId, String deviceOwner, String deviceName, String deviceStatus,
throws GroupManagementException { int offset, int limit) throws GroupManagementException {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Retrieving group details and device IDs for group: " + groupName); log.debug("Retrieving group details and device IDs for group: " + groupName);
} }
@ -1705,7 +1711,7 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
try { try {
GroupManagementDAOFactory.openConnection(); GroupManagementDAOFactory.openConnection();
groupDetailsWithDevices = this.groupDAO.getGroupDetailsWithDevices(groupName, allowingDeviceStatuses, groupDetailsWithDevices = this.groupDAO.getGroupDetailsWithDevices(groupName, allowingDeviceStatuses,
deviceTypeId, tenantId, offset, limit); deviceTypeId, tenantId, deviceOwner, deviceName, deviceStatus, offset, limit);
} catch (GroupManagementDAOException | SQLException e) { } catch (GroupManagementDAOException | SQLException e) {
String msg = "Error occurred while retrieving group details and device IDs for group: " + groupName; String msg = "Error occurred while retrieving group details and device IDs for group: " + groupName;
log.error(msg, e); log.error(msg, e);

@ -384,6 +384,7 @@
<Scope>win:ops:device-info</Scope> <Scope>win:ops:device-info</Scope>
<Scope>win:ops:security-info</Scope> <Scope>win:ops:security-info</Scope>
<Scope>win:ops:firewall-info</Scope> <Scope>win:ops:firewall-info</Scope>
<Scope>win:ops:os-updates-info</Scope>
<Scope>admin:tenant:view</Scope> <Scope>admin:tenant:view</Scope>
<Scope>dm:admin:devices:usage:view</Scope> <Scope>dm:admin:devices:usage:view</Scope>
<Scope>and:ops:clear-app</Scope> <Scope>and:ops:clear-app</Scope>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>heartbeat-management</artifactId> <artifactId>heartbeat-management</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>identity-extensions</artifactId> <artifactId>identity-extensions</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>identity-extensions</artifactId> <artifactId>identity-extensions</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -23,7 +23,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>logger</artifactId> <artifactId>logger</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
</parent> </parent>
<artifactId>io.entgra.device.mgt.core.notification.logger</artifactId> <artifactId>io.entgra.device.mgt.core.notification.logger</artifactId>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>operation-template-mgt</artifactId> <artifactId>operation-template-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -23,7 +23,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -20,7 +20,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>subtype-mgt</artifactId> <artifactId>subtype-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -20,7 +20,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -20,7 +20,7 @@
<parent> <parent>
<artifactId>task-manager</artifactId> <artifactId>task-manager</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>task-manager</artifactId> <artifactId>task-manager</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>task-mgt</artifactId> <artifactId>task-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>task-watcher</artifactId> <artifactId>task-watcher</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>task-mgt</artifactId> <artifactId>task-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -20,7 +20,7 @@
<parent> <parent>
<artifactId>tenant-mgt</artifactId> <artifactId>tenant-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -20,7 +20,7 @@
<parent> <parent>
<artifactId>tenant-mgt</artifactId> <artifactId>tenant-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -20,7 +20,7 @@
<parent> <parent>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>email-sender</artifactId> <artifactId>email-sender</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>transport-mgt</artifactId> <artifactId>transport-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>sms-handler</artifactId> <artifactId>sms-handler</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>sms-handler</artifactId> <artifactId>sms-handler</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>sms-handler</artifactId> <artifactId>sms-handler</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>transport-mgt</artifactId> <artifactId>transport-mgt</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>ui-request-interceptor</artifactId> <artifactId>ui-request-interceptor</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>webapp-authenticator-framework</artifactId> <artifactId>webapp-authenticator-framework</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>grafana-mgt-feature</artifactId> <artifactId>grafana-mgt-feature</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>grafana-mgt-feature</artifactId> <artifactId>grafana-mgt-feature</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>analytics-mgt-feature</artifactId> <artifactId>analytics-mgt-feature</artifactId>
<version>5.1.1-SNAPSHOT</version> <version>5.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save