|
|
|
@ -26,7 +26,6 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManager;
|
|
|
|
|
import org.wso2.carbon.device.mgt.core.dto.operation.mgt.*;
|
|
|
|
|
import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationDAO;
|
|
|
|
|
import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationManagementDAOException;
|
|
|
|
|
import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory;
|
|
|
|
@ -229,22 +228,24 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
}
|
|
|
|
|
org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation dtoOperation = operationDAO
|
|
|
|
|
.getNextOperation(device.getId());
|
|
|
|
|
|
|
|
|
|
if (org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Type.COMMAND.equals(dtoOperation.getType())) {
|
|
|
|
|
if (dtoOperation != null) {
|
|
|
|
|
if (org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Type.COMMAND
|
|
|
|
|
.equals(dtoOperation.getType())) {
|
|
|
|
|
org.wso2.carbon.device.mgt.core.dto.operation.mgt.CommandOperation commandOperation;
|
|
|
|
|
commandOperation = (org.wso2.carbon.device.mgt.core.dto.operation.mgt.CommandOperation) commandOperationDAO
|
|
|
|
|
commandOperation =
|
|
|
|
|
(org.wso2.carbon.device.mgt.core.dto.operation.mgt.CommandOperation) commandOperationDAO
|
|
|
|
|
.getOperation(dtoOperation.getId());
|
|
|
|
|
dtoOperation.setEnabled(commandOperation.isEnabled());
|
|
|
|
|
} else if (org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Type.CONFIG.equals(dtoOperation.getType())) {
|
|
|
|
|
} else if (org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Type.CONFIG
|
|
|
|
|
.equals(dtoOperation.getType())) {
|
|
|
|
|
dtoOperation = configOperationDAO.getOperation(dtoOperation.getId());
|
|
|
|
|
} else if (org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Type.PROFILE.equals(dtoOperation.getType())) {
|
|
|
|
|
} else if (org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Type.PROFILE
|
|
|
|
|
.equals(dtoOperation.getType())) {
|
|
|
|
|
dtoOperation = profileOperationDAO.getOperation(dtoOperation.getId());
|
|
|
|
|
} else if (org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Type
|
|
|
|
|
.POLICY.equals(dtoOperation.getType())) {
|
|
|
|
|
dtoOperation = policyOperationDAO.getOperation(dtoOperation.getId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (dtoOperation != null) {
|
|
|
|
|
operation = OperationDAOUtil.convertOperation(dtoOperation);
|
|
|
|
|
}
|
|
|
|
|
return operation;
|
|
|
|
|