Using the platformManger service instead of using the DAO.

feature/appm-store/pbac
sinthuja 8 years ago
parent a7569456ce
commit e5704ac05d

@ -23,12 +23,14 @@ import org.wso2.carbon.device.application.mgt.common.*;
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException;
import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException;
import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager;
import org.wso2.carbon.device.application.mgt.common.services.PlatformManager;
import org.wso2.carbon.device.application.mgt.core.dao.ApplicationDAO; import org.wso2.carbon.device.application.mgt.core.dao.ApplicationDAO;
import org.wso2.carbon.device.application.mgt.core.dao.LifecycleStateDAO; import org.wso2.carbon.device.application.mgt.core.dao.LifecycleStateDAO;
import org.wso2.carbon.device.application.mgt.core.dao.PlatformDAO; import org.wso2.carbon.device.application.mgt.core.dao.PlatformDAO;
import org.wso2.carbon.device.application.mgt.core.dao.common.DAOFactory; import org.wso2.carbon.device.application.mgt.core.dao.common.DAOFactory;
import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException;
import org.wso2.carbon.device.application.mgt.core.exception.ValidationException; import org.wso2.carbon.device.application.mgt.core.exception.ValidationException;
import org.wso2.carbon.device.application.mgt.core.internal.DataHolder;
import org.wso2.carbon.device.application.mgt.core.util.ConnectionManagerUtil; import org.wso2.carbon.device.application.mgt.core.util.ConnectionManagerUtil;
import org.wso2.carbon.device.application.mgt.core.util.HelperUtil; import org.wso2.carbon.device.application.mgt.core.util.HelperUtil;
@ -66,9 +68,9 @@ public class ApplicationManagerImpl implements ApplicationManager {
lifecycle.setGetLifecycleStateModifiedBy(application.getUser().getUserName()); lifecycle.setGetLifecycleStateModifiedBy(application.getUser().getUserName());
application.setCurrentLifecycle(lifecycle); application.setCurrentLifecycle(lifecycle);
PlatformDAO platformDAO = DAOFactory.getPlatformDAO(); PlatformManager platformManager = DataHolder.getInstance().getPlatformManager();
Platform platform = platformDAO.getPlatform(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(true), Platform platform = platformManager.getPlatform(PrivilegedCarbonContext.getThreadLocalCarbonContext().
application.getPlatform().getIdentifier()); getTenantDomain(true), application.getPlatform().getIdentifier());
if (platform == null) { if (platform == null) {
throw new NotFoundException("Invalid platform"); throw new NotFoundException("Invalid platform");
} }

Loading…
Cancel
Save