Merge pull request #9 from milanperera/master

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

@ -118,10 +118,11 @@ public interface DeviceManager {
/**
* Method to update device information.
*
* @param deviceIdentifier identifier to identify the device
* @param device Updated device information related data
* @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.

@ -19,6 +19,6 @@
package org.wso2.carbon.device.mgt.common.spi;
public interface DeviceMgtService extends DeviceManager,AppManager {
public interface DeviceMgtService extends DeviceManager, AppManager {
}

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

@ -170,7 +170,7 @@ public class OperationManagerImpl implements OperationManager {
if (device == null) {
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>();
dtoOperationList = operationDAO.getOperationsByDeviceAndStatus(device.getId(),

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

Loading…
Cancel
Save