Merge branch 'rest-api-improvements' of https://github.com/wso2/carbon-device-mgt-plugins into rest-api-improvements

merge-requests/1/head
inoshperera 9 years ago
commit 763854ef9a

@ -145,10 +145,9 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
notification.setOperationId(operation.getId()); notification.setOperationId(operation.getId());
notification.setStatus(org.wso2.carbon.device.mgt.common.notification.mgt.Notification. notification.setStatus(org.wso2.carbon.device.mgt.common.notification.mgt.Notification.
Status.NEW.toString()); Status.NEW.toString());
notification.setDeviceIdentifier(id);
notification.setDescription("Operation " + operation.getCode() + " failed to execute on device " + notification.setDescription("Operation " + operation.getCode() + " failed to execute on device " +
deviceName + ". Device ID : " + deviceId); deviceName + ". Device ID : " + deviceId);
AndroidAPIUtils.getNotificationManagementService().addNotification(notification); AndroidAPIUtils.getNotificationManagementService().addNotification(id, notification);
} }
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Updating operation '" + operation.toString() + "'"); log.debug("Updating operation '" + operation.toString() + "'");

@ -87,10 +87,9 @@ public class OperationUtils {
Notification lockResetNotification = new Notification(); Notification lockResetNotification = new Notification();
lockResetNotification.setOperationId(status.getCommandReference()); lockResetNotification.setOperationId(status.getCommandReference());
lockResetNotification.setStatus(String.valueOf(Notification.Status.NEW)); lockResetNotification.setStatus(String.valueOf(Notification.Status.NEW));
lockResetNotification.setDeviceIdentifier(deviceIdentifier);
lockResetNotification.setDescription( lockResetNotification.setDescription(
Constants.SyncMLResponseCodes.LOCKRESET_NOTIFICATION); Constants.SyncMLResponseCodes.LOCKRESET_NOTIFICATION);
nmService.addNotification(lockResetNotification); nmService.addNotification(deviceIdentifier, lockResetNotification);
} catch (NotificationManagementException e) { } catch (NotificationManagementException e) {
throw new WindowsOperationException("Failure occurred in getting notification service", e); throw new WindowsOperationException("Failure occurred in getting notification service", e);
} }
@ -156,10 +155,9 @@ public class OperationUtils {
Notification lockResetNotification = new Notification(); Notification lockResetNotification = new Notification();
lockResetNotification.setOperationId(status.getCommandReference()); lockResetNotification.setOperationId(status.getCommandReference());
lockResetNotification.setStatus(String.valueOf(Notification.Status.NEW)); lockResetNotification.setStatus(String.valueOf(Notification.Status.NEW));
lockResetNotification.setDeviceIdentifier(deviceIdentifier);
lockResetNotification.setDescription(Constants.SyncMLResponseCodes.LOCKRESET_NOTIFICATION); lockResetNotification.setDescription(Constants.SyncMLResponseCodes.LOCKRESET_NOTIFICATION);
nmService.addNotification(lockResetNotification); nmService.addNotification(deviceIdentifier, lockResetNotification);
} catch (NotificationManagementException e) { } catch (NotificationManagementException e) {
String msg = "Failure occurred in getting notification service"; String msg = "Failure occurred in getting notification service";
log.error(msg, e); log.error(msg, e);
@ -404,10 +402,9 @@ public class OperationUtils {
Notification notification = new Notification(); Notification notification = new Notification();
notification.setDescription("Auto generated DevicePin : " + pinValue); notification.setDescription("Auto generated DevicePin : " + pinValue);
notification.setOperationId(result.getCommandReference()); notification.setOperationId(result.getCommandReference());
notification.setDeviceIdentifier(deviceIdentifier);
notification.setStatus(String.valueOf(Notification.Status.NEW)); notification.setStatus(String.valueOf(Notification.Status.NEW));
try { try {
nmService.addNotification(notification); nmService.addNotification(deviceIdentifier, notification);
} catch (NotificationManagementException e) { } catch (NotificationManagementException e) {
String msg = "Failure Occurred in getting notification service."; String msg = "Failure Occurred in getting notification service.";
log.error(msg, e); log.error(msg, e);

Loading…
Cancel
Save