Removed unnecessary DM service

merge-requests/7/head
harshanl 8 years ago
parent f24242fb8a
commit 27a9eeb692

@ -44,16 +44,6 @@ public interface DeviceManagementProviderService {
*/ */
List<Device> getAllDevices(String deviceType) throws DeviceManagementException; List<Device> getAllDevices(String deviceType) throws DeviceManagementException;
/**
* Method to retrieve all the devices of a given device type without other device information.
*
* @param deviceType Device-type of the required devices
* @return List of devices of given device-type.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* devices.
*/
List<Device> getAllDevicesWithoutInfo(String deviceType) throws DeviceManagementException;
/** /**
* Method to retrieve all the devices registered in the system. * Method to retrieve all the devices registered in the system.
* *

@ -713,80 +713,6 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
return devices; return devices;
} }
@Override
public List<Device> getAllDevicesWithoutInfo(String deviceType) throws DeviceManagementException {
List<Device> devices = new ArrayList<>();
List<Device> allDevices;
try {
DeviceManagementDAOFactory.openConnection();
allDevices = deviceDAO.getDevices(deviceType, this.getTenantId());
if (allDevices == null) {
if (log.isDebugEnabled()) {
log.debug("No device is found upon the type '" + deviceType + "'");
}
return null;
}
} catch (DeviceManagementDAOException e) {
throw new DeviceManagementException("Error occurred while retrieving all devices of type '" +
deviceType + "' that are being managed within the scope of current tenant", e);
} catch (SQLException e) {
throw new DeviceManagementException("Error occurred while opening a connection to the data source", e);
} finally {
DeviceManagementDAOFactory.closeConnection();
}
for (Device device : allDevices) {
DeviceInfo info = null;
try {
DeviceManagementDAOFactory.openConnection();
info = deviceInfoDAO.getDeviceInformation(device.getId());
DeviceLocation location = deviceInfoDAO.getDeviceLocation(device.getId());
if (info != null) {
info.setLocation(location);
}
} catch (DeviceDetailsMgtDAOException e) {
log.error("Error occurred while retrieving advance info of '" + device.getType() +
"' that carries the id '" + device.getDeviceIdentifier() + "'");
} catch (SQLException e) {
log.error("Error occurred while opening a connection to the data source", e);
} finally {
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(deviceType);
if (deviceManager == null) {
if (log.isDebugEnabled()) {
log.debug("Device Manager associated with the device type '" + deviceType + "' is null. " +
"Therefore, not attempting method 'isEnrolled'");
}
devices.add(device);
continue;
}
Device dmsDevice =
deviceManager.getDevice(new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
if (dmsDevice != null) {
device.setFeatures(dmsDevice.getFeatures());
device.setProperties(dmsDevice.getProperties());
}
devices.add(device);
}
return devices;
}
@Override @Override
public void sendEnrolmentInvitation(EmailMetaInfo metaInfo) throws DeviceManagementException { public void sendEnrolmentInvitation(EmailMetaInfo metaInfo) throws DeviceManagementException {
Map<String, TypedValue<Class<?>, Object>> params = new HashMap<>(); Map<String, TypedValue<Class<?>, Object>> params = new HashMap<>();

Loading…
Cancel
Save