mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge pull request #1142 from madawas/fix-1556
Checking if the user store manager class is a sub class of the default
This commit is contained in:
commit
73e163d341
@ -222,14 +222,13 @@ public class DeviceMgtAPIUtils {
|
||||
|
||||
|
||||
public static UserStoreCountRetriever getUserStoreCountRetrieverService()
|
||||
throws UserStoreCounterException {
|
||||
throws UserStoreCounterException, UserStoreException {
|
||||
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
|
||||
List<Object> countRetrieverFactories = ctx.getOSGiServices(AbstractCountRetrieverFactory.class, null);
|
||||
RealmService realmService = (RealmService) ctx.getOSGiService(RealmService.class, null);
|
||||
RealmConfiguration realmConfiguration = realmService.getBootstrapRealmConfiguration();
|
||||
String userStoreType;
|
||||
//Ignoring Sonar warning as getUserStoreClass() returning string name of the class. So cannot use 'instanceof'.
|
||||
if (JDBCUserStoreManager.class.getName().equals(realmConfiguration.getUserStoreClass())) {
|
||||
if(DeviceMgtAPIUtils.getUserStoreManager() instanceof JDBCUserStoreManager) {
|
||||
userStoreType = JDBCCountRetrieverFactory.JDBC;
|
||||
} else {
|
||||
userStoreType = InternalCountRetrieverFactory.INTERNAL;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user