@ -1720,8 +1720,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
log . error ( msg ) ;
log . error ( msg ) ;
throw new NotFoundException ( msg ) ;
throw new NotFoundException ( msg ) ;
}
}
ApplicationDTO applicationDTO = this . applicationDAO . getAppWithRelatedRelease ( uuid , tenantId ) ;
int appReleaseId = applicationReleaseDTO . getId ( ) ;
int appReleaseId = applicationReleaseDTO . getId ( ) ;
List < SubscriptionsDTO > groupDetailsWithDevices = new ArrayList < > ( ) ;
List < SubscriptionsDTO > groupDetailsWithDevices = new ArrayList < > ( ) ;
List < GroupSubscriptionDTO > groupDetails =
List < GroupSubscriptionDTO > groupDetails =
@ -1737,7 +1737,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
// 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 , offset , limit ) ;
groupManagementProviderService . getGroupDetailsWithDevices ( groupName , applicationDTO . getDeviceTypeId ( ) ,
offset , limit ) ;
SubscriptionsDTO groupDetailDTO = new SubscriptionsDTO ( ) ;
SubscriptionsDTO groupDetailDTO = new SubscriptionsDTO ( ) ;
groupDetailDTO . setId ( groupDetailWithDevices . getGroupId ( ) ) ;
groupDetailDTO . setId ( groupDetailWithDevices . getGroupId ( ) ) ;
@ -1910,8 +1911,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
log . error ( msg ) ;
log . error ( msg ) ;
throw new NotFoundException ( msg ) ;
throw new NotFoundException ( msg ) ;
}
}
ApplicationDTO applicationDTO = this . applicationDAO . getAppWithRelatedRelease ( uuid , tenantId ) ;
int appReleaseId = applicationReleaseDTO . getId ( ) ;
int appReleaseId = applicationReleaseDTO . getId ( ) ;
List < SubscriptionsDTO > userSubscriptionsWithDevices = new ArrayList < > ( ) ;
List < SubscriptionsDTO > userSubscriptionsWithDevices = new ArrayList < > ( ) ;
List < SubscriptionsDTO > userSubscriptions =
List < SubscriptionsDTO > userSubscriptions =
@ -1927,7 +1928,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
// 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 );
deviceManagementProviderService . getOwnersWithDeviceIds ( userName , applicationDTO . getDeviceTypeId ( ) );
SubscriptionsDTO userSubscriptionDTO = new SubscriptionsDTO ( ) ;
SubscriptionsDTO userSubscriptionDTO = new SubscriptionsDTO ( ) ;
userSubscriptionDTO . setName ( userSubscription . getName ( ) ) ;
userSubscriptionDTO . setName ( userSubscription . getName ( ) ) ;
@ -2097,8 +2098,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
log . error ( msg ) ;
log . error ( msg ) ;
throw new NotFoundException ( msg ) ;
throw new NotFoundException ( msg ) ;
}
}
ApplicationDTO applicationDTO = this . applicationDAO . getAppWithRelatedRelease ( uuid , tenantId ) ;
int appReleaseId = applicationReleaseDTO . getId ( ) ;
int appReleaseId = applicationReleaseDTO . getId ( ) ;
List < SubscriptionsDTO > roleSubscriptionsWithDevices = new ArrayList < > ( ) ;
List < SubscriptionsDTO > roleSubscriptionsWithDevices = new ArrayList < > ( ) ;
List < SubscriptionsDTO > roleSubscriptions =
List < SubscriptionsDTO > roleSubscriptions =
@ -2139,7 +2140,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
for ( String user : users ) {
for ( String user : users ) {
OwnerWithDeviceDTO ownerDetailsWithDevices ;
OwnerWithDeviceDTO ownerDetailsWithDevices ;
try {
try {
ownerDetailsWithDevices = deviceManagementProviderService . getOwnersWithDeviceIds ( user );
ownerDetailsWithDevices = deviceManagementProviderService . getOwnersWithDeviceIds ( user , applicationDTO . getDeviceTypeId ( ) );
} 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 ) ;
}
}
@ -2307,6 +2308,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
log . error ( msg ) ;
log . error ( msg ) ;
throw new NotFoundException ( msg ) ;
throw new NotFoundException ( msg ) ;
}
}
ApplicationDTO applicationDTO = this . applicationDAO . getAppWithRelatedRelease ( uuid , tenantId ) ;
int appReleaseId = applicationReleaseDTO . getId ( ) ;
int appReleaseId = applicationReleaseDTO . getId ( ) ;
DeviceManagementProviderService deviceManagementProviderService = HelperUtil . getDeviceManagementProviderService ( ) ;
DeviceManagementProviderService deviceManagementProviderService = HelperUtil . getDeviceManagementProviderService ( ) ;
@ -2321,7 +2323,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
}
}
List < DeviceDetailsDTO > allDevices =
List < DeviceDetailsDTO > allDevices =
deviceManagementProviderService . getDevicesByTenantId ( tenantId );
deviceManagementProviderService . getDevicesByTenantId ( tenantId , applicationDTO . getDeviceTypeId ( ) );
List < Integer > deviceIds = allDevices . stream ( )
List < Integer > deviceIds = allDevices . stream ( )
. map ( DeviceDetailsDTO : : getDeviceId )
. map ( DeviceDetailsDTO : : getDeviceId )
@ -2493,6 +2495,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
log . error ( msg ) ;
log . error ( msg ) ;
throw new NotFoundException ( msg ) ;
throw new NotFoundException ( msg ) ;
}
}
ApplicationDTO applicationDTO = this . applicationDAO . getAppWithRelatedRelease ( uuid , tenantId ) ;
int appReleaseId = applicationReleaseDTO . getId ( ) ;
int appReleaseId = applicationReleaseDTO . getId ( ) ;
List < DeviceSubscriptionDTO > allSubscriptions =
List < DeviceSubscriptionDTO > allSubscriptions =
@ -2522,7 +2525,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
statusCounts . put ( "NEW" , 0 ) ;
statusCounts . put ( "NEW" , 0 ) ;
List < DeviceDetailsDTO > allDevices =
List < DeviceDetailsDTO > allDevices =
deviceManagementProviderService . getDevicesByTenantId ( tenantId );
deviceManagementProviderService . getDevicesByTenantId ( tenantId , applicationDTO . getDeviceTypeId ( ) );
for ( DeviceDetailsDTO device : allDevices ) {
for ( DeviceDetailsDTO device : allDevices ) {
Integer deviceId = device . getDeviceId ( ) ;
Integer deviceId = device . getDeviceId ( ) ;