From 0f7df72167052f83455c902cb50e476907b2c8eb Mon Sep 17 00:00:00 2001 From: manoj Date: Sat, 30 May 2015 01:54:04 +0530 Subject: [PATCH] Cast to operation type in dto convertion --- .../operation/mgt/dao/util/OperationDAOUtil.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/util/OperationDAOUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/util/OperationDAOUtil.java index 1f5d31ced4..7e8641ac57 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/util/OperationDAOUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/util/OperationDAOUtil.java @@ -18,20 +18,22 @@ */ package org.wso2.carbon.device.mgt.core.operation.mgt.dao.util; -import org.wso2.carbon.device.mgt.core.dto.operation.mgt.CommandOperation; -import org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation; -import org.wso2.carbon.device.mgt.core.dto.operation.mgt.ProfileOperation; +import org.wso2.carbon.device.mgt.core.dto.operation.mgt.*; public class OperationDAOUtil { - public static Operation convertOperation(org.wso2.carbon.device.mgt.common.operation.mgt.Operation operation){ + public static Operation convertOperation(org.wso2.carbon.device.mgt.common.operation.mgt.Operation operation) { Operation dtoOperation = null; - if (operation.getType().equals(org.wso2.carbon.device.mgt.common.operation.mgt.Operation.Type.COMMAND)){ + if (operation.getType().equals(org.wso2.carbon.device.mgt.common.operation.mgt.Operation.Type.COMMAND)) { dtoOperation = new CommandOperation(); - }else if(operation.getType().equals(org.wso2.carbon.device.mgt.common.operation.mgt.Operation.Type.PROFILE)){ + } else if (operation.getType().equals(org.wso2.carbon.device.mgt.common.operation.mgt.Operation.Type.PROFILE)) { dtoOperation = new ProfileOperation(); + }else if(operation.getType().equals(org.wso2.carbon.device.mgt.common.operation.mgt.Operation.Type.POLICY)){ + dtoOperation = new PolicyOperation(); + }else if(operation.getType().equals(org.wso2.carbon.device.mgt.common.operation.mgt.Operation.Type.CONFIG)) { + dtoOperation = new ConfigOperation(); }else{ dtoOperation = new Operation(); }