diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/pom.xml b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/pom.xml
index 65b46b32a3..5a0986f8b7 100644
--- a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/pom.xml
+++ b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
grafana-mgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/analytics/mgt/grafana/proxy/api/service/GrafanaAPIProxyService.java b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/analytics/mgt/grafana/proxy/api/service/GrafanaAPIProxyService.java
index 3921e6fc34..c154f9149c 100644
--- a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/analytics/mgt/grafana/proxy/api/service/GrafanaAPIProxyService.java
+++ b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/analytics/mgt/grafana/proxy/api/service/GrafanaAPIProxyService.java
@@ -112,7 +112,7 @@ public interface GrafanaAPIProxyService {
@Path("/dashboards/uid/{uid}")
@ApiOperation(
produces = MediaType.APPLICATION_JSON,
- httpMethod = "POST",
+ httpMethod = "GET",
value = "Grafana dashboard details API proxy",
tags = "Analytics",
extensions = {
@@ -145,7 +145,7 @@ public interface GrafanaAPIProxyService {
@Path("/alerts/states-for-dashboard")
@ApiOperation(
produces = MediaType.APPLICATION_JSON,
- httpMethod = "POST",
+ httpMethod = "GET",
value = "Get Grafana alert states for dashboard details API proxy",
tags = "Analytics",
extensions = {
diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/analytics/mgt/grafana/proxy/api/service/impl/util/GrafanaRequestHandlerUtil.java b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/analytics/mgt/grafana/proxy/api/service/impl/util/GrafanaRequestHandlerUtil.java
index 064ea037f4..e4d17265a8 100644
--- a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/analytics/mgt/grafana/proxy/api/service/impl/util/GrafanaRequestHandlerUtil.java
+++ b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/analytics/mgt/grafana/proxy/api/service/impl/util/GrafanaRequestHandlerUtil.java
@@ -46,6 +46,7 @@ import javax.ws.rs.core.UriInfo;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URI;
+import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;
@@ -138,7 +139,7 @@ public class GrafanaRequestHandlerUtil {
}
public static void setRequestEntity(HttpPost postRequest, JsonObject body) throws UnsupportedEncodingException {
- StringEntity bodyEntity = new StringEntity(body.toString());
+ StringEntity bodyEntity = new StringEntity(body.toString(), StandardCharsets.UTF_8);
bodyEntity.setContentType(MediaType.APPLICATION_JSON);
postRequest.setEntity(bodyEntity);
}
diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.common/pom.xml b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.common/pom.xml
index 4780a7f221..12ba1521c2 100644
--- a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.common/pom.xml
+++ b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.common/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
grafana-mgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.core/pom.xml b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.core/pom.xml
index 05d8e9d54a..a952f3a7bc 100644
--- a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.core/pom.xml
+++ b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.core/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
grafana-mgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.core/src/main/java/io/entgra/analytics/mgt/grafana/proxy/core/util/GrafanaConstants.java b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.core/src/main/java/io/entgra/analytics/mgt/grafana/proxy/core/util/GrafanaConstants.java
index 65865ad619..b8a33f8b32 100644
--- a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.core/src/main/java/io/entgra/analytics/mgt/grafana/proxy/core/util/GrafanaConstants.java
+++ b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.core/src/main/java/io/entgra/analytics/mgt/grafana/proxy/core/util/GrafanaConstants.java
@@ -60,7 +60,7 @@ public class GrafanaConstants {
public static final String DASHBOARD_PANEL_DETAIL_QUERIES_KEY = "targets";
public static final String QUERY_REF_ID_KEY = "refId";
public static final String PANEL_ID_QUERY_PARAM = "panelId";
- public static final String ORG_ID_QUERY_PARAM = "panelId";
+ public static final String ORG_ID_QUERY_PARAM = "orgId";
public static final String ID_KEY = "id";
public static final String WS_LIVE_API = "/api/live/ws";
diff --git a/components/analytics-mgt/grafana-mgt/pom.xml b/components/analytics-mgt/grafana-mgt/pom.xml
index 7657d60461..5807691202 100644
--- a/components/analytics-mgt/grafana-mgt/pom.xml
+++ b/components/analytics-mgt/grafana-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
analytics-mgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/analytics-mgt/pom.xml b/components/analytics-mgt/pom.xml
index 49f16fdd54..bc58bf24c1 100644
--- a/components/analytics-mgt/pom.xml
+++ b/components/analytics-mgt/pom.xml
@@ -3,7 +3,7 @@
carbon-devicemgt
org.wso2.carbon.devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
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 0ab9138c8d..25e610183c 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml
@@ -22,7 +22,7 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
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 1d20bd67ee..fd3c2c03b6 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,7 +21,7 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
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 5ce50a53eb..8427e524c3 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,7 +22,7 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
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 e6dac63e65..4d5cbaaf15 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,7 +22,7 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/apimgt-extensions/pom.xml b/components/apimgt-extensions/pom.xml
index 853fd05aa7..cda8059d2a 100644
--- a/components/apimgt-extensions/pom.xml
+++ b/components/apimgt-extensions/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
diff --git a/components/application-mgt/io.entgra.application.mgt.addons/pom.xml b/components/application-mgt/io.entgra.application.mgt.addons/pom.xml
index 8d264d59be..8b57965f1f 100644
--- a/components/application-mgt/io.entgra.application.mgt.addons/pom.xml
+++ b/components/application-mgt/io.entgra.application.mgt.addons/pom.xml
@@ -20,7 +20,7 @@
application-mgt
org.wso2.carbon.devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/application-mgt/io.entgra.application.mgt.api/pom.xml b/components/application-mgt/io.entgra.application.mgt.api/pom.xml
index 777c10b817..0fe8e6bb60 100644
--- a/components/application-mgt/io.entgra.application.mgt.api/pom.xml
+++ b/components/application-mgt/io.entgra.application.mgt.api/pom.xml
@@ -22,7 +22,7 @@
application-mgt
org.wso2.carbon.devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/application-mgt/io.entgra.application.mgt.common/pom.xml b/components/application-mgt/io.entgra.application.mgt.common/pom.xml
index 25e0944d26..b4ef88578f 100644
--- a/components/application-mgt/io.entgra.application.mgt.common/pom.xml
+++ b/components/application-mgt/io.entgra.application.mgt.common/pom.xml
@@ -21,7 +21,7 @@
org.wso2.carbon.devicemgt
application-mgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/DeviceSubscriptionData.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/DeviceSubscriptionData.java
index d769a8b139..6484080bef 100644
--- a/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/DeviceSubscriptionData.java
+++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/DeviceSubscriptionData.java
@@ -29,6 +29,7 @@ public class DeviceSubscriptionData {
private String actionType;
private String status;
private Device device;
+ private String currentInstalledVersion;
public String getAction() {
return action;
@@ -77,4 +78,8 @@ public class DeviceSubscriptionData {
public void setDevice(Device device) {
this.device = device;
}
+
+ public String getCurrentInstalledVersion() { return currentInstalledVersion; }
+
+ public void setCurrentInstalledVersion(String currentInstalledVersion) { this.currentInstalledVersion = currentInstalledVersion; }
}
diff --git a/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/ApplicationManager.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/ApplicationManager.java
index 5e77584b9a..018f9af7d9 100644
--- a/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/ApplicationManager.java
+++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/ApplicationManager.java
@@ -51,19 +51,20 @@ public interface ApplicationManager {
*
* @param applicationWrapper Application that need to be created.
* @param applicationArtifact contains artifact data. i.e image name and stream, icon name and stream etc.
+ * @param isPublished checks if application should be published
* @return {@link Application}
* @throws ApplicationManagementException Catch all other throwing exceptions and throw {@link ApplicationManagementException}
*/
- Application createEntApp(ApplicationWrapper applicationWrapper, ApplicationArtifact applicationArtifact)
+ Application createEntApp(ApplicationWrapper applicationWrapper, ApplicationArtifact applicationArtifact, boolean isPublished)
throws ApplicationManagementException;
- Application createWebClip(WebAppWrapper webAppWrapper, ApplicationArtifact applicationArtifact)
+ Application createWebClip(WebAppWrapper webAppWrapper, ApplicationArtifact applicationArtifact, boolean isPublished)
throws ApplicationManagementException;
- Application createPublicApp(PublicAppWrapper publicAppWrapper, ApplicationArtifact applicationArtifact)
+ Application createPublicApp(PublicAppWrapper publicAppWrapper, ApplicationArtifact applicationArtifact, boolean isPublished)
throws ApplicationManagementException;
- Application createCustomApp(CustomAppWrapper customAppWrapper, ApplicationArtifact applicationArtifact)
+ Application createCustomApp(CustomAppWrapper customAppWrapper, ApplicationArtifact applicationArtifact, boolean isPublished)
throws ApplicationManagementException;
/**
@@ -179,7 +180,18 @@ public interface ApplicationManager {
*/
ApplicationRelease changeLifecycleState(String releaseUuid, LifecycleChanger lifecycleChanger)
throws ApplicationManagementException;
-
+
+ /**
+ * To get all the releases of a particular ApplicationDTO.
+ *
+ * @param applicationReleaseDTO of the ApplicationDTO Release.
+ * @param lifecycleChanger Lifecycle changer that contains the action and the reason for the change.
+ * @throws ApplicationManagementException ApplicationDTO Management Exception.
+ * @return
+ */
+ ApplicationRelease changeLifecycleState(ApplicationReleaseDTO applicationReleaseDTO, LifecycleChanger lifecycleChanger)
+ throws ApplicationManagementException;
+
/**
* To update release images such as icons, banner and screenshots.
*
@@ -207,10 +219,11 @@ public interface ApplicationManager {
*
* @param applicationId ID of the ApplicationDTO
* @param entAppReleaseWrapper ApplicatonRelease that need to be be created.
+ * @param isPublished checks if application should be published
* @return the unique id of the application release, if the application release succeeded else -1
*/
ApplicationRelease createEntAppRelease(int applicationId, EntAppReleaseWrapper entAppReleaseWrapper,
- ApplicationArtifact applicationArtifact) throws ApplicationManagementException;
+ ApplicationArtifact applicationArtifact, boolean isPublished) throws ApplicationManagementException;
/***
*
@@ -304,5 +317,4 @@ public interface ApplicationManager {
String getPlistArtifact(String uuid) throws ApplicationManagementException;
List getReleaseByPackageNames(List packageIds) throws ApplicationManagementException;
-
}
diff --git a/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/SubscriptionManager.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/SubscriptionManager.java
index 4fd68a490e..d77ee1401f 100644
--- a/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/SubscriptionManager.java
+++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/SubscriptionManager.java
@@ -175,12 +175,13 @@ public interface SubscriptionManager {
* @param actionStatus status of the operation.
* @param action action related to the device.
* @param appUUID application release UUID
+ * @param installedVersion installed version
* @return {@link PaginationResult}
* @throws ApplicationManagementException if offset or limit contains incorrect values, if it couldn't find an
* application release for given UUID, if an error occurred while getting device details of subscribed device ids,
* if an error occurred while getting subscription details of given application release UUID.
*/
- PaginationResult getAppSubscriptionDetails(PaginationRequest request, String appUUID, String actionStatus, String action)
+ PaginationResult getAppSubscriptionDetails(PaginationRequest request, String appUUID, String actionStatus, String action, String installedVersion)
throws ApplicationManagementException;
/***
diff --git a/components/application-mgt/io.entgra.application.mgt.core/pom.xml b/components/application-mgt/io.entgra.application.mgt.core/pom.xml
index ffd0b0ddb6..1b9644dade 100644
--- a/components/application-mgt/io.entgra.application.mgt.core/pom.xml
+++ b/components/application-mgt/io.entgra.application.mgt.core/pom.xml
@@ -21,7 +21,7 @@
org.wso2.carbon.devicemgt
application-mgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/SubscriptionDAO.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/SubscriptionDAO.java
index a84446d6a3..9913d8e19c 100644
--- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/SubscriptionDAO.java
+++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/SubscriptionDAO.java
@@ -239,4 +239,13 @@ public interface SubscriptionDAO {
*/
List getAppSubscribedDevicesForGroups(int appReleaseId, String subtype, int tenantId)
throws ApplicationManagementDAOException;
+
+ /**
+ * This method is used to get the currently installed version for given app release id
+ * @param appId id of the application
+ * @param deviceIdList id list of devices
+ * @return Map with device id as a key and currently installed version as value
+ * @throws {@link ApplicationManagementDAOException} if connections establishment fails.
+ */
+ Map getCurrentInstalledAppVersion(int appId, List deviceIdList, String installedVersion) throws ApplicationManagementDAOException;
}
diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java
index 521981849d..74b7741c18 100644
--- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java
+++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java
@@ -1311,4 +1311,66 @@ public class GenericSubscriptionDAOImpl extends AbstractDAOImpl implements Subsc
throw new ApplicationManagementDAOException(msg, e);
}
}
+
+ @Override
+ public Map getCurrentInstalledAppVersion(int appId, List deviceIdList, String installedVersion ) throws ApplicationManagementDAOException {
+ if (log.isDebugEnabled()) {
+ log.debug("Request received in DAO Layer to get current installed version of the app for " +
+ "given app release id.");
+ }
+ try {
+
+ Map installedVersionsMap = new HashMap<>();
+ Connection conn = this.getDBConnection();
+ int index = 1;
+ boolean isInstalledVersionAvailable = false;
+ StringJoiner joiner = new StringJoiner(",",
+ " SELECT DM_DEVICE_ID AS DEVICE,VERSION FROM " +
+ " (SELECT AP_APP.ID, VERSION FROM AP_APP_RELEASE AP_APP " +
+ " WHERE ID IN (SELECT ID FROM AP_APP_RELEASE " +
+ " WHERE AP_APP_ID = ?) " +
+ " ) AP_APP_V" +
+ " INNER JOIN " +
+ " (SELECT AP_APP_RELEASE_ID, DM_DEVICE_ID FROM AP_DEVICE_SUBSCRIPTION AP_DEV_1 " +
+ " INNER JOIN (" +
+ " SELECT MAX(ID) AS ID FROM AP_DEVICE_SUBSCRIPTION " +
+ " WHERE STATUS = 'COMPLETED' AND DM_DEVICE_ID IN (",
+ ") GROUP BY DM_DEVICE_ID " +
+ ") AP_DEV_2 " +
+ "ON AP_DEV_2.ID = AP_DEV_1.ID ) AP_APP_R " +
+ "ON AP_APP_R.AP_APP_RELEASE_ID = AP_APP_V.ID");
+ deviceIdList.stream().map(ignored -> "?").forEach(joiner::add);
+ String query = joiner.toString();
+ if(installedVersion != null && !installedVersion.isEmpty()){
+ query += " WHERE VERSION = ? ";
+ isInstalledVersionAvailable = true;
+ }
+ try (PreparedStatement ps = conn.prepareStatement(query)) {
+ ps.setInt(index++, appId);
+ for (int deviceId : deviceIdList) {
+ ps.setInt(index++, deviceId);
+ }
+ if(isInstalledVersionAvailable){
+ ps.setString(index++, installedVersion);
+ }
+ try (ResultSet rs = ps.executeQuery()) {
+ while (rs.next()) {
+ installedVersionsMap.put(rs.getInt("DEVICE"),rs.getString("VERSION"));
+ }
+ }
+ return installedVersionsMap;
+ }
+
+ }catch (DBConnectionException e) {
+ String msg = "Error occurred while obtaining the DB connection to get current installed version of the app for " +
+ "given app id.";
+ log.error(msg, e);
+ throw new ApplicationManagementDAOException(msg, e);
+ } catch (SQLException e) {
+ String msg = "SQL Error occurred while getting current installed version of the app for given " +
+ "app id.";
+ log.error(msg, e);
+ throw new ApplicationManagementDAOException(msg, e);
+ }
+ }
}
diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationManagerImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationManagerImpl.java
index 82405ee2fe..599576f7b3 100644
--- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationManagerImpl.java
+++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationManagerImpl.java
@@ -135,7 +135,7 @@ ApplicationManagerImpl implements ApplicationManager {
@Override
public Application createEntApp(ApplicationWrapper applicationWrapper,
- ApplicationArtifact applicationArtifact) throws ApplicationManagementException {
+ ApplicationArtifact applicationArtifact, boolean isPublished) throws ApplicationManagementException {
if (log.isDebugEnabled()) {
log.debug("Ent. Application create request is received. Application name: " + applicationWrapper.getName()
+ " Device type: " + applicationWrapper.getDeviceType());
@@ -149,11 +149,11 @@ ApplicationManagerImpl implements ApplicationManager {
applicationWrapper.getDeviceType(), tenantId, false);
applicationDTO.getApplicationReleaseDTOs().clear();
applicationDTO.getApplicationReleaseDTOs().add(applicationReleaseDTO);
- return addAppDataIntoDB(applicationDTO, tenantId);
+ return addAppDataIntoDB(applicationDTO, tenantId, isPublished);
}
@Override
- public Application createWebClip(WebAppWrapper webAppWrapper, ApplicationArtifact applicationArtifact)
+ public Application createWebClip(WebAppWrapper webAppWrapper, ApplicationArtifact applicationArtifact, boolean isPublished)
throws ApplicationManagementException {
if (log.isDebugEnabled()) {
log.debug("Web clip create request is received. App name: " + webAppWrapper.getName() + " Device type: "
@@ -175,11 +175,11 @@ ApplicationManagerImpl implements ApplicationManager {
throw new ApplicationManagementException(msg, e);
}
//insert application data into database
- return addAppDataIntoDB(applicationDTO, tenantId);
+ return addAppDataIntoDB(applicationDTO, tenantId, isPublished);
}
@Override
- public Application createPublicApp(PublicAppWrapper publicAppWrapper, ApplicationArtifact applicationArtifact)
+ public Application createPublicApp(PublicAppWrapper publicAppWrapper, ApplicationArtifact applicationArtifact, boolean isPublished)
throws ApplicationManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
@@ -231,11 +231,11 @@ ApplicationManagerImpl implements ApplicationManager {
throw new ApplicationManagementException(msg, e);
}
//insert application data into database
- return addAppDataIntoDB(applicationDTO, tenantId);
+ return addAppDataIntoDB(applicationDTO, tenantId, isPublished);
}
@Override
- public Application createCustomApp(CustomAppWrapper customAppWrapper, ApplicationArtifact applicationArtifact)
+ public Application createCustomApp(CustomAppWrapper customAppWrapper, ApplicationArtifact applicationArtifact, boolean isPublished)
throws ApplicationManagementException {
try {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
@@ -282,7 +282,7 @@ ApplicationManagerImpl implements ApplicationManager {
applicationReleaseDTO = addImageArtifacts(applicationReleaseDTO, applicationArtifact, tenantId);
applicationDTO.getApplicationReleaseDTOs().clear();
applicationDTO.getApplicationReleaseDTOs().add(applicationReleaseDTO);
- return addAppDataIntoDB(applicationDTO, tenantId);
+ return addAppDataIntoDB(applicationDTO, tenantId, isPublished);
} catch (ResourceManagementException e) {
String msg = "Error occurred while uploading application artifact into the server. Application name: "
+ customAppWrapper.getName() + " Device type: " + customAppWrapper.getDeviceType();
@@ -872,7 +872,7 @@ ApplicationManagerImpl implements ApplicationManager {
* @return {@link Application}
* @throws ApplicationManagementException which throws if error occurs while during application management.
*/
- private Application addAppDataIntoDB(ApplicationDTO applicationDTO, int tenantId) throws ApplicationManagementException {
+ private Application addAppDataIntoDB(ApplicationDTO applicationDTO, int tenantId, boolean isPublished) throws ApplicationManagementException {
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
List unrestrictedRoles = applicationDTO.getUnrestrictedRoles();
ApplicationReleaseDTO applicationReleaseDTO = applicationDTO.getApplicationReleaseDTOs().get(0);
@@ -939,12 +939,24 @@ ApplicationManagerImpl implements ApplicationManager {
if (log.isDebugEnabled()) {
log.debug("Creating a new release. App Id:" + appId);
}
- String initialLifecycleState = lifecycleStateManager.getInitialState();
- applicationReleaseDTO.setCurrentState(initialLifecycleState);
- applicationReleaseDTO = this.applicationReleaseDAO
- .createRelease(applicationReleaseDTO, appId, tenantId);
- LifecycleState lifecycleState = getLifecycleStateInstance(initialLifecycleState, initialLifecycleState);
+
+ String lifeCycleState = lifecycleStateManager.getInitialState();
+ String[] publishStates= {"IN-REVIEW", "APPROVED", "PUBLISHED"};
+
+ applicationReleaseDTO.setCurrentState(lifeCycleState);
+ applicationReleaseDTO = this.applicationReleaseDAO.createRelease(applicationReleaseDTO, appId, tenantId);
+ LifecycleState lifecycleState = getLifecycleStateInstance(lifeCycleState, lifeCycleState);
this.lifecycleStateDAO.addLifecycleState(lifecycleState, applicationReleaseDTO.getId(), tenantId);
+
+ if(isPublished){
+ for (String state: publishStates) {
+ LifecycleChanger lifecycleChanger = new LifecycleChanger();
+ lifecycleChanger.setAction(state);
+ lifecycleChanger.setReason("Updated to " + state);
+ this.changeLifecycleState(applicationReleaseDTO, lifecycleChanger);
+ }
+ }
+
applicationReleaseEntities.add(applicationReleaseDTO);
applicationDTO.setApplicationReleaseDTOs(applicationReleaseEntities);
Application application = APIUtil.appDtoToAppResponse(applicationDTO);
@@ -1004,7 +1016,7 @@ ApplicationManagerImpl implements ApplicationManager {
@Override
public ApplicationRelease createEntAppRelease(int applicationId, EntAppReleaseWrapper entAppReleaseWrapper,
- ApplicationArtifact applicationArtifact) throws ApplicationManagementException {
+ ApplicationArtifact applicationArtifact, boolean isPublished) throws ApplicationManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
if (log.isDebugEnabled()) {
log.debug("Application release creating request is received for the application id: " + applicationId);
@@ -1030,15 +1042,28 @@ ApplicationManagerImpl implements ApplicationManager {
ApplicationReleaseDTO applicationReleaseDTO = uploadEntAppReleaseArtifacts(
APIUtil.releaseWrapperToReleaseDTO(entAppReleaseWrapper), applicationArtifact, deviceType.getName(),
tenantId, true);
+
try {
ConnectionManagerUtil.beginDBTransaction();
- String initialstate = lifecycleStateManager.getInitialState();
- applicationReleaseDTO.setCurrentState(initialstate);
- LifecycleState lifecycleState = getLifecycleStateInstance(initialstate, initialstate);
+ String lifeCycleState = lifecycleStateManager.getInitialState();
+ String[] publishStates= {"IN-REVIEW", "APPROVED", "PUBLISHED"};
+
+ applicationReleaseDTO.setCurrentState(lifeCycleState);
+ LifecycleState lifecycleState = getLifecycleStateInstance(lifeCycleState, lifeCycleState);
applicationReleaseDTO = this.applicationReleaseDAO
.createRelease(applicationReleaseDTO, applicationDTO.getId(), tenantId);
this.lifecycleStateDAO
.addLifecycleState(lifecycleState, applicationReleaseDTO.getId(), tenantId);
+
+ if(isPublished){
+ for (String state: publishStates) {
+ LifecycleChanger lifecycleChanger = new LifecycleChanger();
+ lifecycleChanger.setAction(state);
+ lifecycleChanger.setReason("Updated to " + state);
+ this.changeLifecycleState(applicationReleaseDTO, lifecycleChanger);
+ }
+ }
+
ApplicationRelease applicationRelease = APIUtil.releaseDtoToRelease(applicationReleaseDTO);
ConnectionManagerUtil.commitDBTransaction();
return applicationRelease;
@@ -1883,6 +1908,61 @@ ApplicationManagerImpl implements ApplicationManager {
ConnectionManagerUtil.closeDBConnection();
}
}
+
+ public ApplicationRelease changeLifecycleState(ApplicationReleaseDTO applicationReleaseDTO, LifecycleChanger lifecycleChanger) throws ApplicationManagementException {
+
+ int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
+ String userName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
+ if (lifecycleChanger == null || StringUtils.isEmpty(lifecycleChanger.getAction())) {
+ String msg = "The Action is null or empty. Please verify the request.";
+ log.error(msg);
+ throw new BadRequestException(msg);
+ }
+
+ try{
+ if (lifecycleStateManager
+ .isValidStateChange(applicationReleaseDTO.getCurrentState(), lifecycleChanger.getAction(), userName,
+ tenantId)) {
+ if (lifecycleStateManager.isInstallableState(lifecycleChanger.getAction()) && applicationReleaseDAO
+ .hasExistInstallableAppRelease(applicationReleaseDTO.getUuid(),
+ lifecycleStateManager.getInstallableState(), tenantId)) {
+ String msg = "Installable application release is already registered for the application. "
+ + "Therefore it is not permitted to change the lifecycle state from "
+ + applicationReleaseDTO.getCurrentState() + " to " + lifecycleChanger.getAction();
+ log.error(msg);
+ throw new ForbiddenException(msg);
+ }
+ LifecycleState lifecycleState = new LifecycleState();
+ lifecycleState.setCurrentState(lifecycleChanger.getAction());
+ lifecycleState.setPreviousState(applicationReleaseDTO.getCurrentState());
+ lifecycleState.setUpdatedBy(userName);
+ lifecycleState.setReasonForChange(lifecycleChanger.getReason());
+ applicationReleaseDTO.setCurrentState(lifecycleChanger.getAction());
+ if (this.applicationReleaseDAO.updateRelease(applicationReleaseDTO, tenantId) == null) {
+ String msg = "Application release updating is failed/.";
+ log.error(msg);
+ throw new ApplicationManagementException(msg);
+ }
+ this.lifecycleStateDAO.addLifecycleState(lifecycleState, applicationReleaseDTO.getId(), tenantId);
+ return APIUtil.releaseDtoToRelease(applicationReleaseDTO);
+ } else {
+ String msg = "Invalid lifecycle state transition from '" + applicationReleaseDTO.getCurrentState() + "'"
+ + " to '" + lifecycleChanger.getAction() + "'";
+ log.error(msg);
+ throw new ApplicationManagementException(msg);
+ }
+ } catch (ApplicationManagementDAOException e) {
+ String msg = "Error occurred when accessing application release data of application release which has the "
+ + "application release UUID: " + applicationReleaseDTO.getUuid();
+ log.error(msg, e);
+ throw new ApplicationManagementException(msg, e);
+ } catch (LifeCycleManagementDAOException e) {
+ String msg = "Failed to add lifecycle state for Application release UUID: " + applicationReleaseDTO.getUuid();
+ log.error(msg, e);
+ throw new ApplicationManagementException(msg, e);
+ }
+ }
+
@Override
public void addApplicationCategories(List categories) throws ApplicationManagementException {
diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/SubscriptionManagerImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/SubscriptionManagerImpl.java
index a6ceff06d8..8f87f9b3f9 100644
--- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/SubscriptionManagerImpl.java
+++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/SubscriptionManagerImpl.java
@@ -1361,7 +1361,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
@Override
public PaginationResult getAppSubscriptionDetails(PaginationRequest request, String appUUID, String actionStatus,
- String action) throws ApplicationManagementException {
+ String action, String installedVersion) throws ApplicationManagementException {
int limitValue = request.getRowCount();
int offsetValue = request.getStartIndex();
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
@@ -1395,6 +1395,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
}
List deviceIdList = deviceSubscriptionDTOS.stream().map(DeviceSubscriptionDTO::getDeviceId)
.collect(Collectors.toList());
+ Map currentVersionsMap = subscriptionDAO.getCurrentInstalledAppVersion(applicationDTO.getId(),deviceIdList, installedVersion);
try {
//pass the device id list to device manager service method
PaginationResult paginationResult = deviceManagementProviderService.getAppSubscribedDevices
@@ -1404,7 +1405,15 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
if (!paginationResult.getData().isEmpty()) {
List devices = (List) paginationResult.getData();
for (Device device : devices) {
+ if(installedVersion != null && !installedVersion.isEmpty() && !currentVersionsMap.containsKey(device.getId())){
+ continue;
+ }
DeviceSubscriptionData deviceSubscriptionData = new DeviceSubscriptionData();
+ if(currentVersionsMap.containsKey(device.getId())){
+ deviceSubscriptionData.setCurrentInstalledVersion(currentVersionsMap.get(device.getId()));
+ }else{
+ deviceSubscriptionData.setCurrentInstalledVersion("-");
+ }
for (DeviceSubscriptionDTO subscription : deviceSubscriptionDTOS) {
if (subscription.getDeviceId() == device.getId()) {
deviceSubscriptionData.setDevice(device);
diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java
index 998e10e5b1..bab8ef199e 100644
--- a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java
+++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java
@@ -41,7 +41,6 @@ import io.entgra.application.mgt.core.dto.ApplicationsDTO;
import io.entgra.application.mgt.core.impl.ApplicationManagerImpl;
import io.entgra.application.mgt.core.internal.DataHolder;
import io.entgra.application.mgt.core.util.ConnectionManagerUtil;
-import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
import org.wso2.carbon.device.mgt.core.dto.DeviceType;
import org.wso2.carbon.device.mgt.core.dto.DeviceTypeVersion;
@@ -121,9 +120,8 @@ public class ApplicationManagementTest extends BaseTestCase {
screenshots.put("shot3", new FileInputStream(new File("src/test/resources/samples/app1/shot3.png")));
applicationArtifact.setScreenshots(screenshots);
-
ApplicationManager manager = new ApplicationManagerImpl();
- manager.createEntApp(applicationWrapper, applicationArtifact);
+ manager.createEntApp(applicationWrapper, applicationArtifact, false);
}
@DataProvider(name = "applicationIdDataProvider")
@@ -140,7 +138,12 @@ public class ApplicationManagementTest extends BaseTestCase {
public static Object[][] uuidDataProvider() {
return new Object[][] {{"TEST_APP_UUID"}};
}
-
+
+ @Test(enabled = false)
+ public void createApplicationAndPublish(ApplicationWrapper applicationWrapper, ApplicationArtifact applicationArtifact, boolean isPublish) throws ApplicationManagementException {
+
+ }
+
@Test(enabled = false)
public void updateApplication(int applicationId, ApplicationUpdateWrapper applicationUpdateWrapper) throws ApplicationManagementException {
diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/pom.xml b/components/application-mgt/io.entgra.application.mgt.publisher.api/pom.xml
index ebeb1f6343..72b86a50c9 100644
--- a/components/application-mgt/io.entgra.application.mgt.publisher.api/pom.xml
+++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/pom.xml
@@ -22,7 +22,7 @@
application-mgt
org.wso2.carbon.devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java
index 1cd1411da3..772ac1a33d 100644
--- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java
+++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java
@@ -319,6 +319,11 @@ public interface ApplicationManagementPublisherAPI {
value = "The application that need to be created.",
required = true)
@Multipart("application") ApplicationWrapper application,
+ @ApiParam(
+ name = "isPublished",
+ value = "Published state of the application"
+ )
+ @QueryParam("is-Published") boolean isPublished,
@ApiParam(
name = "binaryFile",
value = "Binary file of uploading application",
@@ -388,6 +393,11 @@ public interface ApplicationManagementPublisherAPI {
value = "The web app that need to be created.",
required = true)
@Multipart("webapp") WebAppWrapper webAppWrapper,
+ @ApiParam(
+ name = "isPublished",
+ value = "Published state of the application"
+ )
+ @QueryParam("is-Published") boolean isPublished,
@ApiParam(
name = "icon",
value = "Icon of the uploading web app",
@@ -452,6 +462,11 @@ public interface ApplicationManagementPublisherAPI {
value = "The public app that need to be created.",
required = true)
@Multipart("public-app") PublicAppWrapper publicAppWrapper,
+ @ApiParam(
+ name = "isPublished",
+ value = "Published state of the application"
+ )
+ @QueryParam("is-Published") boolean isPublished,
@ApiParam(
name = "icon",
value = "Icon of the uploading public app",
@@ -514,6 +529,11 @@ public interface ApplicationManagementPublisherAPI {
value = "The application that need to be created.",
required = true)
@Multipart("application") CustomAppWrapper customAppWrapper,
+ @ApiParam(
+ name = "isPublished",
+ value = "Published state of the application"
+ )
+ @QueryParam("is-Published") boolean isPublished,
@ApiParam(
name = "binaryFile",
value = "Binary file of uploading application",
@@ -593,6 +613,11 @@ public interface ApplicationManagementPublisherAPI {
value = "The application release that need to be created.",
required = true)
@Multipart("applicationRelease") EntAppReleaseWrapper entAppReleaseWrapper,
+ @ApiParam(
+ name = "isPublished",
+ value = "Published state of the application"
+ )
+ @QueryParam("is-Published") boolean isPublished,
@ApiParam(
name = "binaryFile",
value = "Binary file of uploading application",
diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java
index 8b156bbf9d..155348284f 100644
--- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java
+++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java
@@ -173,6 +173,7 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem
@Path("/ent-app")
public Response createEntApp(
@Multipart("application") ApplicationWrapper applicationWrapper,
+ @QueryParam("is-published") boolean isPublished,
@Multipart("binaryFile") Attachment binaryFile,
@Multipart("icon") Attachment iconFile,
@Multipart(value = "banner", required = false) Attachment bannerFile,
@@ -190,7 +191,7 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem
// Created new Ent App
Application application = applicationManager.createEntApp(applicationWrapper,
- constructApplicationArtifact(binaryFile, iconFile, bannerFile, attachmentList));
+ constructApplicationArtifact(binaryFile, iconFile, bannerFile, attachmentList), isPublished);
if (application != null) {
return Response.status(Response.Status.CREATED).entity(application).build();
} else {
@@ -218,6 +219,7 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem
@Path("/web-app")
public Response createWebApp(
@Multipart("webapp") WebAppWrapper webAppWrapper,
+ @QueryParam("is-published") boolean isPublished,
@Multipart("icon") Attachment iconFile,
@Multipart(value = "banner", required = false) Attachment bannerFile,
@Multipart("screenshot1") Attachment screenshot1,
@@ -233,7 +235,7 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem
// Created new Web App
Application application = applicationManager.createWebClip(webAppWrapper,
- constructApplicationArtifact(null, iconFile, bannerFile, attachmentList));
+ constructApplicationArtifact(null, iconFile, bannerFile, attachmentList), isPublished);
if (application != null) {
return Response.status(Response.Status.CREATED).entity(application).build();
} else {
@@ -255,12 +257,13 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
}
}
-
+
@POST
@Consumes({"multipart/mixed", MediaType.MULTIPART_FORM_DATA})
@Path("/public-app")
public Response createPubApp(
@Multipart("public-app") PublicAppWrapper publicAppWrapper,
+ @QueryParam("is-published") boolean isPublished,
@Multipart("icon") Attachment iconFile,
@Multipart(value = "banner", required = false) Attachment bannerFile,
@Multipart("screenshot1") Attachment screenshot1,
@@ -276,11 +279,11 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem
// Created new Public App
Application application = applicationManager.createPublicApp(publicAppWrapper,
- constructApplicationArtifact(null, iconFile, bannerFile, attachmentList));
+ constructApplicationArtifact(null, iconFile, bannerFile, attachmentList), isPublished);
if (application != null) {
return Response.status(Response.Status.CREATED).entity(application).build();
} else {
- String msg = "Web app creation is failed";
+ String msg = "Public app creation is failed";
log.error(msg);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
}
@@ -304,6 +307,7 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem
@Path("/custom-app")
public Response createCustomApp(
@Multipart("application") CustomAppWrapper customAppWrapper,
+ @QueryParam("is-published") boolean isPublished,
@Multipart("binaryFile") Attachment binaryFile,
@Multipart("icon") Attachment iconFile,
@Multipart(value = "banner", required = false) Attachment bannerFile,
@@ -321,7 +325,7 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem
// Created new Custom App
Application application = applicationManager.createCustomApp(customAppWrapper,
- constructApplicationArtifact(binaryFile, iconFile, bannerFile, attachmentList));
+ constructApplicationArtifact(binaryFile, iconFile, bannerFile, attachmentList), isPublished);
if (application != null) {
return Response.status(Response.Status.CREATED).entity(application).build();
} else {
@@ -351,6 +355,7 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem
@PathParam("deviceType") String deviceType,
@PathParam("appId") int appId,
@Multipart("applicationRelease") EntAppReleaseWrapper entAppReleaseWrapper,
+ @QueryParam("is-published") boolean isPublished,
@Multipart("binaryFile") Attachment binaryFile,
@Multipart("icon") Attachment iconFile,
@Multipart(value = "banner", required = false) Attachment bannerFile,
@@ -366,7 +371,7 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem
// Created new Ent App release
ApplicationRelease release = applicationManager.createEntAppRelease(appId, entAppReleaseWrapper,
- constructApplicationArtifact(binaryFile, iconFile, bannerFile, attachmentList));
+ constructApplicationArtifact(binaryFile, iconFile, bannerFile, attachmentList), isPublished);
if (release != null) {
return Response.status(Response.Status.CREATED).entity(release).build();
} else {
diff --git a/components/application-mgt/io.entgra.application.mgt.store.api/pom.xml b/components/application-mgt/io.entgra.application.mgt.store.api/pom.xml
index bb118b1912..9605babf87 100644
--- a/components/application-mgt/io.entgra.application.mgt.store.api/pom.xml
+++ b/components/application-mgt/io.entgra.application.mgt.store.api/pom.xml
@@ -22,7 +22,7 @@
application-mgt
org.wso2.carbon.devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java
index fc7719bc63..f9e5079095 100644
--- a/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java
+++ b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java
@@ -139,6 +139,10 @@ public interface SubscriptionManagementAdminAPI {
name = "status",
value = "Provide the device status details, such as active or inactive.")
@QueryParam("status") List status,
+ @ApiParam(
+ name = "installedVersion",
+ value = "Provide the installed version of the application.")
+ @QueryParam("installedVersion") String installedVersion,
@ApiParam(
name = "uuid",
value = "uuid of the application release.",
diff --git a/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java
index b767c39ccd..d95853fcc7 100644
--- a/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java
+++ b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java
@@ -60,6 +60,7 @@ public class SubscriptionManagementAdminAPIImpl implements SubscriptionManagemen
@QueryParam("action") String action,
@QueryParam("actionStatus") String actionStatus,
@QueryParam("status") List status,
+ @QueryParam("installedVersion") String installedVersion,
@PathParam("uuid") String uuid,
@DefaultValue("0")
@QueryParam("offset") int offset,
@@ -97,7 +98,7 @@ public class SubscriptionManagementAdminAPIImpl implements SubscriptionManagemen
}
SubscriptionManager subscriptionManager = APIUtil.getSubscriptionManager();
PaginationResult subscriptionData = subscriptionManager.getAppSubscriptionDetails
- (request, uuid, actionStatus, action);
+ (request, uuid, actionStatus, action, installedVersion);
return Response.status(Response.Status.OK).entity(subscriptionData).build();
} catch (NotFoundException e) {
String msg = "Application with application release UUID: " + uuid + " is not found";
diff --git a/components/application-mgt/pom.xml b/components/application-mgt/pom.xml
index f0ba6dc5d7..d3123b3c22 100644
--- a/components/application-mgt/pom.xml
+++ b/components/application-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
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 be5d49d1a8..ca0ed771dc 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
- 5.0.3-SNAPSHOT
+ 5.0.4-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 e4fcceb66b..c95a8f161f 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
- 5.0.3-SNAPSHOT
+ 5.0.4-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 970249d34a..c11cc38d00 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
@@ -38,7 +38,7 @@
org.wso2.carbon.devicemgt
certificate-mgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/certificate-mgt/pom.xml b/components/certificate-mgt/pom.xml
index 283e977bb7..aca194789f 100644
--- a/components/certificate-mgt/pom.xml
+++ b/components/certificate-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
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 64c5c6131d..f620a31a7d 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
- 5.0.3-SNAPSHOT
+ 5.0.4-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 2acd8b41ce..4db0d7698b 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
- 5.0.3-SNAPSHOT
+ 5.0.4-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 644a9d19d8..24fd2b6351 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
- 5.0.3-SNAPSHOT
+ 5.0.4-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 eee2b7a6a8..48131ab1a6 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
- 5.0.3-SNAPSHOT
+ 5.0.4-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 b3cda0ad5c..94eac19470 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
- 5.0.3-SNAPSHOT
+ 5.0.4-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 e65bd2a136..c6b5ba9cb3 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
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/pom.xml b/components/device-mgt-extensions/pom.xml
index ac3dd2a6fe..4cb0c55410 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
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
diff --git a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml
index be26831d54..2f384c9f7a 100644
--- a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml
+++ b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml
@@ -22,7 +22,7 @@
device-mgt
org.wso2.carbon.devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
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 af068895c3..701f1153da 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
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
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 5429879fde..03a891f664 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
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
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 e481eca242..95d4568eb0 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
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/event/H2EventConfigDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/event/H2EventConfigDAOImpl.java
index fef946649f..ab59d5fc83 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/event/H2EventConfigDAOImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/event/H2EventConfigDAOImpl.java
@@ -23,6 +23,7 @@ import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.event.config.EventConfig;
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
import org.wso2.carbon.device.mgt.core.dao.EventManagementDAOException;
+import org.wso2.carbon.device.mgt.core.dao.EventManagementDAOFactory;
import org.wso2.carbon.device.mgt.core.dao.impl.AbstractEventConfigDAO;
import java.sql.Connection;
@@ -75,6 +76,6 @@ public class H2EventConfigDAOImpl extends AbstractEventConfigDAO {
}
private Connection getConnection() throws SQLException {
- return DeviceManagementDAOFactory.getConnection();
+ return EventManagementDAOFactory.getConnection();
}
}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java
index 6db8bd2fdd..ff17b026f4 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java
@@ -74,7 +74,7 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO {
stmt.setDouble(14, deviceInfo.getTotalRAMMemory());
stmt.setDouble(15, deviceInfo.getAvailableRAMMemory());
stmt.setBoolean(16, deviceInfo.isPluggedIn());
- stmt.setLong(17, DeviceManagementDAOUtil.getCurrentUTCTime());
+ stmt.setLong(17, DeviceManagementDAOUtil.getCurrentUTCTime() * 1000L);
stmt.setInt(18, enrolmentId);
stmt.execute();
@@ -508,7 +508,7 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO {
stmt.setDouble(13, newDeviceInfo.getTotalRAMMemory());
stmt.setDouble(14, newDeviceInfo.getAvailableRAMMemory());
stmt.setBoolean(15, newDeviceInfo.isPluggedIn());
- stmt.setLong(16, System.currentTimeMillis());
+ stmt.setLong(16, DeviceManagementDAOUtil.getCurrentUTCTime() * 1000L);
stmt.setInt(17, deviceId);
stmt.setInt(18, enrollmentId);
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/EventOperationExecutor.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/EventOperationExecutor.java
index 937706c219..9c2a043923 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/EventOperationExecutor.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/EventOperationExecutor.java
@@ -132,7 +132,10 @@ public class EventOperationExecutor implements Runnable {
EventRevokeOperation eventRevokeOperation = new EventRevokeOperation();
eventRevokeOperation.setEventSource(eventSource);
eventRevokeOperation.setId(geoFenceMeta.getId());
- operation.setPayLoad(new Gson().toJson(eventRevokeOperation));
+
+ List eventOperationsRevoke = new ArrayList<>();
+ eventOperationsRevoke.add(eventRevokeOperation);
+ operation.setPayLoad(new Gson().toJson(eventOperationsRevoke));
}
@Override
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 2377954f95..5f2c6c7916 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
@@ -1507,7 +1507,7 @@ public class GeoLocationProviderServiceImpl implements GeoLocationProviderServic
geofenceDAO.deleteGeofenceGroupMapping(groupIdsOfGeoFence, fenceId);
}
geofenceDAO.deleteGeofenceById(fenceId);
- DeviceManagementDAOFactory.commitTransaction();
+ EventManagementDAOFactory.commitTransaction();
GeoCacheManagerImpl.getInstance().removeFenceFromCache(fenceId, tenantId);
} catch (DeviceManagementDAOException e) {
EventManagementDAOFactory.rollbackTransaction();
@@ -1571,7 +1571,7 @@ public class GeoLocationProviderServiceImpl implements GeoLocationProviderServic
log.error(msg, e);
throw new GeoLocationBasedServiceException(msg, e);
} finally {
- DeviceManagementDAOFactory.closeConnection();
+ EventManagementDAOFactory.closeConnection();
}
return true;
}
@@ -1772,12 +1772,9 @@ public class GeoLocationProviderServiceImpl implements GeoLocationProviderServic
DeviceManagementConstants.EventServices.GEOFENCE, new GeoFenceEventMeta(geofenceData),
tenantId, geofenceData.getGroupIds());
} catch (EventConfigurationException e) {
- DeviceManagementDAOFactory.rollbackTransaction();
String msg = "Failed to delete Geofence event configurations";
log.error(msg, e);
throw new GeoLocationBasedServiceException(msg, e);
- } finally {
- DeviceManagementDAOFactory.closeConnection();
}
}
}
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 97b53a14e1..0d6d60fba4 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
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
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 3f5620c737..93f632cf1e 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
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml
index 2d117ceeeb..b2b7fee19a 100644
--- a/components/device-mgt/pom.xml
+++ b/components/device-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
diff --git a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml
index 3d6215077a..fb77c6ef90 100644
--- a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml
+++ b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
heartbeat-management
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/heartbeat-management/pom.xml b/components/heartbeat-management/pom.xml
index a22d908db3..83ed90631f 100644
--- a/components/heartbeat-management/pom.xml
+++ b/components/heartbeat-management/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-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 30e6d3919c..682fb5da4c 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,7 +22,7 @@
org.wso2.carbon.devicemgt
identity-extensions
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
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 b10c9823ee..7dbbd05450 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
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/identity-extensions/pom.xml b/components/identity-extensions/pom.xml
index 9cbd0ce470..983d592aff 100644
--- a/components/identity-extensions/pom.xml
+++ b/components/identity-extensions/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
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 530bec31ba..b187cbd1aa 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,7 +3,7 @@
org.wso2.carbon.devicemgt
policy-mgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
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 761c2a8564..cf3c2391f5 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
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
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 4485663232..8778e9bf06 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,7 +22,7 @@
org.wso2.carbon.devicemgt
policy-mgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
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 9068a6a304..af70297c59 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,7 +22,7 @@
org.wso2.carbon.devicemgt
policy-mgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/policy-mgt/pom.xml b/components/policy-mgt/pom.xml
index 5dca677890..ab3ec8e8f3 100644
--- a/components/policy-mgt/pom.xml
+++ b/components/policy-mgt/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
diff --git a/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml b/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml
index beb952d68d..869e944ee5 100644
--- a/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml
+++ b/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
email-sender
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/transport-mgt/email-sender/pom.xml b/components/transport-mgt/email-sender/pom.xml
index 41f105b461..6013a3c4ba 100644
--- a/components/transport-mgt/email-sender/pom.xml
+++ b/components/transport-mgt/email-sender/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
transport-mgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/transport-mgt/pom.xml b/components/transport-mgt/pom.xml
index 1adbd1abf1..1b33d243a2 100644
--- a/components/transport-mgt/pom.xml
+++ b/components/transport-mgt/pom.xml
@@ -3,7 +3,7 @@
carbon-devicemgt
org.wso2.carbon.devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
diff --git a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml
index 55466f7f9d..4862160f92 100644
--- a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml
+++ b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
sms-handler
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.common/pom.xml b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.common/pom.xml
index 343d9a9c32..1a4636921e 100644
--- a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.common/pom.xml
+++ b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.common/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
sms-handler
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.core/pom.xml b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.core/pom.xml
index 3ce5f78c91..bdd510c108 100644
--- a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.core/pom.xml
+++ b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.core/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
sms-handler
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/transport-mgt/sms-handler/pom.xml b/components/transport-mgt/sms-handler/pom.xml
index 2940603826..17ff6305f8 100644
--- a/components/transport-mgt/sms-handler/pom.xml
+++ b/components/transport-mgt/sms-handler/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
transport-mgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml
index af0efe5674..d94ee9485a 100644
--- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml
+++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml
@@ -21,7 +21,7 @@
ui-request-interceptor
io.entgra.devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
4.0.0
diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/GrafanaHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/GrafanaHandler.java
index 3ac99b1044..6cd8872eae 100644
--- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/GrafanaHandler.java
+++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/GrafanaHandler.java
@@ -48,6 +48,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URI;
+import java.nio.charset.StandardCharsets;
@MultipartConfig
@WebServlet(
@@ -150,6 +151,7 @@ public class GrafanaHandler extends HttpServlet {
resp.setContentType(contentType);
resp.setStatus(grafanaAPIResponse.getCode());
addXFrameOptionsHeaders(resp);
+ resp.setCharacterEncoding(StandardCharsets.UTF_8.name());
resp.getWriter().print(grafanaAPIResponse.getData());
}
diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java
index df0e085b0a..153ace868a 100644
--- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java
+++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java
@@ -84,7 +84,7 @@ public class HandlerConstants {
public static final String WSS_PROTOCOL = "wss";
public static final String WS_PROTOCOL = "ws";
public static final String REMOTE_SESSION_CONTEXT = "/remote/session/clients";
- public static final String GRAFANA_API = "/api/device-mgt/v1.0/reports/grafana";
+ public static final String GRAFANA_API = "/api/grafana-mgt/v1.0";
public static final String IOT_CORE_HOST_ENV_VAR = "iot.core.host";
public static final String IOT_CORE_HTTP_PORT_ENV_VAR = "iot.core.http.port";
diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java
index f6d5d55ff7..6be995f191 100644
--- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java
+++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java
@@ -656,7 +656,7 @@ public class HandlerUtil {
public static ProxyResponse getTokenResult(AuthData authData, String keymanagerUrl) throws IOException {
HttpPost tokenEndpoint = new HttpPost(keymanagerUrl + HandlerConstants.TOKEN_ENDPOINT);
StringEntity tokenEndpointPayload = new StringEntity(
- "grant_type=refresh_token&refresh_token=" + authData.getRefreshToken() + "&scope=PRODUCTION",
+ "grant_type=refresh_token&refresh_token=" + authData.getRefreshToken(),
ContentType.APPLICATION_FORM_URLENCODED);
tokenEndpoint.setEntity(tokenEndpointPayload);
diff --git a/components/ui-request-interceptor/pom.xml b/components/ui-request-interceptor/pom.xml
index 1bdad315d2..945df6c627 100644
--- a/components/ui-request-interceptor/pom.xml
+++ b/components/ui-request-interceptor/pom.xml
@@ -21,7 +21,7 @@
carbon-devicemgt
org.wso2.carbon.devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
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 de117e328b..c6ef125b18 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,7 +21,7 @@
org.wso2.carbon.devicemgt
webapp-authenticator-framework
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/components/webapp-authenticator-framework/pom.xml b/components/webapp-authenticator-framework/pom.xml
index 7d56ea512a..8fb1d37ce4 100644
--- a/components/webapp-authenticator-framework/pom.xml
+++ b/components/webapp-authenticator-framework/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
diff --git a/features/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api.feature/pom.xml b/features/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api.feature/pom.xml
index 65653078ec..087d7b9893 100644
--- a/features/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api.feature/pom.xml
+++ b/features/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
grafana-mgt-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.server.feature/pom.xml b/features/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.server.feature/pom.xml
index 366b373b99..68d245305c 100644
--- a/features/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.server.feature/pom.xml
+++ b/features/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.server.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
grafana-mgt-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/analytics-mgt/grafana-mgt/pom.xml b/features/analytics-mgt/grafana-mgt/pom.xml
index 6325a7fe3f..75efecfe18 100644
--- a/features/analytics-mgt/grafana-mgt/pom.xml
+++ b/features/analytics-mgt/grafana-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
analytics-mgt-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/analytics-mgt/pom.xml b/features/analytics-mgt/pom.xml
index c447f2013c..e0d8aa25e2 100644
--- a/features/analytics-mgt/pom.xml
+++ b/features/analytics-mgt/pom.xml
@@ -3,7 +3,7 @@
carbon-devicemgt
org.wso2.carbon.devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
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 0f4ba11857..77ad82bdfc 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,7 +21,7 @@
org.wso2.carbon.devicemgt
apimgt-extensions-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
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 8448dbce2a..23e70102ae 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,7 +21,7 @@
org.wso2.carbon.devicemgt
apimgt-extensions-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/apimgt-extensions/pom.xml b/features/apimgt-extensions/pom.xml
index f7cac5747f..e867f0f3d6 100644
--- a/features/apimgt-extensions/pom.xml
+++ b/features/apimgt-extensions/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
diff --git a/features/application-mgt/io.entgra.application.mgt.api.feature/pom.xml b/features/application-mgt/io.entgra.application.mgt.api.feature/pom.xml
index 679943cec8..4a642b4aaf 100644
--- a/features/application-mgt/io.entgra.application.mgt.api.feature/pom.xml
+++ b/features/application-mgt/io.entgra.application.mgt.api.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
application-mgt-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/application-mgt/io.entgra.application.mgt.server.feature/pom.xml b/features/application-mgt/io.entgra.application.mgt.server.feature/pom.xml
index 95ff108355..1f0bc9e9d8 100644
--- a/features/application-mgt/io.entgra.application.mgt.server.feature/pom.xml
+++ b/features/application-mgt/io.entgra.application.mgt.server.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
application-mgt-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/application-mgt/pom.xml b/features/application-mgt/pom.xml
index 58d21c6eb2..e3f067c1dd 100644
--- a/features/application-mgt/pom.xml
+++ b/features/application-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
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 c8617a1e09..89e21fb8e8 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
- 5.0.3-SNAPSHOT
+ 5.0.4-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 599420d441..1cc6585b28 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
- 5.0.3-SNAPSHOT
+ 5.0.4-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 0b6407602c..2454902841 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,7 +22,7 @@
org.wso2.carbon.devicemgt
certificate-mgt-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/certificate-mgt/pom.xml b/features/certificate-mgt/pom.xml
index 748f5a4162..6de8afaaf8 100644
--- a/features/certificate-mgt/pom.xml
+++ b/features/certificate-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
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 7ee1e6838a..3fbe2007d1 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,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-extensions-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
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 f65fd9cc67..88145b648f 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,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-extensions-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
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 afb9dee99f..3315f1589f 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,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-extensions-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
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 050fa8ab1d..661291de8d 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,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-extensions-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
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 d0367a8b9f..f64e14bf8e 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,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-extensions-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/pom.xml b/features/device-mgt-extensions/pom.xml
index bae0c55c10..deeffd9319 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
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
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 68f18bb6fb..d28122d4e6 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
- 5.0.3-SNAPSHOT
+ 5.0.4-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 f6b8799ea7..c02eee01de 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
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/datasources/reporting-mgt-datasources.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/datasources/reporting-mgt-datasources.xml
index c070808f0a..4a518e77ac 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/datasources/reporting-mgt-datasources.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/datasources/reporting-mgt-datasources.xml
@@ -31,7 +31,7 @@
- jdbc:mysql://localhost:3306/DM_DB?autoReconnect=true&relaxAutoCommit=true&useSSL=false
+ jdbc:mysql://localhost:3306/MDM_REPORTS?autoReconnect=true&relaxAutoCommit=true&useSSL=false
root
root
com.mysql.cj.jdbc.Driver
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml
index 22f4ef0175..e20d7cfbf0 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml
@@ -185,6 +185,7 @@
perm:metadata:update
perm:android:google-account
perm:android:update-default-sim
+ perm:android:google-account
perm:android:info
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/reporting-mgt-datasources.xml.j2 b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/reporting-mgt-datasources.xml.j2
index c070808f0a..4a518e77ac 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/reporting-mgt-datasources.xml.j2
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/reporting-mgt-datasources.xml.j2
@@ -31,7 +31,7 @@
- jdbc:mysql://localhost:3306/DM_DB?autoReconnect=true&relaxAutoCommit=true&useSSL=false
+ jdbc:mysql://localhost:3306/MDM_REPORTS?autoReconnect=true&relaxAutoCommit=true&useSSL=false
root
root
com.mysql.cj.jdbc.Driver
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2
index 845b8cb5db..575f24ee8e 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2
@@ -183,6 +183,8 @@
perm:android:location
perm:android:clear-password
perm:android:control-camera
+ perm:android:update-default-sim
+ perm:android:google-account
perm:android:enterprise-wipe
perm:android:wipe
perm:android:ring
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 de0db8befd..1ea5127efe 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,7 +4,7 @@
org.wso2.carbon.devicemgt
device-mgt-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
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 ac676b58dc..993addbfc3 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
- 5.0.3-SNAPSHOT
+ 5.0.4-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 e253b3077a..99344dc4f2 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,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml
index 4be64209a2..410dc359fe 100644
--- a/features/device-mgt/pom.xml
+++ b/features/device-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
diff --git a/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml b/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml
index 5ba3411991..c0db3fb2f3 100644
--- a/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml
+++ b/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
heart-beat-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/heartbeat-management/pom.xml b/features/heartbeat-management/pom.xml
index 097b375aae..abdd7e5df3 100644
--- a/features/heartbeat-management/pom.xml
+++ b/features/heartbeat-management/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
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 1c2bea1512..ed71f887a2 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,7 +23,7 @@
org.wso2.carbon.devicemgt
jwt-client-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/jwt-client/pom.xml b/features/jwt-client/pom.xml
index a9c12a6bf0..9271c282cb 100644
--- a/features/jwt-client/pom.xml
+++ b/features/jwt-client/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
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 c884210b8e..0d1d67de04 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,7 +23,7 @@
org.wso2.carbon.devicemgt
policy-mgt-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/policy-mgt/pom.xml b/features/policy-mgt/pom.xml
index 120a70506c..8aff1762c9 100644
--- a/features/policy-mgt/pom.xml
+++ b/features/policy-mgt/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
diff --git a/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/pom.xml b/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/pom.xml
index 2847488dff..6ff05f5910 100644
--- a/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/pom.xml
+++ b/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
email-sender-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/transport-mgt/email-sender/pom.xml b/features/transport-mgt/email-sender/pom.xml
index 0662490003..bc2aecb40e 100644
--- a/features/transport-mgt/email-sender/pom.xml
+++ b/features/transport-mgt/email-sender/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
transport-mgt-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/transport-mgt/pom.xml b/features/transport-mgt/pom.xml
index 52634d75c6..10352a60ca 100644
--- a/features/transport-mgt/pom.xml
+++ b/features/transport-mgt/pom.xml
@@ -3,7 +3,7 @@
carbon-devicemgt
org.wso2.carbon.devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
diff --git a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api.feature/pom.xml b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api.feature/pom.xml
index 05ce668d47..45aff66c94 100644
--- a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api.feature/pom.xml
+++ b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
sms-handler-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/pom.xml b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/pom.xml
index 250da5ae94..1628c8cbbe 100644
--- a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/pom.xml
+++ b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
sms-handler-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/transport-mgt/sms-handler/pom.xml b/features/transport-mgt/sms-handler/pom.xml
index aea81035a4..f81bf0e7bc 100644
--- a/features/transport-mgt/sms-handler/pom.xml
+++ b/features/transport-mgt/sms-handler/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
transport-mgt-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/pom.xml b/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/pom.xml
index 808cc0fe01..213a614a1e 100644
--- a/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/pom.xml
+++ b/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/pom.xml
@@ -21,7 +21,7 @@
ui-request-interceptor-feature
io.entgra.devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
4.0.0
diff --git a/features/ui-request-interceptor/pom.xml b/features/ui-request-interceptor/pom.xml
index ec14a0bf8d..3d8690e6e4 100644
--- a/features/ui-request-interceptor/pom.xml
+++ b/features/ui-request-interceptor/pom.xml
@@ -21,7 +21,7 @@
carbon-devicemgt
org.wso2.carbon.devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
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 ca338ae0f3..6d25868998 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,7 +22,7 @@
org.wso2.carbon.devicemgt
webapp-authenticator-framework-feature
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/features/webapp-authenticator-framework/pom.xml b/features/webapp-authenticator-framework/pom.xml
index 3812c48e6e..a37f32b546 100644
--- a/features/webapp-authenticator-framework/pom.xml
+++ b/features/webapp-authenticator-framework/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../../pom.xml
diff --git a/pom.xml b/pom.xml
index 86ffab18b8..8627ffe83b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
pom
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
WSO2 Carbon - Device Management - Parent
http://wso2.org
WSO2 Connected Device Manager Components
@@ -2076,7 +2076,7 @@
1.2.11.wso2v10
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
4.7.35