|
|
@ -492,8 +492,9 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
public Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException {
|
|
|
|
public Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException {
|
|
|
|
Device device;
|
|
|
|
Device device;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
DeviceManagementDAOFactory.openConnection();
|
|
|
|
device = deviceDAO.getDevice(deviceId, this.getTenantId());
|
|
|
|
device = deviceDAO.getDevice(deviceId, this.getTenantId());
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
} catch (DeviceManagementDAOException | SQLException e) {
|
|
|
|
throw new DeviceManagementException("Error occurred while obtaining the device for id " +
|
|
|
|
throw new DeviceManagementException("Error occurred while obtaining the device for id " +
|
|
|
|
"'" + deviceId.getId() + "'", e);
|
|
|
|
"'" + deviceId.getId() + "'", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
@ -731,10 +732,8 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
DeviceManagementDAOFactory.closeConnection();
|
|
|
|
DeviceManagementDAOFactory.closeConnection();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (Device device : userDevices) {
|
|
|
|
for (Device device : userDevices) {
|
|
|
|
Device dmsDevice =
|
|
|
|
Device dmsDevice = this.getDeviceManager(device.getType()).
|
|
|
|
this.getPluginRepository().getDeviceManagementService(
|
|
|
|
getDevice(new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
|
|
|
|
device.getType()).getDeviceManager().getDevice(
|
|
|
|
|
|
|
|
new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
|
|
|
|
|
|
|
|
if (dmsDevice != null) {
|
|
|
|
if (dmsDevice != null) {
|
|
|
|
device.setFeatures(dmsDevice.getFeatures());
|
|
|
|
device.setFeatures(dmsDevice.getFeatures());
|
|
|
|
device.setProperties(dmsDevice.getProperties());
|
|
|
|
device.setProperties(dmsDevice.getProperties());
|
|
|
@ -771,10 +770,8 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
DeviceManagementDAOFactory.closeConnection();
|
|
|
|
DeviceManagementDAOFactory.closeConnection();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (Device device : allDevices) {
|
|
|
|
for (Device device : allDevices) {
|
|
|
|
Device dmsDevice =
|
|
|
|
Device dmsDevice = this.getDeviceManager(device.getType()).
|
|
|
|
this.getPluginRepository().getDeviceManagementService(
|
|
|
|
getDevice(new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
|
|
|
|
device.getType()).getDeviceManager().getDevice(
|
|
|
|
|
|
|
|
new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
|
|
|
|
|
|
|
|
if (dmsDevice != null) {
|
|
|
|
if (dmsDevice != null) {
|
|
|
|
device.setFeatures(dmsDevice.getFeatures());
|
|
|
|
device.setFeatures(dmsDevice.getFeatures());
|
|
|
|
device.setProperties(dmsDevice.getProperties());
|
|
|
|
device.setProperties(dmsDevice.getProperties());
|
|
|
@ -835,10 +832,8 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (Device device : allDevices) {
|
|
|
|
for (Device device : allDevices) {
|
|
|
|
Device dmsDevice =
|
|
|
|
Device dmsDevice = this.getDeviceManager(device.getType()).
|
|
|
|
this.getPluginRepository().getDeviceManagementService(
|
|
|
|
getDevice(new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
|
|
|
|
device.getType()).getDeviceManager().getDevice(
|
|
|
|
|
|
|
|
new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
|
|
|
|
|
|
|
|
if (dmsDevice != null) {
|
|
|
|
if (dmsDevice != null) {
|
|
|
|
device.setFeatures(dmsDevice.getFeatures());
|
|
|
|
device.setFeatures(dmsDevice.getFeatures());
|
|
|
|
device.setProperties(dmsDevice.getProperties());
|
|
|
|
device.setProperties(dmsDevice.getProperties());
|
|
|
|