Merge pull request #9 from milanperera/master

Refactored to support device info function
revert-70aa11f8
Dilshan Edirisuriya 10 years ago
commit fed104e297

@ -118,10 +118,11 @@ public interface DeviceManager {
/** /**
* Method to update device information. * Method to update device information.
* *
* @param deviceIdentifier identifier to identify the device
* @param device Updated device information related data * @param device Updated device information related data
* @throws DeviceManagementException If some unusual behaviour is observed while updating the device info * @throws DeviceManagementException If some unusual behaviour is observed while updating the device info
*/ */
boolean updateDeviceInfo(Device device) throws DeviceManagementException; boolean updateDeviceInfo(DeviceIdentifier deviceIdentifier, Device device) throws DeviceManagementException;
/** /**
* Method to set the ownership type of a particular device. i.e. BYOD, COPE. * Method to set the ownership type of a particular device. i.e. BYOD, COPE.

@ -378,9 +378,10 @@ public class DeviceManagementServiceProviderImpl implements DeviceManagementServ
} }
@Override @Override
public boolean updateDeviceInfo(Device device) throws DeviceManagementException { public boolean updateDeviceInfo(DeviceIdentifier deviceIdentifier, Device device) throws DeviceManagementException {
DeviceManager dms = this.getPluginRepository().getDeviceManagementProvider(device.getType()); DeviceManager dms =
return dms.updateDeviceInfo(device); this.getPluginRepository().getDeviceManagementProvider(device.getType());
return dms.updateDeviceInfo(deviceIdentifier, device);
} }
@Override @Override

@ -170,7 +170,7 @@ public class OperationManagerImpl implements OperationManager {
if (device == null) { if (device == null) {
throw new OperationManagementException("Device not found for given device " + throw new OperationManagementException("Device not found for given device " +
"Identifier:" + deviceIdentifier.getId() + " and given type" + deviceIdentifier.getType()); "Identifier:" + deviceIdentifier.getId() + " and given type:" + deviceIdentifier.getType());
} }
operations = new ArrayList<Operation>(); operations = new ArrayList<Operation>();
dtoOperationList = operationDAO.getOperationsByDeviceAndStatus(device.getId(), dtoOperationList = operationDAO.getOperationsByDeviceAndStatus(device.getId(),

@ -98,8 +98,10 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
} }
@Override @Override
public boolean updateDeviceInfo(Device device) throws DeviceManagementException { public boolean updateDeviceInfo(DeviceIdentifier deviceIdentifier, Device device) throws DeviceManagementException {
return DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().updateDeviceInfo(device); return DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().
updateDeviceInfo(deviceIdentifier, device);
} }
@Override @Override

Loading…
Cancel
Save