diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 75785e8b75..2e6839b906 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,18 +1,17 @@ -image: maven:latest +image: shinyay/docker-mvn-jdk8:3.5.0 variables: - MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode" + MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode --errors --show-version" MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository" cache: paths: - .m2/repository/ - - target/ build: stage: build script: - - mvn $MAVEN_CLI_OPTS compile + - mvn $MAVEN_CLI_OPTS clean install -Dmaven.test.skip=true test: stage: test diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml index 14bb357c4f..8f5387b87b 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml @@ -22,13 +22,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.annotations - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT bundle WSO2 Carbon - API Management Annotations WSO2 Carbon - API Management Custom Annotation Module diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml index f0d6a333e3..3d0f46b92b 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml @@ -21,12 +21,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT org.wso2.carbon.apimgt.application.extension.api war WSO2 Carbon - API Application Management API diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml index bf4e8c2814..496deb894a 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml @@ -22,12 +22,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT org.wso2.carbon.apimgt.application.extension bundle WSO2 Carbon - API Application Management diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml index 7d2cad0a90..58ee9e50cd 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml @@ -21,13 +21,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.handlers - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT bundle WSO2 Carbon - API Security Handler Component WSO2 Carbon - API Management Security Handler Module diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml index 4f10905bc2..1241c92d33 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml @@ -13,13 +13,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.integration.client - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT bundle WSO2 Carbon - API Management Integration Client WSO2 Carbon - API Management Integration Client diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml index 17019a7fdc..02bd1656b9 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml @@ -13,13 +13,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.integration.generated.client - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT bundle WSO2 Carbon - API Management Integration Generated Client WSO2 Carbon - API Management Integration Client diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml index d8fd7321d4..0c30bf4f4a 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml @@ -22,13 +22,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.webapp.publisher - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT bundle WSO2 Carbon - API Management Webapp Publisher WSO2 Carbon - API Management Webapp Publisher diff --git a/components/apimgt-extensions/pom.xml b/components/apimgt-extensions/pom.xml index f43c13a9b8..374ddfdad7 100644 --- a/components/apimgt-extensions/pom.xml +++ b/components/apimgt-extensions/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml 4.0.0 apimgt-extensions - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - API Management Extensions Component http://wso2.org diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/pom.xml index 67167ce634..9626e6c9c0 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/pom.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/pom.xml @@ -5,12 +5,12 @@ application-mgt org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT 4.0.0 org.wso2.carbon.device.application.mgt.addons - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - Application Management Add-Ons WSO2 Carbon - Application Management Add-Ons http://wso2.org diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.authhandler/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.authhandler/pom.xml index 26653d826b..f75300813f 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.authhandler/pom.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.authhandler/pom.xml @@ -24,11 +24,11 @@ org.wso2.carbon.devicemgt application-mgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT org.wso2.carbon.device.application.mgt.authhandler - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT war WSO2 Carbon - Application Management Authentication Handler API Proxy Service for Authentication Handling in WSO2 App Manager. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/pom.xml index 9be0fe4a68..b4cafe35e1 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/pom.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/pom.xml @@ -21,13 +21,13 @@ org.wso2.carbon.devicemgt application-mgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.application.mgt.common - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT bundle WSO2 Carbon - Application Management Common WSO2 Carbon - Application Management Common diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Application.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Application.java index 87daa4eb5b..0f4d59bb7c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Application.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Application.java @@ -45,7 +45,7 @@ public class Application { @ApiModelProperty(name = "type", value = "Type of the application", required = true, - example = "Mobile, Web, Web Clip etc") + example = "ENTERPRISE, PUBLIC, WEB, WEB_CLIP etc") private String type; @ApiModelProperty(name = "subType", diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationManager.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationManager.java index 0b34ed971e..46cc04d19d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationManager.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationManager.java @@ -93,7 +93,7 @@ public interface ApplicationManager { String getUuidOfLatestRelease(int appId) throws ApplicationManagementException; /** - * To get Application with the given Id. + * To get the Application for given Id. * * @param id id of the Application * @param state state of the Application @@ -102,6 +102,16 @@ public interface ApplicationManager { */ Application getApplicationById(int id, String state) throws ApplicationManagementException; + /** + * To get the Application for given application relase UUID. + * + * @param uuid UUID of the Application + * @param state state of the Application + * @return the Application identified by the ID + * @throws ApplicationManagementException Application Management Exception. + */ + Application getApplicationByUuid(String uuid, String state) throws ApplicationManagementException; + /** * To get an application associated with the release. * @@ -146,11 +156,9 @@ public interface ApplicationManager { * @param releaseUuid UUID of the Application Release. * @param state Lifecycle state to change the app * @param checkExist whether it is needed to check if the app and release already exist in the database - * @param handleDBConnections Whether it is necessary to open connections * @throws ApplicationManagementException Application Management Exception. */ - void changeLifecycleState(int applicationId, String releaseUuid, LifecycleState state, Boolean checkExist, - Boolean handleDBConnections) + void changeLifecycleState(int applicationId, String releaseUuid, LifecycleState state, Boolean checkExist) throws ApplicationManagementException; /** diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml index cbdae1a630..3b1b3ab6cd 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml @@ -21,13 +21,13 @@ org.wso2.carbon.devicemgt application-mgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.application.mgt.core - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT bundle WSO2 Carbon - Application Management Core WSO2 Carbon - Application Management Core diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ApplicationDAO.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ApplicationDAO.java index 772dea5e8d..63e78eceb5 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ApplicationDAO.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ApplicationDAO.java @@ -96,7 +96,7 @@ public interface ApplicationDAO { ApplicationManagementDAOException; /** - * To get the application with the given uuid + * To get the application with the given id * * @param applicationId Id of the application to be retrieved. * @param tenantId ID of the tenant. @@ -105,6 +105,16 @@ public interface ApplicationDAO { */ Application getApplicationById(int applicationId, int tenantId) throws ApplicationManagementDAOException; + /** + * To get the application with the given uuid + * + * @param releaseUuid UUID of the application release. + * @param tenantId ID of the tenant. + * @return the application + * @throws ApplicationManagementDAOException Application Management DAO Exception. + */ + Application getApplicationByUUID(String releaseUuid, int tenantId) throws ApplicationManagementDAOException; + /** * To get the application with the given uuid * diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ApplicationReleaseDAO.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ApplicationReleaseDAO.java index 12d868e663..0ae1d794a1 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ApplicationReleaseDAO.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ApplicationReleaseDAO.java @@ -138,6 +138,26 @@ public interface ApplicationReleaseDAO { */ boolean verifyReleaseExistence(int appId, String uuid, int tenantId) throws ApplicationManagementDAOException; + /** + * To verify whether application release exist or not for the given app release version. + * + * @param appId ID of the application. + * @param hashVal Hash value of the application release. + * @param tenantId Tenant Id + * @throws ApplicationManagementDAOException Application Management DAO Exception. + */ + boolean verifyReleaseExistenceByHash(int appId, String hashVal, int tenantId) + throws ApplicationManagementDAOException; + + /** + * To verify whether application release exist or not for the given app release version. + * + * @param appId ID of the application. + * @param tenantId Tenant Id + * @throws ApplicationManagementDAOException Application Management DAO Exception. + */ + String getPackageName(int appId, int tenantId) throws ApplicationManagementDAOException; + /** * To verify whether application release exist or not for given application release uuid. * diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java index 96ab3d7efb..133df60b9a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java @@ -390,8 +390,55 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic } @Override - public Application getApplicationById(int applicationId, int tenantId) throws + public Application getApplicationByUUID(String releaseUuid, int tenantId) throws ApplicationManagementDAOException { + if (log.isDebugEnabled()) { + log.debug("Getting application with the release UUID: " + releaseUuid + " from the database"); + } + Connection conn; + PreparedStatement stmt = null; + ResultSet rs = null; + try { + conn = this.getDBConnection(); + String sql = + "SELECT AP_APP.ID AS APP_ID, AP_APP.NAME AS APP_NAME, AP_APP.TYPE AS APP_TYPE, AP_APP.APP_CATEGORY " + + "AS APP_CATEGORY, AP_APP.SUB_TYPE AS SUB_TYPE, AP_APP.CURRENCY AS CURRENCY, " + + "AP_APP.RESTRICTED AS RESTRICTED, AP_APP.DEVICE_TYPE_ID AS DEVICE_TYPE_ID, " + + "AP_APP_TAG.TAG AS APP_TAG, AP_UNRESTRICTED_ROLE.ROLE AS " + + "ROLE FROM ((AP_APP LEFT JOIN AP_APP_TAG ON AP_APP.ID = AP_APP_TAG.AP_APP_ID) " + + "LEFT JOIN AP_UNRESTRICTED_ROLE ON AP_APP.ID = AP_UNRESTRICTED_ROLE.AP_APP_ID) " + + "WHERE AP_APP.ID = (SELECT AP_APP_ID FROM AP_APP_RELEASE WHERE UUID =? ) AND " + + "AP_APP.TENANT_ID = ? AND AP_APP.STATUS != ?;"; + + stmt = conn.prepareStatement(sql); + stmt.setString(1, releaseUuid); + stmt.setInt(2, tenantId); + stmt.setString(3, AppLifecycleState.REMOVED.toString()); + rs = stmt.executeQuery(); + + if (log.isDebugEnabled()) { + log.debug("Successfully retrieved basic details of the application for the application release UUID: " + + releaseUuid); + } + + return Util.loadApplication(rs); + + } catch (SQLException e) { + throw new ApplicationManagementDAOException( + "Error occurred while getting application details with app release uuid " + releaseUuid + + " While executing query ", e); + } catch (JSONException e) { + throw new ApplicationManagementDAOException("Error occurred while parsing JSON", e); + } catch (DBConnectionException e) { + throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection.", e); + } finally { + Util.cleanupResources(stmt, rs); + } + } + + @Override + public Application getApplicationById(int applicationId, int tenantId) throws + ApplicationManagementDAOException { if (log.isDebugEnabled()) { log.debug("Getting application with the id (" + applicationId + ") from the database"); } @@ -417,7 +464,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic if (log.isDebugEnabled()) { log.debug("Successfully retrieved basic details of the application with the id " - + applicationId); + + applicationId); } return Util.loadApplication(rs); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java index 4e5ca14683..f255a7c74a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java @@ -431,6 +431,80 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements } } + @Override + public boolean verifyReleaseExistenceByHash(int appId, String hashVal, int tenantId) throws ApplicationManagementDAOException { + if (log.isDebugEnabled()) { + log.debug("Verifying application release existence by application id:" + appId + + " and application hash value: " + hashVal); + } + Connection conn; + PreparedStatement stmt = null; + ResultSet rs = null; + try { + conn = this.getDBConnection(); + String sql = + "SELECT AR.ID AS RELEASE_ID FROM AP_APP_RELEASE AS AR WHERE AR.AP_APP_ID = ? AND " + + "AR.APP_HASH_VALUE = ? AND AR.TENANT_ID = ?;"; + + stmt = conn.prepareStatement(sql); + stmt.setInt(1, appId); + stmt.setString(2, hashVal); + stmt.setInt(3, tenantId); + rs = stmt.executeQuery(); + + if (log.isDebugEnabled()) { + log.debug("Successfully retrieved basic details of the application release with the application ID " + + appId + " Application release hash value: " + hashVal); + } + return rs.next(); + } catch (SQLException e) { + throw new ApplicationManagementDAOException( + "Error occurred while getting application release details with app ID: " + appId + + " App release hash value: " + hashVal + " While executing query ", e); + } catch (DBConnectionException e) { + throw new ApplicationManagementDAOException("Error occurred while obtaining the DB connection.", e); + } finally { + Util.cleanupResources(stmt, rs); + } + } + + @Override + public String getPackageName(int appId, int tenantId) throws ApplicationManagementDAOException { + if (log.isDebugEnabled()) { + log.debug("Getting package name of the application release by application id:" + appId); + } + Connection conn; + PreparedStatement stmt = null; + ResultSet rs = null; + try { + conn = this.getDBConnection(); + String sql = "SELECT AR.PACKAGE_NAME AS PACKAGE_NAME FROM AP_APP_RELEASE AS AR WHERE AR.AP_APP_ID = ? " + + "AND AR.TENANT_ID = ? LIMIT 1;"; + + stmt = conn.prepareStatement(sql); + stmt.setInt(1, appId); + stmt.setInt(2, tenantId); + rs = stmt.executeQuery(); + + if (log.isDebugEnabled()) { + log.debug("Successfully retrieved package name of the application release with the application ID " + + appId); + } + if (rs.next()){ + return rs.getString("PACKAGE_NAME"); + } + return null; + } catch (SQLException e) { + throw new ApplicationManagementDAOException( + "Error occurred while getting package name of the application release with app ID: " + appId, e); + } catch (DBConnectionException e) { + throw new ApplicationManagementDAOException( + "Error occurred while obtaining the DB connection to get application release package name.", e); + } finally { + Util.cleanupResources(stmt, rs); + } + } + @Override public boolean verifyReleaseExistence(int appId, String uuid, int tenantId) throws ApplicationManagementDAOException { if (log.isDebugEnabled()) { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java index c330f7308a..ddb29961c0 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java @@ -35,8 +35,10 @@ import org.wso2.carbon.device.application.mgt.common.Tag; import org.wso2.carbon.device.application.mgt.common.UnrestrictedRole; import org.wso2.carbon.device.application.mgt.common.User; 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.RequestValidatingException; import org.wso2.carbon.device.application.mgt.common.exception.ResourceManagementException; +import org.wso2.carbon.device.application.mgt.common.exception.TransactionManagementException; import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager; import org.wso2.carbon.device.application.mgt.core.dao.ApplicationDAO; @@ -46,6 +48,7 @@ import org.wso2.carbon.device.application.mgt.core.dao.VisibilityDAO; import org.wso2.carbon.device.application.mgt.core.dao.common.ApplicationManagementDAOFactory; import org.wso2.carbon.device.application.mgt.core.dao.common.Util; import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException; +import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; import org.wso2.carbon.device.application.mgt.core.exception.ForbiddenException; import org.wso2.carbon.device.application.mgt.core.exception.LifeCycleManagementDAOException; import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; @@ -108,9 +111,8 @@ public class ApplicationManagerImpl implements ApplicationManager { List applicationReleases = new ArrayList<>(); try { ConnectionManagerUtil.beginDBTransaction(); - MAMDeviceConnectorImpl mamDeviceConnector = new MAMDeviceConnectorImpl(); // Getting the device type details to get device type ID for internal mappings - deviceType = mamDeviceConnector.getDeviceManagementService().getDeviceType(application.getDeviceType()); + deviceType = Util.getDeviceManagementService().getDeviceType(application.getDeviceType()); if (deviceType == null) { log.error("Device type is not matched with application type"); @@ -165,7 +167,7 @@ public class ApplicationManagerImpl implements ApplicationManager { LifecycleState lifecycleState = new LifecycleState(); lifecycleState.setCurrentState(AppLifecycleState.CREATED.toString()); lifecycleState.setPreviousState(AppLifecycleState.CREATED.toString()); - changeLifecycleState(appId, applicationRelease.getUuid(), lifecycleState, false, false); + changeLifecycleState(appId, applicationRelease.getUuid(), lifecycleState, false); applicationRelease.setLifecycleState(lifecycleState); applicationReleases.add(applicationRelease); @@ -245,15 +247,42 @@ public class ApplicationManagerImpl implements ApplicationManager { log.debug("Application release request is received for the application " + application.toString()); } try { - ConnectionManagerUtil.getDBConnection(); + ConnectionManagerUtil.openDBConnection(); + Application existingApplication = this.applicationDAO.getApplicationById(applicationId, tenantId); + if (existingApplication == null){ + throw new NotFoundException( + "Couldn't found application for the application Id: " + applicationId); + } + if (this.applicationReleaseDAO + .verifyReleaseExistenceByHash(applicationId, applicationRelease.getAppHashValue(), tenantId)) { + throw new BadRequestException("Application release exists for the application Id: " + applicationId + + " and uploaded binary file"); + } + String packageName = this.applicationReleaseDAO.getPackageName(applicationId, tenantId); + if (packageName != null && !packageName.equals(applicationRelease.getPackageName())) { + throw new BadRequestException( + "Package name in the payload is different from the existing package name of other application releases."); + } + ConnectionManagerUtil.beginDBTransaction(); applicationRelease = this.applicationReleaseDAO .createRelease(applicationRelease, application.getId(), tenantId); LifecycleState lifecycleState = new LifecycleState(); lifecycleState.setCurrentState(AppLifecycleState.CREATED.toString()); lifecycleState.setPreviousState(AppLifecycleState.CREATED.toString()); - changeLifecycleState(application.getId(), applicationRelease.getUuid(), lifecycleState, true, - false); + changeLifecycleState(application.getId(), applicationRelease.getUuid(), lifecycleState, false); + ConnectionManagerUtil.commitDBTransaction(); return applicationRelease; + } catch (TransactionManagementException e) { + ConnectionManagerUtil.rollbackDBTransaction(); + throw new ApplicationManagementException( + "Error occurred while staring application release creating transaction for application Id: " + + applicationId, e); + } catch (DBConnectionException e) { + ConnectionManagerUtil.rollbackDBTransaction(); + throw new ApplicationManagementException( + "Error occurred while adding application release into IoTS app management Application id of the " + + "application release: " + applicationId, e); + } catch (ApplicationManagementDAOException e) { throw new ApplicationManagementException( "Error occurred while adding application release into IoTS app management Application id of the " @@ -321,6 +350,53 @@ public class ApplicationManagerImpl implements ApplicationManager { } } + @Override + public Application getApplicationByUuid(String uuid, String state) throws ApplicationManagementException { + int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); + String userName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername(); + Application application; + boolean isAppAllowed = false; + boolean isOpenConnection = false; + List applicationReleases = null; + try { + if (state != null) { + ConnectionManagerUtil.openDBConnection(); + isOpenConnection = true; + } + application = this.applicationDAO.getApplicationByUUID(uuid, tenantId); + if (application == null) { + throw new NotFoundException("Couldn't find an application for application release UUID:: " + uuid); + } + if (isAdminUser(userName, tenantId, CarbonConstants.UI_ADMIN_PERMISSION_COLLECTION)) { + applicationReleases = getReleases(application, state); + application.setApplicationReleases(applicationReleases); + return application; + } + + if (!application.getUnrestrictedRoles().isEmpty()) { + if (isRoleExists(application.getUnrestrictedRoles(), userName)) { + isAppAllowed = true; + } + } else { + isAppAllowed = true; + } + + if (!isAppAllowed) { + return null; + } + applicationReleases = getReleases(application, state); + application.setApplicationReleases(applicationReleases); + return application; + } catch (UserStoreException e) { + throw new ApplicationManagementException( + "User-store exception while getting application with the application release UUID " + uuid); + } finally { + if (isOpenConnection) { + ConnectionManagerUtil.closeDBConnection(); + } + } + } + private boolean isRoleExists(Collection unrestrictedRoleList, String userName) throws UserStoreException { String[] roleList; @@ -467,6 +543,14 @@ public class ApplicationManagerImpl implements ApplicationManager { if (AppLifecycleState.PUBLISHED.toString() .equals(state) && filteredReleases.size() > 1) { log.warn("There are more than one application releases is found which is in PUBLISHED state"); + filteredReleases.sort((r1, r2) -> { + if (r1.getLifecycleState().getUpdatedAt().after(r2.getLifecycleState().getUpdatedAt())) { + return -1; + } else if (r2.getLifecycleState().getUpdatedAt().after(r1.getLifecycleState().getUpdatedAt())) { + return 1; + } + return 0; + }); } return filteredReleases; } @@ -502,7 +586,7 @@ public class ApplicationManagerImpl implements ApplicationManager { LifecycleState newAppLifecycleState = new LifecycleState(); newAppLifecycleState.setPreviousState(appLifecycleState.getCurrentState()); newAppLifecycleState.setCurrentState(AppLifecycleState.REMOVED.toString()); - changeLifecycleState(applicationId, applicationRelease.getUuid(), newAppLifecycleState, true, false); + changeLifecycleState(applicationId, applicationRelease.getUuid(), newAppLifecycleState, false); storedLocations.add(applicationRelease.getAppHashValue()); } this.applicationDAO.deleteApplication(applicationId); @@ -537,7 +621,7 @@ public class ApplicationManagerImpl implements ApplicationManager { LifecycleState newAppLifecycleState = new LifecycleState(); newAppLifecycleState.setPreviousState(appLifecycleState.getCurrentState()); newAppLifecycleState.setCurrentState(AppLifecycleState.REMOVED.toString()); - changeLifecycleState(applicationId, applicationRelease.getUuid(), newAppLifecycleState, true, false); + changeLifecycleState(applicationId, applicationRelease.getUuid(), newAppLifecycleState, false); } else { throw new ApplicationManagementException("Can't delete the application release, You have to move the " + "lifecycle state from " + currentState + " to acceptable " + @@ -751,7 +835,6 @@ public class ApplicationManagerImpl implements ApplicationManager { try { ConnectionManagerUtil.openDBConnection(); applicationRelease = getAppReleaseIfExists(appId, uuid); - Application application = getApplicationById(appId, null); List deviceTypes = Util.getDeviceManagementService().getDeviceTypes(); @@ -838,8 +921,7 @@ public class ApplicationManagerImpl implements ApplicationManager { + releaseUuid); } - lifecycleState.setNextStates(new ArrayList<>(getLifecycleManagementService(). - getNextLifecycleStates(lifecycleState.getCurrentState()))); + lifecycleState.setNextStates(new ArrayList<>(lifecycleStateManger.getNextLifecycleStates(lifecycleState.getCurrentState()))); } catch (ApplicationManagementException e) { throw new ApplicationManagementException("Failed to get application and application management", e); @@ -849,15 +931,14 @@ public class ApplicationManagerImpl implements ApplicationManager { return lifecycleState; } - @Override - public void changeLifecycleState(int applicationId, String releaseUuid, LifecycleState state, Boolean checkExist, - Boolean handleDBConnections) throws ApplicationManagementException { + @Override public void changeLifecycleState(int applicationId, String releaseUuid, LifecycleState state, + Boolean checkExist) throws ApplicationManagementException { + int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); + boolean handleDBConnection = false; try { - int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); if (checkExist) { - if (handleDBConnections) { - ConnectionManagerUtil.openDBConnection(); - } + ConnectionManagerUtil.openDBConnection(); + handleDBConnection = true; if (!this.applicationDAO.verifyApplicationExistenceById(applicationId, tenantId)){ throw new NotFoundException( "Couldn't found application for the application Id: " + applicationId); @@ -867,14 +948,20 @@ public class ApplicationManagerImpl implements ApplicationManager { "Couldn't found application release for the application Id: " + applicationId + " application release uuid: " + releaseUuid); } + LifecycleState currentState = this.lifecycleStateDAO.getLatestLifeCycleState(applicationId, releaseUuid); + if (currentState == null){ + throw new ApplicationManagementException( + "Couldn't found latest lifecycle state for the appId: " + applicationId + + " and application release UUID: " + releaseUuid); + } + state.setPreviousState(currentState.getCurrentState()); } String userName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername(); state.setUpdatedBy(userName); if (state.getCurrentState() != null && state.getPreviousState() != null) { - if (getLifecycleManagementService() - .isValidStateChange(state.getPreviousState(), state.getCurrentState())) { + if (lifecycleStateManger.isValidStateChange(state.getPreviousState(), state.getCurrentState())) { //todo if current state of the adding lifecycle state is PUBLISHED, need to check whether is there //todo any other application release in PUBLISHED state for the application( i.e for the appid) this.lifecycleStateDAO.addLifecycleState(state, applicationId, releaseUuid, tenantId); @@ -890,7 +977,7 @@ public class ApplicationManagerImpl implements ApplicationManager { "Failed to add lifecycle state. Application Id: " + applicationId + " Application release UUID: " + releaseUuid, e); } finally { - if (handleDBConnections) { + if (handleDBConnection) { ConnectionManagerUtil.closeDBConnection(); } } @@ -997,15 +1084,4 @@ public class ApplicationManagerImpl implements ApplicationManager { return list; } - public LifecycleStateManger getLifecycleManagementService() { - PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); - LifecycleStateManger deviceManagementProviderService = - (LifecycleStateManger) ctx.getOSGiService(LifecycleStateManger.class, null); - if (deviceManagementProviderService == null) { - String msg = "DeviceImpl Management provider service has not initialized."; - log.error(msg); - throw new IllegalStateException(msg); - } - return deviceManagementProviderService; - } } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/pom.xml index 91ae58570a..cd610174b7 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/pom.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/pom.xml @@ -22,13 +22,13 @@ application-mgt org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.application.mgt.publisher.api - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT war WSO2 Carbon - Application Management Publisher API WSO2 Carbon - Application Management Publisher API diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementAPI.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementAPI.java index d46e8a0b1a..1ab0ec9187 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementAPI.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementAPI.java @@ -313,6 +313,79 @@ public interface ApplicationManagementAPI { @Multipart(value = "screenshot3") Attachment screenshot3 ); + @POST + @Produces(MediaType.APPLICATION_JSON) + @Consumes("multipart/mixed") + @Path("/{deviceType}/{appType}/{appId}") + @ApiOperation( + consumes = MediaType.APPLICATION_JSON, + produces = MediaType.APPLICATION_JSON, + httpMethod = "POST", + value = "Create an application", + notes = "This will create a new application", + tags = "Application Management", + extensions = { + @Extension(properties = { + @ExtensionProperty(name = SCOPE, value = "perm:app:publisher:update") + }) + } + ) + @ApiResponses( + value = { + @ApiResponse( + code = 201, + message = "OK. \n Successfully created an application.", + response = Application.class), + @ApiResponse( + code = 400, + message = "Bad Request. \n " + + "Application creating payload contains unacceptable or vulnerable data"), + @ApiResponse( + code = 500, + message = "Internal Server Error. \n Error occurred while creating the application.", + response = ErrorResponse.class) + }) + Response createRelease( + @PathParam("deviceType") String deviceType, + @PathParam("appId") String appType, + @PathParam("appId") int appId, + @ApiParam( + name = "applicationRelease", + value = "The application release that need to be created.", + required = true) + @Multipart("applicationRelease") ApplicationRelease applicationRelease, + @ApiParam( + name = "binaryFile", + value = "Binary file of uploading application", + required = true) + @Multipart(value = "binaryFile") Attachment binaryFile, + @ApiParam( + name = "icon", + value = "Icon of the uploading application", + required = true) + @Multipart(value = "icon") Attachment iconFile, + @ApiParam( + name = "banner", + value = "Banner of the uploading application", + required = true) + @Multipart(value = "banner") Attachment bannerFile, + @ApiParam( + name = "screenshot1", + value = "Screen Shots of the uploading application", + required = true) + @Multipart(value = "screenshot1") Attachment screenshot1, + @ApiParam( + name = "screenshot2", + value = "Screen Shots of the uploading application", + required = false) + @Multipart(value = "screenshot2") Attachment screenshot2, + @ApiParam( + name = "screenshot3", + value = "Screen Shots of the uploading application", + required = false) + @Multipart(value = "screenshot3") Attachment screenshot3 + ); + @DELETE @Consumes("application/json") @Path("/{appid}") @@ -557,6 +630,10 @@ public interface ApplicationManagementAPI { code = 201, message = "OK. \n Successfully add a lifecycle state.", response = Application.class), + @ApiResponse( + code = 400, + message = "Bad Request. \n " + + "Lifecycle State changing request contains unacceptable or vulnerable data"), @ApiResponse( code = 404, message = "NOT FOUND. \n Error occurred while adding new lifecycle state.", @@ -566,7 +643,21 @@ public interface ApplicationManagementAPI { message = "Internal Server Error. \n Error occurred adding a lifecycle state.", response = ErrorResponse.class) }) - Response addLifecycleState(@PathParam("appId") int applicationId, - @PathParam("uuid") String applicationUuid, - LifecycleState state); + Response addLifecycleState( + @ApiParam( + name = "appId", + value = "Identifier of the Application", + required = true) + @PathParam("appId") int applicationId, + @ApiParam( + name = "uuid", + value = "UUID of the Application Release", + required = true) + @PathParam("uuid") String applicationUuid, + @ApiParam( + name = "action", + value = "Changing lifecycle state", + required = true) + @QueryParam("action") String action + ); } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementAPIImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementAPIImpl.java index 959b471c30..9dd52fa389 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementAPIImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementAPIImpl.java @@ -96,8 +96,8 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { } ApplicationList applications = applicationManager.getApplications(filter); if (applications.getApplications().isEmpty()) { - return Response.status(Response.Status.NOT_FOUND).entity - ("Couldn't find any application for requested query.").build(); + return Response.status(Response.Status.NOT_FOUND) + .entity("Couldn't find any application for requested query.").build(); } return Response.status(Response.Status.OK).entity(applications).build(); } catch (ApplicationManagementException e) { @@ -147,10 +147,10 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { ApplicationRelease applicationRelease; List attachmentList = new ArrayList<>(); attachmentList.add(screenshot1); - if(screenshot2 != null) { + if (screenshot2 != null) { attachmentList.add(screenshot2); } - if(screenshot3 != null) { + if (screenshot3 != null) { attachmentList.add(screenshot3); } @@ -183,8 +183,8 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { } // Upload images - applicationRelease = applicationStorageManager.uploadImageArtifacts(applicationRelease, iconFileStream, - bannerFileStream, attachments); + applicationRelease = applicationStorageManager + .uploadImageArtifacts(applicationRelease, iconFileStream, bannerFileStream, attachments); applicationRelease.setUuid(UUID.randomUUID().toString()); applicationReleases.add(applicationRelease); application.setApplicationReleases(applicationReleases); @@ -202,8 +202,9 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); } catch (ResourceManagementException e) { - log.error("Error occurred while uploading the releases artifacts of the application " - + application.getName(), e); + log.error( + "Error occurred while uploading the releases artifacts of the application " + application.getName(), + e); return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR); } catch (IOException e) { String errorMessage = @@ -218,24 +219,109 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { } } + @POST + @Consumes("multipart/mixed") + @Path("/{deviceType}/{appType}/{appId}") + public Response createRelease( + @PathParam("deviceType") String deviceType, + @PathParam("appId") String appType, + @PathParam("appId") int appId, + @Multipart("applicationRelease") ApplicationRelease applicationRelease, + @Multipart("binaryFile") Attachment binaryFile, + @Multipart("icon") Attachment iconFile, + @Multipart("banner") Attachment bannerFile, + @Multipart("screenshot1") Attachment screenshot1, + @Multipart("screenshot2") Attachment screenshot2, + @Multipart("screenshot3") Attachment screenshot3) { + ApplicationManager applicationManager = APIUtil.getApplicationManager(); + ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager(); + InputStream iconFileStream; + InputStream bannerFileStream; + List attachments = new ArrayList<>(); + List attachmentList = new ArrayList<>(); + attachmentList.add(screenshot1); + if (screenshot2 != null) { + attachmentList.add(screenshot2); + } + if (screenshot3 != null) { + attachmentList.add(screenshot3); + } + + try { + if (!isValidReleaseCreatingRequest(binaryFile, iconFile, bannerFile, attachmentList, appType)) { + return Response.status(Response.Status.BAD_REQUEST).build(); + } + + // The application executable artifacts such as apks are uploaded. + if (!ApplicationType.ENTERPRISE.toString().equals(appType)) { + applicationRelease = applicationStorageManager + .uploadReleaseArtifact(applicationRelease, appType, deviceType, null); + } else { + applicationRelease = applicationStorageManager + .uploadReleaseArtifact(applicationRelease, appType, deviceType, + binaryFile.getDataHandler().getInputStream()); + if (applicationRelease.getAppStoredLoc() == null || applicationRelease.getAppHashValue() == null) { + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); + } + } + + iconFileStream = iconFile.getDataHandler().getInputStream(); + bannerFileStream = bannerFile.getDataHandler().getInputStream(); + + for (Attachment screenshot : attachmentList) { + attachments.add(screenshot.getDataHandler().getInputStream()); + } + + // Upload images + applicationRelease = applicationStorageManager + .uploadImageArtifacts(applicationRelease, iconFileStream, bannerFileStream, attachments); + applicationRelease.setUuid(UUID.randomUUID().toString()); + + // Created new application release entry + ApplicationRelease release = applicationManager.createRelease(appId, applicationRelease); + if (release != null) { + return Response.status(Response.Status.CREATED).entity(release).build(); + } else { + log.error("Application Creation Failed"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); + } + } catch (ApplicationManagementException e) { + String msg = "Error occurred while creating the application"; + log.error(msg, e); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); + } catch (ResourceManagementException e) { + log.error( + "Error occurred while uploading the releases artifacts of the application ID: " + appId, + e); + return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR); + } catch (IOException e) { + String errorMessage = + "Error while uploading binary file and resources for the application release of the application ID: " + + appId; + log.error(errorMessage, e); + return APIUtil.getResponse(new ApplicationManagementException(errorMessage, e), + Response.Status.INTERNAL_SERVER_ERROR); + } catch (RequestValidatingException e) { + log.error("Error occurred while handling the application creating request"); + return APIUtil.getResponse(e, Response.Status.BAD_REQUEST); + } + } + @Override @PUT @Consumes("multipart/mixed") @Produces(MediaType.APPLICATION_JSON) @Path("/image-artifacts/{appId}/{uuid}") public Response updateApplicationImageArtifacts( - @PathParam("appId") int appId, - @PathParam("uuid") String applicationUuid, - @Multipart("icon") Attachment iconFile, - @Multipart("banner") Attachment bannerFile, - @Multipart("screenshot1") Attachment screenshot1, - @Multipart("screenshot2") Attachment screenshot2, + @PathParam("appId") int appId, @PathParam("uuid") String applicationUuid, + @Multipart("icon") Attachment iconFile, @Multipart("banner") Attachment bannerFile, + @Multipart("screenshot1") Attachment screenshot1, @Multipart("screenshot2") Attachment screenshot2, @Multipart("screenshot3") Attachment screenshot3) { try { InputStream iconFileStream = null; InputStream bannerFileStream = null; - List attachments = new ArrayList<>();; + List attachments = new ArrayList<>(); if (iconFile != null) { iconFileStream = iconFile.getDataHandler().getInputStream(); @@ -245,18 +331,18 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { } attachments.add(screenshot1.getDataHandler().getInputStream()); - if(screenshot2 != null) { + if (screenshot2 != null) { attachments.add(screenshot2.getDataHandler().getInputStream()); } - if(screenshot3 != null) { + if (screenshot3 != null) { attachments.add(screenshot3.getDataHandler().getInputStream()); } ApplicationManager applicationManager = APIUtil.getApplicationManager(); - applicationManager.updateApplicationImageArtifact(appId, - applicationUuid, iconFileStream, bannerFileStream, attachments); + applicationManager.updateApplicationImageArtifact(appId, applicationUuid, iconFileStream, bannerFileStream, + attachments); - return Response.status(Response.Status.OK).entity("Successfully uploaded artifacts for the application " - + applicationUuid).build(); + return Response.status(Response.Status.OK) + .entity("Successfully uploaded artifacts for the application " + applicationUuid).build(); } catch (NotFoundException e) { log.error(e.getMessage(), e); return APIUtil.getResponse(e, Response.Status.NOT_FOUND); @@ -267,8 +353,8 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { } catch (IOException e) { String msg = "Exception while trying to read icon, banner files for the application " + applicationUuid; log.error(msg); - return APIUtil.getResponse(new ApplicationManagementException(msg, e), - Response.Status.INTERNAL_SERVER_ERROR); + return APIUtil + .getResponse(new ApplicationManagementException(msg, e), Response.Status.INTERNAL_SERVER_ERROR); } catch (ResourceManagementException e) { log.error("Error occurred while uploading the image artifacts of the application with the uuid " + applicationUuid, e); @@ -296,14 +382,13 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { APIUtil.getApplicationManager().updateApplicationArtifact(applicationId, applicationUuid, binaryFile.getDataHandler().getInputStream()); return Response.status(Response.Status.OK) - .entity("Successfully uploaded artifacts for the application release. UUID is " + applicationUuid).build(); + .entity("Successfully uploaded artifacts for the application release. UUID is " + applicationUuid) + .build(); } catch (IOException e) { - String msg = - "Error occurred while trying to read icon, banner files for the application release" + - applicationUuid; + String msg = "Error occurred while trying to read icon, banner files for the application release" + + applicationUuid; log.error(msg); - return APIUtil.getResponse(new ApplicationManagementException(msg, e), - Response.Status.BAD_REQUEST); + return APIUtil.getResponse(new ApplicationManagementException(msg, e), Response.Status.BAD_REQUEST); } catch (ResourceManagementException e) { log.error("Error occurred while uploading the image artifacts of the application with the uuid " + applicationUuid, e); @@ -313,8 +398,9 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { + applicationUuid, e); return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR); } catch (RequestValidatingException e) { - log.error("Error occured while handling the application artifact updating request. application release UUID: " - + applicationUuid); + log.error( + "Error occured while handling the application artifact updating request. application release UUID: " + + applicationUuid); return APIUtil.getResponse(e, Response.Status.BAD_REQUEST); } catch (DeviceManagementException e) { log.error("Error occurred while updating the image artifacts of the application with the uuid " @@ -360,8 +446,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { try { Application application = applicationManager.getApplicationIfAccessible(applicationId); - if (!applicationManager.isAcceptableAppReleaseUpdate(application.getId(), - applicationRelease.getUuid())) { + if (!applicationManager.isAcceptableAppReleaseUpdate(application.getId(), applicationRelease.getUuid())) { String msg = "Application release is in the " + applicationRelease.getLifecycleState().getCurrentState() + " state. Hence updating is not acceptable when application in this state"; log.error(msg); @@ -384,9 +469,9 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { } } -// applicationRelease = applicationStorageManager -// .updateImageArtifacts(applicationRelease, iconFileStream, bannerFileStream, attachments); -// applicationRelease = applicationManager.updateRelease(applicationId, applicationRelease); + // applicationRelease = applicationStorageManager + // .updateImageArtifacts(applicationRelease, iconFileStream, bannerFileStream, attachments); + // applicationRelease = applicationManager.updateRelease(applicationId, applicationRelease); return Response.status(Response.Status.OK).entity(applicationRelease).build(); } catch (ApplicationManagementException e) { @@ -402,8 +487,9 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { + applicationUUID + " for the release " + applicationRelease.getVersion(), e); return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR); } catch (RequestValidatingException e) { - log.error("Error occured while handling the application release updating request. application release UUID: " - + applicationUUID); + log.error( + "Error occured while handling the application release updating request. application release UUID: " + + applicationUUID); return APIUtil.getResponse(e, Response.Status.BAD_REQUEST); } } @@ -462,13 +548,12 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { ApplicationManager applicationManager = APIUtil.getApplicationManager(); try { lifecycleState = applicationManager.getLifecycleState(applicationId, applicationUuid); - } catch (NotFoundException e){ + } catch (NotFoundException e) { String msg = "Couldn't found application lifecycle details for appid: " + applicationId + " and app release UUID: " + applicationUuid; log.error(msg, e); return Response.status(Response.Status.NOT_FOUND).build(); - } - catch (ApplicationManagementException e) { + } catch (ApplicationManagementException e) { String msg = "Error occurred while getting lifecycle state."; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); @@ -481,10 +566,17 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { public Response addLifecycleState( @PathParam("appId") int applicationId, @PathParam("uuid") String applicationUuid, - LifecycleState state) { + @QueryParam("action") String action) { ApplicationManager applicationManager = APIUtil.getApplicationManager(); try { - applicationManager.changeLifecycleState(applicationId, applicationUuid, state, true, true); + if (action == null || action.isEmpty()) { + String msg = "The Action is null or empty. Please check the request"; + log.error(msg); + return Response.status(Response.Status.BAD_REQUEST).build(); + } + LifecycleState state = new LifecycleState(); + state.setCurrentState(action); + applicationManager.changeLifecycleState(applicationId, applicationUuid, state, true); } catch (NotFoundException e) { String msg = "Could,t find application release for application id: " + applicationId + " and application release uuid: " + applicationUuid; @@ -499,37 +591,62 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { } private boolean isValidAppCreatingRequest(Attachment binaryFile, Attachment iconFile, Attachment bannerFile, - List attachmentList, Application application){ + List attachmentList, Application application) { if (application.getApplicationReleases().size() > 1) { - log.error( - "Invalid application creating request. Application creating request must have single application " - + "release. Application name:" + application.getName() + " and type: " + - application.getType()); + log.error("Invalid application creating request. Application creating request must have single application " + + "release. Application name:" + application.getName() + " and type: " + application.getType()); return false; } if (iconFile == null) { - log.error("Icon file is not found for the application release. Application name: " + - application.getName() + " and type: " + application.getType()); + log.error("Icon file is not found for the application release. Application name: " + application.getName() + + " and type: " + application.getType()); return false; } if (bannerFile == null) { - log.error("Banner file is not found for the application release. Application name: " + - application.getName() + " and application type: " + application.getType()); + log.error("Banner file is not found for the application release. Application name: " + application.getName() + + " and application type: " + application.getType()); return false; } if (attachmentList == null || attachmentList.isEmpty()) { - log.error("Screenshots are not found for the application release. Application name: " + - application.getName() + " Application type: " + application.getType()); + log.error( + "Screenshots are not found for the application release. Application name: " + application.getName() + + " Application type: " + application.getType()); return false; } if (binaryFile == null && ApplicationType.ENTERPRISE.toString().equals(application.getType())) { - log.error("Binary file is not found for the application release. Application name: " - + application.getName() + " Application type: " + application.getType()); + log.error("Binary file is not found for the application release. Application name: " + application.getName() + + " Application type: " + application.getType()); + return false; + } + return true; + } + + private boolean isValidReleaseCreatingRequest(Attachment binaryFile, Attachment iconFile, Attachment bannerFile, + List attachmentList, String appType) { + + if (iconFile == null) { + log.error("Icon file is not found with the application release creating request."); + return false; + } + + if (bannerFile == null) { + log.error("Banner file is not found with the application release creating request."); + return false; + } + + if (attachmentList == null || attachmentList.isEmpty()) { + log.error("Screenshots are not found with the application release creating request."); + return false; + } + + if (binaryFile == null && ApplicationType.ENTERPRISE.toString().equals(appType)) { + log.error("Binary file is not found with the application release creating request. Application type: " + + appType); return false; } return true; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/pom.xml index 33f2cac96b..9b8b893d21 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/pom.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/pom.xml @@ -22,12 +22,12 @@ org.wso2.carbon.devicemgt application-mgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT 4.0.0 org.wso2.carbon.device.application.mgt.publisher.ui - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - Application Management Publisher UI WSO2 Carbon - Application Management Publisher UI React Application http://wso2.org diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/App.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/App.jsx index 4a3d606eff..2df6805a53 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/App.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/App.jsx @@ -68,6 +68,7 @@ class Base extends Component { render() { if (this.state.user !== null) { + console.log(sessionStorage); return (
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/pom.xml index 76e17d7186..384b6a89e6 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/pom.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/pom.xml @@ -22,13 +22,13 @@ application-mgt org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.application.mgt.store.api - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT war WSO2 Carbon - Application Management Store API WSO2 Carbon - Application Management Store API diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ApplicationManagementAPI.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ApplicationManagementAPI.java index dafaae5108..80be617a95 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ApplicationManagementAPI.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ApplicationManagementAPI.java @@ -30,12 +30,10 @@ import io.swagger.annotations.SwaggerDefinition; import io.swagger.annotations.Tag; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; -import org.wso2.carbon.device.application.mgt.common.Filter; import org.wso2.carbon.device.application.mgt.common.ErrorResponse; import org.wso2.carbon.device.application.mgt.common.Application; import org.wso2.carbon.device.application.mgt.common.ApplicationList; -import javax.validation.Valid; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.Path; @@ -69,52 +67,14 @@ import javax.ws.rs.core.Response; @Scope( name = "Get Application Details", description = "Get application details", - key = "perm:application:get", + key = "perm:app:store:view", permissions = {"/device-mgt/application/get"} - ), - @Scope( - name = "Create an Application", - description = "Create an application", - key = "perm:application:create", - permissions = {"/device-mgt/application/create"} - ), - @Scope( - name = "Update an Application", - description = "Update an application", - key = "perm:application:update", - permissions = {"/device-mgt/application/update"} - ), - @Scope( - name = "Create an Application", - description = "Create an application", - key = "perm:application-mgt:login", - permissions = {"/device-mgt/application-mgt/login"} - ), - @Scope( - name = "Delete an Application", - description = "Delete an application", - key = "perm:application:delete", - permissions = {"/device-mgt/application/delete"} - ), - @Scope( - name = "Create an application category", - description = "Create an application category", - key = "perm:application-category:create", - permissions = {"/device-mgt/application/category/create"} - ), - @Scope( - name = "Delete an Application category", - description = "Delete an application category", - key = "perm:application-category:delete", - permissions = {"/device-mgt/application/category/delete"} ) - - } ) @Path("/store/applications") -@Api(value = "Application Management", description = "This API carries all application management related operations " + - "such as get all the applications, add application, etc.") +@Api(value = "Application Management", description = "This API carries all app store management related operations " + + "such as get all the applications etc.") @Produces(MediaType.APPLICATION_JSON) public interface ApplicationManagementAPI { @@ -143,9 +103,8 @@ public interface ApplicationManagementAPI { message = "OK. \n Successfully got application list.", response = ApplicationList.class), @ApiResponse( - code = 304, - message = "Not Modified. Empty body because the client already has the latest version " - + "of the requested resource."), + code = 404, + message = "Not Found. Not Found Applications."), @ApiResponse( code = 500, message = "Internal Server Error. \n Error occurred while getting the application list.", @@ -153,10 +112,21 @@ public interface ApplicationManagementAPI { }) Response getApplications( @ApiParam( - name = "filter", - value = "Filter to get application list", - required = true) - @Valid Filter filter, + name = "name", + value = "Name of the application") + @QueryParam("name") String appName, + @ApiParam( + name = "type", + value = "Type of the application") + @QueryParam("type") String appType, + @ApiParam( + name = "category", + value = "Category of the application") + @QueryParam("category") String appCategory, + @ApiParam( + name = "exact-match", + value = "Is it requesting exactly matching application or partially matching application.") + @QueryParam("exact-match") boolean isFullMatch, @ApiParam( name = "offset", value = "Provide from which position apps should return", defaultValue = "0") @@ -164,12 +134,16 @@ public interface ApplicationManagementAPI { @ApiParam( name = "limit", value = "Provide how many apps it should return", defaultValue = "20") - @QueryParam("limit") int limit + @QueryParam("limit") int limit, + @ApiParam( + name = "limit", + value = "Provide how many apps it should return", defaultValue = "ASC") + @QueryParam("sort") String sortBy ); @GET - @Path("/{appType}") + @Path("/{uuid}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @ApiOperation( @@ -201,15 +175,10 @@ public interface ApplicationManagementAPI { }) Response getApplication( @ApiParam( - name = "appType", + name = "uuid", value = "Type of the application", required = true) - @PathParam("appType") String appType, - @ApiParam( - name = "appName", - value = "Application name", - required = true) - @QueryParam("appName") String appName + @PathParam("uuid") String uuid ); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java index ae4a088df9..38f9ec1db0 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java @@ -21,7 +21,6 @@ package org.wso2.carbon.device.application.mgt.store.api.services.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.AppLifecycleState; -import org.wso2.carbon.device.application.mgt.common.ApplicationRelease; 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; @@ -31,117 +30,84 @@ import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; import org.wso2.carbon.device.application.mgt.core.util.APIUtil; import org.wso2.carbon.device.application.mgt.store.api.services.ApplicationManagementAPI; -import javax.validation.Valid; import javax.ws.rs.Consumes; +import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.Response; -import java.util.ArrayList; -import java.util.List; /** * Implementation of Application Management related APIs. */ -@Produces({"application/json"}) +@Produces({ "application/json" }) @Path("/store/applications") public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { private static Log log = LogFactory.getLog(ApplicationManagementAPIImpl.class); @GET - @Consumes("application/json") @Override + @Consumes("application/json") public Response getApplications( - @Valid Filter filter, - @QueryParam("offset") int offset, - @QueryParam("limit") int limit) { - ApplicationManager applicationManager = APIUtil.getApplicationManager(); + @QueryParam("name") String appName, + @QueryParam("type") String appType, + @QueryParam("category") String appCategory, + @QueryParam("exact-match") boolean isFullMatch, + @DefaultValue("0") @QueryParam("offset") int offset, + @DefaultValue("20") @QueryParam("limit") int limit, + @DefaultValue("ASC") @QueryParam("sort") String sortBy) { + ApplicationManager applicationManager = APIUtil.getApplicationManager(); try { + Filter filter = new Filter(); filter.setOffset(offset); filter.setLimit(limit); - + filter.setSortBy(sortBy); + filter.setFullMatch(isFullMatch); + filter.setCurrentAppReleaseState(AppLifecycleState.PUBLISHED.toString()); + if (appName != null && !appName.isEmpty()) { + filter.setAppName(appName); + } + if (appType != null && !appType.isEmpty()) { + filter.setAppType(appType); + } + if (appCategory != null && !appCategory.isEmpty()) { + filter.setAppCategory(appCategory); + } ApplicationList applications = applicationManager.getApplications(filter); - List publishedApplicationRelease = new ArrayList<>(); - - for (Application application : applications.getApplications()) { - - for (ApplicationRelease appRelease: application.getApplicationReleases()){ - if (AppLifecycleState.PUBLISHED.toString() - .equals(appRelease.getLifecycleState().getCurrentState())) { - publishedApplicationRelease.add(appRelease); - } - } - if (publishedApplicationRelease.size()>1){ - String msg = "Application " + application.getName() - + " has more than one PUBLISHED application releases"; - log.error(msg); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR) - .entity(msg).build(); - } - application.setApplicationReleases(publishedApplicationRelease); - publishedApplicationRelease.clear(); + if (applications.getApplications().isEmpty()) { + return Response.status(Response.Status.NOT_FOUND) + .entity("Couldn't find any application for requested query.").build(); } return Response.status(Response.Status.OK).entity(applications).build(); - } catch (NotFoundException e) { - return Response.status(Response.Status.NOT_FOUND).build(); } catch (ApplicationManagementException e) { - String msg = "Error occurred while getting the application list"; + String msg = "Error occurred while getting the application list for publisher "; log.error(msg, e); - return Response.status(Response.Status.BAD_REQUEST).build(); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } } @GET @Consumes("application/json") - @Path("/{appType}") - public Response getApplication(@PathParam("appType") String appType, - @QueryParam("appName") String appName) { + @Path("/{uuid}") + public Response getApplication( + @PathParam("uuid") String uuid) { ApplicationManager applicationManager = APIUtil.getApplicationManager(); - List filteredApps = new ArrayList<>(); - Filter filter; try { - filter = new Filter(); - filter.setOffset(0); - filter.setLimit(20); - filter.setAppType(appType); - filter.setAppName(appName); - ApplicationList applications = applicationManager.getApplications(filter); - if (applications.getApplications().isEmpty()) { - return Response.status(Response.Status.NOT_FOUND) - .entity("Application with application type: " + appType + " not found").build(); - } - for (Application application : applications.getApplications()) { - List publishedApplicationRelease = new ArrayList<>(); - for (ApplicationRelease appRelease : application.getApplicationReleases()) { - if (AppLifecycleState.PUBLISHED.toString() - .equals(appRelease.getLifecycleState().getCurrentState())) { - publishedApplicationRelease.add(appRelease); - } - } - if (publishedApplicationRelease.size() > 1) { - String msg = "Application " + application.getName() - + " has more than one PUBLISHED application releases"; - log.error(msg); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); - } - application.setApplicationReleases(publishedApplicationRelease); - filteredApps.add(application); - } - applications.setApplications(filteredApps); - return Response.status(Response.Status.OK).entity(applications).build(); + Application application = applicationManager + .getApplicationByUuid(uuid, AppLifecycleState.PUBLISHED.toString()); + return Response.status(Response.Status.OK).entity(application).build(); } catch (NotFoundException e) { - return Response.status(Response.Status.NOT_FOUND).build(); + String msg = "Application with application release UUID: " + uuid + " is not found"; + log.error(msg, e); + return Response.status(Response.Status.NOT_FOUND).entity(msg).build(); } catch (ApplicationManagementException e) { - log.error("Error occurred while getting application with the application type: " + appType - + " and application name: " + appName, e); - return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR); + String msg = "Error occurred while getting application with the application release uuid: " + uuid; + log.error(msg, e); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } } - -// todo --> get applications by category - } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/pom.xml index 427d73439a..ae47784209 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/pom.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/pom.xml @@ -24,10 +24,10 @@ org.wso2.carbon.devicemgt application-mgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT org.wso2.carbon.device.application.mgt.store.ui - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT diff --git a/components/application-mgt/pom.xml b/components/application-mgt/pom.xml index a488c2a8f1..ed3275968c 100644 --- a/components/application-mgt/pom.xml +++ b/components/application-mgt/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml 4.0.0 application-mgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - Application Management Component WSO2 Carbon - Application Management Component diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml index c69f1c4d68..4bc37cd31f 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml @@ -22,7 +22,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml index b35a3f2122..03126821ea 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml @@ -22,7 +22,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.v09.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.v09.api/pom.xml index 01baa16e1a..c8ee274238 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.v09.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.v09.api/pom.xml @@ -24,7 +24,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml index f79b64055c..50e263c21d 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml @@ -21,13 +21,13 @@ org.wso2.carbon.devicemgt certificate-mgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.certificate.mgt.core - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT bundle WSO2 Carbon - Certificate Management Core WSO2 Carbon - Certificate Management Core diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/pom.xml index 05b21e441f..11b3d067de 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/pom.xml @@ -24,7 +24,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/pom.xml b/components/certificate-mgt/pom.xml index 7414ce94c9..b179cec3d8 100644 --- a/components/certificate-mgt/pom.xml +++ b/components/certificate-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt certificate-mgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - Certificate Management Component http://wso2.org diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml index f354fdfe76..0cc3131ba6 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml index ea82cf7176..00d8b1742a 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml index 070d0272e2..e602b9624e 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml index b872de83bf..77a1068fb4 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml index 0474146584..29a78f4ac0 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml index 055a45d153..f79d79b492 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/pom.xml b/components/device-mgt-extensions/pom.xml index 9baa22ad80..13714047a0 100644 --- a/components/device-mgt-extensions/pom.xml +++ b/components/device-mgt-extensions/pom.xml @@ -22,7 +22,7 @@ carbon-devicemgt org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml index 4516c1fe8f..18f0b7b855 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml index c7de451372..4b31a9287a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml @@ -20,7 +20,7 @@ device-mgt org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT 4.0.0 diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/inbound/SubscriptionEndpoint.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/inbound/SubscriptionEndpoint.java index 14db789fa9..b556949ae1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/inbound/SubscriptionEndpoint.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/inbound/SubscriptionEndpoint.java @@ -49,7 +49,7 @@ public class SubscriptionEndpoint { * * @param session - Users registered session. */ - public void onOpen(Session session) { + void onOpen(Session session) { if (log.isDebugEnabled()) { log.debug("WebSocket opened, for Session id: " + session.getId()); } @@ -68,8 +68,7 @@ public class SubscriptionEndpoint { endpoint += "/"; } endpoint += session.getRequestURI().getSchemeSpecificPart().replace("secured-websocket-proxy",""); - AnalyticsClient analyticsClient = new AnalyticsClient(session); - analyticsClient.connectClient(new URI(endpoint)); + AnalyticsClient analyticsClient = new AnalyticsClient(session, new URI(endpoint)); analyticsClients.add(analyticsClient); } catch (URISyntaxException e) { log.error("Unable to create URL from: " + endpoint, e); @@ -121,7 +120,7 @@ public class SubscriptionEndpoint { * @param session - Users registered session. * @param message - Status code for web-socket close. */ - public void onMessage(Session session, String message) { + void onMessage(Session session, String message) { for (AnalyticsClient analyticsClient : analyticsClientsMap.get(session.getId())) { if (analyticsClient != null) { analyticsClient.sendMessage(message); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/outbound/AnalyticsClient.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/outbound/AnalyticsClient.java index 7bfd480288..96e6d6974a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/outbound/AnalyticsClient.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/outbound/AnalyticsClient.java @@ -42,24 +42,18 @@ public class AnalyticsClient { private static final Log log = LogFactory.getLog(AnalyticsClient.class); - private WebSocketContainer container; - private Session analyticsSession = null; - private Session clientSession; + private final Session analyticsSession; + private final Session clientSession; /** * Create {@link AnalyticsClient} instance. */ - public AnalyticsClient(Session clientSession) { - container = ContainerProvider.getWebSocketContainer(); + public AnalyticsClient(Session clientSession, URI endpointURI) throws WSProxyException { + WebSocketContainer container = ContainerProvider.getWebSocketContainer(); this.clientSession = clientSession; - } - /** - * Create web socket client connection using {@link WebSocketContainer}. - */ - public void connectClient(URI endpointURI) throws WSProxyException { try { - analyticsSession = container.connectToServer(this, endpointURI); + this.analyticsSession = container.connectToServer(this, endpointURI); } catch (DeploymentException | IOException e) { String msg = "Error occurred while connecting to remote endpoint " + endpointURI.toString(); log.error(msg, e); @@ -79,7 +73,6 @@ public class AnalyticsClient { log.debug("Closing web socket session: '" + userSession.getId() + "'. Code: " + reason.getCloseCode().toString() + " Reason: " + reason.getReasonPhrase()); } - this.analyticsSession = null; } /** @@ -91,7 +84,16 @@ public class AnalyticsClient { */ @OnMessage public void onMessage(String message) { - this.clientSession.getAsyncRemote().sendText(message); + synchronized (this.clientSession) { + try { + this.clientSession.getBasicRemote().sendText(message); + } catch (IOException e) { + log.warn("Sending message to client failed due to " + e.getMessage()); + if (log.isDebugEnabled()) { + log.debug("Full stack trace:", e); + } + } + } } /** @@ -100,14 +102,23 @@ public class AnalyticsClient { * @param message the message which is going to send. */ public void sendMessage(String message) { - this.analyticsSession.getAsyncRemote().sendText(message); + synchronized (this.analyticsSession) { + try { + this.analyticsSession.getBasicRemote().sendText(message); + } catch (IOException e) { + log.warn("Sending message to analytics failed due to " + e.getMessage()); + if (log.isDebugEnabled()) { + log.debug("Full stack trace:", e); + } + } + } } /** * Close current connection. */ public void closeConnection(CloseReason closeReason) throws WSProxyException { - if (this.analyticsSession != null) { + if (this.analyticsSession.isOpen()) { try { this.analyticsSession.close(closeReason); } catch (IOException e) { @@ -115,6 +126,8 @@ public class AnalyticsClient { log.error(msg, e); throw new WSProxyException(msg, e); } + } else { + log.warn("Analytics session '" + this.analyticsSession.getId() + "' is already closed"); } } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml index 1cf54fe11f..8d1321e2e6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java index d0924d96c2..12630fcd68 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java @@ -529,6 +529,92 @@ public interface UserManagementService { defaultValue = "5") @QueryParam("limit") int limit); + @GET + @Path(("/search")) + @ApiOperation( + produces = MediaType.APPLICATION_JSON, + httpMethod = "GET", + value = "Filter details of users based on the given claims", + notes = "You are able to manage users in WSO2 IoTS by adding, updating and removing users. If you wish to" + + " filter and get a list of users registered with WSO2 IoTS, you can do so using this REST API", + tags = "User Management", + extensions = { + @Extension(properties = { + @ExtensionProperty(name = Constants.SCOPE, value = "perm:users:user-details") + }) + } + ) + @ApiResponses(value = { + @ApiResponse( + code = 200, + message = "OK. \n Successfully fetched the list of users registered with WSO2 IoTS.", + response = BasicUserInfoList.class, + responseHeaders = { + @ResponseHeader( + name = "Content-Type", + description = "The content type of the body"), + @ResponseHeader( + name = "ETag", + description = "Entity Tag of the response resource.\n" + + "Used by caches, or in conditional requests."), + @ResponseHeader( + name = "Last-Modified", + description = "Date and time the resource was last modified.\n" + + "Used by caches, or in conditional requests."), + }), + @ApiResponse( + code = 304, + message = "Not Modified. \n Empty body because the client already has the latest version of " + + "the requested resource.\n"), + @ApiResponse( + code = 406, + message = "Not Acceptable.\n The requested media type is not supported", + response = ErrorResponse.class), + @ApiResponse( + code = 500, + message = "Internal Server Error. \n Server error occurred while fetching users.", + response = ErrorResponse.class) + }) + Response getUsers( + @ApiParam( + name = "username", + value = "Username of the user", + required = false + ) + @QueryParam("username") String username, + @ApiParam( + name = "firstName", + value = "First Name of the user", + required = false + ) + @QueryParam("firstName") String firstName, + @ApiParam( + name = "lastName", + value = "Last Name of the user", + required = false + ) + @QueryParam("lastName")String lastName, + @ApiParam( + name = "emailAddress", + value = "Email Address of the user", + required = false + ) + @QueryParam("emailAddress")String emailAddress, + @HeaderParam("If-Modified-Since") String timestamp, + @ApiParam( + name = "offset", + value = "The starting pagination index for the complete list of qualified items.", + required = false, + defaultValue = "0") + @QueryParam("offset") int offset, + @ApiParam( + name = "limit", + value = "Provide how many user details you require from the starting pagination index/offset.", + required = false, + defaultValue = "5") + @QueryParam("limit") int limit + ); + @GET @Path("/count") @ApiOperation( diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java index a8811e5418..add4acef72 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java @@ -100,7 +100,7 @@ public class GeoLocationBasedServiceImpl implements GeoLocationBasedService { CarbonContext.getThreadLocalCarbonContext().getUsername()); try { - String tenantDomain = MultitenantUtils.getTenantDomain(authorizedUser); + String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain); AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI(); List searchResults = analyticsDataAPI.search(tenantId, tableName, query, diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java index 053d09f77c..c31bc3b523 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java @@ -426,6 +426,104 @@ public class UserManagementServiceImpl implements UserManagementService { } } + @GET + @Path("/search") + @Override + public Response getUsers(@QueryParam("username") String username, @QueryParam("firstName") String firstName, + @QueryParam("lastName") String lastName, @QueryParam("emailAddress") String emailAddress, + @HeaderParam("If-Modified-Since") String timestamp, @QueryParam("offset") int offset, + @QueryParam("limit") int limit) { + + if (RequestValidationUtil.isNonFilterRequest(username,firstName, lastName, emailAddress)) { + return getUsers(null, timestamp, offset, limit); + } + + RequestValidationUtil.validatePaginationParameters(offset, limit); + + if(log.isDebugEnabled()) { + log.debug("Filtering users - filter: {username: " + username +", firstName: " + firstName + ", lastName: " + + lastName + ", emailAddress: " + emailAddress + "}"); + } + + if (limit == 0) { + limit = Constants.DEFAULT_PAGE_LIMIT; + } + + List filteredUserList = new ArrayList<>(); + List commonUsers = null, tempList; + + try { + if (StringUtils.isNotEmpty(username)) { + commonUsers = getUserList(null, username); + } + + if (!skipSearch(commonUsers) && StringUtils.isNotEmpty(firstName)) { + tempList = getUserList(Constants.USER_CLAIM_FIRST_NAME, firstName); + if (commonUsers == null) { + commonUsers = tempList; + } else { + commonUsers.retainAll(tempList); + } + } + + if (!skipSearch(commonUsers) && StringUtils.isNotEmpty(lastName)) { + tempList = getUserList(Constants.USER_CLAIM_LAST_NAME, lastName); + if (commonUsers == null || commonUsers.size() == 0) { + commonUsers = tempList; + } else { + commonUsers.retainAll(tempList); + } + } + + if (!skipSearch(commonUsers) && StringUtils.isNotEmpty(emailAddress)) { + tempList = getUserList(Constants.USER_CLAIM_EMAIL_ADDRESS, emailAddress); + if (commonUsers == null || commonUsers.size() == 0) { + commonUsers = tempList; + } else { + commonUsers.retainAll(tempList); + } + } + + BasicUserInfo basicUserInfo; + if (commonUsers != null) { + for (String user : commonUsers) { + basicUserInfo = new BasicUserInfo(); + basicUserInfo.setUsername(user); + basicUserInfo.setEmailAddress(getClaimValue(user, Constants.USER_CLAIM_EMAIL_ADDRESS)); + basicUserInfo.setFirstname(getClaimValue(user, Constants.USER_CLAIM_FIRST_NAME)); + basicUserInfo.setLastname(getClaimValue(user, Constants.USER_CLAIM_LAST_NAME)); + filteredUserList.add(basicUserInfo); + } + } + + int toIndex = offset + limit; + int listSize = filteredUserList.size(); + int lastIndex = listSize - 1; + + List offsetList; + if (offset <= lastIndex) { + if (toIndex <= listSize) { + offsetList = filteredUserList.subList(offset, toIndex); + } else { + offsetList = filteredUserList.subList(offset, listSize); + } + } else { + offsetList = new ArrayList<>(); + } + + BasicUserInfoList result = new BasicUserInfoList(); + result.setList(offsetList); + result.setCount(commonUsers != null ? commonUsers.size() : 0); + + return Response.status(Response.Status.OK).entity(result).build(); + } catch (UserStoreException e) { + String msg = "Error occurred while retrieving the list of users."; + log.error(msg, e); + return Response.serverError().entity( + new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); + } + } + @GET @Path("/count") @Override @@ -700,4 +798,47 @@ public class UserManagementServiceImpl implements UserManagementService { return DeviceManagementConstants.EmailAttributes.DEFAULT_ENROLLMENT_TEMPLATE; } + /** + * Searches users which matches a given filter based on a claim + * + * @param claim the claim value to apply the filter. If null users will be filtered by username. + * @param filter the search query. + * @return List of users which matches. + * @throws UserStoreException If unable to search users. + */ + private ArrayList getUserList(String claim, String filter) throws UserStoreException { + String defaultFilter = "*"; + + org.wso2.carbon.user.core.UserStoreManager userStoreManager = + (org.wso2.carbon.user.core.UserStoreManager) DeviceMgtAPIUtils.getUserStoreManager(); + + String appliedFilter = filter + defaultFilter; + + String[] users; + if (log.isDebugEnabled()) { + log.debug("Searching Users - claim: " + claim + " filter: " + appliedFilter); + } + if (StringUtils.isEmpty(claim)) { + users = userStoreManager.listUsers(appliedFilter, -1); + } else { + users = userStoreManager.getUserList(claim, appliedFilter, null); + } + + if (log.isDebugEnabled()) { + log.debug("Returned user count: " + users.length); + } + + return new ArrayList<>(Arrays.asList(users)); + } + + /** + * User search provides an AND search result and if either of the filter returns an empty set of users, there is no + * need to carry on the search further. This method decides whether to carry on the search or not. + * + * @param commonUsers current filtered user list. + * @return true if further search is needed. + */ + private boolean skipSearch(List commonUsers) { + return commonUsers != null && commonUsers.size() == 0; + } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/RequestValidationUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/RequestValidationUtil.java index 7c1b5dc86a..3936341384 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/RequestValidationUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/RequestValidationUtil.java @@ -18,6 +18,7 @@ */ package org.wso2.carbon.device.mgt.jaxrs.service.impl.util; +import org.apache.commons.lang.StringUtils; import org.wso2.carbon.device.mgt.jaxrs.beans.Scope; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; @@ -353,4 +354,9 @@ public class RequestValidationUtil { } } + public static boolean isNonFilterRequest(String username, String firstName, String lastName, String emailAddress) { + return StringUtils.isEmpty(username) && StringUtils.isEmpty(firstName) && StringUtils.isEmpty(lastName) + && StringUtils.isEmpty(emailAddress); + } + } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml index 410c859a91..03cf504ccd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml @@ -21,7 +21,7 @@ device-mgt org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/Operation.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/Operation.java index 7e3b2fe7c6..b3b863a5f3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/Operation.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/Operation.java @@ -37,7 +37,7 @@ public class Operation implements Serializable { } public enum Status { - IN_PROGRESS, PENDING, COMPLETED, ERROR, REPEATED + IN_PROGRESS, PENDING, COMPLETED, ERROR, REPEATED, NOTNOW } public enum Control { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManager.java index d85108e960..78bfdec53f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManager.java @@ -76,6 +76,9 @@ public interface OperationManager { */ List getPendingOperations(DeviceIdentifier deviceId) throws OperationManagementException; + Operation getNextPendingOperation(DeviceIdentifier deviceId, long notNowOperationFrequency) + throws OperationManagementException; + Operation getNextPendingOperation(DeviceIdentifier deviceId) throws OperationManagementException; void updateOperation(DeviceIdentifier deviceId, Operation operation) throws OperationManagementException; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml index 5fa19ebc41..e76ca61985 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementPluginRepository.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementPluginRepository.java index 627ea432a9..44b740a097 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementPluginRepository.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementPluginRepository.java @@ -321,7 +321,7 @@ public class DeviceManagementPluginRepository implements DeviceManagerStartupLis getDeviceTaskManagerService(); OperationMonitoringTaskConfig operationMonitoringTaskConfig = deviceManagementService. getOperationMonitoringConfig(); - if (operationMonitoringTaskConfig != null) { + if (operationMonitoringTaskConfig != null && operationMonitoringTaskConfig.isEnabled()) { deviceTaskManagerService.stopTask(deviceManagementService.getType(), deviceManagementService.getOperationMonitoringConfig()); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dto/operation/mgt/Operation.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dto/operation/mgt/Operation.java index 1b34b5d02b..03acfa9a11 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dto/operation/mgt/Operation.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dto/operation/mgt/Operation.java @@ -23,12 +23,14 @@ import java.util.Properties; public class Operation implements Serializable { + private static final long serialVersionUID = -353614864628915060L; + public enum Type { CONFIG, MESSAGE, INFO, COMMAND, PROFILE , POLICY } public enum Status { - IN_PROGRESS, PENDING, COMPLETED, ERROR, REPEATED + IN_PROGRESS, PENDING, COMPLETED, ERROR, REPEATED, NOTNOW } public enum Control { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/geo/service/GeoLocationProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/geo/service/GeoLocationProviderServiceImpl.java index c5bcec41c2..ccb0317a38 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/geo/service/GeoLocationProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/geo/service/GeoLocationProviderServiceImpl.java @@ -51,6 +51,7 @@ import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerSer import org.wso2.carbon.registry.api.Registry; import org.wso2.carbon.registry.api.RegistryException; import org.wso2.carbon.registry.api.Resource; +import org.wso2.carbon.stratos.common.util.ClaimsMgtUtil; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; @@ -428,6 +429,9 @@ public class GeoLocationProviderServiceImpl implements GeoLocationProviderServic } catch (JWTClientException e) { throw new GeoLocationBasedServiceException( "JWT token creation failed while " + action + " geo alert '" + alertType, e); + } catch (Exception e) { + throw new GeoLocationBasedServiceException( + "Error occurred while " + action + " geo alert '" + alertType, e); } finally { cleanup(eventprocessorStub); } @@ -541,6 +545,9 @@ public class GeoLocationProviderServiceImpl implements GeoLocationProviderServic throw new GeoLocationBasedServiceException( "JWT token creation failed while " + action + " geo alert '" + alertType + "' for " + identifier.getType() + " device with id:" + identifier.getId(), e); + } catch (Exception e) { + throw new GeoLocationBasedServiceException( + "Error occurred while " + action + " geo alert '" + alertType, e); } finally { cleanup(eventprocessorStub); } @@ -646,6 +653,9 @@ public class GeoLocationProviderServiceImpl implements GeoLocationProviderServic executionPlanName + " for " + identifier.getType() + " device with id:" + identifier.getId(), e ); + } catch (Exception e) { + throw new GeoLocationBasedServiceException( + "Error occurred while removing geo alert '" + alertType, e); } finally { cleanup(eventprocessorStub); } @@ -672,6 +682,9 @@ public class GeoLocationProviderServiceImpl implements GeoLocationProviderServic "JWT token creation failed while removing geo alert '" + alertType + "': " + executionPlanName, e ); + } catch (Exception e) { + throw new GeoLocationBasedServiceException( + "Error occurred while removing geo alert '" + alertType, e); } finally { cleanup(eventprocessorStub); } @@ -702,14 +715,16 @@ public class GeoLocationProviderServiceImpl implements GeoLocationProviderServic } } - protected EventProcessorAdminServiceStub getEventProcessorAdminServiceStub() throws JWTClientException { + protected EventProcessorAdminServiceStub getEventProcessorAdminServiceStub() throws Exception { //send alert to event-processing String eventProcessorAdminServiceWSUrl = Utils.replaceSystemProperty(GeoServices.DAS_URL) + "/services/EventProcessorAdminService"; //Getting the tenant Domain + int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); - String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername(); + String username = ClaimsMgtUtil.getAdminUserNameFromTenantId(DeviceManagementDataHolder.getInstance().getRealmService(), + tenantId); String tenantAdminUser = username + "@" + tenantDomain; try { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceTaskManagerServiceComponent.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceTaskManagerServiceComponent.java index ae39c83109..ee3072170c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceTaskManagerServiceComponent.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceTaskManagerServiceComponent.java @@ -89,7 +89,9 @@ public class DeviceTaskManagerServiceComponent { Map deviceConfigMap = DeviceMonitoringOperationDataHolder .getInstance().getOperationMonitoringConfigFromMap(); for (String platformType : new ArrayList<>(deviceConfigMap.keySet())) { - deviceTaskManagerService.startTask(platformType, deviceConfigMap.get(platformType)); + if (deviceConfigMap.get(platformType).isEnabled()){ + deviceTaskManagerService.startTask(platformType, deviceConfigMap.get(platformType)); + } deviceConfigMap.remove(platformType); } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java index 0e5306f6c2..89e541615c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java @@ -64,6 +64,7 @@ import org.wso2.carbon.device.mgt.core.task.impl.DeviceTaskManagerImpl; import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil; import java.sql.SQLException; +import java.sql.Timestamp; import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; @@ -251,7 +252,7 @@ public class OperationManagerImpl implements OperationManager { } OperationManagementDAOFactory.commitTransaction(); - if (isScheduled) { + if (!isScheduled) { for (Device device : authorizedDevices) { this.sendNotification(operation, device); } @@ -537,6 +538,13 @@ public class OperationManagerImpl implements OperationManager { @Override public Operation getNextPendingOperation(DeviceIdentifier deviceId) throws OperationManagementException { + // setting notNowOperationFrequency to -1 to avoid picking notnow operations + return this.getNextPendingOperation(deviceId, -1); + } + + @Override + public Operation getNextPendingOperation(DeviceIdentifier deviceId, long notNowOperationFrequency) + throws OperationManagementException { if (log.isDebugEnabled()) { log.debug("device identifier id:[" + deviceId.getId() + "] type:[" + deviceId.getType() + "]"); } @@ -565,8 +573,32 @@ public class OperationManagerImpl implements OperationManager { try { OperationManagementDAOFactory.openConnection(); - org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation dtoOperation = operationDAO.getNextOperation( - enrolmentInfo.getId()); + org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation dtoOperation = null; + + // check whether notnow is set + if (notNowOperationFrequency > 0) { + // retrieve Notnow operations + dtoOperation = operationDAO.getNextOperation(enrolmentInfo.getId(), + org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Status.NOTNOW); + } + + if (dtoOperation != null) { + long currentTime = Calendar.getInstance().getTime().getTime(); + log.info("Current timestamp:" + currentTime); + long updatedTime = Timestamp.valueOf(dtoOperation.getReceivedTimeStamp()).getTime(); + log.info("Updated timestamp: " + updatedTime); + + // check if notnow frequency is met and set next pending operation if not, otherwise let notnow + // operation to proceed + if ((currentTime - updatedTime) < notNowOperationFrequency) { + dtoOperation = operationDAO.getNextOperation(enrolmentInfo.getId(), + org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Status.PENDING); + } + } else { + dtoOperation = operationDAO.getNextOperation(enrolmentInfo.getId(), + org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Status.PENDING); + } + if (dtoOperation != null) { if (org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Type.COMMAND.equals(dtoOperation.getType() )) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationDAO.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationDAO.java index 67dcd517c2..81d47cfc85 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationDAO.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationDAO.java @@ -46,7 +46,7 @@ public interface OperationDAO { List getOperationsForDevice(int enrolmentId, PaginationRequest request) throws OperationManagementDAOException; - Operation getNextOperation(int enrolmentId) throws OperationManagementDAOException; + Operation getNextOperation(int enrolmentId, Operation.Status status) throws OperationManagementDAOException; boolean updateOperationStatus(int enrolmentId, int operationId,Operation.Status status) throws OperationManagementDAOException; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java index 900c41cf96..646f6a9051 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java @@ -1372,7 +1372,7 @@ public class GenericOperationDAOImpl implements OperationDAO { } @Override - public Operation getNextOperation(int enrolmentId) throws OperationManagementDAOException { + public Operation getNextOperation(int enrolmentId, Operation.Status status) throws OperationManagementDAOException { PreparedStatement stmt = null; ResultSet rs = null; try { @@ -1383,7 +1383,7 @@ public class GenericOperationDAOImpl implements OperationDAO { "WHERE dm.ENROLMENT_ID = ? AND dm.STATUS = ?) om ON o.ID = om.OPERATION_ID " + "ORDER BY om.UPDATED_TIMESTAMP ASC, om.ID ASC LIMIT 1"); stmt.setInt(1, enrolmentId); - stmt.setString(2, Operation.Status.PENDING.toString()); + stmt.setString(2, status.toString()); rs = stmt.executeQuery(); Operation operation = null; @@ -1392,11 +1392,7 @@ public class GenericOperationDAOImpl implements OperationDAO { operation.setType(OperationDAOUtil.getType(rs.getString("TYPE"))); operation.setId(rs.getInt("ID")); operation.setCreatedTimeStamp(rs.getTimestamp("CREATED_TIMESTAMP").toString()); -// if (rs.getTimestamp("RECEIVED_TIMESTAMP") == null) { -// operation.setReceivedTimeStamp(""); -// } else { -// operation.setReceivedTimeStamp(rs.getTimestamp("RECEIVED_TIMESTAMP").toString()); -// } + if (rs.getLong("UPDATED_TIMESTAMP") == 0) { operation.setReceivedTimeStamp(""); } else { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java index 9223b3c030..769537b47b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java @@ -53,7 +53,7 @@ public class ProfileOperationDAOImpl extends GenericOperationDAOImpl { bao = new ByteArrayOutputStream(); oos = new ObjectOutputStream(bao); - oos.writeObject(operation); + oos.writeObject(operation.getPayLoad()); stmt.setInt(1, operationId); stmt.setBytes(2, bao.toByteArray()); @@ -91,7 +91,8 @@ public class ProfileOperationDAOImpl extends GenericOperationDAOImpl { ObjectInputStream ois; try { Connection conn = OperationManagementDAOFactory.getConnection(); - String sql = "SELECT OPERATION_ID, ENABLED, OPERATION_DETAILS FROM DM_PROFILE_OPERATION WHERE OPERATION_ID=?"; + String sql = "SELECT o.ID, po.ENABLED, po.OPERATION_DETAILS, o.CREATED_TIMESTAMP, o.OPERATION_CODE " + + "FROM DM_PROFILE_OPERATION po INNER JOIN DM_OPERATION o ON po.OPERATION_ID = O.ID WHERE po.OPERATION_ID=?"; stmt = conn.prepareStatement(sql); stmt.setInt(1, id); @@ -99,9 +100,20 @@ public class ProfileOperationDAOImpl extends GenericOperationDAOImpl { if (rs.next()) { byte[] operationDetails = rs.getBytes("OPERATION_DETAILS"); + int oppId = rs.getInt("ID"); bais = new ByteArrayInputStream(operationDetails); ois = new ObjectInputStream(bais); - profileOperation = (ProfileOperation) ois.readObject(); + Object obj = ois.readObject(); + if(obj instanceof String){ + profileOperation = new ProfileOperation(); + profileOperation.setCode(rs.getString("OPERATION_CODE")); + profileOperation.setId(oppId); + profileOperation.setCreatedTimeStamp(rs.getString("CREATED_TIMESTAMP")); + profileOperation.setId(oppId); + profileOperation.setPayLoad(obj); + } else { + profileOperation = (ProfileOperation) obj; + } } } catch (IOException e) { throw new OperationManagementDAOException("IO Error occurred while de serialize the profile " + @@ -110,7 +122,7 @@ public class ProfileOperationDAOImpl extends GenericOperationDAOImpl { throw new OperationManagementDAOException("Class not found error occurred while de serialize the " + "profile operation object", e); } catch (SQLException e) { - throw new OperationManagementDAOException("SQL Error occurred while retrieving the command " + + throw new OperationManagementDAOException("SQL Error occurred while retrieving the profile " + "operation object " + "available for the id '" + id, e); } finally { OperationManagementDAOUtil.cleanupResources(stmt, rs); @@ -120,7 +132,7 @@ public class ProfileOperationDAOImpl extends GenericOperationDAOImpl { @Override public List getOperationsByDeviceAndStatus(int enrolmentId, - Operation.Status status) throws OperationManagementDAOException { + Operation.Status status) throws OperationManagementDAOException { PreparedStatement stmt = null; ResultSet rs = null; ProfileOperation profileOperation; @@ -132,10 +144,12 @@ public class ProfileOperationDAOImpl extends GenericOperationDAOImpl { try { Connection conn = OperationManagementDAOFactory.getConnection(); - String sql = "Select po.OPERATION_ID, ENABLED, OPERATION_DETAILS from DM_PROFILE_OPERATION po " + - "INNER JOIN " + - "(Select * From DM_ENROLMENT_OP_MAPPING WHERE ENROLMENT_ID=? " + - "AND STATUS=?) dm ON dm.OPERATION_ID = po.OPERATION_ID"; + String sql = "SELECT o.ID, po1.ENABLED, po1.STATUS, o.TYPE, o.CREATED_TIMESTAMP, o.RECEIVED_TIMESTAMP, " + + "o.OPERATION_CODE, po1.OPERATION_DETAILS " + + "FROM (SELECT po.OPERATION_ID, po.ENABLED, po.OPERATION_DETAILS, dm.STATUS " + + "FROM DM_PROFILE_OPERATION po INNER JOIN (SELECT ENROLMENT_ID, OPERATION_ID, STATUS FROM DM_ENROLMENT_OP_MAPPING " + + "WHERE ENROLMENT_ID = ? AND STATUS = ?) dm ON dm.OPERATION_ID = po.OPERATION_ID) po1 " + + "INNER JOIN DM_OPERATION o ON po1.OPERATION_ID = o.ID "; stmt = conn.prepareStatement(sql); stmt.setInt(1, enrolmentId); @@ -147,9 +161,20 @@ public class ProfileOperationDAOImpl extends GenericOperationDAOImpl { byte[] operationDetails = rs.getBytes("OPERATION_DETAILS"); bais = new ByteArrayInputStream(operationDetails); ois = new ObjectInputStream(bais); - profileOperation = (ProfileOperation) ois.readObject(); - profileOperation.setStatus(status); - operationList.add(profileOperation); + Object obj = ois.readObject(); + if(obj instanceof String){ + profileOperation = new ProfileOperation(); + profileOperation.setCode(rs.getString("OPERATION_CODE")); + profileOperation.setId(rs.getInt("ID")); + profileOperation.setCreatedTimeStamp(rs.getString("CREATED_TIMESTAMP")); + profileOperation.setPayLoad(obj); + profileOperation.setStatus(status); + operationList.add(profileOperation); + } else { + profileOperation = (ProfileOperation) obj; + profileOperation.setStatus(status); + operationList.add(profileOperation); + } } } catch (IOException e) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/push/notification/mgt/task/PushNotificationSchedulerTask.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/push/notification/mgt/task/PushNotificationSchedulerTask.java index 133ba08cb0..4f79999c8e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/push/notification/mgt/task/PushNotificationSchedulerTask.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/push/notification/mgt/task/PushNotificationSchedulerTask.java @@ -86,11 +86,18 @@ public class PushNotificationSchedulerTask implements Runnable { NotificationStrategy notificationStrategy = provider.getNotificationStrategyByDeviceType (operationMapping.getDeviceIdentifier().getType()); // Send the push notification on given strategy - notificationStrategy.execute(new NotificationContext(operationMapping.getDeviceIdentifier(), - provider.getOperation(operationMapping.getDeviceIdentifier().getType(), operationMapping - .getOperationId()))); - operationMapping.setPushNotificationStatus(Operation.PushNotificationStatus.COMPLETED); - operationsCompletedList.add(operationMapping); + if (notificationStrategy != null) { + notificationStrategy.execute(new NotificationContext(operationMapping.getDeviceIdentifier(), + provider.getOperation(operationMapping.getDeviceIdentifier().getType(), operationMapping + .getOperationId()))); + operationMapping.setPushNotificationStatus(Operation.PushNotificationStatus.COMPLETED); + operationsCompletedList.add(operationMapping); + } else { + if (log.isDebugEnabled()) { + log.debug("Tenant '" + PrivilegedCarbonContext.getThreadLocalCarbonContext() + .getTenantDomain() + "' does not have push notification strategy."); + } + } } catch (DeviceManagementException e) { log.error("Error occurred while getting notification strategy for operation mapping " + operationMapping.getDeviceIdentifier().getType(), e); @@ -121,7 +128,7 @@ public class PushNotificationSchedulerTask implements Runnable { log.debug("Push notification job running completed."); } } catch (Throwable cause) { - log.error("PushNotificationSchedulerTask failed due to " + cause); + log.error("PushNotificationSchedulerTask failed due to " + cause.getMessage(), cause); } } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java index c30967c87d..504ee52dbe 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java @@ -24,6 +24,7 @@ import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.FeatureManager; import org.wso2.carbon.device.mgt.common.InvalidDeviceException; import org.wso2.carbon.device.mgt.common.MonitoringOperation; +import org.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig; import org.wso2.carbon.device.mgt.common.PaginationRequest; import org.wso2.carbon.device.mgt.common.PaginationResult; import org.wso2.carbon.device.mgt.common.app.mgt.DeviceApplicationMapping; @@ -552,6 +553,9 @@ public interface DeviceManagementProviderService { Operation getNextPendingOperation(DeviceIdentifier deviceId) throws OperationManagementException; + Operation getNextPendingOperation(DeviceIdentifier deviceId, long notNowOperationFrequency) + throws OperationManagementException; + void updateOperation(DeviceIdentifier deviceId, Operation operation) throws OperationManagementException; boolean updateProperties(DeviceIdentifier deviceId, List properties) throws DeviceManagementException; @@ -587,6 +591,8 @@ public interface DeviceManagementProviderService { int getDeviceMonitoringFrequency(String deviceType); + OperationMonitoringTaskConfig getDeviceMonitoringConfig(String deviceType); + boolean isDeviceMonitoringEnabled(String deviceType); PolicyMonitoringManager getPolicyMonitoringManager(String deviceType); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index f1a59cf9b0..278d2d0d47 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -1452,8 +1452,15 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv @Override public Operation getNextPendingOperation(DeviceIdentifier deviceId) throws OperationManagementException { + // // setting notNowOperationFrequency to -1 to avoid picking notnow operations return pluginRepository.getOperationManager(deviceId.getType(), this.getTenantId()) - .getNextPendingOperation(deviceId); + .getNextPendingOperation(deviceId, -1); + } + + public Operation getNextPendingOperation(DeviceIdentifier deviceId, long notNowOperationFrequency) + throws OperationManagementException { + return pluginRepository.getOperationManager(deviceId.getType(), this.getTenantId()) + .getNextPendingOperation(deviceId, notNowOperationFrequency); } @Override @@ -1597,6 +1604,13 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv return operationMonitoringTaskConfig.getFrequency(); } + @Override + public OperationMonitoringTaskConfig getDeviceMonitoringConfig(String deviceType) { + int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); + DeviceManagementService dms = pluginRepository.getDeviceManagementService(deviceType, tenantId); + return dms.getOperationMonitoringConfig(); + } + @Override public boolean isDeviceMonitoringEnabled(String deviceType) { int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/Utils.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/Utils.java index f0997ce4b2..36b43b12c6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/Utils.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/Utils.java @@ -26,14 +26,23 @@ import java.util.Map; public class Utils { - public static Map getTenantedTaskOperationMap(Map> map) { + public static Map getTenantedTaskOperationMap(Map>> map, + String deviceType) { + Map taskMap = new HashMap<>(); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); if (map.containsKey(tenantId)) { - return map.get(tenantId); + if (map.get(tenantId).containsKey(deviceType)) { + return map.get(tenantId).get(deviceType); + } else { + Map> existingTenantMap = map.get(tenantId); + existingTenantMap.put(deviceType, taskMap); + return taskMap; + } } else { - Map mp = new HashMap<>(); - map.put(tenantId, mp); - return mp; + HashMap> typeMap = new HashMap<>(); + typeMap.put(deviceType, taskMap); + map.put(tenantId, typeMap); + return taskMap; } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/impl/DeviceDetailsRetrieverTask.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/impl/DeviceDetailsRetrieverTask.java index 7b65a3b6ee..567964d808 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/impl/DeviceDetailsRetrieverTask.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/impl/DeviceDetailsRetrieverTask.java @@ -16,16 +16,15 @@ * under the License. */ - package org.wso2.carbon.device.mgt.core.task.impl; -import com.google.gson.Gson; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig; import org.wso2.carbon.device.mgt.core.internal.DeviceManagementDataHolder; +import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.device.mgt.core.task.DeviceMgtTaskException; import org.wso2.carbon.device.mgt.core.task.DeviceTaskManager; import org.wso2.carbon.ntask.core.Task; @@ -38,20 +37,13 @@ public class DeviceDetailsRetrieverTask implements Task { private static Log log = LogFactory.getLog(DeviceDetailsRetrieverTask.class); private String deviceType; - private String oppConfig; - private OperationMonitoringTaskConfig operationMonitoringTaskConfig; private boolean executeForTenants = false; private final String IS_CLOUD = "is.cloud"; + private DeviceManagementProviderService deviceManagementProviderService; @Override public void setProperties(Map map) { deviceType = map.get("DEVICE_TYPE"); - oppConfig = map.get("OPPCONFIG"); - - Gson gson = new Gson(); - - operationMonitoringTaskConfig = gson.fromJson(oppConfig, - OperationMonitoringTaskConfig.class); } @Override @@ -60,29 +52,33 @@ public class DeviceDetailsRetrieverTask implements Task { @Override public void execute() { + deviceManagementProviderService = DeviceManagementDataHolder.getInstance() + .getDeviceManagementProvider(); + OperationMonitoringTaskConfig operationMonitoringTaskConfig = deviceManagementProviderService + .getDeviceMonitoringConfig(deviceType); - if(System.getProperty(IS_CLOUD) != null && Boolean.parseBoolean(System.getProperty(IS_CLOUD))){ + if (System.getProperty(IS_CLOUD) != null && Boolean.parseBoolean(System.getProperty(IS_CLOUD))) { executeForTenants = true; } - if(executeForTenants){ - this.executeForAllTenants(); + if (executeForTenants) { + this.executeForAllTenants(operationMonitoringTaskConfig); } else { if (log.isDebugEnabled()) { log.debug("Device details retrieving task started to run."); } - DeviceTaskManager deviceTaskManager = new DeviceTaskManagerImpl(deviceType, - operationMonitoringTaskConfig); + DeviceTaskManager deviceTaskManager = new DeviceTaskManagerImpl(deviceType, operationMonitoringTaskConfig); //pass the configurations also from here, monitoring tasks try { - deviceTaskManager.addOperations(); + if (deviceManagementProviderService.isDeviceMonitoringEnabled(deviceType)) { + deviceTaskManager.addOperations(); + } } catch (DeviceMgtTaskException e) { - log.error( - "Error occurred while trying to add the operations to device to retrieve device details.", e); + log.error("Error occurred while trying to add the operations to device to retrieve device details.", e); } } } - private void executeForAllTenants() { + private void executeForAllTenants(OperationMonitoringTaskConfig operationMonitoringTaskConfig) { if (log.isDebugEnabled()) { log.debug("Device details retrieving task started to run for all tenants."); @@ -101,7 +97,9 @@ public class DeviceDetailsRetrieverTask implements Task { operationMonitoringTaskConfig); //pass the configurations also from here, monitoring tasks try { - deviceTaskManager.addOperations(); + if (deviceManagementProviderService.isDeviceMonitoringEnabled(deviceType)) { + deviceTaskManager.addOperations(); + } } catch (DeviceMgtTaskException e) { log.error("Error occurred while trying to add the operations to " + "device to retrieve device details.", e); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/impl/DeviceTaskManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/impl/DeviceTaskManagerImpl.java index 41d291e74e..2132889189 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/impl/DeviceTaskManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/impl/DeviceTaskManagerImpl.java @@ -36,17 +36,13 @@ import org.wso2.carbon.device.mgt.core.task.DeviceTaskManager; import org.wso2.carbon.device.mgt.core.task.Utils; import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; public class DeviceTaskManagerImpl implements DeviceTaskManager { private static Log log = LogFactory.getLog(DeviceTaskManagerImpl.class); private String deviceType; - private static Map> map = new HashMap<>(); + static volatile Map>> map = new HashMap<>(); private OperationMonitoringTaskConfig operationMonitoringTaskConfig; public DeviceTaskManagerImpl(String deviceType, @@ -126,7 +122,7 @@ public class DeviceTaskManagerImpl implements DeviceTaskManager { List opNames = new ArrayList<>(); Long milliseconds = System.currentTimeMillis(); int frequency = this.getTaskFrequency(); - Map mp = Utils.getTenantedTaskOperationMap(map); + Map mp = Utils.getTenantedTaskOperationMap(map, deviceType); for (MonitoringOperation top : monitoringOperations) { if (!mp.containsKey(top.getTaskName())) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/impl/DeviceTaskManagerServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/impl/DeviceTaskManagerServiceImpl.java index b8119222db..d564fd7542 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/impl/DeviceTaskManagerServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/impl/DeviceTaskManagerServiceImpl.java @@ -107,10 +107,12 @@ public class DeviceTaskManagerServiceImpl implements DeviceTaskManagerService { throws DeviceMgtTaskException { try { + int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); TaskService taskService = DeviceManagementDataHolder.getInstance().getTaskService(); if (taskService.isServerInit()) { TaskManager taskManager = taskService.getTaskManager(TASK_TYPE); - taskManager.deleteTask(deviceType); + String taskName = deviceType + String.valueOf(tenantId); + taskManager.deleteTask(taskName); } } catch (TaskException e) { int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); @@ -131,8 +133,8 @@ public class DeviceTaskManagerServiceImpl implements DeviceTaskManagerService { TaskManager taskManager = taskService.getTaskManager(TASK_TYPE); if (taskManager.isTaskScheduled(deviceType)) { - - taskManager.deleteTask(deviceType); + String taskName = deviceType + String.valueOf(tenantId); + taskManager.deleteTask(taskName); TaskInfo.TriggerInfo triggerInfo = new TaskInfo.TriggerInfo(); triggerInfo.setIntervalMillis(operationMonitoringTaskConfig.getFrequency()); triggerInfo.setRepeatCount(-1); @@ -140,7 +142,7 @@ public class DeviceTaskManagerServiceImpl implements DeviceTaskManagerService { Map properties = new HashMap<>(); properties.put(TENANT_ID, String.valueOf(tenantId)); - TaskInfo taskInfo = new TaskInfo(deviceType, TASK_CLASS, properties, triggerInfo); + TaskInfo taskInfo = new TaskInfo(taskName, TASK_CLASS, properties, triggerInfo); taskManager.registerTask(taskInfo); taskManager.rescheduleTask(taskInfo.getName()); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManagementService.java index 29ebe9c493..d9449f6a49 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManagementService.java @@ -43,7 +43,7 @@ public class TestDeviceManagementService implements DeviceManagementService { public TestDeviceManagementService(String deviceType, String tenantDomain) { providerType = deviceType; this.tenantDomain = tenantDomain; - this.operationCode = "default"; + this.operationCode = "DEVICE_INFO"; } @Override diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/geo/service/GeoLocationProviderServiceTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/geo/service/GeoLocationProviderServiceTest.java index 1e0916d079..649ecf4244 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/geo/service/GeoLocationProviderServiceTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/geo/service/GeoLocationProviderServiceTest.java @@ -143,7 +143,7 @@ public class GeoLocationProviderServiceTest { Assert.assertEquals(geoFenceNode.getStationaryTime(), SAMPLE_STATIONARY_TIME); } - private void initMocks() throws JWTClientException, RemoteException { + private void initMocks() throws Exception { EventProcessorAdminServiceStub mockEventProcessorAdminServiceStub = Mockito.mock(EventProcessorAdminServiceStub.class); geoLocationProviderServiceImpl = Mockito.mock(GeoLocationProviderServiceImpl.class, Mockito.CALLS_REAL_METHODS); mockExecutionPlanConfigurationDto[0] = Mockito.mock(ExecutionPlanConfigurationDto.class); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/operation/OperationManagementTests.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/operation/OperationManagementTests.java index dcfd63b995..b1734948d4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/operation/OperationManagementTests.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/operation/OperationManagementTests.java @@ -18,6 +18,8 @@ package org.wso2.carbon.device.mgt.core.operation; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.powermock.api.mockito.PowerMockito; import org.testng.Assert; import org.testng.annotations.BeforeClass; @@ -67,6 +69,7 @@ public class OperationManagementTests extends BaseDeviceManagementTest { private static final String POLICY_OPERATION_CODE = "POLICY-TEST"; private static final String CONFIG_OPERATION_CODE = "CONFIG-TEST"; private static final String PROFILE_OPERATION_CODE = "PROFILE-TEST"; + private static final String PROFILE_NOTIFICATION_CODE = "NOTIFICATION"; private static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss"; private static final int NO_OF_DEVICES = 5; private static final String ADMIN_USER = "admin"; @@ -80,6 +83,8 @@ public class OperationManagementTests extends BaseDeviceManagementTest { private Activity commandActivity; private long commandActivityBeforeUpdatedTimestamp; + private static Log log = LogFactory.getLog(OperationManagementTests.class); + @BeforeClass public void init() throws Exception { for (int i = 0; i < NO_OF_DEVICES; i++) { @@ -101,14 +106,14 @@ public class OperationManagementTests extends BaseDeviceManagementTest { } this.deviceMgmtProvider = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider(); deviceManagementService = new TestDeviceManagementService(DEVICE_TYPE, - MultitenantConstants.SUPER_TENANT_DOMAIN_NAME); + MultitenantConstants.SUPER_TENANT_DOMAIN_NAME); this.operationMgtService = PowerMockito.spy(new OperationManagerImpl(DEVICE_TYPE, deviceManagementService)); PowerMockito.when(this.operationMgtService, "getNotificationStrategy").thenReturn(new TestNotificationStrategy()); } @Test public void addCommandOperation() throws DeviceManagementException, OperationManagementException, - InvalidDeviceException { + InvalidDeviceException { OperationManager operationManager = PowerMockito.spy( new OperationManagerImpl(DEVICE_TYPE, deviceManagementService)); try { @@ -154,7 +159,7 @@ public class OperationManagementTests extends BaseDeviceManagementTest { public void addEmptyDevicesCommandOperation() throws DeviceManagementException, OperationManagementException, InvalidDeviceException { this.operationMgtService.addOperation(getOperation(new CommandOperation(), Operation.Type.COMMAND, - COMMAND_OPERATION_CODE), new ArrayList<>()); + COMMAND_OPERATION_CODE), new ArrayList<>()); } @Test(expectedExceptions = InvalidDeviceException.class) @@ -205,8 +210,10 @@ public class OperationManagementTests extends BaseDeviceManagementTest { @Test(dependsOnMethods = "addConfigOperation") public void addProfileOperation() throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - Activity activity = this.operationMgtService.addOperation(getOperation(new ProfileOperation(), - Operation.Type.PROFILE, PROFILE_OPERATION_CODE), + Operation opp = getOperation(new ProfileOperation(), + Operation.Type.PROFILE, PROFILE_NOTIFICATION_CODE); + opp.setPayLoad("{\"messageText\":\"xyz\",\"messageTitle\":\"abc\"}"); + Activity activity = this.operationMgtService.addOperation(opp , this.deviceIds); validateOperationResponse(activity, ActivityStatus.Status.PENDING); } @@ -360,6 +367,35 @@ public class OperationManagementTests extends BaseDeviceManagementTest { Assert.assertTrue(operation.getType().equals(Operation.Type.POLICY)); } + @Test(dependsOnMethods = "getNextPendingOperation") + public void getNextNotNowOperation() throws OperationManagementException { + //This is required to introduce a delay for the update operation of the device. + try { + Thread.sleep(2000); + } catch (InterruptedException ignored) { + } + DeviceIdentifier deviceIdentifier = this.deviceIds.get(0); + Operation operation = this.operationMgtService.getNextPendingOperation(deviceIdentifier); + int operationId = operation.getId(); + operation.setStatus(Operation.Status.NOTNOW); + operation.setOperationResponse("The operation is successfully completed"); + this.operationMgtService.updateOperation(deviceIdentifier, operation); + //This is required to introduce a delay for the update operation of the device. + try { + Thread.sleep(2000); + } catch (InterruptedException ignored) { + } + operation = this.operationMgtService.getNextPendingOperation(deviceIdentifier); + Assert.assertTrue(operation.getId() != operationId, "Fetched the incorrect operation"); + log.info("Waiting 10000ms for NotNow operation to be fetched"); + try { + Thread.sleep(10000); + } catch (InterruptedException ignored) { + } + operation = this.operationMgtService.getNextPendingOperation(deviceIdentifier, 7000); + Assert.assertTrue(operation.getId() == operationId, "Fetched the incorrect NotNow operation"); + } + @Test(dependsOnMethods = "updateOperation", expectedExceptions = OperationManagementException.class) public void getNextPendingOperationAsNonAdmin() throws OperationManagementException { startTenantFlowAsNonAdmin(); @@ -403,7 +439,7 @@ public class OperationManagementTests extends BaseDeviceManagementTest { DeviceIdentifier deviceIdentifier = this.deviceIds.get(0); List operation = this.operationMgtService.getOperationsByDeviceAndStatus(deviceIdentifier, Operation.Status.PENDING); - Assert.assertEquals(operation.size(), 3); + Assert.assertEquals(operation.size(), 2); } @Test(dependsOnMethods = "getOperationByDeviceAndOperationId", expectedExceptions = OperationManagementException.class) @@ -476,8 +512,8 @@ public class OperationManagementTests extends BaseDeviceManagementTest { public void getActivityCountUpdatedAfter() throws OperationManagementException, ParseException { int activityCount = this.operationMgtService.getActivityCountUpdatedAfter (this.commandActivityBeforeUpdatedTimestamp / 1000); - Assert.assertTrue(activityCount == 1, - "The activities updated after the created should be 1"); + Assert.assertTrue(activityCount == 2, + "The activities updated after the created should be 2"); } @Test @@ -531,7 +567,7 @@ public class OperationManagementTests extends BaseDeviceManagementTest { expectedExceptions = OperationManagementException.class) public void getUpdateOperationForInvalidDevice() throws DeviceManagementException, OperationManagementException { this.operationMgtService.updateOperation(new DeviceIdentifier(INVALID_DEVICE, DEVICE_TYPE), - getOperation(new CommandOperation(), Operation.Type.COMMAND, COMMAND_OPERATION_CODE)); + getOperation(new CommandOperation(), Operation.Type.COMMAND, COMMAND_OPERATION_CODE)); } @Test(dependsOnMethods = "getUpdateOperationForInvalidDevice", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/task/DeviceTaskManagerTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/task/DeviceTaskManagerTest.java index d76783991c..4b558f0708 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/task/DeviceTaskManagerTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/task/DeviceTaskManagerTest.java @@ -19,6 +19,7 @@ package org.wso2.carbon.device.mgt.core.task; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.mockito.Mockito; import org.powermock.api.mockito.PowerMockito; import org.testng.Assert; import org.testng.annotations.AfterClass; @@ -27,6 +28,8 @@ import org.testng.annotations.Test; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.MonitoringOperation; +import org.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManager; @@ -60,8 +63,6 @@ public class DeviceTaskManagerTest extends BaseDeviceManagementTest { private static final Log log = LogFactory.getLog(DeviceTaskManagerTest.class); private static final String NEW_DEVICE_TYPE = "NEW-DEVICE-TYPE"; - private static final String DEVICE_DETAIL_RETRIEVER_OPPCONFIG = "{\"isEnabled\":true,\"frequency\":60000," + - "\"monitoringOperation\":[{\"taskName\":\"DEVICE_INFO\",\"recurrentTimes\":2}]}"; private List deviceIds; private DeviceTaskManager deviceTaskManager; private DeviceManagementProviderService deviceMgtProviderService; @@ -76,7 +77,6 @@ public class DeviceTaskManagerTest extends BaseDeviceManagementTest { } List devices = TestDataHolder.generateDummyDeviceData(this.deviceIds); this.deviceMgtProviderService = new DeviceManagementProviderServiceImpl(); - DeviceManagementServiceComponent.notifyStartupListeners(); DeviceManagementDataHolder.getInstance().setDeviceManagementProvider(this.deviceMgtProviderService); DeviceManagementDataHolder.getInstance() @@ -152,7 +152,6 @@ public class DeviceTaskManagerTest extends BaseDeviceManagementTest { DeviceDetailsRetrieverTask deviceDetailsRetrieverTask = new DeviceDetailsRetrieverTask(); Map map = new HashMap<>(); map.put("DEVICE_TYPE", TestDataHolder.TEST_DEVICE_TYPE); - map.put("OPPCONFIG", DEVICE_DETAIL_RETRIEVER_OPPCONFIG); deviceDetailsRetrieverTask.setProperties(map); deviceDetailsRetrieverTask.execute(); for (DeviceIdentifier deviceId : deviceIds) { @@ -172,7 +171,6 @@ public class DeviceTaskManagerTest extends BaseDeviceManagementTest { System.setProperty("is.cloud", "true"); Map map = new HashMap<>(); map.put("DEVICE_TYPE", TestDataHolder.TEST_DEVICE_TYPE); - map.put("OPPCONFIG", DEVICE_DETAIL_RETRIEVER_OPPCONFIG); deviceDetailsRetrieverTask.setProperties(map); deviceDetailsRetrieverTask.execute(); for (DeviceIdentifier deviceId : deviceIds) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml index befaefecd6..9586b2dcc8 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml index 713807945a..29a19dfc35 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json index 3b4f031c6d..d717cdae31 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json @@ -15,6 +15,9 @@ "iOSConfigRoot": "%https.ip%/ios-enrollment/", "iOSAPIRoot": "%https.ip%/ios/", "adminService": "%https.ip%", + "deviceInfoServiceAPI" : "/api/device-mgt/%device-type%/v1.0/admin/devices/info", + "deviceLocationServiceAPI" : "/api/device-mgt/%device-type%/v1.0/admin/devices/location", + "iOSDeviceInfoServiceAPI" : "/api/device-mgt/%device-type%/v1.0/admin/devices/info", "gatewayEnabled": true, "oauthProvider": { "appRegistration": { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/public/js/bottomJs.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/public/js/bottomJs.js index 66c1719052..0d18ba9dba 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/public/js/bottomJs.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/public/js/bottomJs.js @@ -39,25 +39,25 @@ $("#view-search-param").click(function () { $("#view-search-param").addClass('hidden'); }); -var dynamicForm = '
' + - '
' + - '
' + - '
' + - '
'; +var dynamicForm = '
' + + '
' + + '
' + + '
' + + '
'; var nonNumericKeyValuePair = ["deviceModel", "vendor", "osVersion", "connectionType", "ssid", "pluggedIn"]; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/search.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/search.hbs index c1c6ba2f7f..5fe3223246 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/search.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/search.hbs @@ -82,7 +82,7 @@ required.
- +
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js index ae15c3aea9..05f582844a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js @@ -275,10 +275,11 @@ function loadUsers() { $(data.users).each(function (index) { objects.push({ - filter: htmlspecialchars(data.users[index].username), - firstname: htmlspecialchars(data.users[index].firstname) ? htmlspecialchars(data.users[index].firstname) : "", - lastname: htmlspecialchars(data.users[index].lastname) ? htmlspecialchars(data.users[index].lastname) : "", + username: htmlspecialchars(data.users[index].username), + firstName: htmlspecialchars(data.users[index].firstname) ? htmlspecialchars(data.users[index].firstname) : "", + lastName: htmlspecialchars(data.users[index].lastname) ? htmlspecialchars(data.users[index].lastname) : "", emailAddress: htmlspecialchars(data.users[index].emailAddress) ? htmlspecialchars(data.users[index].emailAddress) : "", + namePattern: htmlspecialchars(data.users[index].firstname) + ' ' + htmlspecialchars(data.users[index].lastname), DT_RowId: "user-" + htmlspecialchars(data.users[index].username) }) }); @@ -304,49 +305,78 @@ function loadUsers() { //noinspection JSUnusedLocalSymbols var columns = [ { + targets: 0, class: "remove-padding icon-only content-fill", - data: null, - render: function (data, type, row, meta) { - return '
' + + data: 'username', + render: function (username, type, row, meta) { + return '
' + '' + '
'; } }, { + targets: 1, class: "", - data: null, - render: function (data, type, row, meta) { - if (!data.firstname && !data.lastname) { - return ""; - } else if (data.firstname && data.lastname) { - return "

" + data.firstname + " " + data.lastname + "

"; - } - } - }, - { - class: "remove-padding-top", - data: 'filter', - render: function (filter, type, row, meta) { - return '' + filter; - } - }, - { - class: "remove-padding-top", - data: null, - render: function (data, type, row, meta) { - if (!data.emailAddress) { + data: 'namePattern', + render: function (namePattern, type, row, meta) { + if (!namePattern) { return ""; } else { - return "" + data.emailAddress + ""; + return "

" + namePattern + "

"; } } }, { + targets: 2, + class: "remove-padding-top", + data: 'username', + render: function (username, type, row, meta) { + return '' + username; + } + }, + { + targets: 3, + class: "hidden", + data: 'firstName', + render: function (firstName, type, row, meta) { + if (!firstName) { + return ""; + } else if (firstName) { + return "

" + firstName + "

"; + } + } + }, + { + targets: 4, + class: "hidden", + data: 'lastName', + render: function (lastName, type, row, meta) { + if (!lastName) { + return ""; + } else if (lastName) { + return "

" + lastName + "

"; + } + } + }, + { + targets: 5, + class: "remove-padding-top", + data: 'emailAddress', + render: function (emailAddress, type, row, meta) { + if (!emailAddress) { + return ""; + } else { + return "" + emailAddress + ""; + } + } + }, + { + targets: 6, class: "text-right content-fill text-left-on-grid-view no-wrap tooltip-overflow-fix", data: null, render: function (data, type, row, meta) { var editbtn = ' ' + ' ' + @@ -354,18 +384,18 @@ function loadUsers() { '' + ''; - var resetPasswordbtn = '' + '' + '' + '' + ''; - var removebtn = '' + '' + '' + @@ -375,20 +405,19 @@ function loadUsers() { var returnbtnSet = ''; var adminUser = $("#user-table").data("user"); var currentUser = $("#user-table").data("logged-user"); - if ($("#can-edit").length > 0 && adminUser !== data.filter) { + if ($("#can-edit").length > 0 && adminUser !== data.username) { returnbtnSet = returnbtnSet + editbtn; } - if ($("#can-reset-password").length > 0 && adminUser !== data.filter) { + if ($("#can-reset-password").length > 0 && adminUser !== data.username) { returnbtnSet = returnbtnSet + resetPasswordbtn; } - if ($("#can-remove").length > 0 && adminUser !== data.filter && currentUser !== data.filter) { + if ($("#can-remove").length > 0 && adminUser !== data.username && currentUser !== data.username) { returnbtnSet = returnbtnSet + removebtn; } return returnbtnSet; } } - ]; var options = { @@ -400,18 +429,31 @@ function loadUsers() { "sorting": false }; - $('#user-grid').datatables_extended_serverside_paging(settings, '/api/device-mgt/v1.0/users', dataFilter, columns, fnCreatedRow, null, options); + $('#user-grid').datatables_extended_serverside_paging( + settings, + '/api/device-mgt/v1.0/users/search', + dataFilter, + columns, + fnCreatedRow, + null, + options + ); + $(loadingContentView).hide(); } $(document).ready(function () { loadUsers(); + $(function () { $('[data-toggle="tooltip"]').tooltip() }); + if (!$("#can-invite").val()) { $("#invite-user-button").remove(); } + $("#user-grid_filter").hide(); + }); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/users.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/users.hbs index 26f3f97444..34071d41b9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/users.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/users.hbs @@ -75,10 +75,25 @@ id="user-grid"> + + By Username + By First Name + By Last Name + By Email + + + + + + + + + + - +
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/app.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/app.js index 805ec7a3ab..fec0b5b280 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/app.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/app.js @@ -279,10 +279,12 @@ var getProviderData = function (timeFrom, timeTo) { var serviceUrl = '/api/device-mgt/v1.0/geo-services/stats/' + deviceType + '/' + deviceId + '?from=' + timeFrom + '&to=' + timeTo; invokerUtil.get(serviceUrl, function (data) { - if(data === ""){showCurrentLocation(tableData);} + if (data === "") { + showCurrentLocation(tableData); + } tableData = JSON.parse(data); if (tableData.length === 0) { - showCurrentLocation(tableData); + showCurrentLocation(tableData); } }, function (message) { showCurrentLocation(tableData); @@ -552,5 +554,5 @@ function formatDate(date) { hours = hours ? hours : 12; // the hour '0' should be '12' minutes = minutes < 10 ? '0'+minutes : minutes; var strTime = hours + ':' + minutes + ' ' + ampm; - return date.getDate() + "/" + date.getMonth()+1 + "/" + date.getFullYear() + " " + strTime; + return date.getDate() + "/" + (date.getMonth() + 1) + "/" + date.getFullYear() + " " + strTime; } \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/websocket.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/websocket.js index 5bc0c3d8a1..def7287471 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/websocket.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/websocket.js @@ -91,7 +91,7 @@ function initializeGeoLocation(geoFencingEnabled) { InitSpatialObject(geoFencingEnabled); } else { - noty({text: 'Invalid Access! No device information provided to track!', type: 'error'}); + noty({text: 'Invalid Access! No device information provided to track!', type: 'error', timeout: 10000}); } } @@ -493,7 +493,7 @@ GeoAreaObject.prototype.update = function (geoJSON) { }; function notifyAlert(message) { - noty({text: "Alert: " + message, type: 'warning'}); + noty({text: "Alert: " + message, type: 'warning', timeout: 10000}); } function Alert(type, message, level) { @@ -505,7 +505,7 @@ function Alert(type, message, level) { this.level = 'information'; this.notify = function () { - noty({text: this.type + ' ' + this.message, type: level}); + noty({text: this.type + ' ' + this.message, type: level, timeout: 10000}); } } @@ -575,7 +575,7 @@ var webSocketOnAlertError = function (e) { wsURL = wsURL.replace("wss://","https://"); var uriParts = wsURL.split("/"); wsURL = uriParts[0] + "//" + uriParts[2]; - noty({text: 'Something went wrong when trying to connect to ' + wsURL + '', type: 'error'}); + noty({text: 'Something went wrong when trying to connect to ' + wsURL + '', type: 'error', timeout: 10000}); }; var webSocketSpatialOnOpen = function () { @@ -606,7 +606,7 @@ var webSocketSpatialOnError = function (err) { wsURL = wsURL.replace("wss://","https://"); var uriParts = wsURL.split("/"); wsURL = uriParts[0] + "//" + uriParts[2]; - noty({text: 'Something went wrong when trying to connect to ' + wsURL + '', type: 'error'}); + noty({text: 'Something went wrong when trying to connect to ' + wsURL + '', type: 'error', timeout: 10000}); }; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-devices/public/js/app.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-devices/public/js/app.js index de2b1ec9a4..84e0686f35 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-devices/public/js/app.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-devices/public/js/app.js @@ -419,7 +419,7 @@ function formatDate(date) { hours = hours ? hours : 12; // the hour '0' should be '12' minutes = minutes < 10 ? '0' + minutes : minutes; var strTime = hours + ':' + minutes + ' ' + ampm; - return date.getDate() + "/" + date.getMonth() + 1 + "/" + date.getFullYear() + " " + strTime; + return date.getDate() + "/" + (date.getMonth() + 1) + "/" + date.getFullYear() + " " + strTime; } function timeSince(date) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/lib/error-pages-router.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/lib/error-pages-router.js index 5da3b44751..a0e30cc547 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/lib/error-pages-router.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/lib/error-pages-router.js @@ -113,8 +113,7 @@ conf: appConfigurations }, uri: errorPage.definition[constants.PAGE_DEFINITION_URI], - uriParams: {}, - user: utils.getCurrentUser() + uriParams: {} }; var templateContext = {status: status, message: message}; var renderer = require("/lib/dynamic-files-renderer.js").renderer; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml index 3d744c65a6..557416f4ed 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml @@ -23,7 +23,7 @@ device-mgt org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/pom.xml index a553cf49cd..fb80fc8ab3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml index 4ea48b1bc6..8667c75f6c 100644 --- a/components/device-mgt/pom.xml +++ b/components/device-mgt/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml diff --git a/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml b/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml index e8467397ef..768fa0245b 100644 --- a/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml +++ b/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt email-sender - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/email-sender/pom.xml b/components/email-sender/pom.xml index 72080b6e27..daba4f6682 100644 --- a/components/email-sender/pom.xml +++ b/components/email-sender/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml index 102be803cb..573ff4b397 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt identity-extensions - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.oauth.extensions - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT bundle WSO2 Carbon - OAuth Extensions http://wso2.org diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml index 94d61eae0c..7f76feb968 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml @@ -21,7 +21,7 @@ identity-extensions org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT 4.0.0 diff --git a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml index 76b1b77a4c..dedd284944 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt identity-extensions - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/components/identity-extensions/pom.xml b/components/identity-extensions/pom.xml index a686ec6c9f..2b129ca2e6 100644 --- a/components/identity-extensions/pom.xml +++ b/components/identity-extensions/pom.xml @@ -22,12 +22,11 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml 4.0.0 - org.wso2.carbon.devicemgt identity-extensions pom WSO2 Carbon - Identity Extensions Component diff --git a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml index 6be810cba9..55be291d4c 100644 --- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt policy-mgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.complex.policy.decision.point - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT bundle WSO2 Carbon - Policy Decision Point WSO2 Carbon - Policy Decision Point diff --git a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml index ce62ebd92f..bcaa557e7a 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml @@ -3,14 +3,14 @@ org.wso2.carbon.devicemgt policy-mgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.decision.point - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT bundle WSO2 Carbon - Policy Decision Point WSO2 Carbon - Policy Decision Point diff --git a/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml index d6ffb9bbc1..ea0178ec35 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml @@ -3,7 +3,7 @@ org.wso2.carbon.devicemgt policy-mgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml @@ -11,7 +11,7 @@ 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.information.point - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT bundle WSO2 Carbon - Policy Information Point WSO2 Carbon - Policy Information Point diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml index 12949f0aba..9b4b319005 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt policy-mgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.common - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT bundle WSO2 Carbon - Policy Management Common WSO2 Carbon - Policy Management Common diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml index e0ac204dc3..61ea3759cf 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt policy-mgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.core - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT bundle WSO2 Carbon - Policy Management Core WSO2 Carbon - Policy Management Core diff --git a/components/policy-mgt/pom.xml b/components/policy-mgt/pom.xml index ac999a0628..66ba3e2609 100644 --- a/components/policy-mgt/pom.xml +++ b/components/policy-mgt/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml 4.0.0 policy-mgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - Policy Management Component http://wso2.org diff --git a/components/test-coverage/pom.xml b/components/test-coverage/pom.xml index 52e1f903f6..85d66bd30d 100644 --- a/components/test-coverage/pom.xml +++ b/components/test-coverage/pom.xml @@ -21,7 +21,7 @@ carbon-devicemgt org.wso2.carbon.devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml index 7ba7e69371..f09d91a886 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml @@ -21,14 +21,14 @@ org.wso2.carbon.devicemgt webapp-authenticator-framework - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.webapp.authenticator.framework - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT bundle WSO2 Carbon - Web Application Authenticator Framework Bundle WSO2 Carbon - Web Application Authenticator Framework Bundle diff --git a/components/webapp-authenticator-framework/pom.xml b/components/webapp-authenticator-framework/pom.xml index 82e02a0c30..9e11ab1f37 100644 --- a/components/webapp-authenticator-framework/pom.xml +++ b/components/webapp-authenticator-framework/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt webapp-authenticator-framework - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - Webapp Authenticator Framework http://wso2.org diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml index de29013f9d..5025e5fc9e 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml @@ -21,14 +21,14 @@ org.wso2.carbon.devicemgt apimgt-extensions-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.application.extension.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - API Management Application Extension Feature http://wso2.org This feature contains an implementation of a api application registration, which takes care of subscription diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml index 2e2d806cc9..a5c528d0ed 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt apimgt-extensions-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.handler.server.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - Device Management - APIM handler Server Feature http://wso2.org This feature contains the handler for the api authentications diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml index 40248cb18b..e4adf005ad 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml @@ -21,13 +21,13 @@ org.wso2.carbon.devicemgt apimgt-extensions-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.integration.client.feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - APIM Integration Client Feature http://wso2.org diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml index faf1057ee8..d415133a5a 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml @@ -21,14 +21,14 @@ org.wso2.carbon.devicemgt apimgt-extensions-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.webapp.publisher.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - API Management Webapp Publisher Feature http://wso2.org This feature contains an implementation of a Tomcat lifecycle listener, which takes care of publishing diff --git a/features/apimgt-extensions/pom.xml b/features/apimgt-extensions/pom.xml index 9c6a264d95..77fbe93672 100644 --- a/features/apimgt-extensions/pom.xml +++ b/features/apimgt-extensions/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt apimgt-extensions-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - API Management Extensions Feature http://wso2.org diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.api.feature/pom.xml b/features/application-mgt/org.wso2.carbon.device.application.mgt.api.feature/pom.xml index 000a1559a0..11f4c4ef41 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.api.feature/pom.xml +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.api.feature/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt application-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.application.mgt.api.feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - Application Management API Feature http://wso2.org diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.auth.handler.feature/pom.xml b/features/application-mgt/org.wso2.carbon.device.application.mgt.auth.handler.feature/pom.xml index c6fa240225..d9d9cd9a10 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.auth.handler.feature/pom.xml +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.auth.handler.feature/pom.xml @@ -22,12 +22,12 @@ org.wso2.carbon.devicemgt application-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT 4.0.0 org.wso2.carbon.device.application.mgt.auth.handler.feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - Application Management Authentication Handler Feature This feature contains the Authentication Handler implementation for Publisher and Store. diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.feature/pom.xml b/features/application-mgt/org.wso2.carbon.device.application.mgt.feature/pom.xml index 36c2d81dda..b394a5b66b 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.feature/pom.xml +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.feature/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt application-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.application.mgt.feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - Application Management Aggregate Feature http://wso2.org diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui.feature/pom.xml b/features/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui.feature/pom.xml index 23b99c3c4a..4d278e1a13 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui.feature/pom.xml +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui.feature/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt application-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.application.mgt.publisher.ui.feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - Application Management Publisher UI Feature http://wso2.org diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/pom.xml b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/pom.xml index f360e9c295..53cf5447df 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/pom.xml +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt application-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.application.mgt.server.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - Application Management Server Feature http://wso2.org diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.store.ui.feature/pom.xml b/features/application-mgt/org.wso2.carbon.device.application.mgt.store.ui.feature/pom.xml index 751c34173c..fe0c202351 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.store.ui.feature/pom.xml +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.store.ui.feature/pom.xml @@ -23,12 +23,12 @@ org.wso2.carbon.devicemgt application-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT 4.0.0 org.wso2.carbon.device.application.mgt.store.ui.feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - Application Management Store UI Feature http://wso2.org diff --git a/features/application-mgt/pom.xml b/features/application-mgt/pom.xml index 908750352c..8c58c569be 100644 --- a/features/application-mgt/pom.xml +++ b/features/application-mgt/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml 4.0.0 application-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - Application Management Feature http://wso2.org diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml index 8eccb4c000..a2d8dc7cf6 100644 --- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml +++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt certificate-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml index f188fa4a04..5acdb552df 100644 --- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml +++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt certificate-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml index 23349e920f..0f8b67276e 100644 --- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml +++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt certificate-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.certificate.mgt.server.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - Certificate Management Server Feature http://wso2.org This feature contains the core bundles required for back-end Certificate Management functionality diff --git a/features/certificate-mgt/pom.xml b/features/certificate-mgt/pom.xml index 68556235c5..03f5f10de9 100644 --- a/features/certificate-mgt/pom.xml +++ b/features/certificate-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt certificate-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - Certificate Management Feature http://wso2.org diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml index 6078a8fefa..9934153114 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - Device Type Deployer Feature http://wso2.org WSO2 Carbon - Device Type Deployer Feature diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml index 90105cabea..893d59993e 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - FCM Based Push Notification Provider Feature http://wso2.org WSO2 Carbon - MQTT Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature/pom.xml index 4ae690e9e0..402f91d6ea 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - MQTT Based Push Notification Provider Feature http://wso2.org WSO2 Carbon - MQTT Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml index 7575e2890d..fc27c03330 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - MQTT Based Push Notification Provider Feature http://wso2.org WSO2 Carbon - MQTT Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml index 00e897dfe9..b375aab687 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - XMPP Based Push Notification Provider Feature http://wso2.org WSO2 Carbon - XMPP Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/pom.xml b/features/device-mgt-extensions/pom.xml index da2c10d621..ea5b0a253b 100644 --- a/features/device-mgt-extensions/pom.xml +++ b/features/device-mgt-extensions/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/pom.xml index b478134197..3b1cd917ed 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.analytics.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - Device Management Server Feature http://wso2.org This feature contains bundles related to device analytics data publisher and ws proxy diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml index 70686c9498..eab18373e1 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml index 12c040ec3f..4e557642e9 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml index b9dd9dbc65..159fdda997 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml @@ -4,14 +4,14 @@ org.wso2.carbon.devicemgt device-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - Device Management Extensions Feature http://wso2.org This feature contains common extensions used by key device management functionalities diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml index e9ac672779..0371465415 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml index a7d761be17..0b9a4ebfe5 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.server.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - Device Management Server Feature http://wso2.org This feature contains the core bundles required for Back-end Device Management functionality diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml index 00e36a1956..342f777896 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml index ad4064eb40..b347b66fa7 100644 --- a/features/device-mgt/pom.xml +++ b/features/device-mgt/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml diff --git a/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml b/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml index 21b75267df..fd6563b142 100644 --- a/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml +++ b/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt email-sender-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.email.sender.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - Email Sender Feature http://wso2.org This feature contains the core bundles required for email sender related functionality diff --git a/features/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/email/templates/default-enrollment-invitation.vm b/features/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/email/templates/default-enrollment-invitation.vm index 6bac59590d..6084f37ec1 100644 --- a/features/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/email/templates/default-enrollment-invitation.vm +++ b/features/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/email/templates/default-enrollment-invitation.vm @@ -16,29 +16,196 @@ under the License. *# - You have been invited to enroll your $device-type device in WSO2 IoT + You have been invited to enroll your $device-type device in Entgra IoT - WSO2 IoT Server + Entgra IoT Server
-
+
- WSO2 + entgra.io

Hi,

- -

- You have been invited by $first-name to enrol your $device-type device in WSO2 IoT Server. +

+ You have been invited by $first-name to enrol your $device-type device in Entgra IoT Server. Click here to begin device enrolment.

@@ -49,20 +216,10 @@

Regards,

- -

- WSO2 IoT Administrator +

+ Entgra IoT Administrator

-
- - - - -
WSO2
-
diff --git a/features/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/email/templates/user-enrollment.vm b/features/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/email/templates/user-enrollment.vm index 5c8a01f5c7..0c29e86b4b 100644 --- a/features/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/email/templates/user-enrollment.vm +++ b/features/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/email/templates/user-enrollment.vm @@ -16,29 +16,196 @@ under the License. *# - You have been invited to enroll your device in WSO2 IoT + You have been invited to enroll your device in Entgra IoT - WSO2 IoT Server + Entgra IoT Server
-
+
- WSO2 + entgra.io

Hi $first-name,

- -

- You have been invited to enrol your device in WSO2 IoT Server. +

+ You have been invited to enrol your device in Entgra IoT Server. Click here to begin device enrolment.

@@ -49,19 +216,10 @@ Regards,

-

- WSO2 IoT Administrator +

+ Entgra IoT Administrator

-
- - - - -
WSO2
-
diff --git a/features/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/email/templates/user-registration.vm b/features/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/email/templates/user-registration.vm index c47ed13571..5d4592007e 100644 --- a/features/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/email/templates/user-registration.vm +++ b/features/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/email/templates/user-registration.vm @@ -16,20 +16,188 @@ under the License. *# - You have successfully been registered in WSO2 IoT + You have successfully been registered in Entgra IoT - WSO2 IoT Server + Entgra IoT Server
-
+
- WSO2 + entgra.io
@@ -37,12 +205,12 @@ Hi $first-name,

-

- You have been registered in WSO2 IoT and invited to enrol your device. +

+ You have been registered in Entgra IoT and invited to enrol your device. Click here to begin device enrolment.

-

- Use following credentials to log in to WSO2 IoT Device Management application. +

+ Use following credentials to log in to Entgra IoT Device Management application.

@@ -59,19 +227,10 @@ Regards,

-

- WSO2 IoT Administrator +

+ Entgra IoT Administrator

-
- - - - -
WSO2
-
diff --git a/features/email-sender/pom.xml b/features/email-sender/pom.xml index 1720a50787..dbfde57989 100644 --- a/features/email-sender/pom.xml +++ b/features/email-sender/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt email-sender-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - Email Sender Feature http://wso2.org diff --git a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml index ce8d574b47..0138144e84 100644 --- a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml +++ b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt jwt-client-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.identity.jwt.client.extension.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - JWT Client Feature http://wso2.org This feature contains jwt client implementation from which we can get a access token using the jwt diff --git a/features/jwt-client/pom.xml b/features/jwt-client/pom.xml index 0e6fe60de2..3880663260 100644 --- a/features/jwt-client/pom.xml +++ b/features/jwt-client/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml 4.0.0 jwt-client-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - JWT Client Extension Feature http://wso2.org diff --git a/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml b/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml index 0f52113112..b390cc8785 100644 --- a/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml +++ b/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt oauth-extensions-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.oauth.extensions.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - Device Mgt OAuth Extensions Feature http://wso2.org This feature contains devicemgt related OAuth extensions diff --git a/features/oauth-extensions/pom.xml b/features/oauth-extensions/pom.xml index b3163e4310..ca5a7276d4 100644 --- a/features/oauth-extensions/pom.xml +++ b/features/oauth-extensions/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt oauth-extensions-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - Device Management OAuth Extensions Feature http://wso2.org diff --git a/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml b/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml index 0bf0d010c2..3d869d6c78 100644 --- a/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml +++ b/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt policy-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.policy.mgt.server.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - Policy Management Server Feature http://wso2.org This feature contains the core bundles required for Back-end Device Management functionality diff --git a/features/policy-mgt/pom.xml b/features/policy-mgt/pom.xml index a2effad935..5d61abb322 100644 --- a/features/policy-mgt/pom.xml +++ b/features/policy-mgt/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt policy-mgt-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - Policy Management Feature http://wso2.org diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml index 393a26f397..c4ae8cf969 100644 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml +++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt webapp-authenticator-framework-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.webapp.authenticator.framework.server.feature pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - Webapp Authenticator Framework Server Feature http://wso2.org This feature contains the core bundles required for Back-end Device Management functionality diff --git a/features/webapp-authenticator-framework/pom.xml b/features/webapp-authenticator-framework/pom.xml index 3255d169b8..5641dcd07e 100644 --- a/features/webapp-authenticator-framework/pom.xml +++ b/features/webapp-authenticator-framework/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt webapp-authenticator-framework-feature - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT pom WSO2 Carbon - Webapp Authenticator Framework Feature http://wso2.org diff --git a/pom.xml b/pom.xml index 50cf2142a3..cdf352e397 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt pom - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT WSO2 Carbon - Device Management - Parent http://wso2.org WSO2 Connected Device Manager Components @@ -37,7 +37,7 @@ components/device-mgt components/device-mgt-extensions - components/identity-extensions + components/identity-extensions components/apimgt-extensions components/application-mgt components/policy-mgt @@ -2082,7 +2082,7 @@ 1.2.11.wso2v10 - 3.2.1-SNAPSHOT + 3.2.2-SNAPSHOT 4.6.21