WIP: subscription / Refactored the code in subscription management #483
Draft
ruwin
wants to merge 6 commits from ruwin/device-mgt-core:subscription
into master
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'ruwin/device-mgt-core:subscription'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Purpose
Description
The following changes have been made:
SubscriptionResponse getStatusBaseSubscriptions(SubscriptionInfo subscriptionInfo, int limit, int offset)
throws ApplicationManagementException;
Remove unnecessary new line
* @return {@link SubscriptionResponse}
* @throws ApplicationManagementException Throws when error encountered while getting subscription data
*/
@Override
Why did you remove this annotation?
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationPolicyDTO;
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.*;
do not use wild card imports.
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.*;
Do not use wild card imports
* @return {@link SubscriptionResponse}
* @throws ApplicationManagementException Throws when error encountered while getting subscription data
*/
Remove unnecessary new line
* @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.
*/
Remove unnecessary new line
List<Integer> deviceIdsOwnByGroup = devices.stream().map(Device::getId).collect(Collectors.toList());
SubscriptionStatisticDTO subscriptionStatisticDTO = subscriptionDAO.
getSubscriptionStatistic(deviceIdsOwnByGroup, isUnsubscribe, tenantId, applicationReleaseDTO.getId());
int allDeviceCount = HelperUtil.getGroupManagementProviderService().getDeviceCount(subscriptionInfo.getIdentifier());
It is not required to assign the return value into a variable here.
* @throws ApplicationManagementException Throws when error encountered while getting subscription data
*/
@Override
Remove unnecessary new line
return getStatusBaseSubscriptionsRoleUser(subscriptionInfo, limit, offset);
}
}
Remove unnecessary new line
}
public SubscriptionResponse getStatusBaseSubscriptionsDevice(SubscriptionInfo subscriptionInfo, int limit, int offset)
Do we need to define this as a public method?
return deviceListOwnByUser.stream().map(Device::getId).collect(Collectors.toList());
}
private List<Integer> getAllDeviceIds (SubscriptionInfo subscriptionInfo) throws DeviceManagementException, UserStoreException {
Add Java doc comment
}
if (Objects.equals(type,SubscriptionMetadata.SubscriptionTypes.USER)){
return getDeviceIdsOwnByUser(subscriptionInfo.getIdentifier());
}else
Fix formatting issue
Reviewers