mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Resolved wso2/product-iots#1390
This commit is contained in:
parent
c7d5043248
commit
e81a90510f
@ -2,8 +2,6 @@ package org.wso2.carbon.device.mgt.mobile.windows.impl;
|
|||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.wso2.carbon.device.mgt.common.TransactionManagementException;
|
|
||||||
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
|
|
||||||
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException;
|
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException;
|
||||||
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsDAOFactory;
|
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsDAOFactory;
|
||||||
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsEnrollmentTokenDAO;
|
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsEnrollmentTokenDAO;
|
||||||
@ -16,7 +14,6 @@ public class WindowsTokenServiceImpl implements WindowsTokenService {
|
|||||||
private static WindowsEnrollmentTokenDAO windowsEnrollmentTokenDAO;
|
private static WindowsEnrollmentTokenDAO windowsEnrollmentTokenDAO;
|
||||||
|
|
||||||
public WindowsTokenServiceImpl() {
|
public WindowsTokenServiceImpl() {
|
||||||
WindowsDAOFactory windowsDAOFactory = new WindowsDAOFactory();
|
|
||||||
windowsEnrollmentTokenDAO = new WindowsEnrollmentTokenDAOImpl();
|
windowsEnrollmentTokenDAO = new WindowsEnrollmentTokenDAOImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,9 +43,8 @@ public class WindowsTokenServiceImpl implements WindowsTokenService {
|
|||||||
public MobileCacheEntry getCacheToken(String token) throws MobileDeviceManagementDAOException {
|
public MobileCacheEntry getCacheToken(String token) throws MobileDeviceManagementDAOException {
|
||||||
MobileCacheEntry cacheEntry = null;
|
MobileCacheEntry cacheEntry = null;
|
||||||
try {
|
try {
|
||||||
WindowsDAOFactory.beginTransaction();
|
WindowsDAOFactory.openConnection();
|
||||||
cacheEntry = windowsEnrollmentTokenDAO.getCacheToken(token);
|
cacheEntry = windowsEnrollmentTokenDAO.getCacheToken(token);
|
||||||
WindowsDAOFactory.commitTransaction();
|
|
||||||
} finally {
|
} finally {
|
||||||
WindowsDAOFactory.closeConnection();
|
WindowsDAOFactory.closeConnection();
|
||||||
}
|
}
|
||||||
@ -59,9 +55,8 @@ public class WindowsTokenServiceImpl implements WindowsTokenService {
|
|||||||
throws MobileDeviceManagementDAOException {
|
throws MobileDeviceManagementDAOException {
|
||||||
MobileCacheEntry cacheEntry = null;
|
MobileCacheEntry cacheEntry = null;
|
||||||
try {
|
try {
|
||||||
WindowsDAOFactory.beginTransaction();
|
WindowsDAOFactory.openConnection();
|
||||||
cacheEntry = windowsEnrollmentTokenDAO.getCacheTokenFromDeviceId(deviceId);
|
cacheEntry = windowsEnrollmentTokenDAO.getCacheTokenFromDeviceId(deviceId);
|
||||||
WindowsDAOFactory.commitTransaction();
|
|
||||||
} finally {
|
} finally {
|
||||||
WindowsDAOFactory.closeConnection();
|
WindowsDAOFactory.closeConnection();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user