|
|
@ -30,7 +30,7 @@ import org.wso2.carbon.device.application.mgt.common.Filter;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.dto.TagDTO;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.dto.TagDTO;
|
|
|
|
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.core.dao.ApplicationDAO;
|
|
|
|
import org.wso2.carbon.device.application.mgt.core.dao.ApplicationDAO;
|
|
|
|
import org.wso2.carbon.device.application.mgt.core.dao.common.Util;
|
|
|
|
import org.wso2.carbon.device.application.mgt.core.util.DAOUtil;
|
|
|
|
import org.wso2.carbon.device.application.mgt.core.dao.impl.AbstractDAOImpl;
|
|
|
|
import org.wso2.carbon.device.application.mgt.core.dao.impl.AbstractDAOImpl;
|
|
|
|
import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException;
|
|
|
|
import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException;
|
|
|
|
import org.wso2.carbon.device.application.mgt.core.exception.UnexpectedServerErrorException;
|
|
|
|
import org.wso2.carbon.device.application.mgt.core.exception.UnexpectedServerErrorException;
|
|
|
@ -90,7 +90,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while adding the application", e);
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while adding the application", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, rs);
|
|
|
|
DAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -120,7 +120,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
throw new ApplicationManagementDAOException(
|
|
|
|
throw new ApplicationManagementDAOException(
|
|
|
|
"DB connection error occured while checking whether application exist or not.", e);
|
|
|
|
"DB connection error occured while checking whether application exist or not.", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, rs);
|
|
|
|
DAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -248,7 +248,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stmt.setInt(paramIndex, filter.getOffset());
|
|
|
|
stmt.setInt(paramIndex, filter.getOffset());
|
|
|
|
rs = stmt.executeQuery();
|
|
|
|
rs = stmt.executeQuery();
|
|
|
|
return Util.loadApplications(rs);
|
|
|
|
return DAOUtil.loadApplications(rs);
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while getting application list for the tenant"
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while getting application list for the tenant"
|
|
|
|
+ " " + tenantId + ". While executing " + sql, e);
|
|
|
|
+ " " + tenantId + ". While executing " + sql, e);
|
|
|
@ -259,7 +259,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
} catch (JSONException e) {
|
|
|
|
} catch (JSONException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while parsing JSON ", e);
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while parsing JSON ", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, rs);
|
|
|
|
DAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -294,7 +294,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection for "
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection for "
|
|
|
|
+ "getting app release id", e);
|
|
|
|
+ "getting app release id", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, rs);
|
|
|
|
DAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -338,7 +338,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection.", e);
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection.", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, rs);
|
|
|
|
DAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return count;
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -373,7 +373,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
+ appType + "and app name " + appName);
|
|
|
|
+ appType + "and app name " + appName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return Util.loadApplication(rs);
|
|
|
|
return DAOUtil.loadApplication(rs);
|
|
|
|
|
|
|
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new ApplicationManagementDAOException(
|
|
|
|
throw new ApplicationManagementDAOException(
|
|
|
@ -386,7 +386,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
} catch (UnexpectedServerErrorException e) {
|
|
|
|
} catch (UnexpectedServerErrorException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection.", e);
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection.", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, rs);
|
|
|
|
DAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -416,7 +416,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
log.debug("Successfully retrieved basic details of the application with the id:" + id);
|
|
|
|
log.debug("Successfully retrieved basic details of the application with the id:" + id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return Util.loadApplication(rs);
|
|
|
|
return DAOUtil.loadApplication(rs);
|
|
|
|
|
|
|
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new ApplicationManagementDAOException(
|
|
|
|
throw new ApplicationManagementDAOException(
|
|
|
@ -429,7 +429,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
} catch (UnexpectedServerErrorException e) {
|
|
|
|
} catch (UnexpectedServerErrorException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection.", e);
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection.", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, rs);
|
|
|
|
DAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -490,7 +490,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
+ releaseUuid);
|
|
|
|
+ releaseUuid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return Util.loadApplication(rs);
|
|
|
|
return DAOUtil.loadApplication(rs);
|
|
|
|
|
|
|
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new ApplicationManagementDAOException(
|
|
|
|
throw new ApplicationManagementDAOException(
|
|
|
@ -503,7 +503,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
} catch (UnexpectedServerErrorException e) {
|
|
|
|
} catch (UnexpectedServerErrorException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection.", e);
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection.", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, rs);
|
|
|
|
DAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -562,7 +562,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
log.debug("Successfully retrieved basic details of the application with the id "
|
|
|
|
log.debug("Successfully retrieved basic details of the application with the id "
|
|
|
|
+ applicationId);
|
|
|
|
+ applicationId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return Util.loadApplication(rs);
|
|
|
|
return DAOUtil.loadApplication(rs);
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new ApplicationManagementDAOException(
|
|
|
|
throw new ApplicationManagementDAOException(
|
|
|
|
"Error occurred while getting application details with app id " + applicationId +
|
|
|
|
"Error occurred while getting application details with app id " + applicationId +
|
|
|
@ -574,7 +574,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
} catch (UnexpectedServerErrorException e) {
|
|
|
|
} catch (UnexpectedServerErrorException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection.", e);
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection.", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, rs);
|
|
|
|
DAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -607,7 +607,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection.", e);
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection.", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, rs);
|
|
|
|
DAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -662,7 +662,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while deleting the application: ", e);
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while deleting the application: ", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, null);
|
|
|
|
DAOUtil.cleanupResources(stmt, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -693,7 +693,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while adding tags", e);
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while adding tags", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, null);
|
|
|
|
DAOUtil.cleanupResources(stmt, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -730,7 +730,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while adding tags", e);
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while adding tags", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, rs);
|
|
|
|
DAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -767,7 +767,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while getting categories", e);
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while getting categories", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, rs);
|
|
|
|
DAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -859,7 +859,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while adding categories.", e);
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while adding categories.", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, null);
|
|
|
|
DAOUtil.cleanupResources(stmt, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -892,7 +892,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while adding data into category mapping.", e);
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while adding data into category mapping.", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, null);
|
|
|
|
DAOUtil.cleanupResources(stmt, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1101,7 +1101,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while adding tags", e);
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while adding tags", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, null);
|
|
|
|
DAOUtil.cleanupResources(stmt, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1459,7 +1459,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
throw new ApplicationManagementDAOException(
|
|
|
|
throw new ApplicationManagementDAOException(
|
|
|
|
"Error occurred while deleting tags of application: " + applicationId, e);
|
|
|
|
"Error occurred while deleting tags of application: " + applicationId, e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, null);
|
|
|
|
DAOUtil.cleanupResources(stmt, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1497,7 +1497,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
|
|
|
|
|
|
|
|
ApplicationDTO application = null;
|
|
|
|
ApplicationDTO application = null;
|
|
|
|
while (rs.next()) {
|
|
|
|
while (rs.next()) {
|
|
|
|
ApplicationReleaseDTO appRelease = Util.loadApplicationRelease(rs);
|
|
|
|
ApplicationReleaseDTO appRelease = DAOUtil.loadApplicationRelease(rs);
|
|
|
|
application = new ApplicationDTO();
|
|
|
|
application = new ApplicationDTO();
|
|
|
|
|
|
|
|
|
|
|
|
application.setId(rs.getInt("APP_ID"));
|
|
|
|
application.setId(rs.getInt("APP_ID"));
|
|
|
@ -1528,7 +1528,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection.", e);
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection.", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, rs);
|
|
|
|
DAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1557,7 +1557,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while getting application List", e);
|
|
|
|
throw new ApplicationManagementDAOException("Error occurred while getting application List", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
Util.cleanupResources(stmt, rs);
|
|
|
|
DAOUtil.cleanupResources(stmt, rs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|