Refactored the code in subscription management.

-This commit addresses an improvement to code redundancy and repetition.

Testing:
- Verified successful installation on multiple environments.
pull/483/head
Ruwin Dissanayake 3 months ago
parent 0ee4412770
commit 32ff2cfe93

@ -252,7 +252,6 @@ public interface SubscriptionManager {
SubscriptionResponse getStatusBaseSubscriptions(SubscriptionInfo subscriptionInfo, int limit, int offset) SubscriptionResponse getStatusBaseSubscriptions(SubscriptionInfo subscriptionInfo, int limit, int offset)
throws ApplicationManagementException; throws ApplicationManagementException;
/** /**
* Get subscription statistics related data describes by the {@link SubscriptionInfo} * Get subscription statistics related data describes by the {@link SubscriptionInfo}
* @param subscriptionInfo {@link SubscriptionInfo} * @param subscriptionInfo {@link SubscriptionInfo}

@ -19,13 +19,42 @@
package io.entgra.device.mgt.core.application.mgt.core.impl; package io.entgra.device.mgt.core.application.mgt.core.impl;
import com.google.gson.Gson; import com.google.gson.Gson;
import io.entgra.device.mgt.core.application.mgt.common.*; import io.entgra.device.mgt.core.application.mgt.common.ApplicationInstallResponse;
import io.entgra.device.mgt.core.application.mgt.common.dto.*; import io.entgra.device.mgt.core.application.mgt.common.ApplicationSubscriptionInfo;
import io.entgra.device.mgt.core.application.mgt.common.ApplicationType;
import io.entgra.device.mgt.core.application.mgt.common.CategorizedSubscriptionResult;
import io.entgra.device.mgt.core.application.mgt.common.DeviceSubscription;
import io.entgra.device.mgt.core.application.mgt.common.DeviceSubscriptionData;
import io.entgra.device.mgt.core.application.mgt.common.DeviceSubscriptionFilterCriteria;
import io.entgra.device.mgt.core.application.mgt.common.DeviceTypes;
import io.entgra.device.mgt.core.application.mgt.common.ExecutionStatus;
import io.entgra.device.mgt.core.application.mgt.common.SubAction;
import io.entgra.device.mgt.core.application.mgt.common.SubscribingDeviceIdHolder;
import io.entgra.device.mgt.core.application.mgt.common.SubscriptionEntity;
import io.entgra.device.mgt.core.application.mgt.common.SubscriptionInfo;
import io.entgra.device.mgt.core.application.mgt.common.SubscriptionMetadata;
import io.entgra.device.mgt.core.application.mgt.common.SubscriptionResponse;
import io.entgra.device.mgt.core.application.mgt.common.SubscriptionStatistics;
import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationPolicyDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.CategorizedSubscriptionCountsDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.DeviceOperationDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.DeviceSubscriptionDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.ScheduledSubscriptionDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.SubscriptionStatisticDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.VppAssetDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.VppUserDTO;
import io.entgra.device.mgt.core.application.mgt.common.services.VPPApplicationManager; import io.entgra.device.mgt.core.application.mgt.common.services.VPPApplicationManager;
import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationReleaseDAO; import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationReleaseDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.VppApplicationDAO; import io.entgra.device.mgt.core.application.mgt.core.dao.VppApplicationDAO;
import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException;
import io.entgra.device.mgt.core.application.mgt.core.util.SubscriptionManagementHelperUtil; import io.entgra.device.mgt.core.application.mgt.core.util.SubscriptionManagementHelperUtil;
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.EnrolmentInfo;
import io.entgra.device.mgt.core.device.mgt.common.MDMAppConstants;
import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest;
import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; import io.entgra.device.mgt.core.device.mgt.common.PaginationResult;
import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants;
@ -70,7 +99,6 @@ import io.entgra.device.mgt.core.application.mgt.core.util.ConnectionManagerUtil
import io.entgra.device.mgt.core.application.mgt.core.util.Constants; import io.entgra.device.mgt.core.application.mgt.core.util.Constants;
import io.entgra.device.mgt.core.application.mgt.core.util.HelperUtil; import io.entgra.device.mgt.core.application.mgt.core.util.HelperUtil;
import io.entgra.device.mgt.core.application.mgt.core.util.OAuthUtils; import io.entgra.device.mgt.core.application.mgt.core.util.OAuthUtils;
import io.entgra.device.mgt.core.device.mgt.common.*;
import io.entgra.device.mgt.core.device.mgt.common.app.mgt.App; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.App;
import io.entgra.device.mgt.core.device.mgt.common.app.mgt.MobileAppTypes; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.MobileAppTypes;
import io.entgra.device.mgt.core.device.mgt.common.app.mgt.android.CustomApplication; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.android.CustomApplication;
@ -103,7 +131,16 @@ import java.net.URL;
import java.security.KeyManagementException; import java.security.KeyManagementException;
import java.security.KeyStoreException; import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -165,7 +202,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
// Only for iOS devices // Only for iOS devices
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
// Ignore checking device type if app is a web clip // Ignore checking device type if app is a web clip
if(!applicationDTO.getType().equals("WEB_CLIP")){ if (!applicationDTO.getType().equals("WEB_CLIP")) {
if (DeviceTypes.IOS.toString().equalsIgnoreCase(APIUtil.getDeviceTypeData(applicationDTO if (DeviceTypes.IOS.toString().equalsIgnoreCase(APIUtil.getDeviceTypeData(applicationDTO
.getDeviceTypeId()).getName())) { .getDeviceTypeId()).getName())) {
// TODO: replace getAssetByAppId with the correct one in DAO // TODO: replace getAssetByAppId with the correct one in DAO
@ -495,7 +532,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
* @throws ApplicationManagementException if error occurred while getting Application subscription info * @throws ApplicationManagementException if error occurred while getting Application subscription info
*/ */
private <T> ApplicationSubscriptionInfo getAppSubscriptionInfo(ApplicationDTO applicationDTO, String subType, private <T> ApplicationSubscriptionInfo getAppSubscriptionInfo(ApplicationDTO applicationDTO, String subType,
List<T> params) throws ApplicationManagementException { List<T> params) throws ApplicationManagementException {
DeviceManagementProviderService deviceManagementProviderService = HelperUtil DeviceManagementProviderService deviceManagementProviderService = HelperUtil
.getDeviceManagementProviderService(); .getDeviceManagementProviderService();
@ -542,7 +579,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
String username = (String) param; String username = (String) param;
subscribers.add(username); subscribers.add(username);
devices.addAll(deviceManagementProviderService.getDevicesOfUser(username, devices.addAll(deviceManagementProviderService.getDevicesOfUser(username,
allowingDeviceStatuses, false )); allowingDeviceStatuses, false));
} }
} else { } else {
if (SubscriptionType.ROLE.toString().equalsIgnoreCase(subType)) { if (SubscriptionType.ROLE.toString().equalsIgnoreCase(subType)) {
@ -608,7 +645,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
* @throws ApplicationManagementException if error occurred while getting or updating subscription data. * @throws ApplicationManagementException if error occurred while getting or updating subscription data.
*/ */
private void updateSubscriptionsForEntInstall(int applicationReleaseId, List<Integer> appSubscribingDeviceIds, private void updateSubscriptionsForEntInstall(int applicationReleaseId, List<Integer> appSubscribingDeviceIds,
List<Integer> appReSubscribingDeviceIds, List<String> params, String subType, String action) List<Integer> appReSubscribingDeviceIds, List<String> params, String subType, String action)
throws ApplicationManagementException { throws ApplicationManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername(); String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
@ -679,14 +716,14 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
/** /**
* This method perform given action (i.e APP INSTALL or APP UNINSTALL) on given set of devices. * This method perform given action (i.e APP INSTALL or APP UNINSTALL) on given set of devices.
* *
* @param deviceType Application supported device type. * @param deviceType Application supported device type.
* @param devices List of devices that action is triggered. * @param devices List of devices that action is triggered.
* @param applicationDTO Application data * @param applicationDTO Application data
* @param subType Subscription type (i.e USER, ROLE, GROUP or DEVICE) * @param subType Subscription type (i.e USER, ROLE, GROUP or DEVICE)
* @param subscribers Subscribers * @param subscribers Subscribers
* @param action Performing action. (i.e INSTALL or UNINSTALL) * @param action Performing action. (i.e INSTALL or UNINSTALL)
* @param isOperationReExecutingDisabled To prevent adding the application subscribing operation to devices that are * @param isOperationReExecutingDisabled To prevent adding the application subscribing operation to devices that are
* already subscribed application successfully. * already subscribed application successfully.
* @return {@link ApplicationInstallResponse} * @return {@link ApplicationInstallResponse}
* @throws ApplicationManagementException if error occurred when adding operation on device or updating subscription * @throws ApplicationManagementException if error occurred when adding operation on device or updating subscription
* data. * data.
@ -905,7 +942,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
* @throws ApplicationManagementException if error occurred while getting or updating subscription data. * @throws ApplicationManagementException if error occurred while getting or updating subscription data.
*/ */
private void updateSubscriptions(int applicationReleaseId, List<Activity> activities, private void updateSubscriptions(int applicationReleaseId, List<Activity> activities,
SubscribingDeviceIdHolder subscribingDeviceIdHolder, List<String> params, String subType, String action) SubscribingDeviceIdHolder subscribingDeviceIdHolder, List<String> params, String subType, String action)
throws ApplicationManagementException { throws ApplicationManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername(); String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
@ -981,7 +1018,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
* @throws ApplicationManagementDAOException if error occurred while updating or inserting subscriber entities * @throws ApplicationManagementDAOException if error occurred while updating or inserting subscriber entities
*/ */
private void updateBulkSubscribers(int applicationReleaseId, List<String> params, String subType, String action, private void updateBulkSubscribers(int applicationReleaseId, List<String> params, String subType, String action,
int tenantId, String username) throws ApplicationManagementDAOException { int tenantId, String username) throws ApplicationManagementDAOException {
List<String> subscribedEntities = new ArrayList<>(); List<String> subscribedEntities = new ArrayList<>();
if (SubscriptionType.USER.toString().equalsIgnoreCase(subType)) { if (SubscriptionType.USER.toString().equalsIgnoreCase(subType)) {
subscribedEntities = subscriptionDAO.getAppSubscribedUserNames(params, applicationReleaseId, tenantId); subscribedEntities = subscriptionDAO.getAppSubscribedUserNames(params, applicationReleaseId, tenantId);
@ -1067,7 +1104,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
* @throws ApplicationManagementException if found an invalid device. * @throws ApplicationManagementException if found an invalid device.
*/ */
private Activity addAppOperationOnDevices(ApplicationDTO applicationDTO, private Activity addAppOperationOnDevices(ApplicationDTO applicationDTO,
List<DeviceIdentifier> deviceIdentifierList, String deviceType, String action, Properties properties) List<DeviceIdentifier> deviceIdentifierList, String deviceType, String action, Properties properties)
throws ApplicationManagementException { throws ApplicationManagementException {
DeviceManagementProviderService deviceManagementProviderService = HelperUtil DeviceManagementProviderService deviceManagementProviderService = HelperUtil
.getDeviceManagementProviderService(); .getDeviceManagementProviderService();
@ -1217,10 +1254,11 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
/** /**
* Get the bundle id of the iOS public application. * Get the bundle id of the iOS public application.
*
* @param appId Application Id * @param appId Application Id
* @return {@link String} bundle Id * @return {@link String} bundle Id
* @throws ApplicationManagementException if error occurred while getting the bundle if of the requesting public * @throws ApplicationManagementException if error occurred while getting the bundle if of the requesting public
* application * application
*/ */
private String getBundleId(String appId) throws ApplicationManagementException { private String getBundleId(String appId) throws ApplicationManagementException {
try { try {
@ -1261,7 +1299,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
throws SubscriptionManagementException { throws SubscriptionManagementException {
try { try {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
List<Integer> operationIds = getOperationIdsForSubId(subId, tenantId); List<Integer> operationIds = getOperationIdsForSubId(subId, tenantId);
APIUtil.getApplicationManager().updateSubStatus(deviceId, operationIds, status); APIUtil.getApplicationManager().updateSubStatus(deviceId, operationIds, status);
} catch (DBConnectionException e) { } catch (DBConnectionException e) {
String msg = "Error occurred while observing the database connection to get operation Ids for " + subId; String msg = "Error occurred while observing the database connection to get operation Ids for " + subId;
@ -1309,7 +1347,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
public int installEnrollmentApplications(ApplicationPolicyDTO applicationPolicyDTO) public int installEnrollmentApplications(ApplicationPolicyDTO applicationPolicyDTO)
throws ApplicationManagementException { throws ApplicationManagementException {
String requestUrl =null; String requestUrl = null;
try { try {
requestUrl = Constants.ApplicationInstall.ENROLLMENT_APP_INSTALL_PROTOCOL + System requestUrl = Constants.ApplicationInstall.ENROLLMENT_APP_INSTALL_PROTOCOL + System
.getProperty(Constants.ApplicationInstall.IOT_GATEWAY_HOST) + Constants.ApplicationInstall.COLON .getProperty(Constants.ApplicationInstall.IOT_GATEWAY_HOST) + Constants.ApplicationInstall.COLON
@ -1320,7 +1358,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
HttpPost httpPost = new HttpPost(requestUrl); HttpPost httpPost = new HttpPost(requestUrl);
StringEntity stringEntity = new StringEntity(payload, Constants.ApplicationInstall.ENCODING); StringEntity stringEntity = new StringEntity(payload, Constants.ApplicationInstall.ENCODING);
httpPost.addHeader("Content-Type",MediaType.APPLICATION_JSON); httpPost.addHeader("Content-Type", MediaType.APPLICATION_JSON);
httpPost.setEntity(stringEntity); httpPost.setEntity(stringEntity);
return invokeIOTCoreAPI(httpPost); return invokeIOTCoreAPI(httpPost);
} catch (UserStoreException e) { } catch (UserStoreException e) {
@ -1346,7 +1384,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
builder.loadTrustMaterial(null, new TrustSelfSignedStrategy()); builder.loadTrustMaterial(null, new TrustSelfSignedStrategy());
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(builder.build()); SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(builder.build());
return HttpClients.custom().setSSLSocketFactory(sslsf).useSystemProperties().build(); return HttpClients.custom().setSSLSocketFactory(sslsf).useSystemProperties().build();
} catch (NoSuchAlgorithmException e) { } catch (NoSuchAlgorithmException e) {
String msg = "Failed while building the http client for EntApp installation. " + String msg = "Failed while building the http client for EntApp installation. " +
"Used SSL algorithm not available"; "Used SSL algorithm not available";
log.error(msg, e); log.error(msg, e);
@ -1674,17 +1712,18 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
/** /**
* Get subscription data describes by {@link SubscriptionInfo} entity * Get subscription data describes by {@link SubscriptionInfo} entity
*
* @param subscriptionInfo {@link SubscriptionInfo} * @param subscriptionInfo {@link SubscriptionInfo}
* @param limit Limit value * @param limit Limit value
* @param offset Offset value * @param offset Offset value
* @return {@link SubscriptionResponse} * @return {@link SubscriptionResponse}
* @throws ApplicationManagementException Throws when error encountered while getting subscription data * @throws ApplicationManagementException Throws when error encountered while getting subscription data
*/ */
@Override @Override
public SubscriptionResponse getSubscriptions(SubscriptionInfo subscriptionInfo, int limit, int offset) public SubscriptionResponse getSubscriptions(SubscriptionInfo subscriptionInfo, int limit, int offset)
throws ApplicationManagementException { throws ApplicationManagementException {
final boolean isUnsubscribe = Objects.equals(SubscriptionMetadata.SUBSCRIPTION_STATUS_UNSUBSCRIBED, subscriptionInfo.getSubscriptionStatus()); final boolean isUnsubscribe = Objects.equals(SubscriptionMetadata.SUBSCRIPTION_STATUS_UNSUBSCRIBED,
subscriptionInfo.getSubscriptionStatus());
final int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); final int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
try { try {
ConnectionManagerUtil.openDBConnection(); ConnectionManagerUtil.openDBConnection();
@ -1702,13 +1741,15 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
int subscriptionCount = isUnsubscribe ? subscriptionDAO.getGroupUnsubscriptionCount(applicationReleaseDTO.getId(), tenantId) : int subscriptionCount = isUnsubscribe ? subscriptionDAO.getGroupUnsubscriptionCount(applicationReleaseDTO.getId(), tenantId) :
subscriptionDAO.getGroupSubscriptionCount(applicationReleaseDTO.getId(), tenantId); subscriptionDAO.getGroupSubscriptionCount(applicationReleaseDTO.getId(), tenantId);
return new SubscriptionResponse(subscriptionInfo.getApplicationUUID(), subscriptionCount, subscriptionEntities); return new SubscriptionResponse(subscriptionInfo.getApplicationUUID(), subscriptionCount, subscriptionEntities);
} if (Objects.equals(subscriptionInfo.getSubscriptionType(), SubscriptionMetadata.SubscriptionTypes.ROLE)){ }
if (Objects.equals(subscriptionInfo.getSubscriptionType(), SubscriptionMetadata.SubscriptionTypes.ROLE)) {
List<SubscriptionEntity> subscriptionEntities = subscriptionDAO. List<SubscriptionEntity> subscriptionEntities = subscriptionDAO.
getRoleSubscriptionsByAppReleaseID(applicationReleaseDTO.getId(), isUnsubscribe, tenantId, offset, limit); getRoleSubscriptionsByAppReleaseID(applicationReleaseDTO.getId(), isUnsubscribe, tenantId, offset, limit);
int subscriptionCount = isUnsubscribe ? subscriptionDAO.getRoleUnsubscriptionCount(applicationReleaseDTO.getId(), tenantId) : int subscriptionCount = isUnsubscribe ? subscriptionDAO.getRoleUnsubscriptionCount(applicationReleaseDTO.getId(), tenantId) :
subscriptionDAO.getRoleSubscriptionCount(applicationReleaseDTO.getId(), tenantId); subscriptionDAO.getRoleSubscriptionCount(applicationReleaseDTO.getId(), tenantId);
return new SubscriptionResponse(subscriptionInfo.getApplicationUUID(), subscriptionCount, subscriptionEntities); return new SubscriptionResponse(subscriptionInfo.getApplicationUUID(), subscriptionCount, subscriptionEntities);
} if (Objects.equals(subscriptionInfo.getSubscriptionType(), SubscriptionMetadata.SubscriptionTypes.USER)){ }
if (Objects.equals(subscriptionInfo.getSubscriptionType(), SubscriptionMetadata.SubscriptionTypes.USER)) {
List<SubscriptionEntity> subscriptionEntities = subscriptionDAO. List<SubscriptionEntity> subscriptionEntities = subscriptionDAO.
getUserSubscriptionsByAppReleaseID(applicationReleaseDTO.getId(), isUnsubscribe, tenantId, offset, limit); getUserSubscriptionsByAppReleaseID(applicationReleaseDTO.getId(), isUnsubscribe, tenantId, offset, limit);
int subscriptionCount = isUnsubscribe ? subscriptionDAO.getUserUnsubscriptionCount(applicationReleaseDTO.getId(), tenantId) : int subscriptionCount = isUnsubscribe ? subscriptionDAO.getUserUnsubscriptionCount(applicationReleaseDTO.getId(), tenantId) :
@ -1717,7 +1758,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
} else { } else {
return new SubscriptionResponse(subscriptionInfo.getApplicationUUID(), Collections.emptyList()); return new SubscriptionResponse(subscriptionInfo.getApplicationUUID(), Collections.emptyList());
} }
} catch (DBConnectionException | ApplicationManagementDAOException e) { } catch (DBConnectionException | ApplicationManagementDAOException e) {
String msg = "Error encountered while connecting to the database"; String msg = "Error encountered while connecting to the database";
log.error(msg, e); log.error(msg, e);
throw new ApplicationManagementException(msg, e); throw new ApplicationManagementException(msg, e);
@ -1728,17 +1769,18 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
/** /**
* Retrieves subscription statistics described by the {@link SubscriptionInfo} entity. * Retrieves subscription statistics described by the {@link SubscriptionInfo} entity.
*
* @param subscriptionInfo The {@link SubscriptionInfo} containing details about the subscription type and identifier. * @param subscriptionInfo The {@link SubscriptionInfo} containing details about the subscription type and identifier.
* @return {@link SubscriptionStatistics} The subscription statistics for the specified subscription type and identifier. * @return {@link SubscriptionStatistics} The subscription statistics for the specified subscription type and identifier.
* @throws ApplicationManagementException Throws when an error is encountered while getting subscription statistics. * @throws ApplicationManagementException Throws when an error is encountered while getting subscription statistics.
*/ */
public SubscriptionStatistics getSubscriptionStatistics(SubscriptionInfo subscriptionInfo) public SubscriptionStatistics getSubscriptionStatistics(SubscriptionInfo subscriptionInfo)
throws ApplicationManagementException { throws ApplicationManagementException {
if (Objects.equals(subscriptionInfo.getSubscriptionType(), SubscriptionMetadata.SubscriptionTypes.DEVICE)){ if (Objects.equals(subscriptionInfo.getSubscriptionType(), SubscriptionMetadata.SubscriptionTypes.DEVICE)) {
return null; return null;
} }
final boolean isUnsubscribe = Objects.equals(SubscriptionMetadata.SUBSCRIPTION_STATUS_UNSUBSCRIBED, subscriptionInfo.getSubscriptionStatus()); final boolean isUnsubscribe = Objects.equals(SubscriptionMetadata.SUBSCRIPTION_STATUS_UNSUBSCRIBED,
subscriptionInfo.getSubscriptionStatus());
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
try { try {
ConnectionManagerUtil.openDBConnection(); ConnectionManagerUtil.openDBConnection();
@ -1751,29 +1793,31 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
throw new NotFoundException(msg); throw new NotFoundException(msg);
} }
if (Objects.equals(subscriptionInfo.getSubscriptionType(), SubscriptionMetadata.SubscriptionTypes.GROUP)) { if (Objects.equals(subscriptionInfo.getSubscriptionType(), SubscriptionMetadata.SubscriptionTypes.GROUP)) {
List<Device> devices = HelperUtil.getGroupManagementProviderService(). return SubscriptionManagementHelperUtil.getSubscriptionStatistics(
getAllDevicesOfGroup(subscriptionInfo.getIdentifier(), false); subscriptionDAO.getSubscriptionStatistic(
List<Integer> deviceIdsOwnByGroup = devices.stream().map(Device::getId).collect(Collectors.toList()); HelperUtil.getGroupManagementProviderService()
SubscriptionStatisticDTO subscriptionStatisticDTO = subscriptionDAO. .getAllDevicesOfGroup(subscriptionInfo.getIdentifier(), false)
getSubscriptionStatistic(deviceIdsOwnByGroup, isUnsubscribe, tenantId, applicationReleaseDTO.getId()); .stream().map(Device::getId).collect(Collectors.toList()),
int allDeviceCount = HelperUtil.getGroupManagementProviderService().getDeviceCount(subscriptionInfo.getIdentifier()); isUnsubscribe, tenantId, applicationReleaseDTO.getId()),
return SubscriptionManagementHelperUtil.getSubscriptionStatistics(subscriptionStatisticDTO, allDeviceCount); HelperUtil.getGroupManagementProviderService().getDeviceCount(subscriptionInfo.getIdentifier())
} if (Objects.equals(subscriptionInfo.getSubscriptionType(), SubscriptionMetadata.SubscriptionTypes.ROLE)){ );
List<Integer> deviceIdsOwnByRole = getDeviceIdsOwnByRole(subscriptionInfo.getIdentifier(), tenantId); }
SubscriptionStatisticDTO subscriptionStatisticDTO = subscriptionDAO. if (Objects.equals(subscriptionInfo.getSubscriptionType(), SubscriptionMetadata.SubscriptionTypes.ROLE)) {
getSubscriptionStatistic(deviceIdsOwnByRole, isUnsubscribe, tenantId, applicationReleaseDTO.getId()); return SubscriptionManagementHelperUtil.getSubscriptionStatistics(subscriptionDAO.getSubscriptionStatistic(
int allDeviceCount = deviceIdsOwnByRole.size(); getDeviceIdsOwnByRole(subscriptionInfo.getIdentifier(), tenantId), isUnsubscribe, tenantId,
return SubscriptionManagementHelperUtil.getSubscriptionStatistics(subscriptionStatisticDTO, allDeviceCount); applicationReleaseDTO.getId()
} if (Objects.equals(subscriptionInfo.getSubscriptionType(), SubscriptionMetadata.SubscriptionTypes.USER)){ ), getDeviceIdsOwnByRole(subscriptionInfo.getIdentifier(), tenantId).size());
List<Integer> deviceIdsOwnByUser = getDeviceIdsOwnByUser(subscriptionInfo.getIdentifier()); }
SubscriptionStatisticDTO subscriptionStatisticDTO = subscriptionDAO. if (Objects.equals(subscriptionInfo.getSubscriptionType(), SubscriptionMetadata.SubscriptionTypes.USER)) {
getSubscriptionStatistic(deviceIdsOwnByUser, isUnsubscribe, tenantId, applicationReleaseDTO.getId()); return SubscriptionManagementHelperUtil.getSubscriptionStatistics(
int allDeviceCount = deviceIdsOwnByUser.size(); subscriptionDAO.getSubscriptionStatistic(getDeviceIdsOwnByUser(subscriptionInfo.getIdentifier()),
return SubscriptionManagementHelperUtil.getSubscriptionStatistics(subscriptionStatisticDTO, allDeviceCount); isUnsubscribe, tenantId, applicationReleaseDTO.getId()),
getDeviceIdsOwnByUser(subscriptionInfo.getIdentifier()).size()
);
} else { } else {
return null; return null;
} }
} catch (ApplicationManagementDAOException e) { } catch (ApplicationManagementDAOException e) {
String msg = "Error encountered while getting subscription statistics for group: " + subscriptionInfo.getIdentifier(); String msg = "Error encountered while getting subscription statistics for group: " + subscriptionInfo.getIdentifier();
log.error(msg, e); log.error(msg, e);
throw new ApplicationManagementException(msg, e); throw new ApplicationManagementException(msg, e);
@ -1796,13 +1840,14 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
/** /**
* Get status based subscription data describes by {@link SubscriptionInfo} entity * Get status based subscription data describes by {@link SubscriptionInfo} entity
*
* @param subscriptionInfo {@link SubscriptionInfo} * @param subscriptionInfo {@link SubscriptionInfo}
* @param limit Limit value * @param limit Limit value
* @param offset Offset value * @param offset Offset value
* @return {@link SubscriptionResponse} * @return {@link SubscriptionResponse}
* @throws ApplicationManagementException Throws when error encountered while getting subscription data * @throws ApplicationManagementException Throws when error encountered while getting subscription data
*/ */
@Override
public SubscriptionResponse getStatusBaseSubscriptions(SubscriptionInfo subscriptionInfo, int limit, int offset) public SubscriptionResponse getStatusBaseSubscriptions(SubscriptionInfo subscriptionInfo, int limit, int offset)
throws ApplicationManagementException { throws ApplicationManagementException {
if (Objects.equals(subscriptionInfo.getSubscriptionType(), SubscriptionMetadata.SubscriptionTypes.DEVICE)) { if (Objects.equals(subscriptionInfo.getSubscriptionType(), SubscriptionMetadata.SubscriptionTypes.DEVICE)) {
@ -1810,14 +1855,14 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
} else if (Objects.equals(subscriptionInfo.getSubscriptionType(), SubscriptionMetadata.SubscriptionTypes.GROUP)) { } else if (Objects.equals(subscriptionInfo.getSubscriptionType(), SubscriptionMetadata.SubscriptionTypes.GROUP)) {
return getStatusBaseSubscriptionsGroup(subscriptionInfo, limit, offset); return getStatusBaseSubscriptionsGroup(subscriptionInfo, limit, offset);
} else { } else {
return getStatusBaseSubscriptionsRoleUser(subscriptionInfo, limit, offset); return getStatusBaseSubscriptionsRoleAndUser(subscriptionInfo, limit, offset);
} }
} }
private SubscriptionResponse getStatusBaseSubscriptionsDevice(SubscriptionInfo subscriptionInfo, int limit, int offset)
public SubscriptionResponse getStatusBaseSubscriptionsDevice(SubscriptionInfo subscriptionInfo, int limit, int offset)
throws ApplicationManagementException { throws ApplicationManagementException {
final boolean isUnsubscribe = Objects.equals(SubscriptionMetadata.SUBSCRIPTION_STATUS_UNSUBSCRIBED, subscriptionInfo.getSubscriptionStatus()); final boolean isUnsubscribe = Objects.equals(SubscriptionMetadata.SUBSCRIPTION_STATUS_UNSUBSCRIBED,
subscriptionInfo.getSubscriptionStatus());
List<DeviceSubscriptionDTO> deviceSubscriptionDTOS; List<DeviceSubscriptionDTO> deviceSubscriptionDTOS;
int deviceCount = 0; int deviceCount = 0;
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
@ -1843,25 +1888,25 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
String deviceSubscriptionStatus = SubscriptionManagementHelperUtil.getDeviceSubscriptionStatus(subscriptionInfo); String deviceSubscriptionStatus = SubscriptionManagementHelperUtil.getDeviceSubscriptionStatus(subscriptionInfo);
DeviceSubscriptionFilterCriteria deviceSubscriptionFilterCriteria = subscriptionInfo.getDeviceSubscriptionFilterCriteria(); DeviceSubscriptionFilterCriteria deviceSubscriptionFilterCriteria = subscriptionInfo.getDeviceSubscriptionFilterCriteria();
DeviceManagementProviderService deviceManagementProviderService = HelperUtil.getDeviceManagementProviderService(); DeviceManagementProviderService deviceManagementProviderService = HelperUtil.getDeviceManagementProviderService();
List<String> dbSubscriptionStatus = SubscriptionManagementHelperUtil.getDBSubscriptionStatus(subscriptionInfo.getDeviceSubscriptionStatus()); List<String> dbSubscriptionStatus = SubscriptionManagementHelperUtil.getDBSubscriptionStatus
(subscriptionInfo.getDeviceSubscriptionStatus());
if (Objects.equals(SubscriptionMetadata.DeviceSubscriptionStatus.NEW, deviceSubscriptionStatus)) { if (Objects.equals(SubscriptionMetadata.DeviceSubscriptionStatus.NEW, deviceSubscriptionStatus)) {
deviceSubscriptionDTOS = subscriptionDAO.getAllSubscriptionsDetails(applicationReleaseDTO. deviceSubscriptionDTOS = subscriptionDAO.getAllSubscriptionsDetails(applicationReleaseDTO.
getId(), isUnsubscribe, tenantId, null, null, getId(), isUnsubscribe, tenantId, null, null,
deviceSubscriptionFilterCriteria.getTriggeredBy(), -1, -1); deviceSubscriptionFilterCriteria.getTriggeredBy(), -1, -1);
List<Integer> deviceIdsOfSubscription = deviceSubscriptionDTOS.stream().
map(DeviceSubscriptionDTO::getDeviceId).collect(Collectors.toList());
List<Integer> newDeviceIds = deviceManagementProviderService.getDevicesNotInGivenIdList(deviceIdsOfSubscription); List<Integer> deviceIdsOfSubscription = deviceSubscriptionDTOS.stream().
map(DeviceSubscriptionDTO::getDeviceId).collect(Collectors.toList());
deviceSubscriptionDTOS = newDeviceIds.stream().map(DeviceSubscriptionDTO::new).collect(Collectors.toList()); List<Integer> newDeviceIds = deviceManagementProviderService.getDevicesNotInGivenIdList(deviceIdsOfSubscription);
} else {
deviceSubscriptionDTOS = subscriptionDAO.getAllSubscriptionsDetails(applicationReleaseDTO.
getId(), isUnsubscribe, tenantId, dbSubscriptionStatus, null,
deviceSubscriptionFilterCriteria.getTriggeredBy(), -1, -1);
}
deviceSubscriptionDTOS = newDeviceIds.stream().map(DeviceSubscriptionDTO::new).collect(Collectors.toList());
} else {
deviceSubscriptionDTOS = subscriptionDAO.getAllSubscriptionsDetails(applicationReleaseDTO.
getId(), isUnsubscribe, tenantId, dbSubscriptionStatus, null,
deviceSubscriptionFilterCriteria.getTriggeredBy(), -1, -1);
}
List<DeviceSubscription> deviceSubscriptions = SubscriptionManagementHelperUtil.getDeviceSubscriptionData(deviceSubscriptionDTOS, List<DeviceSubscription> deviceSubscriptions = SubscriptionManagementHelperUtil.getDeviceSubscriptionData(deviceSubscriptionDTOS,
subscriptionInfo.getDeviceSubscriptionFilterCriteria(), isUnsubscribe, applicationDTO.getDeviceTypeId(), limit, offset); subscriptionInfo.getDeviceSubscriptionFilterCriteria(), isUnsubscribe, applicationDTO.getDeviceTypeId(), limit, offset);
@ -1879,10 +1924,11 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
} }
} }
public SubscriptionResponse getStatusBaseSubscriptionsGroup(SubscriptionInfo subscriptionInfo, int limit, int offset) private SubscriptionResponse getStatusBaseSubscriptionsGroup(SubscriptionInfo subscriptionInfo, int limit, int offset)
throws ApplicationManagementException { throws ApplicationManagementException {
final boolean isUnsubscribe = Objects.equals(SubscriptionMetadata.SUBSCRIPTION_STATUS_UNSUBSCRIBED, subscriptionInfo.getSubscriptionStatus()); final boolean isUnsubscribe = Objects.equals(SubscriptionMetadata.SUBSCRIPTION_STATUS_UNSUBSCRIBED,
subscriptionInfo.getSubscriptionStatus());
List<DeviceSubscriptionDTO> deviceSubscriptionDTOS; List<DeviceSubscriptionDTO> deviceSubscriptionDTOS;
int deviceCount = 0; int deviceCount = 0;
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
@ -1912,12 +1958,15 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
GroupManagementProviderService groupManagementProviderService = HelperUtil.getGroupManagementProviderService(); GroupManagementProviderService groupManagementProviderService = HelperUtil.getGroupManagementProviderService();
GroupDetailsDTO groupDetailsDTO; GroupDetailsDTO groupDetailsDTO;
List<String> dbSubscriptionStatus = SubscriptionManagementHelperUtil.getDBSubscriptionStatus(subscriptionInfo.getDeviceSubscriptionStatus()); List<String> dbSubscriptionStatus = SubscriptionManagementHelperUtil.getDBSubscriptionStatus
(subscriptionInfo.getDeviceSubscriptionStatus());
if (Objects.equals(SubscriptionMetadata.DeviceSubscriptionStatus.NEW, deviceSubscriptionStatus)) { if (Objects.equals(SubscriptionMetadata.DeviceSubscriptionStatus.NEW, deviceSubscriptionStatus)) {
List<Integer> allDeviceIdsOwnByGroup = groupManagementProviderService.getGroupDetailsWithDevices(subscriptionInfo.getIdentifier(), List<Integer> allDeviceIdsOwnByGroup = groupManagementProviderService.getGroupDetailsWithDevices
applicationDTO.getDeviceTypeId(), deviceSubscriptionFilterCriteria.getOwner(), deviceSubscriptionFilterCriteria.getName(), (subscriptionInfo.getIdentifier(),
deviceSubscriptionFilterCriteria.getDeviceStatus(), -1, -1).getDeviceIds(); applicationDTO.getDeviceTypeId(), deviceSubscriptionFilterCriteria.getOwner(),
deviceSubscriptionFilterCriteria.getName(),
deviceSubscriptionFilterCriteria.getDeviceStatus(), -1, -1).getDeviceIds();
deviceSubscriptionDTOS = subscriptionDAO.getSubscriptionDetailsByDeviceIds(applicationReleaseDTO.getId(), deviceSubscriptionDTOS = subscriptionDAO.getSubscriptionDetailsByDeviceIds(applicationReleaseDTO.getId(),
isUnsubscribe, tenantId, allDeviceIdsOwnByGroup, null, isUnsubscribe, tenantId, allDeviceIdsOwnByGroup, null,
@ -1964,10 +2013,10 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
} }
} }
private SubscriptionResponse getStatusBaseSubscriptionsRoleAndUser(SubscriptionInfo subscriptionInfo, int limit, int offset)
public SubscriptionResponse getStatusBaseSubscriptionsRoleUser(SubscriptionInfo subscriptionInfo, int limit, int offset)
throws ApplicationManagementException { throws ApplicationManagementException {
final boolean isUnsubscribe = Objects.equals(SubscriptionMetadata.SUBSCRIPTION_STATUS_UNSUBSCRIBED, subscriptionInfo.getSubscriptionStatus()); final boolean isUnsubscribe = Objects.equals(SubscriptionMetadata.SUBSCRIPTION_STATUS_UNSUBSCRIBED,
subscriptionInfo.getSubscriptionStatus());
List<DeviceSubscriptionDTO> deviceSubscriptionDTOS; List<DeviceSubscriptionDTO> deviceSubscriptionDTOS;
int deviceCount = 0; int deviceCount = 0;
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
@ -1995,7 +2044,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
String deviceSubscriptionStatus = SubscriptionManagementHelperUtil.getDeviceSubscriptionStatus(subscriptionInfo); String deviceSubscriptionStatus = SubscriptionManagementHelperUtil.getDeviceSubscriptionStatus(subscriptionInfo);
DeviceSubscriptionFilterCriteria deviceSubscriptionFilterCriteria = subscriptionInfo.getDeviceSubscriptionFilterCriteria(); DeviceSubscriptionFilterCriteria deviceSubscriptionFilterCriteria = subscriptionInfo.getDeviceSubscriptionFilterCriteria();
DeviceManagementProviderService deviceManagementProviderService = HelperUtil.getDeviceManagementProviderService(); DeviceManagementProviderService deviceManagementProviderService = HelperUtil.getDeviceManagementProviderService();
List<String> dbSubscriptionStatus = SubscriptionManagementHelperUtil.getDBSubscriptionStatus(subscriptionInfo.getDeviceSubscriptionStatus()); List<String> dbSubscriptionStatus = SubscriptionManagementHelperUtil.getDBSubscriptionStatus
(subscriptionInfo.getDeviceSubscriptionStatus());
if (Objects.equals(SubscriptionMetadata.DeviceSubscriptionStatus.NEW, deviceSubscriptionStatus)) { if (Objects.equals(SubscriptionMetadata.DeviceSubscriptionStatus.NEW, deviceSubscriptionStatus)) {
deviceSubscriptionDTOS = subscriptionDAO.getSubscriptionDetailsByDeviceIds(applicationReleaseDTO.getId(), deviceSubscriptionDTOS = subscriptionDAO.getSubscriptionDetailsByDeviceIds(applicationReleaseDTO.getId(),
@ -2021,7 +2071,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
List<DeviceSubscription> deviceSubscriptions = SubscriptionManagementHelperUtil. List<DeviceSubscription> deviceSubscriptions = SubscriptionManagementHelperUtil.
getDeviceSubscriptionData(deviceSubscriptionDTOS, getDeviceSubscriptionData(deviceSubscriptionDTOS,
subscriptionInfo.getDeviceSubscriptionFilterCriteria(), isUnsubscribe, applicationDTO.getDeviceTypeId(), limit, offset); subscriptionInfo.getDeviceSubscriptionFilterCriteria(), isUnsubscribe,
applicationDTO.getDeviceTypeId(), limit, offset);
return new SubscriptionResponse(subscriptionInfo.getApplicationUUID(), deviceCount, deviceSubscriptions); return new SubscriptionResponse(subscriptionInfo.getApplicationUUID(), deviceCount, deviceSubscriptions);
} catch (UserStoreException e) { } catch (UserStoreException e) {
@ -2041,7 +2092,6 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
} }
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private List<Integer> getDeviceIdsOwnByRole(String roleName, int tenantId) throws UserStoreException, DeviceManagementException { private List<Integer> getDeviceIdsOwnByRole(String roleName, int tenantId) throws UserStoreException, DeviceManagementException {
UserStoreManager userStoreManager = DataHolder.getInstance().getRealmService(). UserStoreManager userStoreManager = DataHolder.getInstance().getRealmService().
@ -2076,21 +2126,31 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
return deviceListOwnByUser.stream().map(Device::getId).collect(Collectors.toList()); return deviceListOwnByUser.stream().map(Device::getId).collect(Collectors.toList());
} }
private List<Integer> getAllDeviceIds (SubscriptionInfo subscriptionInfo) throws DeviceManagementException, UserStoreException { /**
* Retrieves a list of device IDs associated with the subscription described by the {@link SubscriptionInfo}.
* The device IDs are determined based on the subscription type, which could be either a role or a user.
*
* @param subscriptionInfo {@link SubscriptionInfo} containing the subscription details.
* @return A {@link List} of device IDs corresponding to the subscription type, or {@code null} if the type is not recognized.
* @throws DeviceManagementException Thrown when an error occurs while retrieving device IDs.
* @throws UserStoreException Thrown when an error occurs while accessing the user store.
*/
private List<Integer> getAllDeviceIds(SubscriptionInfo subscriptionInfo) throws DeviceManagementException, UserStoreException {
String type = subscriptionInfo.getSubscriptionType(); String type = subscriptionInfo.getSubscriptionType();
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
if (Objects.equals(type, SubscriptionMetadata.SubscriptionTypes.ROLE)){ if (Objects.equals(type, SubscriptionMetadata.SubscriptionTypes.ROLE)) {
return getDeviceIdsOwnByRole(subscriptionInfo.getIdentifier(),tenantId); return getDeviceIdsOwnByRole(subscriptionInfo.getIdentifier(), tenantId);
} }
if (Objects.equals(type,SubscriptionMetadata.SubscriptionTypes.USER)){ if (Objects.equals(type, SubscriptionMetadata.SubscriptionTypes.USER)) {
return getDeviceIdsOwnByUser(subscriptionInfo.getIdentifier()); return getDeviceIdsOwnByUser(subscriptionInfo.getIdentifier());
}else } else {
return null; return null;
}
} }
/** /**
* Get subscription statistics related data describes by the {@link SubscriptionInfo} * Get subscription statistics related data describes by the {@link SubscriptionInfo}
*
* @param subscriptionInfo {@link SubscriptionInfo} * @param subscriptionInfo {@link SubscriptionInfo}
* @return {@link SubscriptionStatistics} * @return {@link SubscriptionStatistics}
* @throws ApplicationManagementException Throws when error encountered while getting statistics * @throws ApplicationManagementException Throws when error encountered while getting statistics
@ -2100,7 +2160,6 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
return getSubscriptionStatistics(subscriptionInfo); return getSubscriptionStatistics(subscriptionInfo);
} }
@Override @Override
public List<DeviceOperationDTO> getSubscriptionOperationsByUUIDAndDeviceID(int deviceId, String uuid) public List<DeviceOperationDTO> getSubscriptionOperationsByUUIDAndDeviceID(int deviceId, String uuid)
throws ApplicationManagementException { throws ApplicationManagementException {

Loading…
Cancel
Save