use of org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService in project product-iots by wso2.
the class APIUtil method getDeviceManagementService.
public static DeviceManagementProviderService getDeviceManagementService() {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
DeviceManagementProviderService deviceManagementProviderService = (DeviceManagementProviderService) ctx.getOSGiService(DeviceManagementProviderService.class, null);
if (deviceManagementProviderService == null) {
throw new IllegalStateException("Device Management service has not initialized");
}
return deviceManagementProviderService;
}
use of org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService in project product-iots by wso2.
the class APIUtil method getDeviceManagementService.
/**
* @return Device management service of current context
*/
public static DeviceManagementProviderService getDeviceManagementService() {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
DeviceManagementProviderService deviceManagementProviderService = (DeviceManagementProviderService) ctx.getOSGiService(DeviceManagementProviderService.class, null);
if (deviceManagementProviderService == null) {
String msg = "Device Management service has not initialized.";
log.error(msg);
throw new IllegalStateException(msg);
}
return deviceManagementProviderService;
}
Aggregations