minor refactoring for getTenantId

4.x.x
inoshperera 5 years ago
parent d7355cef55
commit 8df21f8af1

@ -182,7 +182,7 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
DeviceDetailsWrapper deviceDetailsWrapper = new DeviceDetailsWrapper(); DeviceDetailsWrapper deviceDetailsWrapper = new DeviceDetailsWrapper();
deviceDetailsWrapper.setDevice(device); deviceDetailsWrapper.setDevice(device);
deviceDetailsWrapper.setDeviceInfo(deviceInfo); deviceDetailsWrapper.setDeviceInfo(deviceInfo);
deviceDetailsWrapper.getJSONString(); deviceDetailsWrapper.setTenantId(DeviceManagerUtil.getTenantId());
GroupManagementProviderService groupManagementService = DeviceManagementDataHolder GroupManagementProviderService groupManagementService = DeviceManagementDataHolder
.getInstance().getGroupManagementProviderService(); .getInstance().getGroupManagementProviderService();
@ -206,6 +206,11 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
} catch (UserStoreException e) { } catch (UserStoreException e) {
log.error("Error occurred while getting role list", e); log.error("Error occurred while getting role list", e);
} }
} else {
if(log.isTraceEnabled()) {
log.trace("Event publishing is not enabled for tenant "
+ DeviceManagerUtil.getTenantId());
}
} }
} }

@ -350,6 +350,11 @@ public final class DeviceManagerUtil {
} }
} }
public static int getTenantId() {
return PrivilegedCarbonContext
.getThreadLocalCarbonContext().getTenantId();
}
public static int validateActivityListPageSize(int limit) throws OperationManagementException { public static int validateActivityListPageSize(int limit) throws OperationManagementException {
if (limit == 0) { if (limit == 0) {
DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance(). DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance().

Loading…
Cancel
Save