|
|
@ -116,6 +116,7 @@ import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
|
|
|
|
import org.wso2.carbon.device.mgt.core.dao.DeviceTypeDAO;
|
|
|
|
import org.wso2.carbon.device.mgt.core.dao.DeviceTypeDAO;
|
|
|
|
import org.wso2.carbon.device.mgt.core.dao.EnrollmentDAO;
|
|
|
|
import org.wso2.carbon.device.mgt.core.dao.EnrollmentDAO;
|
|
|
|
import org.wso2.carbon.device.mgt.core.dao.util.DeviceManagementDAOUtil;
|
|
|
|
import org.wso2.carbon.device.mgt.core.dao.util.DeviceManagementDAOUtil;
|
|
|
|
|
|
|
|
import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceDetailsMgtException;
|
|
|
|
import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceInformationManager;
|
|
|
|
import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceInformationManager;
|
|
|
|
import org.wso2.carbon.device.mgt.core.device.details.mgt.dao.DeviceDetailsDAO;
|
|
|
|
import org.wso2.carbon.device.mgt.core.device.details.mgt.dao.DeviceDetailsDAO;
|
|
|
|
import org.wso2.carbon.device.mgt.core.device.details.mgt.dao.DeviceDetailsMgtDAOException;
|
|
|
|
import org.wso2.carbon.device.mgt.core.device.details.mgt.dao.DeviceDetailsMgtDAOException;
|
|
|
@ -169,9 +170,11 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
private EnrollmentDAO enrollmentDAO;
|
|
|
|
private EnrollmentDAO enrollmentDAO;
|
|
|
|
private ApplicationDAO applicationDAO;
|
|
|
|
private ApplicationDAO applicationDAO;
|
|
|
|
private DeviceManagementPluginRepository pluginRepository;
|
|
|
|
private DeviceManagementPluginRepository pluginRepository;
|
|
|
|
|
|
|
|
private DeviceInformationManager deviceInformationManager;
|
|
|
|
|
|
|
|
|
|
|
|
public DeviceManagementProviderServiceImpl() {
|
|
|
|
public DeviceManagementProviderServiceImpl() {
|
|
|
|
this.pluginRepository = new DeviceManagementPluginRepository();
|
|
|
|
this.pluginRepository = new DeviceManagementPluginRepository();
|
|
|
|
|
|
|
|
this.deviceInformationManager = new DeviceInformationManagerImpl();
|
|
|
|
initDataAccessObjects();
|
|
|
|
initDataAccessObjects();
|
|
|
|
/* Registering a listener to retrieve events when some device management service plugin is installed after
|
|
|
|
/* Registering a listener to retrieve events when some device management service plugin is installed after
|
|
|
|
* the component is done getting initialized */
|
|
|
|
* the component is done getting initialized */
|
|
|
@ -386,6 +389,16 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
sendNotification(device);
|
|
|
|
sendNotification(device);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
extractDeviceLocationToUpdate(device);
|
|
|
|
extractDeviceLocationToUpdate(device);
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
if (device.getDeviceInfo() != null) {
|
|
|
|
|
|
|
|
deviceInformationManager.addDeviceInfo(device, device.getDeviceInfo());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (DeviceDetailsMgtException e) {
|
|
|
|
|
|
|
|
//This is not logging as error, neither throwing an exception as this is not an exception in main
|
|
|
|
|
|
|
|
// business logic.
|
|
|
|
|
|
|
|
String msg = "Error occurred while adding device info";
|
|
|
|
|
|
|
|
log.warn(msg, e);
|
|
|
|
|
|
|
|
}
|
|
|
|
return status;
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -3414,7 +3427,6 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
deviceLocation.setDistance(Double.parseDouble(distance));
|
|
|
|
deviceLocation.setDistance(Double.parseDouble(distance));
|
|
|
|
deviceLocation.setSpeed(Float.parseFloat(speed));
|
|
|
|
deviceLocation.setSpeed(Float.parseFloat(speed));
|
|
|
|
deviceLocation.setBearing(Float.parseFloat(bearing));
|
|
|
|
deviceLocation.setBearing(Float.parseFloat(bearing));
|
|
|
|
DeviceInformationManager deviceInformationManager = new DeviceInformationManagerImpl();
|
|
|
|
|
|
|
|
deviceInformationManager.addDeviceLocation(device, deviceLocation);
|
|
|
|
deviceInformationManager.addDeviceLocation(device, deviceLocation);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
//We are not failing the execution since this is not critical for the functionality. But logging as
|
|
|
|
//We are not failing the execution since this is not critical for the functionality. But logging as
|
|
|
|