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.DBConnectionException;
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.LifecycleStateDAO;
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.exception.NotFoundException;
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.HelperUtil;
@ -66,9 +68,9 @@ public class ApplicationManagerImpl implements ApplicationManager {
lifecycle.setGetLifecycleStateModifiedBy(application.getUser().getUserName());
application.setCurrentLifecycle(lifecycle);
PlatformDAO platformDAO = DAOFactory.getPlatformDAO();
Platform platform = platformDAO.getPlatform(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(true),
application.getPlatform().getIdentifier());
PlatformManager platformManager = DataHolder.getInstance().getPlatformManager();
Platform platform = platformManager.getPlatform(PrivilegedCarbonContext.getThreadLocalCarbonContext().
getTenantDomain(true), application.getPlatform().getIdentifier());
if (platform == null) {
throw new NotFoundException("Invalid platform");
}

Loading…
Cancel
Save