From a8e52ee781732d091e89bcca0994ee2435b6a6ad Mon Sep 17 00:00:00 2001 From: Ace Date: Tue, 9 Oct 2018 13:57:02 +0530 Subject: [PATCH] Fixing issue due to change in serialVersionUID after adding additional field to Operation DTO and correcting flaw in notification sending logic --- .../carbon/device/mgt/core/dto/operation/mgt/Operation.java | 4 +++- .../device/mgt/core/operation/mgt/OperationManagerImpl.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dto/operation/mgt/Operation.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dto/operation/mgt/Operation.java index 1b34b5d02b7..cf8645cc420 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dto/operation/mgt/Operation.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dto/operation/mgt/Operation.java @@ -23,7 +23,9 @@ import java.util.Properties; public class Operation implements Serializable { - public enum Type { + private static final long serialVersionUID = -353614864628915060L; + + public enum Type { CONFIG, MESSAGE, INFO, COMMAND, PROFILE , POLICY } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java index 0e5306f6c24..2ac5150a59d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java @@ -251,7 +251,7 @@ public class OperationManagerImpl implements OperationManager { } OperationManagementDAOFactory.commitTransaction(); - if (isScheduled) { + if (!isScheduled) { for (Device device : authorizedDevices) { this.sendNotification(operation, device); }