mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fixing the error reported by check styles plugin.
This commit is contained in:
parent
783ead216e
commit
9656b9b747
@ -18,5 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.wso2.carbon.device.application.mgt.core.dao;
|
package org.wso2.carbon.device.application.mgt.core.dao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This interface specifies the database access operations performed for comments.
|
||||||
|
*/
|
||||||
public interface CommentDAO {
|
public interface CommentDAO {
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,5 +18,9 @@
|
|||||||
*/
|
*/
|
||||||
package org.wso2.carbon.device.application.mgt.core.dao;
|
package org.wso2.carbon.device.application.mgt.core.dao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This interface provides the list of operations that are supported with subscription database.
|
||||||
|
*
|
||||||
|
*/
|
||||||
public interface SubscriptionDAO {
|
public interface SubscriptionDAO {
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,9 @@ import org.wso2.carbon.device.application.mgt.core.exception.VisibilityManagemen
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface provides the list of operations that are performed in the database layer with respect to the visibility.
|
* This interface provides the list of operations that are performed in the database
|
||||||
|
* layer with respect to the visibility.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public interface VisibilityDAO {
|
public interface VisibilityDAO {
|
||||||
|
|
||||||
|
|||||||
@ -25,8 +25,8 @@ import org.wso2.carbon.device.application.mgt.core.config.ConfigurationManager;
|
|||||||
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.ApplicationReleaseDAO;
|
import org.wso2.carbon.device.application.mgt.core.dao.ApplicationReleaseDAO;
|
||||||
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.VisibilityDAO;
|
|
||||||
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.VisibilityDAO;
|
||||||
import org.wso2.carbon.device.application.mgt.core.dao.impl.application.GenericApplicationDAOImpl;
|
import org.wso2.carbon.device.application.mgt.core.dao.impl.application.GenericApplicationDAOImpl;
|
||||||
import org.wso2.carbon.device.application.mgt.core.dao.impl.application.release.GenericApplicationReleaseDAOImpl;
|
import org.wso2.carbon.device.application.mgt.core.dao.impl.application.release.GenericApplicationReleaseDAOImpl;
|
||||||
import org.wso2.carbon.device.application.mgt.core.dao.impl.application.release.OracleApplicationDAOImpl;
|
import org.wso2.carbon.device.application.mgt.core.dao.impl.application.release.OracleApplicationDAOImpl;
|
||||||
@ -61,14 +61,14 @@ public class DAOFactory {
|
|||||||
public static ApplicationDAO getApplicationDAO() {
|
public static ApplicationDAO getApplicationDAO() {
|
||||||
if (databaseEngine != null) {
|
if (databaseEngine != null) {
|
||||||
switch (databaseEngine) {
|
switch (databaseEngine) {
|
||||||
case Constants.DataBaseTypes.DB_TYPE_H2:
|
case Constants.DataBaseTypes.DB_TYPE_H2:
|
||||||
case Constants.DataBaseTypes.DB_TYPE_MYSQL:
|
case Constants.DataBaseTypes.DB_TYPE_MYSQL:
|
||||||
case Constants.DataBaseTypes.DB_TYPE_POSTGRESQL:
|
case Constants.DataBaseTypes.DB_TYPE_POSTGRESQL:
|
||||||
return new GenericApplicationDAOImpl();
|
return new GenericApplicationDAOImpl();
|
||||||
case Constants.DataBaseTypes.DB_TYPE_ORACLE:
|
case Constants.DataBaseTypes.DB_TYPE_ORACLE:
|
||||||
return new OracleApplicationDAOImpl();
|
return new OracleApplicationDAOImpl();
|
||||||
default:
|
default:
|
||||||
throw new UnsupportedDatabaseEngineException("Unsupported database engine : " + databaseEngine);
|
throw new UnsupportedDatabaseEngineException("Unsupported database engine : " + databaseEngine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new IllegalStateException("Database engine has not initialized properly.");
|
throw new IllegalStateException("Database engine has not initialized properly.");
|
||||||
@ -77,15 +77,15 @@ public class DAOFactory {
|
|||||||
public static PlatformDAO getPlatformDAO() {
|
public static PlatformDAO getPlatformDAO() {
|
||||||
if (databaseEngine != null) {
|
if (databaseEngine != null) {
|
||||||
switch (databaseEngine) {
|
switch (databaseEngine) {
|
||||||
case Constants.DataBaseTypes.DB_TYPE_H2:
|
case Constants.DataBaseTypes.DB_TYPE_H2:
|
||||||
case Constants.DataBaseTypes.DB_TYPE_MYSQL:
|
case Constants.DataBaseTypes.DB_TYPE_MYSQL:
|
||||||
case Constants.DataBaseTypes.DB_TYPE_POSTGRESQL:
|
case Constants.DataBaseTypes.DB_TYPE_POSTGRESQL:
|
||||||
return new GenericPlatformDAOImpl();
|
return new GenericPlatformDAOImpl();
|
||||||
case Constants.DataBaseTypes.DB_TYPE_MSSQL:
|
case Constants.DataBaseTypes.DB_TYPE_MSSQL:
|
||||||
case Constants.DataBaseTypes.DB_TYPE_ORACLE:
|
case Constants.DataBaseTypes.DB_TYPE_ORACLE:
|
||||||
return new OracleMsSQLPlatformDAOImpl();
|
return new OracleMsSQLPlatformDAOImpl();
|
||||||
default:
|
default:
|
||||||
throw new UnsupportedDatabaseEngineException("Unsupported database engine : " + databaseEngine);
|
throw new UnsupportedDatabaseEngineException("Unsupported database engine : " + databaseEngine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new IllegalStateException("Database engine has not initialized properly.");
|
throw new IllegalStateException("Database engine has not initialized properly.");
|
||||||
@ -94,13 +94,13 @@ public class DAOFactory {
|
|||||||
public static LifecycleStateDAO getLifecycleStateDAO() {
|
public static LifecycleStateDAO getLifecycleStateDAO() {
|
||||||
if (databaseEngine != null) {
|
if (databaseEngine != null) {
|
||||||
switch (databaseEngine) {
|
switch (databaseEngine) {
|
||||||
case Constants.DataBaseTypes.DB_TYPE_H2:
|
case Constants.DataBaseTypes.DB_TYPE_H2:
|
||||||
case Constants.DataBaseTypes.DB_TYPE_MYSQL:
|
case Constants.DataBaseTypes.DB_TYPE_MYSQL:
|
||||||
case Constants.DataBaseTypes.DB_TYPE_POSTGRESQL:
|
case Constants.DataBaseTypes.DB_TYPE_POSTGRESQL:
|
||||||
case Constants.DataBaseTypes.DB_TYPE_ORACLE:
|
case Constants.DataBaseTypes.DB_TYPE_ORACLE:
|
||||||
return new GenericLifecycleStateImpl();
|
return new GenericLifecycleStateImpl();
|
||||||
default:
|
default:
|
||||||
throw new UnsupportedDatabaseEngineException("Unsupported database engine : " + databaseEngine);
|
throw new UnsupportedDatabaseEngineException("Unsupported database engine : " + databaseEngine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new IllegalStateException("Database engine has not initialized properly.");
|
throw new IllegalStateException("Database engine has not initialized properly.");
|
||||||
@ -108,18 +108,19 @@ public class DAOFactory {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* To get the instance of ApplicationReleaseDAOImplementation of the particular database engine.
|
* To get the instance of ApplicationReleaseDAOImplementation of the particular database engine.
|
||||||
|
*
|
||||||
* @return specific ApplicationReleaseDAOImplementation
|
* @return specific ApplicationReleaseDAOImplementation
|
||||||
*/
|
*/
|
||||||
public static ApplicationReleaseDAO getApplicationReleaseDAO() {
|
public static ApplicationReleaseDAO getApplicationReleaseDAO() {
|
||||||
if (databaseEngine != null) {
|
if (databaseEngine != null) {
|
||||||
switch (databaseEngine) {
|
switch (databaseEngine) {
|
||||||
case Constants.DataBaseTypes.DB_TYPE_H2:
|
case Constants.DataBaseTypes.DB_TYPE_H2:
|
||||||
case Constants.DataBaseTypes.DB_TYPE_MYSQL:
|
case Constants.DataBaseTypes.DB_TYPE_MYSQL:
|
||||||
case Constants.DataBaseTypes.DB_TYPE_POSTGRESQL:
|
case Constants.DataBaseTypes.DB_TYPE_POSTGRESQL:
|
||||||
case Constants.DataBaseTypes.DB_TYPE_ORACLE:
|
case Constants.DataBaseTypes.DB_TYPE_ORACLE:
|
||||||
return new GenericApplicationReleaseDAOImpl();
|
return new GenericApplicationReleaseDAOImpl();
|
||||||
default:
|
default:
|
||||||
throw new UnsupportedDatabaseEngineException("Unsupported database engine : " + databaseEngine);
|
throw new UnsupportedDatabaseEngineException("Unsupported database engine : " + databaseEngine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new IllegalStateException("Database engine has not initialized properly.");
|
throw new IllegalStateException("Database engine has not initialized properly.");
|
||||||
@ -127,9 +128,10 @@ public class DAOFactory {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* To get the instance of VisibilityDAOImplementation of the particular database engine.
|
* To get the instance of VisibilityDAOImplementation of the particular database engine.
|
||||||
|
*
|
||||||
* @return specific VisibilityDAOImplementation
|
* @return specific VisibilityDAOImplementation
|
||||||
*/
|
*/
|
||||||
public static VisibilityDAO getVisibilityDAO(){
|
public static VisibilityDAO getVisibilityDAO() {
|
||||||
if (databaseEngine != null) {
|
if (databaseEngine != null) {
|
||||||
switch (databaseEngine) {
|
switch (databaseEngine) {
|
||||||
case Constants.DataBaseTypes.DB_TYPE_H2:
|
case Constants.DataBaseTypes.DB_TYPE_H2:
|
||||||
|
|||||||
@ -39,7 +39,6 @@ import java.sql.Date;
|
|||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Statement;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@ -32,7 +32,6 @@ import java.sql.Date;
|
|||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Statement;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -41,7 +40,7 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* GenericApplicationReleaseDAOImpl holds the implementation of ApplicationRelease related DAO operations.
|
* GenericApplicationReleaseDAOImpl holds the implementation of ApplicationRelease related DAO operations.
|
||||||
*/
|
*/
|
||||||
public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements ApplicationReleaseDAO {
|
public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements ApplicationReleaseDAO {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApplicationRelease createRelease(ApplicationRelease applicationRelease) throws
|
public ApplicationRelease createRelease(ApplicationRelease applicationRelease) throws
|
||||||
@ -56,7 +55,7 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
|||||||
String sql = "insert into APPM_APPLICATION_RELEASE(VERSION_NAME, RELEASE_RESOURCE, RELEASE_CHANNEL ,"
|
String sql = "insert into APPM_APPLICATION_RELEASE(VERSION_NAME, RELEASE_RESOURCE, RELEASE_CHANNEL ,"
|
||||||
+ "RELEASE_DETAILS, CREATED_AT, APPM_APPLICATION_ID, IS_DEFAULT) values (?, ?, ?, ?, ?, ?, ?)";
|
+ "RELEASE_DETAILS, CREATED_AT, APPM_APPLICATION_ID, IS_DEFAULT) values (?, ?, ?, ?, ?, ?, ?)";
|
||||||
int index = 0;
|
int index = 0;
|
||||||
String generatedColumns[] = { "ID" };
|
String generatedColumns[] = {"ID"};
|
||||||
try {
|
try {
|
||||||
connection = this.getDBConnection();
|
connection = this.getDBConnection();
|
||||||
statement = connection.prepareStatement(sql, generatedColumns);
|
statement = connection.prepareStatement(sql, generatedColumns);
|
||||||
@ -134,7 +133,7 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
|||||||
versionName, e);
|
versionName, e);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new ApplicationManagementDAOException("Error while getting release details of the application " +
|
throw new ApplicationManagementDAOException("Error while getting release details of the application " +
|
||||||
applicationUuid + " and version " + versionName + " , while executing the query " + sql, e);
|
applicationUuid + " and version " + versionName + " , while executing the query " + sql, e);
|
||||||
} finally {
|
} finally {
|
||||||
Util.cleanupResources(statement, resultSet);
|
Util.cleanupResources(statement, resultSet);
|
||||||
Util.cleanupResources(null, rsProperties);
|
Util.cleanupResources(null, rsProperties);
|
||||||
@ -199,9 +198,9 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
|||||||
throws ApplicationManagementDAOException {
|
throws ApplicationManagementDAOException {
|
||||||
Connection connection;
|
Connection connection;
|
||||||
PreparedStatement statement = null;
|
PreparedStatement statement = null;
|
||||||
String sql = "UPDATE APPM_APPLICATION_RELEASE SET RELEASE_RESOURCE = IFNULL (?, RELEASE_RESOURCE), RELEASE_CHANNEL = IFNULL "
|
String sql = "UPDATE APPM_APPLICATION_RELEASE SET RELEASE_RESOURCE = IFNULL (?, RELEASE_RESOURCE)," +
|
||||||
+ "(?, RELEASE_CHANNEL), RELEASE_DETAILS = IFNULL (?, RELEASE_DETAILS), IS_DEFAULT = IFNULL "
|
" RELEASE_CHANNEL = IFNULL (?, RELEASE_CHANNEL), RELEASE_DETAILS = IFNULL (?, RELEASE_DETAILS), " +
|
||||||
+ "(?, IS_DEFAULT) WHERE APPM_APPLICATION_ID = ? AND VERSION_NAME = ?";
|
"IS_DEFAULT = IFNULL (?, IS_DEFAULT) WHERE APPM_APPLICATION_ID = ? AND VERSION_NAME = ?";
|
||||||
try {
|
try {
|
||||||
connection = this.getDBConnection();
|
connection = this.getDBConnection();
|
||||||
statement = connection.prepareStatement(sql);
|
statement = connection.prepareStatement(sql);
|
||||||
@ -277,7 +276,7 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void changeReleaseDefault(String uuid, String version, boolean isDefault, String releaseChannel,
|
public void changeReleaseDefault(String uuid, String version, boolean isDefault, String releaseChannel,
|
||||||
int tenantId) throws ApplicationManagementDAOException {
|
int tenantId) throws ApplicationManagementDAOException {
|
||||||
Connection connection;
|
Connection connection;
|
||||||
PreparedStatement statement = null;
|
PreparedStatement statement = null;
|
||||||
String sql = "UPDATE APPM_APPLICATION_RELEASE SET IS_DEFAULT = ? AND RELEASE_CHANNEL = ? WHERE "
|
String sql = "UPDATE APPM_APPLICATION_RELEASE SET IS_DEFAULT = ? AND RELEASE_CHANNEL = ? WHERE "
|
||||||
@ -311,7 +310,8 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* To insert the application release properties.
|
* To insert the application release properties.
|
||||||
* @param connection Database Connection
|
*
|
||||||
|
* @param connection Database Connection
|
||||||
* @param applicationRelease Application Release the properties of which that need to be inserted.
|
* @param applicationRelease Application Release the properties of which that need to be inserted.
|
||||||
* @throws SQLException SQL Exception.
|
* @throws SQLException SQL Exception.
|
||||||
*/
|
*/
|
||||||
@ -343,11 +343,11 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
|||||||
/**
|
/**
|
||||||
* To make all the releases of particular release channel as non-default ones.
|
* To make all the releases of particular release channel as non-default ones.
|
||||||
*
|
*
|
||||||
* @param uuid UUID of the Application.
|
* @param uuid UUID of the Application.
|
||||||
* @param releaseChannel ReleaseChannel for which we need to make all the releases as non-default ones.
|
* @param releaseChannel ReleaseChannel for which we need to make all the releases as non-default ones.
|
||||||
* @param tenantId ID of the tenant.
|
* @param tenantId ID of the tenant.
|
||||||
* @throws DBConnectionException Database Connection Exception.
|
* @throws DBConnectionException Database Connection Exception.
|
||||||
* @throws SQLException SQL Exception.
|
* @throws SQLException SQL Exception.
|
||||||
*/
|
*/
|
||||||
private void removeDefaultReleases(String uuid, String releaseChannel, int tenantId)
|
private void removeDefaultReleases(String uuid, String releaseChannel, int tenantId)
|
||||||
throws DBConnectionException, SQLException {
|
throws DBConnectionException, SQLException {
|
||||||
|
|||||||
@ -117,12 +117,12 @@ public class GenericVisibilityDAOImpl extends AbstractDAOImpl implements Visibil
|
|||||||
public Visibility get(int applicationId) throws VisibilityManagementDAOException {
|
public Visibility get(int applicationId) throws VisibilityManagementDAOException {
|
||||||
PreparedStatement stmt = null;
|
PreparedStatement stmt = null;
|
||||||
ResultSet resultSet = null;
|
ResultSet resultSet = null;
|
||||||
final String VISIBILITY_TYPE = "VISIBILITY_TYPE";
|
final String visibilityTypeColumn = "VISIBILITY_TYPE";
|
||||||
final String ALLOWED_VAL = "ALLOWED_VAL";
|
final String allowedValColumn = "ALLOWED_VAL";
|
||||||
try {
|
try {
|
||||||
Connection connection = getDBConnection();
|
Connection connection = getDBConnection();
|
||||||
String sql = "SELECT APPM_VISIBILITY.VALUE as " + ALLOWED_VAL + ", APPM_RESOURCE_TYPE.NAME AS " +
|
String sql = "SELECT APPM_VISIBILITY.VALUE as " + allowedValColumn + ", APPM_RESOURCE_TYPE.NAME AS " +
|
||||||
VISIBILITY_TYPE + " FROM APPM_VISIBILITY JOIN APPM_RESOURCE_TYPE " +
|
visibilityTypeColumn + " FROM APPM_VISIBILITY JOIN APPM_RESOURCE_TYPE " +
|
||||||
"ON APPM_VISIBILITY.RESOURCE_TYPE_ID = APPM_RESOURCE_TYPE.ID " +
|
"ON APPM_VISIBILITY.RESOURCE_TYPE_ID = APPM_RESOURCE_TYPE.ID " +
|
||||||
"WHERE APPM_VISIBILITY.APPLICATION_ID = ?";
|
"WHERE APPM_VISIBILITY.APPLICATION_ID = ?";
|
||||||
stmt = connection.prepareStatement(sql);
|
stmt = connection.prepareStatement(sql);
|
||||||
@ -132,14 +132,14 @@ public class GenericVisibilityDAOImpl extends AbstractDAOImpl implements Visibil
|
|||||||
List<String> allowedVal = new ArrayList<>();
|
List<String> allowedVal = new ArrayList<>();
|
||||||
while (resultSet.next()) {
|
while (resultSet.next()) {
|
||||||
if (visibility.getType() == null) {
|
if (visibility.getType() == null) {
|
||||||
visibility.setType(Visibility.Type.valueOf(resultSet.getString(VISIBILITY_TYPE)));
|
visibility.setType(Visibility.Type.valueOf(resultSet.getString(visibilityTypeColumn)));
|
||||||
}
|
}
|
||||||
String val = resultSet.getString(ALLOWED_VAL);
|
String val = resultSet.getString(allowedValColumn);
|
||||||
if (val != null) {
|
if (val != null) {
|
||||||
allowedVal.add(val);
|
allowedVal.add(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!allowedVal.isEmpty()){
|
if (!allowedVal.isEmpty()) {
|
||||||
visibility.setAllowedList(allowedVal);
|
visibility.setAllowedList(allowedVal);
|
||||||
}
|
}
|
||||||
return visibility;
|
return visibility;
|
||||||
|
|||||||
@ -22,7 +22,15 @@ import org.apache.commons.logging.Log;
|
|||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.wso2.carbon.CarbonConstants;
|
import org.wso2.carbon.CarbonConstants;
|
||||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||||
import org.wso2.carbon.device.application.mgt.common.*;
|
import org.wso2.carbon.device.application.mgt.common.Application;
|
||||||
|
import org.wso2.carbon.device.application.mgt.common.ApplicationList;
|
||||||
|
import org.wso2.carbon.device.application.mgt.common.Filter;
|
||||||
|
import org.wso2.carbon.device.application.mgt.common.Lifecycle;
|
||||||
|
import org.wso2.carbon.device.application.mgt.common.LifecycleState;
|
||||||
|
import org.wso2.carbon.device.application.mgt.common.LifecycleStateTransition;
|
||||||
|
import org.wso2.carbon.device.application.mgt.common.Platform;
|
||||||
|
import org.wso2.carbon.device.application.mgt.common.User;
|
||||||
|
import org.wso2.carbon.device.application.mgt.common.Visibility;
|
||||||
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.services.ApplicationManager;
|
import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager;
|
||||||
import org.wso2.carbon.device.application.mgt.core.dao.ApplicationDAO;
|
import org.wso2.carbon.device.application.mgt.core.dao.ApplicationDAO;
|
||||||
|
|||||||
@ -22,6 +22,10 @@ import org.wso2.carbon.device.application.mgt.common.Filter;
|
|||||||
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.services.CategoryManager;
|
import org.wso2.carbon.device.application.mgt.common.services.CategoryManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is the default implementation for the CategoryManager.
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class CategoryManagerImpl implements CategoryManager {
|
public class CategoryManagerImpl implements CategoryManager {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -19,5 +19,8 @@ package org.wso2.carbon.device.application.mgt.core.impl;
|
|||||||
|
|
||||||
import org.wso2.carbon.device.application.mgt.common.services.CommentsManager;
|
import org.wso2.carbon.device.application.mgt.common.services.CommentsManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is the default implementation for the Managing the comments.
|
||||||
|
*/
|
||||||
public class CommentsManagerImpl implements CommentsManager {
|
public class CommentsManagerImpl implements CommentsManager {
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,12 +25,17 @@ import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManage
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the default implementation for the Subscription Manager.
|
||||||
|
*/
|
||||||
public class SubscriptionManagerImpl implements SubscriptionManager {
|
public class SubscriptionManagerImpl implements SubscriptionManager {
|
||||||
|
|
||||||
private static final Log log = LogFactory.getLog(SubscriptionManagerImpl.class);
|
private static final Log log = LogFactory.getLog(SubscriptionManagerImpl.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DeviceIdentifier> installApplicationForDevices(String applicationUUID, List<DeviceIdentifier> deviceList) throws ApplicationManagementException {
|
public List<DeviceIdentifier> installApplicationForDevices(String applicationUUID,
|
||||||
|
List<DeviceIdentifier> deviceList)
|
||||||
|
throws ApplicationManagementException {
|
||||||
log.info("Install application: " + applicationUUID + " to: " + deviceList.size() + " devices.");
|
log.info("Install application: " + applicationUUID + " to: " + deviceList.size() + " devices.");
|
||||||
for (DeviceIdentifier device : deviceList) {
|
for (DeviceIdentifier device : deviceList) {
|
||||||
String deviceId = device.getId();
|
String deviceId = device.getId();
|
||||||
@ -42,7 +47,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> installApplicationForUsers(String applicationUUID, List<String> userList) throws ApplicationManagementException {
|
public List<String> installApplicationForUsers(String applicationUUID, List<String> userList)
|
||||||
|
throws ApplicationManagementException {
|
||||||
log.info("Install application: " + applicationUUID + " to: " + userList.size() + " users.");
|
log.info("Install application: " + applicationUUID + " to: " + userList.size() + " users.");
|
||||||
for (String user : userList) {
|
for (String user : userList) {
|
||||||
//Todo: implementation
|
//Todo: implementation
|
||||||
@ -51,7 +57,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> installApplicationForRoles(String applicationUUID, List<String> roleList) throws ApplicationManagementException {
|
public List<String> installApplicationForRoles(String applicationUUID, List<String> roleList)
|
||||||
|
throws ApplicationManagementException {
|
||||||
log.info("Install application: " + applicationUUID + " to: " + roleList.size() + " users.");
|
log.info("Install application: " + applicationUUID + " to: " + roleList.size() + " users.");
|
||||||
for (String role : roleList) {
|
for (String role : roleList) {
|
||||||
//Todo: implementation
|
//Todo: implementation
|
||||||
@ -60,7 +67,9 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DeviceIdentifier> uninstallApplication(String applicationUUID, List<DeviceIdentifier> deviceList) throws ApplicationManagementException {
|
public List<DeviceIdentifier> uninstallApplication(String applicationUUID,
|
||||||
|
List<DeviceIdentifier> deviceList)
|
||||||
|
throws ApplicationManagementException {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,7 +32,7 @@ public class VisibilityManagerImpl implements VisibilityManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Visibility put(int applicationID, Visibility visibility) throws VisibilityManagementException {
|
public Visibility put(int applicationID, Visibility visibility) throws VisibilityManagementException {
|
||||||
if (visibility == null){
|
if (visibility == null) {
|
||||||
visibility = new Visibility();
|
visibility = new Visibility();
|
||||||
visibility.setType(Visibility.Type.PUBLIC);
|
visibility.setType(Visibility.Type.PUBLIC);
|
||||||
}
|
}
|
||||||
@ -71,8 +71,9 @@ public class VisibilityManagerImpl implements VisibilityManager {
|
|||||||
public Visibility get(int applicationID) throws VisibilityManagementException {
|
public Visibility get(int applicationID) throws VisibilityManagementException {
|
||||||
try {
|
try {
|
||||||
VisibilityDAO visibilityDAO = DAOFactory.getVisibilityDAO();
|
VisibilityDAO visibilityDAO = DAOFactory.getVisibilityDAO();
|
||||||
Visibility visibility = visibilityDAO.get(applicationID);
|
Visibility visibility = visibilityDAO.get(applicationID);
|
||||||
if (visibility.getType() == null && (visibility.getAllowedList() == null || visibility.getAllowedList().isEmpty())){
|
if (visibility.getType() == null && (visibility.getAllowedList() == null ||
|
||||||
|
visibility.getAllowedList().isEmpty())) {
|
||||||
visibility.setType(Visibility.Type.PUBLIC);
|
visibility.setType(Visibility.Type.PUBLIC);
|
||||||
}
|
}
|
||||||
return visibility;
|
return visibility;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user