mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Further fixing retrieving application list with device info
This commit is contained in:
parent
d3ce96585f
commit
1a29a9f58f
@ -62,9 +62,11 @@ public class Device implements Serializable {
|
||||
private List<Device.Property> properties;
|
||||
|
||||
@ApiModelProperty(name = "advanceInfo", value = "This defines the device registration related information. " +
|
||||
"It is mandatory to define this information.", required = true)
|
||||
"It is mandatory to define this information.", required = false)
|
||||
private DeviceInfo deviceInfo;
|
||||
|
||||
@ApiModelProperty(name = "applications", value = "This represents the application list installed into the device",
|
||||
required = false)
|
||||
private List<Application> applications;
|
||||
|
||||
public Device() {
|
||||
|
||||
@ -539,6 +539,20 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
||||
DeviceManagementDAOFactory.closeConnection();
|
||||
}
|
||||
device.setDeviceInfo(info);
|
||||
|
||||
try {
|
||||
DeviceManagementDAOFactory.openConnection();
|
||||
List<Application> applications = applicationDAO.getInstalledApplications(device.getId());
|
||||
device.setApplications(applications);
|
||||
} catch (DeviceManagementDAOException e) {
|
||||
log.error("Error occurred while retrieving the application list of '" + device.getType() + "', " +
|
||||
"which carries the id '" + device.getId() + "'", e);
|
||||
} catch (SQLException e) {
|
||||
log.error("Error occurred while opening a connection to the data source", e);
|
||||
} finally {
|
||||
DeviceManagementDAOFactory.closeConnection();
|
||||
}
|
||||
|
||||
DeviceManager deviceManager = this.getDeviceManager(device.getType());
|
||||
if (deviceManager == null) {
|
||||
if (log.isDebugEnabled()) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user