From 0ed9c46a64da0b1d14f8805d8f240c74779ba681 Mon Sep 17 00:00:00 2001 From: manoj Date: Fri, 29 May 2015 20:07:24 +0530 Subject: [PATCH] set operation status --- .../core/operation/mgt/dao/impl/CommandOperationDAOImpl.java | 1 + .../mgt/core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java | 1 + .../mgt/core/operation/mgt/dao/impl/OperationDAOImpl.java | 2 ++ .../mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java | 1 + .../core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java | 1 + 5 files changed, 6 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/CommandOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/CommandOperationDAOImpl.java index e79681362c..a57a728638 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/CommandOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/CommandOperationDAOImpl.java @@ -164,6 +164,7 @@ public class CommandOperationDAOImpl extends OperationDAOImpl { for(CommandOperation cmOperation:commandOperationList){ operation = super.getOperation(cmOperation.getId()); operation.setEnabled(cmOperation.isEnabled()); + operation.setStatus(status); operationList.add(operation); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java index e5d4c0db25..584859a714 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java @@ -198,6 +198,7 @@ public class ConfigOperationDAOImpl extends OperationDAOImpl { bais = new ByteArrayInputStream(operationDetails); ois = new ObjectInputStream(bais); configOperation = (ConfigOperation) ois.readObject(); + configOperation.setStatus(status); operationList.add(configOperation); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationDAOImpl.java index a323c8761f..5eb710eb35 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationDAOImpl.java @@ -218,6 +218,7 @@ public class OperationDAOImpl implements OperationDAO { operation.setReceivedTimeStamp(rs.getTimestamp("RECEIVED_TIMESTAMP").toString()); } operation.setCode(rs.getString("OPERATION_CODE")); + operation.setStatus(status); operationList.add(operation); } } catch (SQLException e) { @@ -312,6 +313,7 @@ public class OperationDAOImpl implements OperationDAO { operation.setReceivedTimeStamp(rs.getTimestamp("RECEIVED_TIMESTAMP").toString()); } operation.setCode(rs.getString("OPERATION_CODE")); + operation.setStatus(Operation.Status.PENDING); } return operation; } catch (SQLException e) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java index d1156c9d25..9ef96d2b51 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java @@ -201,6 +201,7 @@ public class PolicyOperationDAOImpl extends OperationDAOImpl { bais = new ByteArrayInputStream(operationDetails); ois = new ObjectInputStream(bais); policyOperation = (PolicyOperation) ois.readObject(); + policyOperation.setStatus(status); operationList.add(policyOperation); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java index 23369f7ee1..b7b96513db 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java @@ -197,6 +197,7 @@ public class ProfileOperationDAOImpl extends OperationDAOImpl { bais = new ByteArrayInputStream(operationDetails); ois = new ObjectInputStream(bais); profileOperation = (ProfileOperation) ois.readObject(); + profileOperation.setStatus(status); operationList.add(profileOperation); }