Merge branch 'application-mgt-new' into 'application-mgt-new'

Sync with upstream master.

See merge request entgra/carbon-device-mgt!315
feature/appm-store/pbac
Dharmakeerthi Lasantha 5 years ago
commit 2cdb27767f

@ -22,13 +22,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.annotations</artifactId> <artifactId>org.wso2.carbon.apimgt.annotations</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Annotations</name> <name>WSO2 Carbon - API Management Annotations</name>
<description>WSO2 Carbon - API Management Custom Annotation Module</description> <description>WSO2 Carbon - API Management Custom Annotation Module</description>

@ -21,12 +21,12 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<artifactId>org.wso2.carbon.apimgt.application.extension.api</artifactId> <artifactId>org.wso2.carbon.apimgt.application.extension.api</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<name>WSO2 Carbon - API Application Management API</name> <name>WSO2 Carbon - API Application Management API</name>

@ -22,12 +22,12 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<artifactId>org.wso2.carbon.apimgt.application.extension</artifactId> <artifactId>org.wso2.carbon.apimgt.application.extension</artifactId>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Application Management</name> <name>WSO2 Carbon - API Application Management</name>

@ -21,13 +21,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.handlers</artifactId> <artifactId>org.wso2.carbon.apimgt.handlers</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Security Handler Component</name> <name>WSO2 Carbon - API Security Handler Component</name>
<description>WSO2 Carbon - API Management Security Handler Module</description> <description>WSO2 Carbon - API Management Security Handler Module</description>

@ -13,13 +13,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.integration.client</artifactId> <artifactId>org.wso2.carbon.apimgt.integration.client</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Integration Client</name> <name>WSO2 Carbon - API Management Integration Client</name>
<description>WSO2 Carbon - API Management Integration Client</description> <description>WSO2 Carbon - API Management Integration Client</description>

@ -13,13 +13,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.integration.generated.client</artifactId> <artifactId>org.wso2.carbon.apimgt.integration.generated.client</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Integration Generated Client</name> <name>WSO2 Carbon - API Management Integration Generated Client</name>
<description>WSO2 Carbon - API Management Integration Client</description> <description>WSO2 Carbon - API Management Integration Client</description>

@ -22,13 +22,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.webapp.publisher</artifactId> <artifactId>org.wso2.carbon.apimgt.webapp.publisher</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Webapp Publisher</name> <name>WSO2 Carbon - API Management Webapp Publisher</name>
<description>WSO2 Carbon - API Management Webapp Publisher</description> <description>WSO2 Carbon - API Management Webapp Publisher</description>

@ -22,13 +22,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - API Management Extensions Component</name> <name>WSO2 Carbon - API Management Extensions Component</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

@ -5,15 +5,16 @@
<parent> <parent>
<artifactId>application-mgt</artifactId> <artifactId>application-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.application.mgt.addons</artifactId> <artifactId>org.wso2.carbon.device.application.mgt.addons</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<name>WSO2 Carbon - Application Management Add-Ons</name> <name>WSO2 Carbon - Application Management Add-Ons</name>
<description>WSO2 Carbon - Application Management Add-Ons</description> <description>WSO2 Carbon - Application Management Add-Ons</description>
<url>http://wso2.org</url> <url>https://entgra.io</url>
<build> <build>
<plugins> <plugins>

@ -22,17 +22,17 @@
<parent> <parent>
<artifactId>application-mgt</artifactId> <artifactId>application-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.application.mgt.api</artifactId> <artifactId>org.wso2.carbon.device.application.mgt.api</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>WSO2 Carbon - Application Management API</name> <name>WSO2 Carbon - Application Management API</name>
<description>WSO2 Carbon - Application Management API</description> <description>WSO2 Carbon - Application Management API</description>
<url>http://wso2.org</url> <url>https://entgra.io</url>
<build> <build>
<plugins> <plugins>

@ -21,17 +21,17 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>application-mgt</artifactId> <artifactId>application-mgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.application.mgt.common</artifactId> <artifactId>org.wso2.carbon.device.application.mgt.common</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Application Management Common</name> <name>WSO2 Carbon - Application Management Common</name>
<description>WSO2 Carbon - Application Management Common</description> <description>WSO2 Carbon - Application Management Common</description>
<url>http://wso2.org</url> <url>https://entgra.io</url>
<build> <build>
<plugins> <plugins>

@ -21,17 +21,17 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>application-mgt</artifactId> <artifactId>application-mgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.application.mgt.core</artifactId> <artifactId>org.wso2.carbon.device.application.mgt.core</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Application Management Core</name> <name>WSO2 Carbon - Application Management Core</name>
<description>WSO2 Carbon - Application Management Core</description> <description>WSO2 Carbon - Application Management Core</description>
<url>http://wso2.org</url> <url>https://entgra.io</url>
<build> <build>
<plugins> <plugins>

@ -135,12 +135,12 @@ public class OracleApplicationDAOImpl extends GenericApplicationDAOImpl {
try (PreparedStatement stmt = conn.prepareStatement(sql); try (PreparedStatement stmt = conn.prepareStatement(sql);
){ ){
if (filter.getLimit() != -1) { if (filter.getLimit() != -1) {
stmt.setInt(paramIndex++, filter.getOffset());
if (filter.getLimit() == 0) { if (filter.getLimit() == 0) {
stmt.setInt(paramIndex++, 100); stmt.setInt(paramIndex++, 100);
} else { } else {
stmt.setInt(paramIndex++, filter.getLimit()); stmt.setInt(paramIndex++, filter.getLimit());
} }
stmt.setInt(paramIndex++, filter.getOffset());
} }
stmt.setInt(paramIndex++, tenantId); stmt.setInt(paramIndex++, tenantId);

@ -133,12 +133,12 @@ public class SQLServerApplicationDAOImpl extends GenericApplicationDAOImpl {
try (PreparedStatement stmt = conn.prepareStatement(sql); try (PreparedStatement stmt = conn.prepareStatement(sql);
){ ){
if (filter.getLimit() != -1) { if (filter.getLimit() != -1) {
stmt.setInt(paramIndex++, filter.getOffset());
if (filter.getLimit() == 0) { if (filter.getLimit() == 0) {
stmt.setInt(paramIndex++, 100); stmt.setInt(paramIndex++, 100);
} else { } else {
stmt.setInt(paramIndex++, filter.getLimit()); stmt.setInt(paramIndex++, filter.getLimit());
} }
stmt.setInt(paramIndex++, filter.getOffset());
} }
stmt.setInt(paramIndex++, tenantId); stmt.setInt(paramIndex++, tenantId);

@ -70,8 +70,8 @@ public class OracleReviewDAOImpl extends GenericReviewDAOImpl {
statement.setInt(1, releaseId); statement.setInt(1, releaseId);
statement.setInt(2, Constants.REVIEW_PARENT_ID); statement.setInt(2, Constants.REVIEW_PARENT_ID);
statement.setInt(3, tenantId); statement.setInt(3, tenantId);
statement.setInt(4, request.getLimit()); statement.setInt(4, request.getOffSet());
statement.setInt(5, request.getOffSet()); statement.setInt(5, request.getLimit());
try (ResultSet rs = statement.executeQuery()) { try (ResultSet rs = statement.executeQuery()) {
return DAOUtil.loadReviews(rs); return DAOUtil.loadReviews(rs);
} }
@ -124,8 +124,8 @@ public class OracleReviewDAOImpl extends GenericReviewDAOImpl {
} }
ps.setInt(index++, Constants.REVIEW_PARENT_ID); ps.setInt(index++, Constants.REVIEW_PARENT_ID);
ps.setInt(index++, tenantId); ps.setInt(index++, tenantId);
ps.setInt(index++, request.getLimit()); ps.setInt(index++, request.getOffSet());
ps.setInt(index, request.getOffSet()); ps.setInt(index, request.getLimit());
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
return DAOUtil.loadReviews(rs); return DAOUtil.loadReviews(rs);
} }
@ -180,8 +180,8 @@ public class OracleReviewDAOImpl extends GenericReviewDAOImpl {
ps.setInt(index++, Constants.REVIEW_PARENT_ID); ps.setInt(index++, Constants.REVIEW_PARENT_ID);
ps.setString(index++, username); ps.setString(index++, username);
ps.setInt(index++, tenantId); ps.setInt(index++, tenantId);
ps.setInt(index++, request.getLimit()); ps.setInt(index++, request.getOffSet());
ps.setInt(index, request.getOffSet()); ps.setInt(index, request.getLimit());
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
return DAOUtil.loadReviews(rs); return DAOUtil.loadReviews(rs);
} }

@ -70,8 +70,8 @@ public class SQLServerReviewDAOImpl extends GenericReviewDAOImpl {
statement.setInt(1, releaseId); statement.setInt(1, releaseId);
statement.setInt(2, Constants.REVIEW_PARENT_ID); statement.setInt(2, Constants.REVIEW_PARENT_ID);
statement.setInt(3, tenantId); statement.setInt(3, tenantId);
statement.setInt(4, request.getLimit()); statement.setInt(4, request.getOffSet());
statement.setInt(5, request.getOffSet()); statement.setInt(5, request.getLimit());
try (ResultSet rs = statement.executeQuery()) { try (ResultSet rs = statement.executeQuery()) {
return DAOUtil.loadReviews(rs); return DAOUtil.loadReviews(rs);
} }
@ -124,8 +124,8 @@ public class SQLServerReviewDAOImpl extends GenericReviewDAOImpl {
} }
ps.setInt(index++, Constants.REVIEW_PARENT_ID); ps.setInt(index++, Constants.REVIEW_PARENT_ID);
ps.setInt(index++, tenantId); ps.setInt(index++, tenantId);
ps.setInt(index++, request.getLimit()); ps.setInt(index++, request.getOffSet());
ps.setInt(index, request.getOffSet()); ps.setInt(index, request.getLimit());
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
return DAOUtil.loadReviews(rs); return DAOUtil.loadReviews(rs);
} }
@ -180,8 +180,8 @@ public class SQLServerReviewDAOImpl extends GenericReviewDAOImpl {
ps.setInt(index++, Constants.REVIEW_PARENT_ID); ps.setInt(index++, Constants.REVIEW_PARENT_ID);
ps.setString(index++, username); ps.setString(index++, username);
ps.setInt(index++, tenantId); ps.setInt(index++, tenantId);
ps.setInt(index++, request.getLimit()); ps.setInt(index++, request.getOffSet());
ps.setInt(index, request.getOffSet()); ps.setInt(index, request.getLimit());
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
return DAOUtil.loadReviews(rs); return DAOUtil.loadReviews(rs);
} }

@ -55,8 +55,8 @@ public class OracleSubscriptionDAOImpl extends GenericSubscriptionDAOImpl {
try (PreparedStatement stmt = conn.prepareStatement(sql)) { try (PreparedStatement stmt = conn.prepareStatement(sql)) {
stmt.setInt(1, appReleaseId); stmt.setInt(1, appReleaseId);
stmt.setInt(2, tenantId); stmt.setInt(2, tenantId);
stmt.setInt(3, limitValue); stmt.setInt(3, offsetValue);
stmt.setInt(4, offsetValue); stmt.setInt(4, limitValue);
try (ResultSet rs = stmt.executeQuery()) { try (ResultSet rs = stmt.executeQuery()) {
while (rs.next()) { while (rs.next()) {
subscribedUsers.add(rs.getString("USER")); subscribedUsers.add(rs.getString("USER"));
@ -95,8 +95,8 @@ public class OracleSubscriptionDAOImpl extends GenericSubscriptionDAOImpl {
try (PreparedStatement ps = conn.prepareStatement(sql)) { try (PreparedStatement ps = conn.prepareStatement(sql)) {
ps.setInt(1, appReleaseId); ps.setInt(1, appReleaseId);
ps.setInt(2, tenantId); ps.setInt(2, tenantId);
ps.setInt(3, limitValue); ps.setInt(3, offsetValue);
ps.setInt(4, offsetValue); ps.setInt(4, limitValue);
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
while (rs.next()) { while (rs.next()) {
subscribedRoles.add(rs.getString("ROLE")); subscribedRoles.add(rs.getString("ROLE"));
@ -135,8 +135,8 @@ public class OracleSubscriptionDAOImpl extends GenericSubscriptionDAOImpl {
try (PreparedStatement ps = conn.prepareStatement(sql)) { try (PreparedStatement ps = conn.prepareStatement(sql)) {
ps.setInt(1, appReleaseId); ps.setInt(1, appReleaseId);
ps.setInt(2, tenantId); ps.setInt(2, tenantId);
ps.setInt(3, limitValue); ps.setInt(3, offsetValue);
ps.setInt(4, offsetValue); ps.setInt(4, limitValue);
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
while (rs.next()) { while (rs.next()) {
subscribedGroups.add(rs.getString("GROUPS")); subscribedGroups.add(rs.getString("GROUPS"));

@ -55,8 +55,8 @@ public class SQLServerSubscriptionDAOImpl extends GenericSubscriptionDAOImpl {
try (PreparedStatement stmt = conn.prepareStatement(sql)) { try (PreparedStatement stmt = conn.prepareStatement(sql)) {
stmt.setInt(1, appReleaseId); stmt.setInt(1, appReleaseId);
stmt.setInt(2, tenantId); stmt.setInt(2, tenantId);
stmt.setInt(3, limitValue); stmt.setInt(3, offsetValue);
stmt.setInt(4, offsetValue); stmt.setInt(4, limitValue);
try (ResultSet rs = stmt.executeQuery()) { try (ResultSet rs = stmt.executeQuery()) {
while (rs.next()) { while (rs.next()) {
subscribedUsers.add(rs.getString("USER")); subscribedUsers.add(rs.getString("USER"));
@ -95,8 +95,8 @@ public class SQLServerSubscriptionDAOImpl extends GenericSubscriptionDAOImpl {
try (PreparedStatement ps = conn.prepareStatement(sql)) { try (PreparedStatement ps = conn.prepareStatement(sql)) {
ps.setInt(1, appReleaseId); ps.setInt(1, appReleaseId);
ps.setInt(2, tenantId); ps.setInt(2, tenantId);
ps.setInt(3, limitValue); ps.setInt(3, offsetValue);
ps.setInt(4, offsetValue); ps.setInt(4, limitValue);
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
while (rs.next()) { while (rs.next()) {
subscribedRoles.add(rs.getString("ROLE")); subscribedRoles.add(rs.getString("ROLE"));
@ -135,8 +135,8 @@ public class SQLServerSubscriptionDAOImpl extends GenericSubscriptionDAOImpl {
try (PreparedStatement ps = conn.prepareStatement(sql)) { try (PreparedStatement ps = conn.prepareStatement(sql)) {
ps.setInt(1, appReleaseId); ps.setInt(1, appReleaseId);
ps.setInt(2, tenantId); ps.setInt(2, tenantId);
ps.setInt(3, limitValue); ps.setInt(3, offsetValue);
ps.setInt(4, offsetValue); ps.setInt(4, limitValue);
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
while (rs.next()) { while (rs.next()) {
subscribedGroups.add(rs.getString("GROUPS")); subscribedGroups.add(rs.getString("GROUPS"));

@ -22,17 +22,17 @@
<parent> <parent>
<artifactId>application-mgt</artifactId> <artifactId>application-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.application.mgt.publisher.api</artifactId> <artifactId>org.wso2.carbon.device.application.mgt.publisher.api</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>WSO2 Carbon - Application Management Publisher API</name> <name>WSO2 Carbon - Application Management Publisher API</name>
<description>WSO2 Carbon - Application Management Publisher API</description> <description>WSO2 Carbon - Application Management Publisher API</description>
<url>http://wso2.org</url> <url>https://entgra.io</url>
<build> <build>
<plugins> <plugins>

@ -24,13 +24,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>application-mgt</artifactId> <artifactId>application-mgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>org.wso2.carbon.device.application.mgt.publisher.ui</artifactId> <artifactId>org.wso2.carbon.device.application.mgt.publisher.ui</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>WSO2 Carbon - Application Management Publisher UI Component</name> <name>WSO2 Carbon - Application Management Publisher UI Component</name>
<url>http://wso2.org</url> <url>https://entgra.io</url>
<description>This Component contains Application Management publisher UI</description> <description>This Component contains Application Management publisher UI</description>
<build> <build>
<plugins> <plugins>

@ -22,17 +22,17 @@
<parent> <parent>
<artifactId>application-mgt</artifactId> <artifactId>application-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.application.mgt.store.api</artifactId> <artifactId>org.wso2.carbon.device.application.mgt.store.api</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>WSO2 Carbon - Application Management Store API</name> <name>WSO2 Carbon - Application Management Store API</name>
<description>WSO2 Carbon - Application Management Store API</description> <description>WSO2 Carbon - Application Management Store API</description>
<url>http://wso2.org</url> <url>https://entgra.io</url>
<build> <build>
<plugins> <plugins>

@ -24,13 +24,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>application-mgt</artifactId> <artifactId>application-mgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>org.wso2.carbon.device.application.mgt.store.ui</artifactId> <artifactId>org.wso2.carbon.device.application.mgt.store.ui</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>WSO2 Carbon - Application Management Store UI Component</name> <name>WSO2 Carbon - Application Management Store UI Component</name>
<url>http://wso2.org</url> <url>https://entgra.io</url>
<description>This Component contains Application Management store UI</description> <description>This Component contains Application Management store UI</description>
<dependencies> <dependencies>
</dependencies> </dependencies>

@ -22,13 +22,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>application-mgt</artifactId> <artifactId>application-mgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Application Management Component</name> <name>WSO2 Carbon - Application Management Component</name>
<description>WSO2 Carbon - Application Management Component</description> <description>WSO2 Carbon - Application Management Component</description>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,13 +21,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.certificate.mgt.core</artifactId> <artifactId>org.wso2.carbon.certificate.mgt.core</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Certificate Management Core</name> <name>WSO2 Carbon - Certificate Management Core</name>
<description>WSO2 Carbon - Certificate Management Core</description> <description>WSO2 Carbon - Certificate Management Core</description>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Certificate Management Component</name> <name>WSO2 Carbon - Certificate Management Component</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -24,10 +24,10 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>io.entgra.device.mgt.ui</artifactId> <artifactId>io.entgra.device.mgt.ui</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>Entgra - Device Management UI Component</name> <name>Entgra - Device Management UI Component</name>
<url>https://entgra.io</url> <url>https://entgra.io</url>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -20,7 +20,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -29,10 +29,13 @@ public class Adapter {
@ApiModelProperty(value = "Attached stream name:version") @ApiModelProperty(value = "Attached stream name:version")
private String eventStreamWithVersion; private String eventStreamWithVersion;
@ApiModelProperty(value = "Adapter type") @ApiModelProperty(value = "Adapter type")
private AdapterType adapterType; private TransportType adapterType;
@ApiModelProperty(value = "Adapter main configurations") @ApiModelProperty(value = "Adapter main configurations")
private AdapterConfiguration adapterConfiguration; private AdapterConfiguration adapterConfiguration;
@ApiModelProperty(value = "Adapter definition", notes = "use only when creating adapter as a String")
private String definition;
public String getAdapterName() { public String getAdapterName() {
return adapterName; return adapterName;
} }
@ -49,11 +52,11 @@ public class Adapter {
this.eventStreamWithVersion = eventStreamWithVersion; this.eventStreamWithVersion = eventStreamWithVersion;
} }
public AdapterType getAdapterType() { public TransportType getAdapterType() {
return adapterType; return adapterType;
} }
public void setAdapterType(AdapterType adapterType) { public void setAdapterType(TransportType adapterType) {
this.adapterType = adapterType; this.adapterType = adapterType;
} }
@ -65,4 +68,12 @@ public class Adapter {
AdapterConfiguration adapterConfiguration) { AdapterConfiguration adapterConfiguration) {
this.adapterConfiguration = adapterConfiguration; this.adapterConfiguration = adapterConfiguration;
} }
public String getDefinition() {
return definition;
}
public void setDefinition(String definition) {
this.definition = definition;
}
} }

@ -18,6 +18,8 @@
package org.wso2.carbon.device.mgt.jaxrs.beans.analytics; package org.wso2.carbon.device.mgt.jaxrs.beans.analytics;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -30,15 +32,15 @@ public class AdapterMappingConfiguration {
@ApiModelProperty(value = "Input mapping for json,text and xml mappings") @ApiModelProperty(value = "Input mapping for json,text and xml mappings")
private String inputMappingString; private String inputMappingString;
@ApiModelProperty(value = "Input mapping for json,map and xml mappings") @ApiModelProperty(value = "Input mapping for json,map and xml mappings")
private List<MappingProperty> inputMappingProperties; private List<MappingProperty> inputMappingProperties = new ArrayList<>();
@ApiModelProperty(value = "Name-scape mapping for xml mapping") @ApiModelProperty(value = "Name-scape mapping for xml mapping")
private List<MappingProperty> namespaceMappingProperties; private List<MappingProperty> namespaceMappingProperties = new ArrayList<>();
@ApiModelProperty(value = "Correlation mapping for wso2 mapping") @ApiModelProperty(value = "Correlation mapping for wso2 mapping")
private List<MappingProperty> correlationMappingProperties; private List<MappingProperty> correlationMappingProperties = new ArrayList<>();
@ApiModelProperty(value = "Payload mapping for wso2 mapping") @ApiModelProperty(value = "Payload mapping for wso2 mapping")
private List<MappingProperty> payloadMappingProperties; private List<MappingProperty> payloadMappingProperties = new ArrayList<>();
@ApiModelProperty(value = "Meta mapping for wso2 mapping") @ApiModelProperty(value = "Meta mapping for wso2 mapping")
private List<MappingProperty> metaMappingProperties; private List<MappingProperty> metaMappingProperties = new ArrayList<>();
public MessageFormat getMessageFormat() { public MessageFormat getMessageFormat() {
return messageFormat; return messageFormat;

@ -1,30 +0,0 @@
/*
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
*
* Entgra (pvt) Ltd. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.device.mgt.jaxrs.beans.analytics;
/**
* Available adapter types
*/
public enum AdapterType {
EMAIL, FILE_TAIL, HTTP, IOT_EVENT, JMS, KAFKA, MQTT, OAUTH_MQTT, SOAP, WEBSOCKET, WEBSOCKET_LOCAL,
WSO2_EVENT, XMPP, UI, RDBMS, SECURED_WEBSOCKET, CASSANDRA, LOGGER;
public String toStringFormatted() {
return super.toString().toLowerCase().replace("_", "-");
}
}

@ -1,34 +0,0 @@
/*
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
*
* Entgra (pvt) Ltd. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.device.mgt.jaxrs.beans.analytics;
import io.swagger.annotations.ApiModelProperty;
public class EventPublisher {
@ApiModelProperty(value = "Publisher definition")
private String definition;
public String getDefinition() {
return definition;
}
public void setDefinition(String definition) {
this.definition = definition;
}
}

@ -1,34 +0,0 @@
/*
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
*
* Entgra (pvt) Ltd. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.device.mgt.jaxrs.beans.analytics;
import io.swagger.annotations.ApiModelProperty;
public class EventReceiver {
@ApiModelProperty(value = "Stream definition")
private String definition;
public String getDefinition() {
return definition;
}
public void setDefinition(String definition) {
this.definition = definition;
}
}

@ -17,10 +17,9 @@
*/ */
package org.wso2.carbon.device.mgt.jaxrs.beans.analytics; package org.wso2.carbon.device.mgt.jaxrs.beans.analytics;
import com.sun.istack.NotNull;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.NotEmpty;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -37,12 +36,13 @@ public class EventStream {
@ApiModelProperty(value = "Stream description") @ApiModelProperty(value = "Stream description")
private String description; private String description;
@ApiModelProperty(value = "Meta attribute list") @ApiModelProperty(value = "Meta attribute list")
private List<Attribute> metaData; private List<Attribute> metaData = new ArrayList<>();
@ApiModelProperty(value = "Correlation attribute list") @ApiModelProperty(value = "Correlation attribute list")
private List<Attribute> correlationData; private List<Attribute> correlationData = new ArrayList<>();
@ApiModelProperty(value = "Payload attribute list") @ApiModelProperty(value = "Payload attribute list")
private List<Attribute> payloadData; private List<Attribute> payloadData = new ArrayList<>();
@ApiModelProperty(value = "Stream definition") @NotNull @NotEmpty
@ApiModelProperty(value = "Stream definition" , notes = "use only when creating stream as a String")
private String definition; private String definition;
public String getName() { public String getName() {

@ -21,6 +21,11 @@ package org.wso2.carbon.device.mgt.jaxrs.beans.analytics;
* This hold the default transport types support by the server. * This hold the default transport types support by the server.
*/ */
public enum TransportType { public enum TransportType {
HTTP, MQTT; EMAIL, FILE_TAIL, HTTP, IOT_EVENT, JMS, KAFKA, MQTT, OAUTH_MQTT, SOAP, WEBSOCKET, WEBSOCKET_LOCAL,
WSO2_EVENT, XMPP, UI, RDBMS, SECURED_WEBSOCKET, CASSANDRA, LOGGER;
public String toStringFormatted() {
return super.toString().toLowerCase().replace("_", "-");
}
} }

@ -28,11 +28,11 @@ public class InvalidExecutionPlanException extends WebApplicationException {
private static final long serialVersionUID = 7583096344745990515L; private static final long serialVersionUID = 7583096344745990515L;
public InvalidExecutionPlanException(ErrorResponse error) { public InvalidExecutionPlanException(ErrorResponse error) {
super(Response.status(Response.Status.NOT_FOUND).entity(error).build()); super(Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(error).build());
} }
public InvalidExecutionPlanException(ErrorDTO errorDTO) { public InvalidExecutionPlanException(ErrorDTO errorDTO) {
super(Response.status(Response.Status.NOT_FOUND) super(Response.status(Response.Status.INTERNAL_SERVER_ERROR)
.entity(errorDTO) .entity(errorDTO)
.header(Constants.DeviceConstants.HEADER_CONTENT_TYPE, Constants.DeviceConstants.APPLICATION_JSON) .header(Constants.DeviceConstants.HEADER_CONTENT_TYPE, Constants.DeviceConstants.APPLICATION_JSON)
.build()); .build());

@ -17,14 +17,13 @@
*/ */
package org.wso2.carbon.device.mgt.jaxrs.service.api; package org.wso2.carbon.device.mgt.jaxrs.service.api;
import io.swagger.annotations.ApiParam;
import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scope;
import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.apimgt.annotations.api.Scopes;
import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse;
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.Adapter; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.Adapter;
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.EventStream; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.EventStream;
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.SiddhiExecutionPlan; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.SiddhiExecutionPlan;
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.EventPublisher;
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.EventReceiver;
import org.wso2.carbon.device.mgt.jaxrs.util.Constants; import org.wso2.carbon.device.mgt.jaxrs.util.Constants;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -91,17 +90,17 @@ import javax.ws.rs.core.Response;
} }
) )
@Path("/analytics/artifacts")
@Api(value = "Analytics Artifacts Management", description = "This API corresponds to services" + @Api(value = "Analytics Artifacts Management", description = "This API corresponds to services" +
" related to Analytics Artifacts management") " related to Analytics Artifacts management")
@Path("/analytics/artifacts")
@Consumes(MediaType.APPLICATION_JSON)
public interface AnalyticsArtifactsManagementService { public interface AnalyticsArtifactsManagementService {
@POST @POST
@Consumes(MediaType.APPLICATION_JSON)
@Path("/stream/{id}") @Path("/stream/{id}")
@ApiOperation( @ApiOperation(
httpMethod = "POST", httpMethod = "POST",
value = "Create Event Stream Artifact as String", value = "Create Event Stream Artifact through a String argument.",
notes = "Deploy a Json Stream Artifact in Analytics server.", notes = "Deploy a Json Stream Artifact in Analytics server.",
tags = "Analytics Artifacts Management", tags = "Analytics Artifacts Management",
extensions = { extensions = {
@ -143,16 +142,20 @@ public interface AnalyticsArtifactsManagementService {
response = ErrorResponse.class) response = ErrorResponse.class)
} }
) )
Response deployEventDefinitionAsString(@PathParam("id") String id, Response deployEventDefinitionAsString(
@ApiParam(name = "id", value = "Stream id(name:version).")
@PathParam("id") String id,
@ApiParam(name = "isEdited", value = "This stream is being edited or created.")
@QueryParam("isEdited") boolean isEdited, @QueryParam("isEdited") boolean isEdited,
@ApiParam(name = "stream", value = "Add the data to complete the EventStream object.",
required = true)
@Valid EventStream stream); @Valid EventStream stream);
@POST @POST
@Consumes(MediaType.APPLICATION_JSON)
@Path("/stream") @Path("/stream")
@ApiOperation( @ApiOperation(
httpMethod = "POST", httpMethod = "POST",
value = "Create Event Stream Artifact as DTO", value = "Create Event Stream Artifact through a DTO class.",
notes = "Deploy a Json Stream Artifact in Analytics server.", notes = "Deploy a Json Stream Artifact in Analytics server.",
tags = "Analytics Artifacts Management", tags = "Analytics Artifacts Management",
extensions = { extensions = {
@ -194,14 +197,16 @@ public interface AnalyticsArtifactsManagementService {
response = ErrorResponse.class) response = ErrorResponse.class)
} }
) )
Response deployEventDefinitionAsDto(@Valid EventStream stream); Response deployEventDefinitionAsDto(
@ApiParam(name = "stream", value = "Add the data to complete the EventStream object.",
required = true)
@Valid EventStream stream);
@POST @POST
@Consumes(MediaType.APPLICATION_JSON)
@Path("/receiver/{name}") @Path("/receiver/{name}")
@ApiOperation( @ApiOperation(
httpMethod = "POST", httpMethod = "POST",
value = "Create Event Receiver Artifact as String", value = "Create Event Receiver Artifact through a String argument.",
notes = "Deploy a XML Event Receiver Artifact in Analytics server.", notes = "Deploy a XML Event Receiver Artifact in Analytics server.",
tags = "Analytics Artifacts Management", tags = "Analytics Artifacts Management",
extensions = { extensions = {
@ -244,16 +249,20 @@ public interface AnalyticsArtifactsManagementService {
response = ErrorResponse.class) response = ErrorResponse.class)
} }
) )
Response deployEventReceiverAsString(@PathParam("name") String name, Response deployEventReceiverAsString(
@ApiParam(name = "name", value = "Receiver name.")
@PathParam("name") String name,
@ApiParam(name = "isEdited", value = "This stream is being edited or created.")
@QueryParam("isEdited") boolean isEdited, @QueryParam("isEdited") boolean isEdited,
@Valid EventReceiver receiver); @ApiParam(name = "receiver", value = "Add the data to complete the EventReceiver object.",
required = true)
@Valid Adapter receiver);
@POST @POST
@Consumes(MediaType.APPLICATION_JSON)
@Path("/receiver") @Path("/receiver")
@ApiOperation( @ApiOperation(
httpMethod = "POST", httpMethod = "POST",
value = "Create Event Receiver Artifact as DTO", value = "Create Event Receiver Artifact through a DTO class.",
notes = "Deploy a JSON Event Receiver Artifact in Analytics server.", notes = "Deploy a JSON Event Receiver Artifact in Analytics server.",
tags = "Analytics Artifacts Management", tags = "Analytics Artifacts Management",
extensions = { extensions = {
@ -296,14 +305,16 @@ public interface AnalyticsArtifactsManagementService {
response = ErrorResponse.class) response = ErrorResponse.class)
} }
) )
Response deployEventReceiverAsDto(@Valid Adapter receiver); Response deployEventReceiverAsDto(
@ApiParam(name = "receiver", value = "Add the data to complete the Adapter object.",
required = true)
@Valid Adapter receiver);
@POST @POST
@Consumes(MediaType.APPLICATION_JSON)
@Path("/publisher/{name}") @Path("/publisher/{name}")
@ApiOperation( @ApiOperation(
httpMethod = "POST", httpMethod = "POST",
value = "Create Event Publisher Artifact as String", value = "Create Event Publisher Artifact through a String argument.",
notes = "Deploy a XML Event Publisher Artifact in Analytics server.", notes = "Deploy a XML Event Publisher Artifact in Analytics server.",
tags = "Analytics Artifacts Management", tags = "Analytics Artifacts Management",
extensions = { extensions = {
@ -346,16 +357,20 @@ public interface AnalyticsArtifactsManagementService {
response = ErrorResponse.class) response = ErrorResponse.class)
} }
) )
Response deployEventPublisherAsString(@PathParam("name") String name, Response deployEventPublisherAsString(
@ApiParam(name = "name", value = "Publisher name.")
@PathParam("name") String name,
@ApiParam(name = "isEdited", value = "This stream is being edited or created.")
@QueryParam("isEdited") boolean isEdited, @QueryParam("isEdited") boolean isEdited,
@Valid EventPublisher publisher); @ApiParam(name = "publisher", value = "Add the data to complete the EventPublisher object.",
required = true)
@Valid Adapter publisher);
@POST @POST
@Consumes(MediaType.APPLICATION_JSON)
@Path("/publisher") @Path("/publisher")
@ApiOperation( @ApiOperation(
httpMethod = "POST", httpMethod = "POST",
value = "Create Event Publisher Artifact as DTO", value = "Create Event Publisher Artifact through a DTO class.",
notes = "Deploy a JSON Event Publisher Artifact in Analytics server.", notes = "Deploy a JSON Event Publisher Artifact in Analytics server.",
tags = "Analytics Artifacts Management", tags = "Analytics Artifacts Management",
extensions = { extensions = {
@ -398,15 +413,17 @@ public interface AnalyticsArtifactsManagementService {
response = ErrorResponse.class) response = ErrorResponse.class)
} }
) )
Response deployEventPublisherAsDto(@Valid Adapter publisher); Response deployEventPublisherAsDto(
@ApiParam(name = "publisher", value = "Add the data to complete the Adapter object.",
required = true)
@Valid Adapter publisher);
@POST @POST
@Consumes(MediaType.APPLICATION_JSON)
@Path("/siddhi-script/{name}") @Path("/siddhi-script/{name}")
@ApiOperation( @ApiOperation(
httpMethod = "POST", httpMethod = "POST",
value = "Create Siddhi Script Artifact as String", value = "Create Siddhi Script Artifact through a String argument.",
notes = "Deploy a SiddhiQL Siddhi script Artifact in Analytics server.", notes = "Deploy a SiddhiQL script Artifact in Analytics server.",
tags = "Analytics Artifacts Management", tags = "Analytics Artifacts Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -449,6 +466,11 @@ public interface AnalyticsArtifactsManagementService {
} }
) )
Response deploySiddhiExecutableScript( Response deploySiddhiExecutableScript(
@PathParam("name") String name, @QueryParam("isEdited") boolean isEdited, @ApiParam(name = "name", value = "Siddhi Executable Script name.")
@PathParam("name") String name,
@ApiParam(name = "isEdited", value = "This stream is being edited or created.")
@QueryParam("isEdited") boolean isEdited,
@ApiParam(name = "plan", value = "Add the data to complete the SiddhiExecutionPlan object.",
required = true)
@Valid SiddhiExecutionPlan plan); @Valid SiddhiExecutionPlan plan);
} }

@ -18,6 +18,7 @@
package org.wso2.carbon.device.mgt.jaxrs.service.impl; package org.wso2.carbon.device.mgt.jaxrs.service.impl;
import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse;
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.Attribute; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.Attribute;
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.AdapterMappingConfiguration; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.AdapterMappingConfiguration;
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.MappingProperty; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.MappingProperty;
@ -25,8 +26,7 @@ import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.AdapterConfiguration;
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.AdapterProperty; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.AdapterProperty;
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.MessageFormat; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.MessageFormat;
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.SiddhiExecutionPlan; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.SiddhiExecutionPlan;
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.EventPublisher; import org.wso2.carbon.device.mgt.jaxrs.exception.BadRequestException;
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.EventReceiver;
import org.wso2.carbon.device.mgt.jaxrs.exception.ErrorDTO; import org.wso2.carbon.device.mgt.jaxrs.exception.ErrorDTO;
import org.wso2.carbon.device.mgt.jaxrs.exception.InvalidExecutionPlanException; import org.wso2.carbon.device.mgt.jaxrs.exception.InvalidExecutionPlanException;
import org.wso2.carbon.device.mgt.jaxrs.service.api.AnalyticsArtifactsManagementService; import org.wso2.carbon.device.mgt.jaxrs.service.api.AnalyticsArtifactsManagementService;
@ -58,7 +58,6 @@ import javax.ws.rs.Path;
import javax.ws.rs.PathParam; import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam; import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import java.nio.charset.StandardCharsets;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.util.List; import java.util.List;
@ -67,14 +66,10 @@ import java.util.List;
* siddhi scripts to the Analytics server as Artifacts * siddhi scripts to the Analytics server as Artifacts
*/ */
@Path("/analytics/artifacts") @Path("/analytics/artifacts")
public class AnalyticsArtifactsManagementServiceImpl implements AnalyticsArtifactsManagementService { public class AnalyticsArtifactsManagementServiceImpl
implements AnalyticsArtifactsManagementService {
private static final Log log = LogFactory.getLog(AnalyticsArtifactsManagementServiceImpl.class); private static final Log log = LogFactory.getLog(AnalyticsArtifactsManagementServiceImpl.class);
/**
* @param stream EventStream object with the properties of the stream
* @return A status code depending on the code result
* Function - Used to deploy stream as an artifact using a String
*/
@Override @Override
@POST @POST
@Path("/stream/{id}") @Path("/stream/{id}")
@ -84,90 +79,70 @@ public class AnalyticsArtifactsManagementServiceImpl implements AnalyticsArtifac
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
EventStreamAdminServiceStub eventStreamAdminServiceStub = null; EventStreamAdminServiceStub eventStreamAdminServiceStub = null;
try { try {
String streamDefinition = new String(stream.getDefinition().getBytes(), StandardCharsets.UTF_8); String streamDefinition = stream.getDefinition();
eventStreamAdminServiceStub = DeviceMgtAPIUtils.getEventStreamAdminServiceStub(); eventStreamAdminServiceStub = DeviceMgtAPIUtils.getEventStreamAdminServiceStub();
if (!isEdited) { if (!isEdited) {
eventStreamAdminServiceStub.addEventStreamDefinitionAsString(streamDefinition); eventStreamAdminServiceStub.addEventStreamDefinitionAsString(streamDefinition);
} else { } else {
// Find and edit stream
if (eventStreamAdminServiceStub.getStreamDetailsForStreamId(id) != null) { if (eventStreamAdminServiceStub.getStreamDetailsForStreamId(id) != null) {
eventStreamAdminServiceStub.editEventStreamDefinitionAsString(streamDefinition, id); eventStreamAdminServiceStub.editEventStreamDefinitionAsString(streamDefinition, id);
} }
} }
return Response.ok().build(); return Response.ok().build();
} catch (AxisFault e) { } catch (AxisFault e) {
log.error("Failed to create event definitions for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to create event definitions for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (RemoteException e) { } catch (RemoteException e) {
log.error("Failed to connect with the remote services for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to connect with the remote services for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (JWTClientException e) { } catch (JWTClientException e) {
log.error("Failed to generate jwt token for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to generate jwt token for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (UserStoreException e) { } catch (UserStoreException e) {
log.error("Failed to connect with the user store for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to connect with the user store for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} finally { } finally {
cleanup(eventStreamAdminServiceStub); cleanup(eventStreamAdminServiceStub);
} }
} }
/**
* @param stream EventStream object with the properties of the stream
* @return A status code depending on the code result
* Function - Used to deploy stream as an artifact using a DTO
*/
@Override @Override
@POST @POST
@Path("/stream") @Path("/stream")
public Response deployEventDefinitionAsDto(@Valid EventStream stream) { public Response deployEventDefinitionAsDto(@Valid EventStream stream) {
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
// Categorize attributes to three lists depending on their type
List<Attribute> metaData = stream.getMetaData();
List<Attribute> payloadData = stream.getPayloadData();
List<Attribute> correlationData = stream.getCorrelationData();
try { try {
/* Conditions deployStream(stream);
* - At least one list should always be not null
*/
if (metaData == null && correlationData == null && payloadData == null) {
log.error("Invalid payload: event attributes");
return Response.status(Response.Status.BAD_REQUEST).build();
} else {
// Publish the event stream
publishStream(stream, metaData, correlationData, payloadData);
return Response.ok().build(); return Response.ok().build();
}
} catch (AxisFault e) { } catch (AxisFault e) {
log.error("Failed to create event definitions for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to create event definitions for tenant " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (RemoteException e) { } catch (RemoteException e) {
log.error("Failed to connect with the remote services for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to connect with the remote services for tenant " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (JWTClientException e) { } catch (JWTClientException e) {
log.error("Failed to generate jwt token for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to generate jwt token for tenant " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (UserStoreException e) { } catch (UserStoreException e) {
log.error("Failed to connect with the user store for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to connect with the user store for tenant " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} }
} }
/**
* @param name Receiver name
* @param isEdited If receiver is created or edited
* @param receiver Receiver object with the properties of the receiver
* @return A status code depending on the code result
* Function - Used to deploy receiver as an artifact using a String
*/
@Override @Override
@POST @POST
@Path("/receiver/{name}") @Path("/receiver/{name}")
public Response deployEventReceiverAsString(@PathParam("name") String name, public Response deployEventReceiverAsString(@PathParam("name") String name,
@QueryParam("isEdited") boolean isEdited, @QueryParam("isEdited") boolean isEdited,
@Valid EventReceiver receiver) { @Valid Adapter receiver) {
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
EventReceiverAdminServiceStub eventReceiverAdminServiceStub; EventReceiverAdminServiceStub eventReceiverAdminServiceStub;
try { try {
@ -178,202 +153,128 @@ public class AnalyticsArtifactsManagementServiceImpl implements AnalyticsArtifac
} else { } else {
eventReceiverAdminServiceStub.editActiveEventReceiverConfiguration(receiverDefinition, name); eventReceiverAdminServiceStub.editActiveEventReceiverConfiguration(receiverDefinition, name);
} }
return Response.ok().build();
} catch (AxisFault e) { } catch (AxisFault e) {
log.error("Failed to create event definitions for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to create event definitions for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (RemoteException e) { } catch (RemoteException e) {
log.error("Failed to connect with the remote services for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to connect with the remote services for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (JWTClientException e) { } catch (JWTClientException e) {
log.error("Failed to generate jwt token for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to generate jwt token for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (UserStoreException e) { } catch (UserStoreException e) {
log.error("Failed to connect with the user store for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to connect with the user store for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} }
return Response.ok().entity(name).build();
} }
/**
* @param receiver Receiver object with the properties of the receiver
* @return A status code depending on the code result
* Function - Used to deploy receiver as an artifact using a DTO
*/
@Override @Override
@POST @POST
@Path("/receiver") @Path("/receiver")
public Response deployEventReceiverAsDto(@Valid Adapter receiver) { public Response deployEventReceiverAsDto(@Valid Adapter receiver) {
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
String receiverName = receiver.getAdapterName();
String adapterType = receiver.getAdapterType().toStringFormatted();
AdapterConfiguration adapterConfiguration = receiver.getAdapterConfiguration();
AdapterMappingConfiguration adapterMappingConfiguration = adapterConfiguration.getAdapterMappingConfiguration();
try { try {
List<AdapterProperty> adapterProperties = adapterConfiguration.getAdapterProperties(); AdapterConfiguration adapterConfiguration = receiver.getAdapterConfiguration();
if (adapterProperties == null) {
log.error("Invalid attribute payload");
return Response.status(Response.Status.BAD_REQUEST).build();
}
boolean customMapping = adapterConfiguration.isCustomMappingEnabled(); boolean customMapping = adapterConfiguration.isCustomMappingEnabled();
List<MappingProperty> inputMappingProperties = adapterMappingConfiguration.getInputMappingProperties(); validateAdapterProperties(adapterConfiguration.getAdapterProperties());
List<MappingProperty> namespaceMappingProperties = adapterMappingConfiguration.getNamespaceMappingProperties(); if (customMapping) {
List<MappingProperty> correlationMappingProperties = adapterMappingConfiguration.getCorrelationMappingProperties(); validateAdapterMapping(adapterConfiguration.getAdapterMappingConfiguration());
List<MappingProperty> payloadMappingProperties = adapterMappingConfiguration.getPayloadMappingProperties();
List<MappingProperty> metaMappingProperties = adapterMappingConfiguration.getMetaMappingProperties();
MessageFormat messageFormat = adapterMappingConfiguration.getMessageFormat();
/*
* Conditions
* - if CustomMappingEnabled check validity of property lists
* - if both inputMappingProperties and namespaceMappingProperties null check remaining property lists
* - if all correlationMappingProperties, payloadMappingProperties, metaMappingProperties null log error
* - if message format is null change the final result to TRUE
* - else continue
* */
if ((customMapping &&
(inputMappingProperties == null && namespaceMappingProperties == null) &&
(correlationMappingProperties == null && payloadMappingProperties == null &&
metaMappingProperties == null)) || messageFormat == null) {
String errMsg = "Invalid mapping payload";
log.error(errMsg);
return Response.status(Response.Status.BAD_REQUEST).entity(errMsg).build();
} }
String eventStreamWithVersion = receiver.getEventStreamWithVersion(); deployReceiver(receiver, customMapping, adapterConfiguration);
publishReceiver(receiverName, adapterType, adapterProperties, customMapping, inputMappingProperties,
namespaceMappingProperties, correlationMappingProperties, payloadMappingProperties,
metaMappingProperties, messageFormat, eventStreamWithVersion);
return Response.ok().build(); return Response.ok().build();
} catch (AxisFault e) { } catch (AxisFault e) {
log.error("Failed to create event definitions for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to create event definitions for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (RemoteException e) { } catch (RemoteException e) {
log.error("Failed to connect with the remote services for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to connect with the remote services for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (JWTClientException e) { } catch (JWTClientException e) {
log.error("Failed to generate jwt token for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to generate jwt token for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (UserStoreException e) { } catch (UserStoreException e) {
log.error("Failed to connect with the user store for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to connect with the user store for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} }
} }
/**
* @param name Publisher name
* @param isEdited If receiver is created or edited
* @param publisher Publisher object with the properties of the publisher
* @return A status code depending on the code result
* Function - Used to deploy publisher as an artifact using a String
*/
@Override @Override
@POST @POST
@Path("/publisher/{name}") @Path("/publisher/{name}")
public Response deployEventPublisherAsString(@PathParam("name") String name, public Response deployEventPublisherAsString(@PathParam("name") String name,
@QueryParam("isEdited") boolean isEdited, @QueryParam("isEdited") boolean isEdited,
@Valid EventPublisher publisher) { @Valid Adapter publisher) {
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
EventPublisherAdminServiceStub eventPublisherAdminServiceStub; EventPublisherAdminServiceStub eventPublisherAdminServiceStub;
try { try {
String publisherDefinition = publisher.getDefinition(); String publisherDefinition = publisher.getDefinition();
eventPublisherAdminServiceStub = DeviceMgtAPIUtils.getEventPublisherAdminServiceStub(); eventPublisherAdminServiceStub = DeviceMgtAPIUtils.getEventPublisherAdminServiceStub();
if (!isEdited) { if (!isEdited) {
eventPublisherAdminServiceStub.deployEventPublisherConfiguration(publisherDefinition); eventPublisherAdminServiceStub.deployEventPublisherConfiguration(publisherDefinition);
} else { } else {
eventPublisherAdminServiceStub.editActiveEventPublisherConfiguration(publisherDefinition, name); eventPublisherAdminServiceStub.editActiveEventPublisherConfiguration(publisherDefinition, name);
} }
return Response.ok().build();
} catch (AxisFault e) { } catch (AxisFault e) {
log.error("Failed to create event definitions for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to create event definitions for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (RemoteException e) { } catch (RemoteException e) {
log.error("Failed to connect with the remote services for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to connect with the remote services for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (JWTClientException e) { } catch (JWTClientException e) {
log.error("Failed to generate jwt token for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to generate jwt token for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (UserStoreException e) { } catch (UserStoreException e) {
log.error("Failed to connect with the user store for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to connect with the user store for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} }
return Response.ok().entity(publisher).build();
} }
/**
* @param publisher Publisher object with the properties of the publisher
* @return A status code depending on the code result
* Function - Used to deploy publisher as an artifact using a DTO
*/
@Override @Override
@POST @POST
@Path("/publisher") @Path("/publisher")
public Response deployEventPublisherAsDto(@Valid Adapter publisher) { public Response deployEventPublisherAsDto(@Valid Adapter publisher) {
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
String publisherName = publisher.getAdapterName();
String adapterType = publisher.getAdapterType().toStringFormatted();
AdapterConfiguration adapterConfiguration = publisher.getAdapterConfiguration(); AdapterConfiguration adapterConfiguration = publisher.getAdapterConfiguration();
AdapterMappingConfiguration adapterMappingConfiguration = adapterConfiguration.getAdapterMappingConfiguration();
try { try {
List<AdapterProperty> adapterProperties = adapterConfiguration.getAdapterProperties(); validateAdapterProperties(adapterConfiguration.getAdapterProperties());
if (adapterProperties == null) {
log.error("Invalid attribute payload");
return Response.status(Response.Status.BAD_REQUEST).build();
}
boolean customMapping = adapterConfiguration.isCustomMappingEnabled(); boolean customMapping = adapterConfiguration.isCustomMappingEnabled();
String inputMappingString = adapterMappingConfiguration.getInputMappingString(); if (customMapping) {
List<MappingProperty> inputMappingProperties = adapterMappingConfiguration.getInputMappingProperties(); validateAdapterMapping(adapterConfiguration.getAdapterMappingConfiguration());
List<MappingProperty> correlationMappingProperties = adapterMappingConfiguration.getCorrelationMappingProperties();
List<MappingProperty> payloadMappingProperties = adapterMappingConfiguration.getPayloadMappingProperties();
List<MappingProperty> metaMappingProperties = adapterMappingConfiguration.getMetaMappingProperties();
MessageFormat messageFormat = adapterMappingConfiguration.getMessageFormat();
/*
* Conditions
* - if CustomMappingEnabled check validity of property lists
* - if all correlationMappingProperties, payloadMappingProperties, metaMappingProperties null log error
* - if message format is null change the final result to TRUE
* - else continue
*/
if ((customMapping &&
(inputMappingProperties == null && inputMappingString == null) &&
(correlationMappingProperties == null && payloadMappingProperties == null &&
metaMappingProperties == null)) || messageFormat == null) {
String errMsg = "Invalid mapping payload";
log.error(errMsg);
return Response.status(Response.Status.BAD_REQUEST).entity(errMsg).build();
} }
String eventStreamWithVersion = publisher.getEventStreamWithVersion(); deployPublisher(publisher, customMapping, adapterConfiguration);
publishPublisher(publisherName, adapterType, adapterProperties, customMapping
, inputMappingString, inputMappingProperties, correlationMappingProperties
, payloadMappingProperties, metaMappingProperties, messageFormat
, eventStreamWithVersion);
return Response.ok().build(); return Response.ok().build();
} catch (AxisFault e) { } catch (AxisFault e) {
log.error("Failed to create event definitions for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to create event definitions for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (RemoteException e) { } catch (RemoteException e) {
log.error("Failed to connect with the remote services for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to connect with the remote services for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (JWTClientException e) { } catch (JWTClientException e) {
log.error("Failed to generate jwt token for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to generate jwt token for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (UserStoreException e) { } catch (UserStoreException e) {
log.error("Failed to connect with the user store for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to connect with the user store for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} }
} }
/**
* @param name Siddhi plan name
* @param isEdited If receiver is created or edited
* @param plan Siddhi plan definition
* @return a status code depending on the code execution
* Function - Used to deploy Siddhi script as an artifact using a String
*/
@Override @Override
@POST @POST
@Path("/siddhi-script/{name}") @Path("/siddhi-script/{name}")
@ -385,38 +286,46 @@ public class AnalyticsArtifactsManagementServiceImpl implements AnalyticsArtifac
publishSiddhiExecutionPlan(name, isEdited, plan.getDefinition()); publishSiddhiExecutionPlan(name, isEdited, plan.getDefinition());
return Response.ok().build(); return Response.ok().build();
} catch (AxisFault e) { } catch (AxisFault e) {
log.error("Failed to create event definitions for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to create event definitions for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (RemoteException e) { } catch (RemoteException e) {
log.error("Failed to connect with the remote services for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to connect with the remote services for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
} catch (InvalidExecutionPlanException e) { return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
log.error("Invalid Execution plan: " + tenantDomain, e);
return e.getResponse();
} catch (JWTClientException e) { } catch (JWTClientException e) {
log.error("Failed to generate jwt token for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to generate jwt token for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} catch (UserStoreException e) { } catch (UserStoreException e) {
log.error("Failed to connect with the user store for tenantDomain: " + tenantDomain, e); String errMsg = "Failed to connect with the user store for tenantDomain: " + tenantDomain;
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); log.error(errMsg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
} }
} }
/** /**
* Set data to a Stream dto and deploy dto through a stub
*
* @param stream Stream definition * @param stream Stream definition
* @param metaData Meta attributes of the stream
* @param correlationData Correlation attributes of the stream
* @param payloadData Payload attributes of the stream
* @throws RemoteException exception that may occur during a remote method call
* @throws UserStoreException exception that may occur during JWT token generation
* @throws JWTClientException exception that may occur during connecting to client store
*/ */
private void publishStream(EventStream stream, List<Attribute> metaData, private void deployStream(EventStream stream)
List<Attribute> correlationData, List<Attribute> payloadData)
throws RemoteException, UserStoreException, JWTClientException { throws RemoteException, UserStoreException, JWTClientException {
EventStreamAdminServiceStub eventStreamAdminServiceStub = EventStreamAdminServiceStub eventStreamAdminServiceStub = null;
DeviceMgtAPIUtils.getEventStreamAdminServiceStub(); List<Attribute> metaData = stream.getMetaData();
List<Attribute> payloadData = stream.getPayloadData();
List<Attribute> correlationData = stream.getCorrelationData();
if (metaData.isEmpty() && correlationData.isEmpty() && payloadData.isEmpty()) {
String errMsg = String.format("Failed to validate Stream property attributes of %s:%s",
stream.getName(), stream.getVersion());
ErrorResponse errorResponse = new ErrorResponse();
errorResponse.setMessage(errMsg);
log.error(errMsg);
throw new BadRequestException(errorResponse);
}
try { try {
eventStreamAdminServiceStub = DeviceMgtAPIUtils.getEventStreamAdminServiceStub();
EventStreamDefinitionDto eventStreamDefinitionDto = new EventStreamDefinitionDto(); EventStreamDefinitionDto eventStreamDefinitionDto = new EventStreamDefinitionDto();
eventStreamDefinitionDto.setName(stream.getName()); eventStreamDefinitionDto.setName(stream.getName());
eventStreamDefinitionDto.setVersion(stream.getVersion()); eventStreamDefinitionDto.setVersion(stream.getVersion());
@ -425,6 +334,7 @@ public class AnalyticsArtifactsManagementServiceImpl implements AnalyticsArtifac
eventStreamDefinitionDto.setMetaData(addEventAttributesToDto(metaData)); eventStreamDefinitionDto.setMetaData(addEventAttributesToDto(metaData));
eventStreamDefinitionDto.setPayloadData(addEventAttributesToDto(payloadData)); eventStreamDefinitionDto.setPayloadData(addEventAttributesToDto(payloadData));
eventStreamDefinitionDto.setCorrelationData(addEventAttributesToDto(correlationData)); eventStreamDefinitionDto.setCorrelationData(addEventAttributesToDto(correlationData));
String streamId = stream.getName() + ":" + stream.getVersion(); String streamId = stream.getName() + ":" + stream.getVersion();
if (eventStreamAdminServiceStub.getStreamDefinitionDto(streamId) != null) { if (eventStreamAdminServiceStub.getStreamDefinitionDto(streamId) != null) {
eventStreamAdminServiceStub.editEventStreamDefinitionAsDto(eventStreamDefinitionDto, streamId); eventStreamAdminServiceStub.editEventStreamDefinitionAsDto(eventStreamDefinitionDto, streamId);
@ -438,55 +348,40 @@ public class AnalyticsArtifactsManagementServiceImpl implements AnalyticsArtifac
} }
/** /**
* @param receiverName Receiver name * Set data to a receiver dto and deploy dto through a stub
* @param adapterType Receiver type *
* @param adapterProperties Receiver properties * @param receiver Event Receiver adapter
* @param customMapping Is receiver mapped * @param customMapping Is Receiver mapped
* @param inputMappingProperties Receiver input attribute mapping * @param adapterConfiguration Adapter property and mapping configuration
* @param namespaceMappingProperties Receiver name-scape attribute mapping * @throws RemoteException Exception that may occur during a remote method call
* @param correlationMappingProperties Receiver correlation attribute mapping * @throws UserStoreException Exception that may occur during JWT token generation
* @param payloadMappingProperties Receiver payload attribute mapping * @throws JWTClientException Exception that may occur during connecting to client store
* @param metaMappingProperties Receiver meta attribute mapping
* @param messageFormat Receiver mapping format
* @param eventStreamWithVersion Attached stream
* @throws RemoteException exception that may occur during a remote method call
* @throws UserStoreException exception that may occur during JWT token generation
* @throws JWTClientException exception that may occur during connecting to client store
*/ */
private void publishReceiver(String receiverName, String adapterType, private void deployReceiver(Adapter receiver, boolean customMapping,
List<AdapterProperty> adapterProperties, boolean customMapping, AdapterConfiguration adapterConfiguration)
List<MappingProperty> inputMappingProperties,
List<MappingProperty> namespaceMappingProperties,
List<MappingProperty> correlationMappingProperties,
List<MappingProperty> payloadMappingProperties,
List<MappingProperty> metaMappingProperties,
MessageFormat messageFormat,
String eventStreamWithVersion)
throws RemoteException, UserStoreException, JWTClientException { throws RemoteException, UserStoreException, JWTClientException {
EventReceiverAdminServiceStub eventReceiverAdminServiceStub = DeviceMgtAPIUtils.getEventReceiverAdminServiceStub(); EventReceiverAdminServiceStub eventReceiverAdminServiceStub = DeviceMgtAPIUtils.getEventReceiverAdminServiceStub();
try { try {
String receiverName = receiver.getAdapterName();
String adapterType = receiver.getAdapterType().toStringFormatted();
String eventStreamWithVersion = receiver.getEventStreamWithVersion();
List<AdapterProperty> adapterProperties = adapterConfiguration.getAdapterProperties();
EventReceiverConfigurationDto eventReceiverConfigurationDto = eventReceiverAdminServiceStub EventReceiverConfigurationDto eventReceiverConfigurationDto = eventReceiverAdminServiceStub
.getActiveEventReceiverConfiguration(receiverName); .getActiveEventReceiverConfiguration(receiverName);
// Check if adapter already exists, if so un-deploy it
if (eventReceiverConfigurationDto != null) { if (eventReceiverConfigurationDto != null) {
eventReceiverAdminServiceStub.undeployActiveEventReceiverConfiguration(receiverName); eventReceiverAdminServiceStub.undeployActiveEventReceiverConfiguration(receiverName);
} }
BasicInputAdapterPropertyDto[] basicInputAdapterPropertyDtos = addReceiverConfigToDto(adapterProperties);
// Adding attribute properties to DTOs AdapterMappingConfiguration adapterMappingConfiguration = adapterConfiguration.getAdapterMappingConfiguration();
BasicInputAdapterPropertyDto[] basicInputAdapterPropertyDtos = MessageFormat messageFormat = adapterMappingConfiguration.getMessageFormat();
addReceiverConfigToDto(adapterProperties);
if (eventReceiverAdminServiceStub.getActiveEventReceiverConfiguration(receiverName) == null) {
// Call stub deploy methods according to the message format
if (!messageFormat.toString().equals("wso2event")) { if (!messageFormat.toString().equals("wso2event")) {
EventMappingPropertyDto[] inputMappingPropertyDtos = EventMappingPropertyDto[] inputMappingPropertyDtos =
addReceiverMappingToDto(inputMappingProperties); addReceiverMappingToDto(adapterMappingConfiguration.getInputMappingProperties());
if (messageFormat.toString().equals("xml")) { if (messageFormat.toString().equals("xml")) {
EventMappingPropertyDto[] namespaceMappingPropertyDtos = EventMappingPropertyDto[] namespaceMappingPropertyDtos =
addReceiverMappingToDto(namespaceMappingProperties); addReceiverMappingToDto(adapterMappingConfiguration.getNamespaceMappingProperties());
eventReceiverAdminServiceStub.deployXmlEventReceiverConfiguration(receiverName eventReceiverAdminServiceStub.deployXmlEventReceiverConfiguration(receiverName
, eventStreamWithVersion, adapterType, null , eventStreamWithVersion, adapterType, null
, namespaceMappingPropertyDtos, inputMappingPropertyDtos , namespaceMappingPropertyDtos, inputMappingPropertyDtos
@ -507,9 +402,15 @@ public class AnalyticsArtifactsManagementServiceImpl implements AnalyticsArtifac
} }
} }
} else { } else {
EventMappingPropertyDto[] correlationMappingPropertyDtos = addReceiverMappingToDto(correlationMappingProperties); EventMappingPropertyDto[] correlationMappingPropertyDtos = addReceiverMappingToDto(
EventMappingPropertyDto[] metaMappingPropertyDtos = addReceiverMappingToDto(metaMappingProperties); adapterMappingConfiguration.getCorrelationMappingProperties()
EventMappingPropertyDto[] payloadMappingPropertyDtos = addReceiverMappingToDto(payloadMappingProperties); );
EventMappingPropertyDto[] metaMappingPropertyDtos = addReceiverMappingToDto(
adapterMappingConfiguration.getInputMappingProperties()
);
EventMappingPropertyDto[] payloadMappingPropertyDtos = addReceiverMappingToDto(
adapterMappingConfiguration.getPayloadMappingProperties()
);
eventReceiverAdminServiceStub.deployWso2EventReceiverConfiguration(receiverName eventReceiverAdminServiceStub.deployWso2EventReceiverConfiguration(receiverName
, eventStreamWithVersion, adapterType, metaMappingPropertyDtos , eventStreamWithVersion, adapterType, metaMappingPropertyDtos
@ -517,86 +418,81 @@ public class AnalyticsArtifactsManagementServiceImpl implements AnalyticsArtifac
, basicInputAdapterPropertyDtos, customMapping , basicInputAdapterPropertyDtos, customMapping
, eventStreamWithVersion); , eventStreamWithVersion);
} }
}
} finally { } finally {
cleanup(eventReceiverAdminServiceStub); cleanup(eventReceiverAdminServiceStub);
} }
} }
/** /**
* @param publisherName Publisher name * Set data to a publisher dto and deploy dto through a stub
* @param adapterType Publisher type *
* @param adapterProperties Publisher properties * @param publisher Event Publisher adapter
* @param customMapping Is publisher mapped * @param customMapping Is Publisher mapped
* @param correlationMappingProperties Publisher correlation attribute mapping * @param adapterConfiguration Publisher property and mapping configuration
* @param payloadMappingProperties Publisher payload attribute mapping * @throws RemoteException Exception that may occur during a remote method call
* @param metaMappingProperties Publisher meta attribute mapping * @throws UserStoreException Exception that may occur during JWT token generation
* @param messageFormat Publisher mapping format * @throws JWTClientException Exception that may occur during connecting to client store
* @param eventStreamWithVersion Attached stream
* @throws RemoteException exception that may occur during a remote method call
* @throws UserStoreException exception that may occur during JWT token generation
* @throws JWTClientException exception that may occur during connecting to client store
*/ */
private void publishPublisher(String publisherName, String adapterType, private void deployPublisher(Adapter publisher, boolean customMapping,
List<AdapterProperty> adapterProperties, AdapterConfiguration adapterConfiguration)
boolean customMapping,
String inputMappingString,
List<MappingProperty> inputMappingProperties,
List<MappingProperty> correlationMappingProperties,
List<MappingProperty> payloadMappingProperties,
List<MappingProperty> metaMappingProperties,
MessageFormat messageFormat,
String eventStreamWithVersion)
throws RemoteException, UserStoreException, JWTClientException { throws RemoteException, UserStoreException, JWTClientException {
EventPublisherAdminServiceStub eventPublisherAdminServiceStub = DeviceMgtAPIUtils.getEventPublisherAdminServiceStub(); EventPublisherAdminServiceStub eventPublisherAdminServiceStub = DeviceMgtAPIUtils.getEventPublisherAdminServiceStub();
// Check if adapter already exists, if so un-deploy it
try { try {
String publisherName = publisher.getAdapterName();
String adapterType = publisher.getAdapterType().toStringFormatted();
String eventStreamWithVersion = publisher.getEventStreamWithVersion();
List<AdapterProperty> adapterProperties = adapterConfiguration.getAdapterProperties();
EventPublisherConfigurationDto eventPublisherConfigurationDto = eventPublisherAdminServiceStub EventPublisherConfigurationDto eventPublisherConfigurationDto = eventPublisherAdminServiceStub
.getActiveEventPublisherConfiguration(publisherName); .getActiveEventPublisherConfiguration(publisherName);
if (eventPublisherConfigurationDto != null) { if (eventPublisherConfigurationDto != null) {
eventPublisherAdminServiceStub.undeployActiveEventPublisherConfiguration(publisherName); eventPublisherAdminServiceStub.undeployActiveEventPublisherConfiguration(publisherName);
} }
// Adding attribute properties to DTOs
BasicOutputAdapterPropertyDto[] basicOutputAdapterPropertyDtos = BasicOutputAdapterPropertyDto[] basicOutputAdapterPropertyDtos =
addPublisherConfigToDto(adapterProperties); addPublisherConfigToDto(adapterProperties);
if (eventPublisherAdminServiceStub.getActiveEventPublisherConfiguration(publisherName) == null) { AdapterMappingConfiguration adapterMappingConfiguration = adapterConfiguration.getAdapterMappingConfiguration();
// Call stub deploy methods according to the message format MessageFormat messageFormat = adapterMappingConfiguration.getMessageFormat();
if (!messageFormat.toString().equals("wso2event")) { if (!messageFormat.toString().equals("wso2event")) {
if (!messageFormat.toString().equals("map")) { if (!messageFormat.toString().equals("map")) {
if (messageFormat.toString().equals("xml")) { if (messageFormat.toString().equals("xml")) {
eventPublisherAdminServiceStub.deployXmlEventPublisherConfiguration(publisherName eventPublisherAdminServiceStub.deployXmlEventPublisherConfiguration(publisherName
, eventStreamWithVersion, adapterType, inputMappingString , eventStreamWithVersion, adapterType, adapterMappingConfiguration.getInputMappingString()
, basicOutputAdapterPropertyDtos, eventStreamWithVersion , basicOutputAdapterPropertyDtos, eventStreamWithVersion
, customMapping); , customMapping);
} else if (messageFormat.toString().equals("text")) { } else if (messageFormat.toString().equals("text")) {
eventPublisherAdminServiceStub.deployTextEventPublisherConfiguration(publisherName eventPublisherAdminServiceStub.deployTextEventPublisherConfiguration(publisherName
, eventStreamWithVersion, adapterType, inputMappingString , eventStreamWithVersion, adapterType, adapterMappingConfiguration.getInputMappingString()
, basicOutputAdapterPropertyDtos, eventStreamWithVersion , basicOutputAdapterPropertyDtos, eventStreamWithVersion
, customMapping); , customMapping);
} else { } else {
eventPublisherAdminServiceStub.deployJsonEventPublisherConfiguration(publisherName eventPublisherAdminServiceStub.deployJsonEventPublisherConfiguration(publisherName
, eventStreamWithVersion, adapterType, inputMappingString , eventStreamWithVersion, adapterType, adapterMappingConfiguration.getInputMappingString()
, basicOutputAdapterPropertyDtos, eventStreamWithVersion , basicOutputAdapterPropertyDtos, eventStreamWithVersion
, customMapping); , customMapping);
} }
} else { } else {
org.wso2.carbon.event.publisher.stub.types.EventMappingPropertyDto[] inputMappingPropertyDtos = org.wso2.carbon.event.publisher.stub.types.EventMappingPropertyDto[] inputMappingPropertyDtos =
addPublisherMappingToDto(inputMappingProperties); addPublisherMappingToDto(
adapterMappingConfiguration.getInputMappingProperties()
);
eventPublisherAdminServiceStub.deployMapEventPublisherConfiguration(publisherName eventPublisherAdminServiceStub.deployMapEventPublisherConfiguration(publisherName
, eventStreamWithVersion, adapterType, inputMappingPropertyDtos , eventStreamWithVersion, adapterType, inputMappingPropertyDtos
, basicOutputAdapterPropertyDtos, customMapping); , basicOutputAdapterPropertyDtos, customMapping);
} }
} else { } else {
org.wso2.carbon.event.publisher.stub.types.EventMappingPropertyDto[] correlationMappingPropertyDtos = org.wso2.carbon.event.publisher.stub.types.EventMappingPropertyDto[] correlationMappingPropertyDtos =
addPublisherMappingToDto(correlationMappingProperties); addPublisherMappingToDto(
adapterMappingConfiguration.getCorrelationMappingProperties()
);
org.wso2.carbon.event.publisher.stub.types.EventMappingPropertyDto[] metaMappingPropertyDtos = org.wso2.carbon.event.publisher.stub.types.EventMappingPropertyDto[] metaMappingPropertyDtos =
addPublisherMappingToDto(metaMappingProperties); addPublisherMappingToDto(
adapterMappingConfiguration.getMetaMappingProperties()
);
org.wso2.carbon.event.publisher.stub.types.EventMappingPropertyDto[] payloadMappingPropertyDtos = org.wso2.carbon.event.publisher.stub.types.EventMappingPropertyDto[] payloadMappingPropertyDtos =
addPublisherMappingToDto(payloadMappingProperties); addPublisherMappingToDto(
adapterMappingConfiguration.getPayloadMappingProperties()
);
eventPublisherAdminServiceStub.deployWSO2EventPublisherConfiguration(publisherName eventPublisherAdminServiceStub.deployWSO2EventPublisherConfiguration(publisherName
, eventStreamWithVersion, adapterType, metaMappingPropertyDtos , eventStreamWithVersion, adapterType, metaMappingPropertyDtos
, correlationMappingPropertyDtos, payloadMappingPropertyDtos , correlationMappingPropertyDtos, payloadMappingPropertyDtos
@ -604,41 +500,39 @@ public class AnalyticsArtifactsManagementServiceImpl implements AnalyticsArtifac
, eventStreamWithVersion); , eventStreamWithVersion);
} }
}
} finally { } finally {
cleanup(eventPublisherAdminServiceStub); cleanup(eventPublisherAdminServiceStub);
} }
} }
/** /**
* @param name plan name * Publish a siddhi execution plan using a stub
* @param isEdited is plan edited *
* @param plan plan data * @param name Plan name
* @throws RemoteException exception that may occur during a remote method call * @param isEdited Is plan edited
* @throws UserStoreException exception that may occur during JWT token generation * @param plan Plan data
* @throws JWTClientException exception that may occur during connecting to client store * @throws RemoteException Exception that may occur during a remote method call
* @throws InvalidExecutionPlanException exception that may occur if execution plan validation fails * @throws UserStoreException Exception that may occur during JWT token generation
* @throws JWTClientException Exception that may occur during connecting to client store
* @throws InvalidExecutionPlanException Exception that may occur if execution plan validation fails
*/ */
private void publishSiddhiExecutionPlan(String name, boolean isEdited, private void publishSiddhiExecutionPlan(String name, boolean isEdited,
String plan) String plan)
throws RemoteException, UserStoreException, JWTClientException, throws RemoteException, UserStoreException, JWTClientException {
InvalidExecutionPlanException {
EventProcessorAdminServiceStub eventProcessorAdminServiceStub = null; EventProcessorAdminServiceStub eventProcessorAdminServiceStub = null;
try { try {
eventProcessorAdminServiceStub = DeviceMgtAPIUtils.getEventProcessorAdminServiceStub(); eventProcessorAdminServiceStub = DeviceMgtAPIUtils.getEventProcessorAdminServiceStub();
// Validate the plan code
String validationResponse = eventProcessorAdminServiceStub.validateExecutionPlan(plan); String validationResponse = eventProcessorAdminServiceStub.validateExecutionPlan(plan);
if (validationResponse.equals("success")) { if (validationResponse.equals("success")) {
if (!isEdited) { if (!isEdited) {
// Create a new plan
eventProcessorAdminServiceStub.deployExecutionPlan(plan); eventProcessorAdminServiceStub.deployExecutionPlan(plan);
} else { } else {
// Edit plan
eventProcessorAdminServiceStub.editActiveExecutionPlan(plan, name); eventProcessorAdminServiceStub.editActiveExecutionPlan(plan, name);
} }
} else { } else {
ErrorDTO errorDTO = new ErrorDTO(); ErrorDTO errorDTO = new ErrorDTO();
errorDTO.setMessage(validationResponse); errorDTO.setMessage(validationResponse);
log.error(validationResponse);
throw new InvalidExecutionPlanException(errorDTO); throw new InvalidExecutionPlanException(errorDTO);
} }
} finally { } finally {
@ -646,18 +540,74 @@ public class AnalyticsArtifactsManagementServiceImpl implements AnalyticsArtifac
} }
} }
/**
* This will set payload of event attribute's mapping to the DTO
*
* @param attributes list of event attributes
* @return DTO with all the event attributes
*/
private EventStreamAttributeDto[] addEventAttributesToDto(List<Attribute> attributes) { private EventStreamAttributeDto[] addEventAttributesToDto(List<Attribute> attributes) {
EventStreamAttributeDto[] eventStreamAttributeDtos = new EventStreamAttributeDto[attributes.size()]; EventStreamAttributeDto[] eventStreamAttributeDtos = new EventStreamAttributeDto[attributes.size()];
for (int i = 0; i < attributes.size(); i++) { for (Attribute attribute : attributes) {
EventStreamAttributeDto eventStreamAttributeDto = new EventStreamAttributeDto(); EventStreamAttributeDto eventStreamAttributeDto = new EventStreamAttributeDto();
eventStreamAttributeDto.setAttributeName(attributes.get(i).getName()); eventStreamAttributeDto.setAttributeName(attribute.getName());
eventStreamAttributeDto.setAttributeType(attributes.get(i).getType().toString()); eventStreamAttributeDto.setAttributeType(attribute.getType().toString());
eventStreamAttributeDtos[i] = eventStreamAttributeDto;
} }
return eventStreamAttributeDtos; return eventStreamAttributeDtos;
} }
/**
* Validate adapter payload attributes
*
* @param adapterProperties Adapter payload attributes
*/
private void validateAdapterProperties(List<AdapterProperty> adapterProperties) {
if (adapterProperties.isEmpty()) {
String errMsg = "Invalid payload: event property attributes invalid!!!";
ErrorResponse errorResponse = new ErrorResponse();
errorResponse.setMessage(errMsg);
log.error(errMsg);
throw new BadRequestException(errorResponse);
}
}
/**
* Validate adapter mapping attributes
* <p>
* Conditions
* - if both inputMappingProperties and namespaceMappingProperties null check remaining property lists
* - if all correlationMappingProperties, payloadMappingProperties, metaMappingProperties null log error
* - if message format is null change the final result to TRUE
* - else continue
*
* @param adapterMappingConfiguration Adapter mapping attributes
*/
private void validateAdapterMapping(AdapterMappingConfiguration adapterMappingConfiguration) {
if (adapterMappingConfiguration.getInputMappingString() == null &&
(adapterMappingConfiguration.getInputMappingProperties().isEmpty() &&
adapterMappingConfiguration.getNamespaceMappingProperties().isEmpty()) &&
(
adapterMappingConfiguration.getCorrelationMappingProperties().isEmpty() &&
adapterMappingConfiguration.getPayloadMappingProperties().isEmpty() &&
adapterMappingConfiguration.getMetaMappingProperties().isEmpty()
)
|| adapterMappingConfiguration.getMessageFormat() == null) {
String errMsg = "Invalid payload: event mapping attributes invalid!!!";
ErrorResponse errorResponse = new ErrorResponse();
errorResponse.setMessage(errMsg);
log.error(errMsg);
throw new BadRequestException(errorResponse);
}
}
/**
* This will set payload of receiver attributes to the DTO
*
* @param adapterProperties List of receiver attributes
* @return DTO with all the receiver attributes
*/
private BasicInputAdapterPropertyDto[] addReceiverConfigToDto( private BasicInputAdapterPropertyDto[] addReceiverConfigToDto(
List<AdapterProperty> adapterProperties) { List<AdapterProperty> adapterProperties) {
BasicInputAdapterPropertyDto[] basicInputAdapterPropertyDtos BasicInputAdapterPropertyDto[] basicInputAdapterPropertyDtos
@ -671,7 +621,14 @@ public class AnalyticsArtifactsManagementServiceImpl implements AnalyticsArtifac
return basicInputAdapterPropertyDtos; return basicInputAdapterPropertyDtos;
} }
private EventMappingPropertyDto[] addReceiverMappingToDto(List<MappingProperty> mapProperties) { /**
* This will set payload of receiver mapping attributes to the DTO
*
* @param mapProperties List of receiver mapping attributes
* @return DTO with all the receiver mapping attributes
*/
private EventMappingPropertyDto[] addReceiverMappingToDto
(List<MappingProperty> mapProperties) {
EventMappingPropertyDto[] eventMappingPropertyDtos = new EventMappingPropertyDto[mapProperties.size()]; EventMappingPropertyDto[] eventMappingPropertyDtos = new EventMappingPropertyDto[mapProperties.size()];
for (int i = 0; i < mapProperties.size(); i++) { for (int i = 0; i < mapProperties.size(); i++) {
EventMappingPropertyDto eventMappingPropertyDto = new EventMappingPropertyDto(); EventMappingPropertyDto eventMappingPropertyDto = new EventMappingPropertyDto();
@ -683,6 +640,12 @@ public class AnalyticsArtifactsManagementServiceImpl implements AnalyticsArtifac
return eventMappingPropertyDtos; return eventMappingPropertyDtos;
} }
/**
* This will set payload of publisher attributes to the DTO
*
* @param adapterProperties List of publisher attributes
* @return DTO with all the publisher attributes
*/
private BasicOutputAdapterPropertyDto[] addPublisherConfigToDto( private BasicOutputAdapterPropertyDto[] addPublisherConfigToDto(
List<AdapterProperty> adapterProperties) { List<AdapterProperty> adapterProperties) {
BasicOutputAdapterPropertyDto[] basicOutputAdapterPropertyDtos = BasicOutputAdapterPropertyDto[] basicOutputAdapterPropertyDtos =
@ -697,6 +660,12 @@ public class AnalyticsArtifactsManagementServiceImpl implements AnalyticsArtifac
return basicOutputAdapterPropertyDtos; return basicOutputAdapterPropertyDtos;
} }
/**
* This will set payload of publisher mapping attributes to the DTO
*
* @param mapProperties List of publisher mapping attributes
* @return DTO with all the publisher mapping attributes
*/
private org.wso2.carbon.event.publisher.stub.types.EventMappingPropertyDto[] addPublisherMappingToDto private org.wso2.carbon.event.publisher.stub.types.EventMappingPropertyDto[] addPublisherMappingToDto
(List<MappingProperty> mapProperties) { (List<MappingProperty> mapProperties) {
org.wso2.carbon.event.publisher.stub.types.EventMappingPropertyDto[] eventMappingPropertyDtos org.wso2.carbon.event.publisher.stub.types.EventMappingPropertyDto[] eventMappingPropertyDtos
@ -712,6 +681,11 @@ public class AnalyticsArtifactsManagementServiceImpl implements AnalyticsArtifac
return eventMappingPropertyDtos; return eventMappingPropertyDtos;
} }
/**
* Clean Service client in the stub
*
* @param stub Stud that needs to be cleaned
*/
private void cleanup(Stub stub) { private void cleanup(Stub stub) {
if (stub != null) { if (stub != null) {
try { try {

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -1724,6 +1724,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
return deviceLocationHistories; return deviceLocationHistories;
} }
@Override
public void deleteDevices(List<String> deviceIdentifiers, List<Integer> deviceIds, List<Integer> enrollmentIds) public void deleteDevices(List<String> deviceIdentifiers, List<Integer> deviceIds, List<Integer> enrollmentIds)
throws DeviceManagementDAOException { throws DeviceManagementDAOException {
Connection conn; Connection conn;
@ -1808,9 +1809,14 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
private void removeDeviceDetail(Connection conn, List<Integer> deviceIds) throws DeviceManagementDAOException { private void removeDeviceDetail(Connection conn, List<Integer> deviceIds) throws DeviceManagementDAOException {
String sql = "DELETE FROM DM_DEVICE_DETAIL WHERE DEVICE_ID = ?"; String sql = "DELETE FROM DM_DEVICE_DETAIL WHERE DEVICE_ID = ?";
try { try {
executeBatchOperation(conn, sql, deviceIds); if (!executeBatchOperation(conn, sql, deviceIds)) {
String msg = "Failed to remove device details of devices with deviceIds : " + deviceIds +
" while executing batch operation";
log.error(msg);
throw new DeviceManagementDAOException(msg);
}
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while removing device details."; String msg = "SQL error occurred while removing device details of devices with deviceIds : " + deviceIds;
log.error(msg, e); log.error(msg, e);
throw new DeviceManagementDAOException(msg, e); throw new DeviceManagementDAOException(msg, e);
} }
@ -1825,9 +1831,14 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
private void removeDeviceLocation(Connection conn, List<Integer> deviceIds) throws DeviceManagementDAOException { private void removeDeviceLocation(Connection conn, List<Integer> deviceIds) throws DeviceManagementDAOException {
String sql = "DELETE FROM DM_DEVICE_LOCATION WHERE DEVICE_ID = ?"; String sql = "DELETE FROM DM_DEVICE_LOCATION WHERE DEVICE_ID = ?";
try { try {
executeBatchOperation(conn, sql, deviceIds); if (!executeBatchOperation(conn, sql, deviceIds)) {
String msg = "Failed to remove locations of devices with deviceIds : " + deviceIds
+ " while executing batch operation";
log.error(msg);
throw new DeviceManagementDAOException(msg);
}
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while obtaining locations of devices."; String msg = "SQL error occurred while removing locations of devices with deviceIds : " + deviceIds;
log.error(msg, e); log.error(msg, e);
throw new DeviceManagementDAOException(msg, e); throw new DeviceManagementDAOException(msg, e);
} }
@ -1842,9 +1853,14 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
private void removeDeviceInfo(Connection conn, List<Integer> deviceIds) throws DeviceManagementDAOException { private void removeDeviceInfo(Connection conn, List<Integer> deviceIds) throws DeviceManagementDAOException {
String sql = "DELETE FROM DM_DEVICE_INFO WHERE DEVICE_ID = ?"; String sql = "DELETE FROM DM_DEVICE_INFO WHERE DEVICE_ID = ?";
try { try {
executeBatchOperation(conn, sql, deviceIds); if (!executeBatchOperation(conn, sql, deviceIds)) {
String msg = "Failed to remove device info of devices with deviceIds : " + deviceIds
+ " while executing batch operation";
log.error(msg);
throw new DeviceManagementDAOException(msg);
}
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while removing device info."; String msg = "SQL error occurred while removing device info of devices with deviceIds : " + deviceIds;
log.error(msg, e); log.error(msg, e);
throw new DeviceManagementDAOException(msg, e); throw new DeviceManagementDAOException(msg, e);
} }
@ -1859,9 +1875,14 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
private void removeDeviceNotification(Connection conn, List<Integer> deviceIds) throws DeviceManagementDAOException { private void removeDeviceNotification(Connection conn, List<Integer> deviceIds) throws DeviceManagementDAOException {
String sql = "DELETE FROM DM_NOTIFICATION WHERE DEVICE_ID = ?"; String sql = "DELETE FROM DM_NOTIFICATION WHERE DEVICE_ID = ?";
try { try {
executeBatchOperation(conn, sql, deviceIds); if (!executeBatchOperation(conn, sql, deviceIds)) {
String msg = "Failed to remove device notifications of devices with deviceIds : " + deviceIds +
" while executing batch operation";
log.error(msg);
throw new DeviceManagementDAOException(msg);
}
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while removing device notifications."; String msg = "SQL error occurred while removing device notifications of devices with deviceIds : " + deviceIds;
log.error(msg, e); log.error(msg, e);
throw new DeviceManagementDAOException(msg, e); throw new DeviceManagementDAOException(msg, e);
} }
@ -1878,9 +1899,15 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
throws DeviceManagementDAOException { throws DeviceManagementDAOException {
String sql = "DELETE FROM DM_DEVICE_APPLICATION_MAPPING WHERE DEVICE_ID = ?"; String sql = "DELETE FROM DM_DEVICE_APPLICATION_MAPPING WHERE DEVICE_ID = ?";
try { try {
executeBatchOperation(conn, sql, deviceIds); if (!executeBatchOperation(conn, sql, deviceIds)) {
String msg = "Failed to remove device application mapping of of devices with deviceIds : " + deviceIds +
" while executing batch operation";
log.error(msg);
throw new DeviceManagementDAOException(msg);
}
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while removing device application mapping"; String msg = "SQL error occurred while removing device application mapping of devices with deviceIds : "
+ deviceIds;
log.error(msg, e); log.error(msg, e);
throw new DeviceManagementDAOException(msg, e); throw new DeviceManagementDAOException(msg, e);
} }
@ -1896,9 +1923,14 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
throws DeviceManagementDAOException { throws DeviceManagementDAOException {
String sql = "DELETE FROM DM_DEVICE_POLICY_APPLIED WHERE DEVICE_ID = ?"; String sql = "DELETE FROM DM_DEVICE_POLICY_APPLIED WHERE DEVICE_ID = ?";
try { try {
executeBatchOperation(conn, sql, deviceIds); if (!executeBatchOperation(conn, sql, deviceIds)) {
String msg = "Failed to remove policies applied on devices with deviceIds : " + deviceIds +
" while executing batch operation";
log.error(msg);
throw new DeviceManagementDAOException(msg);
}
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while removing policies applied on devices"; String msg = "SQL error occurred while removing policies applied on devices with deviceIds : " + deviceIds;
log.error(msg, e); log.error(msg, e);
throw new DeviceManagementDAOException(msg, e); throw new DeviceManagementDAOException(msg, e);
} }
@ -1913,9 +1945,14 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
private void removeDevicePolicy(Connection conn, List<Integer> deviceIds) throws DeviceManagementDAOException { private void removeDevicePolicy(Connection conn, List<Integer> deviceIds) throws DeviceManagementDAOException {
String sql = "DELETE FROM DM_DEVICE_POLICY WHERE DEVICE_ID = ?"; String sql = "DELETE FROM DM_DEVICE_POLICY WHERE DEVICE_ID = ?";
try { try {
executeBatchOperation(conn, sql, deviceIds); if (!executeBatchOperation(conn, sql, deviceIds)) {
String msg = "Failed to remove policies of devices with deviceIds : " + deviceIds +
" while executing batch operation";
log.error(msg);
throw new DeviceManagementDAOException(msg);
}
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while removing policies of devices"; String msg = "SQL error occurred while removing policies of devices with deviceIds : " + deviceIds;
log.error(msg, e); log.error(msg, e);
throw new DeviceManagementDAOException(msg, e); throw new DeviceManagementDAOException(msg, e);
} }
@ -1931,9 +1968,15 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
throws DeviceManagementDAOException { throws DeviceManagementDAOException {
String sql = "DELETE FROM DM_DEVICE_DETAIL WHERE ENROLMENT_ID = ?"; String sql = "DELETE FROM DM_DEVICE_DETAIL WHERE ENROLMENT_ID = ?";
try { try {
executeBatchOperation(conn, sql, enrollmentIds); if (!executeBatchOperation(conn, sql, enrollmentIds)) {
String msg = "Failed to remove enrollment details of devices with enrollmentIds : " + enrollmentIds
+ " while executing batch operation";
log.error(msg);
throw new DeviceManagementDAOException(msg);
}
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while removing enrollment details of devices"; String msg = "SQL error occurred while removing enrollment details of devices with enrollmentIds : "
+ enrollmentIds;
log.error(msg, e); log.error(msg, e);
throw new DeviceManagementDAOException(msg, e); throw new DeviceManagementDAOException(msg, e);
} }
@ -1949,9 +1992,15 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
throws DeviceManagementDAOException { throws DeviceManagementDAOException {
String sql = "DELETE FROM DM_DEVICE_LOCATION WHERE ENROLMENT_ID = ?"; String sql = "DELETE FROM DM_DEVICE_LOCATION WHERE ENROLMENT_ID = ?";
try { try {
executeBatchOperation(conn, sql, enrollmentIds); if (!executeBatchOperation(conn, sql, enrollmentIds)) {
String msg = "Failed to remove enrollment locations of devices with enrollmentIds : " + enrollmentIds
+ " while executing batch operation";
log.error(msg);
throw new DeviceManagementDAOException(msg);
}
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while removing enrollment locations of devices"; String msg = "SQL error occurred while removing enrollment locations of devices with enrollmentIds : "
+ enrollmentIds;
log.error(msg, e); log.error(msg, e);
throw new DeviceManagementDAOException(msg, e); throw new DeviceManagementDAOException(msg, e);
} }
@ -1967,9 +2016,15 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
throws DeviceManagementDAOException { throws DeviceManagementDAOException {
String sql = "DELETE FROM DM_DEVICE_INFO WHERE ENROLMENT_ID = ?"; String sql = "DELETE FROM DM_DEVICE_INFO WHERE ENROLMENT_ID = ?";
try { try {
executeBatchOperation(conn, sql, enrollmentIds); if (!executeBatchOperation(conn, sql, enrollmentIds)) {
String msg = "Failed to remove enrollment info of devices with enrollmentIds : " + enrollmentIds
+ " while executing batch operation";
log.error(msg);
throw new DeviceManagementDAOException(msg);
}
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while removing enrollment info of devices"; String msg = "SQL error occurred while removing enrollment info of devices with enrollmentIds : "
+ enrollmentIds;
log.error(msg, e); log.error(msg, e);
throw new DeviceManagementDAOException(msg, e); throw new DeviceManagementDAOException(msg, e);
} }
@ -1985,9 +2040,15 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
throws DeviceManagementDAOException { throws DeviceManagementDAOException {
String sql = "DELETE FROM DM_DEVICE_APPLICATION_MAPPING WHERE ENROLMENT_ID = ?"; String sql = "DELETE FROM DM_DEVICE_APPLICATION_MAPPING WHERE ENROLMENT_ID = ?";
try { try {
executeBatchOperation(conn, sql, enrollmentIds); if (!executeBatchOperation(conn, sql, enrollmentIds)) {
String msg = "Failed to remove enrollment device application mapping of devices with enrollmentIds : "
+ enrollmentIds + " while executing batch operation";
log.error(msg);
throw new DeviceManagementDAOException(msg);
}
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while removing enrollment device application mapping"; String msg = "SQL error occurred while removing enrollment device application mapping of devices with " +
"enrollmentIds : " + enrollmentIds;
log.error(msg, e); log.error(msg, e);
throw new DeviceManagementDAOException(msg, e); throw new DeviceManagementDAOException(msg, e);
} }
@ -2003,9 +2064,15 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
throws DeviceManagementDAOException { throws DeviceManagementDAOException {
String sql = "DELETE FROM DM_DEVICE_OPERATION_RESPONSE WHERE ENROLMENT_ID = ?"; String sql = "DELETE FROM DM_DEVICE_OPERATION_RESPONSE WHERE ENROLMENT_ID = ?";
try { try {
executeBatchOperation(conn, sql, enrollmentIds); if (!executeBatchOperation(conn, sql, enrollmentIds)) {
String msg = "Failed to remove device operation response of devices with enrollmentIds : "
+ enrollmentIds + " while executing batch operation";
log.error(msg);
throw new DeviceManagementDAOException(msg);
}
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while removing device operation response"; String msg = "SQL error occurred while removing device operation response of devices with enrollmentIds : "
+ enrollmentIds;
log.error(msg, e); log.error(msg, e);
throw new DeviceManagementDAOException(msg, e); throw new DeviceManagementDAOException(msg, e);
} }
@ -2021,9 +2088,15 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
throws DeviceManagementDAOException { throws DeviceManagementDAOException {
String sql = "DELETE FROM DM_ENROLMENT_OP_MAPPING WHERE ENROLMENT_ID = ?"; String sql = "DELETE FROM DM_ENROLMENT_OP_MAPPING WHERE ENROLMENT_ID = ?";
try { try {
executeBatchOperation(conn, sql, enrollmentIds); if (!executeBatchOperation(conn, sql, enrollmentIds)) {
String msg = "Failed to remove enrollment operation mapping of devices with enrollmentIds : "
+ enrollmentIds + " while executing batch operation";
log.error(msg);
throw new DeviceManagementDAOException(msg);
}
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while removing enrollment operation mapping"; String msg = "SQL error occurred while removing enrollment operation mapping of devices with enrollmentIds :"
+ enrollmentIds;
log.error(msg, e); log.error(msg, e);
throw new DeviceManagementDAOException(msg, e); throw new DeviceManagementDAOException(msg, e);
} }
@ -2039,9 +2112,15 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
throws DeviceManagementDAOException { throws DeviceManagementDAOException {
String sql = "DELETE FROM DM_ENROLMENT WHERE DEVICE_ID = ?"; String sql = "DELETE FROM DM_ENROLMENT WHERE DEVICE_ID = ?";
try { try {
executeBatchOperation(conn, sql, enrollmentIds); if (!executeBatchOperation(conn, sql, enrollmentIds)) {
String msg = "Failed to remove enrollments of devices with enrollmentIds : " + enrollmentIds
+ " while executing batch operation";
log.error(msg);
throw new DeviceManagementDAOException(msg);
}
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while removing enrollments of devices"; String msg = "SQL error occurred while removing enrollments of devices with enrollmentIds : "
+ enrollmentIds;
log.error(msg, e); log.error(msg, e);
throw new DeviceManagementDAOException(msg, e); throw new DeviceManagementDAOException(msg, e);
} }
@ -2056,9 +2135,15 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
private void removeDeviceGroupMapping(Connection conn, List<Integer> deviceIds) throws DeviceManagementDAOException { private void removeDeviceGroupMapping(Connection conn, List<Integer> deviceIds) throws DeviceManagementDAOException {
String sql = "DELETE FROM DM_DEVICE_GROUP_MAP WHERE DEVICE_ID = ?"; String sql = "DELETE FROM DM_DEVICE_GROUP_MAP WHERE DEVICE_ID = ?";
try { try {
executeBatchOperation(conn, sql, deviceIds); if (!executeBatchOperation(conn, sql, deviceIds)) {
String msg = "Failed to remove device group mapping of devices with deviceIds : " + deviceIds
+ " while executing batch operation";
log.error(msg);
throw new DeviceManagementDAOException(msg);
}
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while removing device group mapping"; String msg = "SQL error occurred while removing device group mapping of devices with deviceIds : "
+ deviceIds;
log.error(msg, e); log.error(msg, e);
throw new DeviceManagementDAOException(msg, e); throw new DeviceManagementDAOException(msg, e);
} }
@ -2073,9 +2158,13 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
private void removeDevice(Connection conn, List<Integer> deviceIds) throws DeviceManagementDAOException { private void removeDevice(Connection conn, List<Integer> deviceIds) throws DeviceManagementDAOException {
String sql = "DELETE FROM DM_DEVICE WHERE ID = ?"; String sql = "DELETE FROM DM_DEVICE WHERE ID = ?";
try { try {
executeBatchOperation(conn, sql, deviceIds); if (!executeBatchOperation(conn, sql, deviceIds)) {
String msg = "Failed to remove devices with deviceIds : " + deviceIds + " while executing batch operation";
log.error(msg);
throw new DeviceManagementDAOException(msg);
}
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while removing devices."; String msg = "SQL error occurred while removing devices with deviceIds : " + deviceIds;
log.error(msg, e); log.error(msg, e);
throw new DeviceManagementDAOException(msg, e); throw new DeviceManagementDAOException(msg, e);
} }
@ -2085,12 +2174,15 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
* This method executes batch operations for a given list of primary keys * This method executes batch operations for a given list of primary keys
* where the statement only has one param of type int, following the given pattern: * where the statement only has one param of type int, following the given pattern:
* DELETE FROM TABLE WHERE ID = ? * DELETE FROM TABLE WHERE ID = ?
*
* This method does not check if the number of rows affected by the executeBatch() method is 0
* because there can be tables with no records to delete.
* @param sql SQL statement * @param sql SQL statement
* @param conn Connection object * @param conn Connection object
* @param identifiers list of device ids (primary keys) * @param identifiers list of device ids (primary keys)
* @throws SQLException if deletion fails. * @throws SQLException if deletion fails.
*/ */
private void executeBatchOperation(Connection conn, String sql, List<Integer> identifiers) throws SQLException { private boolean executeBatchOperation(Connection conn, String sql, List<Integer> identifiers) throws SQLException {
try (PreparedStatement ps = conn.prepareStatement(sql)) { try (PreparedStatement ps = conn.prepareStatement(sql)) {
if (conn.getMetaData().supportsBatchUpdates()) { if (conn.getMetaData().supportsBatchUpdates()) {
for (int identifier : identifiers) { for (int identifier : identifiers) {
@ -2098,19 +2190,18 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
ps.addBatch(); ps.addBatch();
} }
for (int i : ps.executeBatch()) { for (int i : ps.executeBatch()) {
if (i == 0 || i == Statement.SUCCESS_NO_INFO || i == Statement.EXECUTE_FAILED) { if (i == Statement.SUCCESS_NO_INFO || i == Statement.EXECUTE_FAILED) {
break; return false;
} }
} }
} else { } else {
for (int enrollmentId : identifiers) { for (int identifier : identifiers) {
ps.setInt(1, enrollmentId); ps.setInt(1, identifier);
if (ps.executeUpdate() == 0) { ps.executeUpdate();
break;
}
} }
} }
} }
return true;
} }
private int getDeviceId(Connection conn, DeviceIdentifier deviceIdentifier, int tenantId) private int getDeviceId(Connection conn, DeviceIdentifier deviceIdentifier, int tenantId)

@ -528,43 +528,39 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
} }
@Override @Override
public boolean deleteDevices(List<String> deviceIdentifiers) throws DeviceManagementException, InvalidDeviceException { public boolean deleteDevices(List<String> deviceIdentifiers) throws DeviceManagementException,
List<Integer> deviceIds = new ArrayList<>(); InvalidDeviceException {
if (deviceIdentifiers == null || deviceIdentifiers.isEmpty()) {
String msg = "Required values of device identifiers are not set to permanently delete device/s.";
log.error(msg);
throw new InvalidDeviceException(msg);
}
HashSet<Integer> deviceIds = new HashSet<>();
List<Integer> enrollmentIds = new ArrayList<>(); List<Integer> enrollmentIds = new ArrayList<>();
List<String> validDeviceIdentifiers = new ArrayList<>();
Map<String, List<String>> deviceIdentifierMap = new HashMap<>(); Map<String, List<String>> deviceIdentifierMap = new HashMap<>();
Map<String, DeviceManager> deviceManagerMap = new HashMap<>(); Map<String, DeviceManager> deviceManagerMap = new HashMap<>();
List<DeviceCacheKey> deviceCacheKeyList = new ArrayList<>(); List<DeviceCacheKey> deviceCacheKeyList = new ArrayList<>();
int tenantId = this.getTenantId(); int tenantId = this.getTenantId();
List<Device> existingDevices;
try { try {
DeviceManagementDAOFactory.beginTransaction(); DeviceManagementDAOFactory.beginTransaction();
existingDevices = deviceDAO.getDevicesByIdentifiers(deviceIdentifiers, tenantId); List<Device> existingDevices = deviceDAO.getDevicesByIdentifiers(deviceIdentifiers, tenantId);
if (existingDevices.size() != deviceIdentifiers.size()) { DeviceCacheKey deviceCacheKey;
for (Device device : existingDevices) { for (Device device : existingDevices) {
deviceIdentifiers.remove(device.getDeviceIdentifier()); if (!EnrolmentInfo.Status.REMOVED.equals(device.getEnrolmentInfo().getStatus())) {
}
String msg =
"Couldn't find device ids for all the requested device identifiers. " +
"Therefore payload should contain device identifiers which are not in the system. " +
"Invalid device identifiers are " + deviceIdentifiers.toString();
log.error(msg);
DeviceManagementDAOFactory.rollbackTransaction(); DeviceManagementDAOFactory.rollbackTransaction();
throw new InvalidDeviceException(msg);
}
for (Device device : existingDevices) {
if (!device.getEnrolmentInfo().getStatus().equals(EnrolmentInfo.Status.REMOVED)) {
String msg = "Device " + device.getDeviceIdentifier() + " of type " + device.getType() String msg = "Device " + device.getDeviceIdentifier() + " of type " + device.getType()
+ " is not dis-enrolled to permanently delete the device"; + " is not dis-enrolled to permanently delete the device";
log.error(msg); log.error(msg);
DeviceManagementDAOFactory.rollbackTransaction();
throw new InvalidDeviceException(msg); throw new InvalidDeviceException(msg);
} }
DeviceCacheKey deviceCacheKey = new DeviceCacheKey(); deviceCacheKey = new DeviceCacheKey();
deviceCacheKey.setDeviceId(device.getDeviceIdentifier()); deviceCacheKey.setDeviceId(device.getDeviceIdentifier());
deviceCacheKey.setDeviceType(device.getType()); deviceCacheKey.setDeviceType(device.getType());
deviceCacheKey.setTenantId(tenantId); deviceCacheKey.setTenantId(tenantId);
deviceCacheKeyList.add(deviceCacheKey); deviceCacheKeyList.add(deviceCacheKey);
deviceIds.add(device.getId()); deviceIds.add(device.getId());
validDeviceIdentifiers.add(device.getDeviceIdentifier());
enrollmentIds.add(device.getEnrolmentInfo().getId()); enrollmentIds.add(device.getEnrolmentInfo().getId());
if (deviceIdentifierMap.containsKey(device.getType())) { if (deviceIdentifierMap.containsKey(device.getType())) {
deviceIdentifierMap.get(device.getType()).add(device.getDeviceIdentifier()); deviceIdentifierMap.get(device.getType()).add(device.getDeviceIdentifier());
@ -573,17 +569,23 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
new ArrayList<>(Arrays.asList(device.getDeviceIdentifier()))); new ArrayList<>(Arrays.asList(device.getDeviceIdentifier())));
DeviceManager deviceManager = this.getDeviceManager(device.getType()); DeviceManager deviceManager = this.getDeviceManager(device.getType());
if (deviceManager == null) { if (deviceManager == null) {
if (log.isDebugEnabled()) { log.error("Device Manager associated with the device type '" +device.getType() +
log.debug("Device Manager associated with the device type '" "' is null. Therefore, not attempting method 'deleteDevice'");
+ device.getType() + "' is null. Therefore, not attempting method 'deleteDevice'");
}
return false; return false;
} }
deviceManagerMap.put(device.getType(), deviceManager); deviceManagerMap.put(device.getType(), deviceManager);
} }
} }
if (deviceIds.isEmpty()) {
String msg = "No device IDs found for the device identifiers '" + deviceIdentifiers + "'";
log.error(msg);
throw new InvalidDeviceException(msg);
}
if (log.isDebugEnabled()) {
log.debug("Permanently deleting the details of devices : " + validDeviceIdentifiers);
}
//deleting device from the core //deleting device from the core
deviceDAO.deleteDevices(deviceIdentifiers, deviceIds, enrollmentIds); deviceDAO.deleteDevices(validDeviceIdentifiers, new ArrayList<>(deviceIds), enrollmentIds);
for (Map.Entry<String, DeviceManager> entry : deviceManagerMap.entrySet()) { for (Map.Entry<String, DeviceManager> entry : deviceManagerMap.entrySet()) {
try { try {
// deleting device from the plugin level // deleting device from the plugin level
@ -600,6 +602,9 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
} }
DeviceManagementDAOFactory.commitTransaction(); DeviceManagementDAOFactory.commitTransaction();
this.removeDevicesFromCache(deviceCacheKeyList); this.removeDevicesFromCache(deviceCacheKeyList);
if (log.isDebugEnabled()) {
log.debug("Successfully permanently deleted the details of devices : " + validDeviceIdentifiers);
}
return true; return true;
} catch (TransactionManagementException e) { } catch (TransactionManagementException e) {
String msg = "Error occurred while initiating transaction"; String msg = "Error occurred while initiating transaction";
@ -611,6 +616,8 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
"' devices"; "' devices";
log.error(msg, e); log.error(msg, e);
throw new DeviceManagementException(msg, e); throw new DeviceManagementException(msg, e);
} finally {
DeviceManagementDAOFactory.closeConnection();
} }
} }

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -220,7 +220,6 @@ public class DeviceTypePluginDAOImpl implements PluginDAO {
public boolean deleteDevices(List<String> deviceIdentifiers) throws DeviceTypeMgtPluginException { public boolean deleteDevices(List<String> deviceIdentifiers) throws DeviceTypeMgtPluginException {
try { try {
Connection conn = deviceTypeDAOHandler.getConnection(); Connection conn = deviceTypeDAOHandler.getConnection();
boolean status = true;
try (PreparedStatement ps = conn.prepareStatement(deleteDBQueryForDeleteDevice)) { try (PreparedStatement ps = conn.prepareStatement(deleteDBQueryForDeleteDevice)) {
if (conn.getMetaData().supportsBatchUpdates()) { if (conn.getMetaData().supportsBatchUpdates()) {
for (String deviceId : deviceIdentifiers) { for (String deviceId : deviceIdentifiers) {
@ -228,22 +227,18 @@ public class DeviceTypePluginDAOImpl implements PluginDAO {
ps.addBatch(); ps.addBatch();
} }
for (int i : ps.executeBatch()) { for (int i : ps.executeBatch()) {
if (i == 0 || i == Statement.SUCCESS_NO_INFO || i == Statement.EXECUTE_FAILED) { if (i == Statement.SUCCESS_NO_INFO || i == Statement.EXECUTE_FAILED) {
status = false; return false;
break;
} }
} }
} else { } else {
for (String deviceId : deviceIdentifiers) { for (String deviceId : deviceIdentifiers) {
ps.setString(1, deviceId); ps.setString(1, deviceId);
if (ps.executeUpdate() == 0) { ps.executeUpdate();
status = false;
break;
} }
} }
} }
} return true;
return status;
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while deleting the data in " String msg = "Error occurred while deleting the data in "
+ deviceDAODefinition.getDeviceTableName(); + deviceDAODefinition.getDeviceTableName();

@ -222,7 +222,6 @@ public class PropertyBasedPluginDAOImpl implements PluginDAO {
public boolean deleteDevices(List<String> deviceIdentifiers) throws DeviceTypeMgtPluginException { public boolean deleteDevices(List<String> deviceIdentifiers) throws DeviceTypeMgtPluginException {
try { try {
Connection conn = deviceTypeDAOHandler.getConnection(); Connection conn = deviceTypeDAOHandler.getConnection();
boolean status = true;
try (PreparedStatement ps = conn.prepareStatement("DELETE FROM DM_DEVICE_PROPERTIES WHERE DEVICE_IDENTIFICATION = ?")) { try (PreparedStatement ps = conn.prepareStatement("DELETE FROM DM_DEVICE_PROPERTIES WHERE DEVICE_IDENTIFICATION = ?")) {
if (conn.getMetaData().supportsBatchUpdates()) { if (conn.getMetaData().supportsBatchUpdates()) {
for (String deviceId : deviceIdentifiers) { for (String deviceId : deviceIdentifiers) {
@ -230,22 +229,18 @@ public class PropertyBasedPluginDAOImpl implements PluginDAO {
ps.addBatch(); ps.addBatch();
} }
for (int i : ps.executeBatch()) { for (int i : ps.executeBatch()) {
if (i == 0 || i == Statement.SUCCESS_NO_INFO || i == Statement.EXECUTE_FAILED) { if (i == Statement.SUCCESS_NO_INFO || i == Statement.EXECUTE_FAILED) {
status = false; return false;
break;
} }
} }
} else { } else {
for (String deviceId : deviceIdentifiers) { for (String deviceId : deviceIdentifiers) {
ps.setString(1, deviceId); ps.setString(1, deviceId);
if (ps.executeUpdate() == 0) { ps.executeUpdate();
status = false;
break;
} }
} }
} }
} return true;
return status;
} catch (SQLException e) { } catch (SQLException e) {
String msg = "Error occurred while deleting the data of the devices: '" + deviceIdentifiers + "'of type: " String msg = "Error occurred while deleting the data of the devices: '" + deviceIdentifiers + "'of type: "
+ deviceType; + deviceType;

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -161,6 +161,7 @@
"perm:device:enroll", "perm:device:enroll",
"perm:geo-service:analytics-view", "perm:geo-service:analytics-view",
"perm:geo-service:alerts-manage", "perm:geo-service:alerts-manage",
"perm:devices:permanent-delete",
"appm:read" "appm:read"
], ],
"isOAuthEnabled": true, "isOAuthEnabled": true,

@ -623,6 +623,9 @@ var userModule = function () {
if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/devices/update-enrollment")) { if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/devices/update-enrollment")) {
permissions["UPDATE_ENROLLMENT"] = true; permissions["UPDATE_ENROLLMENT"] = true;
} }
if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/devices/permanent-delete")) {
permissions["PERMANENT_DELETE"] = true;
}
return permissions; return permissions;
}; };

@ -23,7 +23,7 @@
{{#equal enrolmentInfo.status "ACTIVE"}}<span><i class="fw fw-success icon-success"></i> Active</span>{{/equal}} {{#equal enrolmentInfo.status "ACTIVE"}}<span><i class="fw fw-success icon-success"></i> Active</span>{{/equal}}
{{#equal enrolmentInfo.status "INACTIVE"}}<span><i class="fw fw-warning icon-warning"></i> Inactive</span>{{/equal}} {{#equal enrolmentInfo.status "INACTIVE"}}<span><i class="fw fw-warning icon-warning"></i> Inactive</span>{{/equal}}
{{#equal enrolmentInfo.status "BLOCKED"}}<span><i class="fw fw-remove icon-danger"></i> Blocked</span>{{/equal}} {{#equal enrolmentInfo.status "BLOCKED"}}<span><i class="fw fw-remove icon-danger"></i> Blocked</span>{{/equal}}
{{#equal enrolmentInfo.status "REMOVED"}}<span><i class="fw fw-delete icon-danger"></i> Removed</span>{{/equal}} {{#equal enrolmentInfo.status "REMOVED"}}<span><i class="fw fw-disabled icon-danger"></i> Removed</span>{{/equal}}
</td> </td>
<td class="remove-padding-top" data-search="{{type}}" data-display="{{type}}" data-grid-label="Type">{{type}}</td> <td class="remove-padding-top" data-search="{{type}}" data-display="{{type}}" data-grid-label="Type">{{type}}</td>
<td class="remove-padding-top" data-search="{{enrolmentInfo.ownership}}" data-display="{{enrolmentInfo.ownership}}" data-grid-label="Ownership">{{enrolmentInfo.ownership}}</td> <td class="remove-padding-top" data-search="{{enrolmentInfo.ownership}}" data-display="{{enrolmentInfo.ownership}}" data-grid-label="Ownership">{{enrolmentInfo.ownership}}</td>

@ -218,15 +218,31 @@
data-toggle="modal" data-target="#modalDemo"> data-toggle="modal" data-target="#modalDemo">
<span class="icon fw-stack"> <span class="icon fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i> <i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-delete fw-stack-1x"></i> <i class="fw fw-disabled fw-stack-1x"></i>
</span> </span>
{{#if group}} {{#if group}}
Remove from group Remove from group
{{else}} {{else}}
Remove Device Dis-enroll Device
{{/if}} {{/if}}
</a> </a>
</li> </li>
<!--permanent delete-->
{{#if permissions.permanentDelete}}
<li>
<a href="#"
data-click-event="remove-form"
class="btn square-element delete-device-link"
data-toggle="modal" data-target="#modalDemo">
<span class="icon fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-delete fw-stack-1x"></i>
</span>
Delete Device
</a>
</li>
{{/if}}
<!--/permanent delete-->
<!--update enrollment--> <!--update enrollment-->
{{#if permissions.updateEnrollment}} {{#if permissions.updateEnrollment}}
<li> <li>
@ -423,6 +439,58 @@
</div> </div>
</div> </div>
<div id="delete-device-modal-content" class="hide">
<div class="modal-header">
<h3 class="pull-left modal-title">
{{#if group}}
Do you really want to permanently delete this device(s) from '{{group.name}}' group?
{{else}}
Do you really want to permanently delete this device(s) from your Devices?
{{/if}}
</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i
class="fw fw-cancel"></i>
</button>
</div>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
</div>
<div class="modal-footer">
<div class="buttons">
<a href="#" id="delete-device-yes-link" class="btn-operations">
Yes
</a>
<a href="#" id="delete-device-cancel-link" class="btn-operations">
Cancel
</a>
</div>
</div>
</div>
<div id="delete-device-200-content" class="hide">
<div class="modal-header">
<h3 class="pull-left modal-title">
{{#if group}}
Successfully deleted from '{{group.name}}' group.
{{else}}
Successfully deleted.
{{/if}}
</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i
class="fw fw-cancel"></i>
</button>
</div>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
</div>
<div class="modal-footer">
<div class="buttons">
<a href="javascript:hidePopup()" class="btn-operations">Ok</a>
</div>
</div>
</div>
<div id="edit-device-modal-content" class="hide"> <div id="edit-device-modal-content" class="hide">
<div class="modal-header"> <div class="modal-header">
<h3 class="pull-left modal-title"> <h3 class="pull-left modal-title">
@ -475,6 +543,22 @@
</div> </div>
</div> </div>
<div id="enrolled-device-delete-content" class="hide">
<div class="modal-header">
<h3 class="pull-left modal-title">Could not delete devices since some are still
enrolled.</h3>
</div>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
</div>
<div class="modal-footer">
<div class="buttons">
<a href="#" id="enrolled-device-delete-link" class="btn-operations">
Ok
</a>
</div>
</div>
</div>
<div id="device-400-content" class="hide"> <div id="device-400-content" class="hide">
<div class="modal-content"> <div class="modal-content">
<div class="row"> <div class="row">

@ -46,6 +46,9 @@ function onRequest(context) {
if (uiPermissions.UPDATE_ENROLLMENT) { if (uiPermissions.UPDATE_ENROLLMENT) {
viewModel.permissions.updateEnrollment = true; viewModel.permissions.updateEnrollment = true;
} }
if (uiPermissions.PERMANENT_DELETE) {
viewModel.permissions.permanentDelete = true;
}
viewModel.currentUser = currentUser; viewModel.currentUser = currentUser;
var deviceCount = 0; var deviceCount = 0;
if (groupId) { if (groupId) {

@ -70,7 +70,7 @@ function InitiateViewOption(url) {
var deviceCheckbox = "#ast-container .ctrl-wr-asset .itm-select input[type='checkbox']"; var deviceCheckbox = "#ast-container .ctrl-wr-asset .itm-select input[type='checkbox']";
var assetContainer = "#ast-container"; var assetContainer = "#ast-container";
var deviceListing, currentUser, groupId; var deviceListing, currentUser, groupId, hasDeletePermission;
/* /*
* DOM ready functions. * DOM ready functions.
@ -87,8 +87,8 @@ $(document).ready(function () {
}; };
deviceListing = $("#device-listing"); deviceListing = $("#device-listing");
hasDeletePermission = $("#permission").data("permission")['PERMANENT_DELETE'];
currentUser = deviceListing.data("current-user"); currentUser = deviceListing.data("current-user");
groupId = getParameterByName("groupId"); groupId = getParameterByName("groupId");
/* Adding selected class for selected devices */ /* Adding selected class for selected devices */
@ -320,7 +320,7 @@ function loadDevices(searchType, searchParam) {
html = '<span><i class="fw fw-remove icon-danger"></i> Blocked</span>'; html = '<span><i class="fw fw-remove icon-danger"></i> Blocked</span>';
break; break;
case 'REMOVED' : case 'REMOVED' :
html = '<span><i class="fw fw-delete icon-danger"></i> Removed</span>'; html = '<span><i class="fw fw-disabled icon-danger"></i> Removed</span>';
break; break;
case 'UNREACHABLE' : case 'UNREACHABLE' :
html = '<span><i class="fw fw-warning icon-warning"></i> Unreachable</span>'; html = '<span><i class="fw fw-warning icon-warning"></i> Unreachable</span>';
@ -361,12 +361,12 @@ function loadDevices(searchType, searchParam) {
var portalUrl = $("#device-listing").data("portal-url"); var portalUrl = $("#device-listing").data("portal-url");
var serverUrl = $("#device-listing").data("server-url"); var serverUrl = $("#device-listing").data("server-url");
var userDomain = $("#device-listing").data("userDomain"); var userDomain = $("#device-listing").data("userDomain");
var statusCode = row.status;
var statURL; var statURL;
if (status != 'REMOVED') { if (statusCode != 'REMOVED') {
html = ''; html = '';
if (analyticsEnabled(row.deviceType)) { if (analyticsEnabled(row.deviceType)) {
// redirecting to respective analytics view depending on device configs // redirecting to respective analytics view depending on device configs
switch (getAnalyticsView(deviceType)) { switch (getAnalyticsView(deviceType)) {
case "DAS" : { statURL =portalUrl + "/portal/t/"+ userDomain+ "/dashboards/android-iot/battery?owner=" +currentUser+"&deviceId=";break;} case "DAS" : { statURL =portalUrl + "/portal/t/"+ userDomain+ "/dashboards/android-iot/battery?owner=" +currentUser+"&deviceId=";break;}
@ -405,17 +405,115 @@ function loadDevices(searchType, searchParam) {
+ 'data-deviceid="' + deviceIdentifier + '" data-devicetype="' + deviceType + 'data-deviceid="' + deviceIdentifier + '" data-devicetype="' + deviceType
+ '" data-devicename="' + row.name + '" data-placement="top" data-toggle="tooltip" data-original-title="Remove from group">' + '" data-devicename="' + row.name + '" data-placement="top" data-toggle="tooltip" data-original-title="Remove from group">'
+ '<span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i>' + '<span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i>'
+ '<i class="fw fw-delete fw-stack-1x"></i></span>' + '<i class="fw fw-disabled fw-stack-1x"></i></span>'
+ '<span class="hidden-xs hidden-on-grid-view">Remove from group</span>'; + '<span class="hidden-xs hidden-on-grid-view">Remove from group</span>';
} else { } else {
html += html +=
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view remove-device-link" ' '<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view remove-device-link" '
+ 'data-deviceid="' + deviceIdentifier + '" data-devicetype="' + deviceType + 'data-deviceid="' + deviceIdentifier + '" data-devicetype="' + deviceType
+ '" data-devicename="' + row.name + '" data-placement="top" data-toggle="tooltip" data-original-title="Dis-enroll">'
+ '<span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i>'
+ '<i class="fw fw-disabled fw-stack-1x"></i></span>'
+ '<span class="hidden-xs hidden-on-grid-view">Dis-enroll</span>';
}
} else if (statusCode == 'REMOVED' && hasDeletePermission) {
html = '';
if (analyticsEnabled(row.deviceType)) {
// redirecting to respective analytics view depending on device configs
switch (getAnalyticsView(deviceType)) {
case "DAS" : {
statURL = portalUrl + "/portal/t/" + userDomain + "/dashboards/android-iot/battery?owner=" + currentUser + "&deviceId=";
break;
}
default : {
statURL = context + "/device/" + row.deviceType + "/analytics?deviceId="
}
}
html += '<a href="' + statURL +
deviceIdentifier + '&deviceName=' + row.name + '" ' + 'data-click-event="remove-form"' +
' class="btn padding-reduce-on-grid-view" data-placement="top" data-toggle="tooltip" data-original-title="Analytics"><span class="fw-stack">' +
'<i class="fw fw-circle-outline fw-stack-2x"></i><i class="fw fw-statistics fw-stack-1x"></i></span>' +
'<span class="hidden-xs hidden-on-grid-view">Analytics</span>';
}
if (!groupId && groupingEnabled(row.deviceType)) {
html +=
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view group-device-link" '
+
'data-deviceid="' + deviceIdentifier + '" data-devicetype="' + deviceType
+ '" data-devicename="' +
row.name + '" data-placement="top" data-toggle="tooltip" data-original-title="Group"><span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i>' +
'<i class="fw fw-group fw-stack-1x"></i></span>' +
'<span class="hidden-xs hidden-on-grid-view">Group</span></a>';
}
html +=
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view edit-device-link" '
+ 'data-deviceid="' + deviceIdentifier + '" data-devicetype="' + deviceType
+ '" data-devicename="' + row.name + '" data-placement="top" data-toggle="tooltip" data-original-title="Edit">'
+ '<span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i>'
+ '<i class="fw fw-edit fw-stack-1x"></i></span>'
+ '<span class="hidden-xs hidden-on-grid-view">Edit</span></a>';
var groupOwner = $('#group_owner').text();
if (groupId && groupOwner != "wso2.system.user") {
html +=
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view delete-device-link" '
+ 'data-deviceid="' + deviceIdentifier + '" data-devicetype="' + deviceType
+ '" data-devicename="' + row.name + '" data-placement="top" data-toggle="tooltip" data-original-title="Remove from group">'
+ '<span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i>'
+ '<i class="fw fw-delete fw-stack-1x"></i></span>'
+ '<span class="hidden-xs hidden-on-grid-view">Remove from group</span>';
} else {
html +=
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view delete-device-link" '
+ 'data-deviceid="' + deviceIdentifier + '" data-devicetype="' + deviceType
+ '" data-devicename="' + row.name + '" data-placement="top" data-toggle="tooltip" data-original-title="Delete">' + '" data-devicename="' + row.name + '" data-placement="top" data-toggle="tooltip" data-original-title="Delete">'
+ '<span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i>' + '<span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i>'
+ '<i class="fw fw-delete fw-stack-1x"></i></span>' + '<i class="fw fw-delete fw-stack-1x"></i></span>'
+ '<span class="hidden-xs hidden-on-grid-view">Delete</span>'; + '<span class="hidden-xs hidden-on-grid-view">Delete</span>';
} }
} else {
html = '';
if (analyticsEnabled(row.deviceType)) {
// redirecting to respective analytics view depending on device configs
switch (getAnalyticsView(deviceType)) {
case "DAS" : {
statURL = portalUrl + "/portal/t/" + userDomain + "/dashboards/android-iot/battery?owner=" + currentUser + "&deviceId=";
break;
}
default : {
statURL = context + "/device/" + row.deviceType + "/analytics?deviceId="
}
}
html += '<a href="' + statURL +
deviceIdentifier + '&deviceName=' + row.name + '" ' + 'data-click-event="remove-form"' +
' class="btn padding-reduce-on-grid-view" data-placement="top" data-toggle="tooltip" data-original-title="Analytics"><span class="fw-stack">' +
'<i class="fw fw-circle-outline fw-stack-2x"></i><i class="fw fw-statistics fw-stack-1x"></i></span>' +
'<span class="hidden-xs hidden-on-grid-view">Analytics</span>';
}
if (!groupId && groupingEnabled(row.deviceType)) {
html +=
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view group-device-link" '
+
'data-deviceid="' + deviceIdentifier + '" data-devicetype="' + deviceType
+ '" data-devicename="' +
row.name + '" data-placement="top" data-toggle="tooltip" data-original-title="Group"><span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i>' +
'<i class="fw fw-group fw-stack-1x"></i></span>' +
'<span class="hidden-xs hidden-on-grid-view">Group</span></a>';
}
html +=
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view edit-device-link" '
+ 'data-deviceid="' + deviceIdentifier + '" data-devicetype="' + deviceType
+ '" data-devicename="' + row.name + '" data-placement="top" data-toggle="tooltip" data-original-title="Edit">'
+ '<span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i>'
+ '<i class="fw fw-edit fw-stack-1x"></i></span>'
+ '<span class="hidden-xs hidden-on-grid-view">Edit</span></a>';
} }
return html; return html;
} }
@ -423,6 +521,11 @@ function loadDevices(searchType, searchParam) {
]; ];
var fnCreatedRow = function (row, data, dataIndex) { var fnCreatedRow = function (row, data, dataIndex) {
if (data.status != "REMOVED") {
$(row).attr('data-type', 'selectable');
} else {
$(row).attr('data-type', 'non-selectable');
}
var model = htmlspecialchars(getPropertyValue(data.properties, 'DEVICE_MODEL')); var model = htmlspecialchars(getPropertyValue(data.properties, 'DEVICE_MODEL'));
var vendor = htmlspecialchars(getPropertyValue(data.properties, 'VENDOR')); var vendor = htmlspecialchars(getPropertyValue(data.properties, 'VENDOR'));
var owner = htmlspecialchars(data.userPattern); var owner = htmlspecialchars(data.userPattern);
@ -787,6 +890,60 @@ function attachDeviceEvents() {
}); });
}); });
/**
* Following click function would execute
* when a user clicks on "Delete" link
* on Device Management page in Entgra MDM Console.
*/
$("a.delete-device-link").click(function () {
var deviceIdentifiers = [];
var deviceId = $(this).data("deviceid");
if (deviceId) {
deviceIdentifiers = [deviceId];
$(modalPopupContent).html($('#delete-device-modal-content').html());
showPopup();
} else {
var selectedDevices = getSelectedDevices();
if (selectedDevices.length == 0) {
$(modalPopupContent).html($('#no-device-selected').html());
$("a#no-device-selected-link").click(function () {
hidePopup();
});
showPopup();
return;
} else {
var hasEnrolledDevice;
for (var i = 0; i < selectedDevices.length; i++) {
if (selectedDevices[i].selectability == 'selectable') {
hasEnrolledDevice = true;
break;
} else {
deviceIdentifiers.push(selectedDevices[i].id);
}
}
if (hasEnrolledDevice) {
$(modalPopupContent).html($('#enrolled-device-delete-content').html());
$("a#enrolled-device-delete-link").click(function () {
hidePopup();
});
showPopup();
} else {
$(modalPopupContent).html($('#delete-device-modal-content').html());
showPopup();
}
}
}
$("a#delete-device-yes-link").click(function () {
deleteDevices(deviceIdentifiers);
});
$("a#delete-device-cancel-link").click(function () {
hidePopup();
});
});
/** /**
* Following click function would execute * Following click function would execute
* when a user clicks on "Edit" link * when a user clicks on "Edit" link
@ -1100,6 +1257,19 @@ function removeDevices(deviceIdentifiers) {
}); });
} }
function deleteDevices(deviceIdentifiers) {
var serviceURL = "/api/device-mgt/v1.0/admin/devices/permanent-delete";
invokerUtil.put(serviceURL, deviceIdentifiers, function (message) {
$(modalPopupContent).html($('#delete-device-200-content').html());
setTimeout(function () {
hidePopup();
location.reload(false);
}, 2000);
}, function (jqXHR) {
displayDeviceErrors(jqXHR);
});
}
function displayDeviceErrors(jqXHR) { function displayDeviceErrors(jqXHR) {
showPopup(); showPopup();
if (jqXHR.status == 400) { if (jqXHR.status == 400) {
@ -1144,7 +1314,8 @@ function getSelectedDevices() {
deviceList.push( deviceList.push(
{ {
"id": $(thisTable.api().row(this).node()).data('deviceid'), "id": $(thisTable.api().row(this).node()).data('deviceid'),
"type": $(thisTable.api().row(this).node()).data('devicetype') "type": $(thisTable.api().row(this).node()).data('devicetype'),
"selectability": $(thisTable.api().row(this).node()).data('type')
} }
); );
} }

@ -92,7 +92,7 @@
data-current="policy-naming" data-next="policy-criteria">Back</a> data-current="policy-naming" data-next="policy-criteria">Back</a>
<a href="javascript:void(0)" class="wr-btn wizard-stepper" <a href="javascript:void(0)" class="wr-btn wizard-stepper"
data-current="policy-naming-publish" data-next="policy-message" data-current="policy-naming-publish" data-next="policy-message"
data-validate="true">Publish</a> data-validate="true">Save and Publish</a>
<a href="javascript:void(0)" class="wr-btn wizard-stepper" <a href="javascript:void(0)" class="wr-btn wizard-stepper"
data-current="policy-naming" data-current="policy-naming"
data-next="policy-message" data-validate="true">Save</a> data-next="policy-message" data-validate="true">Save</a>

@ -148,6 +148,7 @@ $("#policy-name-input").focus(function () {
skipStep["policy-platform"] = function (policyPayloadObj) { skipStep["policy-platform"] = function (policyPayloadObj) {
policy["name"] = policyPayloadObj["policyName"]; policy["name"] = policyPayloadObj["policyName"];
policy["platform"] = policyPayloadObj["profile"]["deviceType"]; policy["platform"] = policyPayloadObj["profile"]["deviceType"];
policy["policyType"] = policyPayloadObj["policyType"];
var userRoleInput = $("#user-roles-input"); var userRoleInput = $("#user-roles-input");
var ownershipInput = $("#ownership-input"); var ownershipInput = $("#ownership-input");
@ -488,6 +489,7 @@ var updatePolicy = function (policy, state) {
var payload = { var payload = {
"policyName": policy["policyName"], "policyName": policy["policyName"],
"description": policy["description"], "description": policy["description"],
"policyType": policy["policyType"],
"compliance": policy["selectedNonCompliantAction"], "compliance": policy["selectedNonCompliantAction"],
"ownershipType": null, "ownershipType": null,
"profile": { "profile": {

@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>email-sender</artifactId> <artifactId>email-sender</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,13 +22,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>identity-extensions</artifactId> <artifactId>identity-extensions</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.oauth.extensions</artifactId> <artifactId>org.wso2.carbon.device.mgt.oauth.extensions</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - OAuth Extensions</name> <name>WSO2 Carbon - OAuth Extensions</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>identity-extensions</artifactId> <artifactId>identity-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>identity-extensions</artifactId> <artifactId>identity-extensions</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.complex.policy.decision.point</artifactId> <artifactId>org.wso2.carbon.complex.policy.decision.point</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Decision Point</name> <name>WSO2 Carbon - Policy Decision Point</name>
<description>WSO2 Carbon - Policy Decision Point</description> <description>WSO2 Carbon - Policy Decision Point</description>

@ -3,14 +3,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.decision.point</artifactId> <artifactId>org.wso2.carbon.policy.decision.point</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Decision Point</name> <name>WSO2 Carbon - Policy Decision Point</name>
<description>WSO2 Carbon - Policy Decision Point</description> <description>WSO2 Carbon - Policy Decision Point</description>

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.information.point</artifactId> <artifactId>org.wso2.carbon.policy.information.point</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Information Point</name> <name>WSO2 Carbon - Policy Information Point</name>
<description>WSO2 Carbon - Policy Information Point</description> <description>WSO2 Carbon - Policy Information Point</description>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.mgt.common</artifactId> <artifactId>org.wso2.carbon.policy.mgt.common</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Management Common</name> <name>WSO2 Carbon - Policy Management Common</name>
<description>WSO2 Carbon - Policy Management Common</description> <description>WSO2 Carbon - Policy Management Common</description>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.mgt.core</artifactId> <artifactId>org.wso2.carbon.policy.mgt.core</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Management Core</name> <name>WSO2 Carbon - Policy Management Core</name>
<description>WSO2 Carbon - Policy Management Core</description> <description>WSO2 Carbon - Policy Management Core</description>

@ -23,13 +23,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Policy Management Component</name> <name>WSO2 Carbon - Policy Management Component</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

@ -21,14 +21,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>webapp-authenticator-framework</artifactId> <artifactId>webapp-authenticator-framework</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.webapp.authenticator.framework</artifactId> <artifactId>org.wso2.carbon.webapp.authenticator.framework</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Web Application Authenticator Framework Bundle</name> <name>WSO2 Carbon - Web Application Authenticator Framework Bundle</name>
<description>WSO2 Carbon - Web Application Authenticator Framework Bundle</description> <description>WSO2 Carbon - Web Application Authenticator Framework Bundle</description>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>webapp-authenticator-framework</artifactId> <artifactId>webapp-authenticator-framework</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Webapp Authenticator Framework</name> <name>WSO2 Carbon - Webapp Authenticator Framework</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

@ -21,14 +21,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId> <artifactId>apimgt-extensions-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.application.extension.feature</artifactId> <artifactId>org.wso2.carbon.apimgt.application.extension.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<name>WSO2 Carbon - API Management Application Extension Feature</name> <name>WSO2 Carbon - API Management Application Extension Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains an implementation of a api application registration, which takes care of subscription <description>This feature contains an implementation of a api application registration, which takes care of subscription

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId> <artifactId>apimgt-extensions-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.handler.server.feature</artifactId> <artifactId>org.wso2.carbon.apimgt.handler.server.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<name>WSO2 Carbon - Device Management - APIM handler Server Feature</name> <name>WSO2 Carbon - Device Management - APIM handler Server Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains the handler for the api authentications <description>This feature contains the handler for the api authentications

@ -21,13 +21,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId> <artifactId>apimgt-extensions-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.integration.client.feature</artifactId> <artifactId>org.wso2.carbon.apimgt.integration.client.feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - APIM Integration Client Feature</name> <name>WSO2 Carbon - APIM Integration Client Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

@ -21,14 +21,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId> <artifactId>apimgt-extensions-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.webapp.publisher.feature</artifactId> <artifactId>org.wso2.carbon.apimgt.webapp.publisher.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<name>WSO2 Carbon - API Management Webapp Publisher Feature</name> <name>WSO2 Carbon - API Management Webapp Publisher Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains an implementation of a Tomcat lifecycle listener, which takes care of publishing <description>This feature contains an implementation of a Tomcat lifecycle listener, which takes care of publishing

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId> <artifactId>apimgt-extensions-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - API Management Extensions Feature</name> <name>WSO2 Carbon - API Management Extensions Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

@ -22,16 +22,16 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>application-mgt-feature</artifactId> <artifactId>application-mgt-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.application.mgt.api.feature</artifactId> <artifactId>org.wso2.carbon.device.application.mgt.api.feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Application Management API Feature</name> <name>WSO2 Carbon - Application Management API Feature</name>
<url>http://wso2.org</url> <url>https://entgra.io</url>
<description>This feature contains the APIs required for Application Management console UI</description> <description>This feature contains the APIs required for Application Management console UI</description>
<build> <build>

@ -22,16 +22,16 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>application-mgt-feature</artifactId> <artifactId>application-mgt-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.application.mgt.publisher.ui.feature</artifactId> <artifactId>org.wso2.carbon.device.application.mgt.publisher.ui.feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Application Management Publisher UI Feature</name> <name>WSO2 Carbon - Application Management Publisher UI Feature</name>
<url>http://wso2.org</url> <url>https://entgra.io</url>
<description>This feature contains Application Management publisher UI</description> <description>This feature contains Application Management publisher UI</description>
<build> <build>
<plugins> <plugins>

@ -22,17 +22,17 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>application-mgt-feature</artifactId> <artifactId>application-mgt-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.application.mgt.server.feature</artifactId> <artifactId>org.wso2.carbon.device.application.mgt.server.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<name>WSO2 Carbon - Application Management Server Feature</name> <name>WSO2 Carbon - Application Management Server Feature</name>
<url>http://wso2.org</url> <url>https://entgra.io</url>
<description>This feature contains the core bundles required for Back-end Application Management functionality <description>This feature contains the core bundles required for Back-end Application Management functionality
</description> </description>

@ -23,15 +23,16 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>application-mgt-feature</artifactId> <artifactId>application-mgt-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.application.mgt.store.ui.feature</artifactId> <artifactId>org.wso2.carbon.device.application.mgt.store.ui.feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Application Management Store UI Feature</name> <name>WSO2 Carbon - Application Management Store UI Feature</name>
<url>http://wso2.org</url> <url>https://entgra.io</url>
<description>This feature contains Application Management Store UI</description> <description>This feature contains Application Management Store UI</description>
<build> <build>

@ -22,16 +22,16 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>application-mgt-feature</artifactId> <artifactId>application-mgt-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Application Management Feature</name> <name>WSO2 Carbon - Application Management Feature</name>
<url>http://wso2.org</url> <url>https://entgra.io</url>
<modules> <modules>
<module>org.wso2.carbon.device.application.mgt.api.feature</module> <module>org.wso2.carbon.device.application.mgt.api.feature</module>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt-feature</artifactId> <artifactId>certificate-mgt-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt-feature</artifactId> <artifactId>certificate-mgt-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt-feature</artifactId> <artifactId>certificate-mgt-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.certificate.mgt.server.feature</artifactId> <artifactId>org.wso2.carbon.certificate.mgt.server.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<name>WSO2 Carbon - Certificate Management Server Feature</name> <name>WSO2 Carbon - Certificate Management Server Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains the core bundles required for back-end Certificate Management functionality <description>This feature contains the core bundles required for back-end Certificate Management functionality

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt-feature</artifactId> <artifactId>certificate-mgt-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Certificate Management Feature</name> <name>WSO2 Carbon - Certificate Management Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId> <artifactId>device-mgt-extensions-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<name>WSO2 Carbon - Device Type Deployer Feature</name> <name>WSO2 Carbon - Device Type Deployer Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>WSO2 Carbon - Device Type Deployer Feature</description> <description>WSO2 Carbon - Device Type Deployer Feature</description>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId> <artifactId>device-mgt-extensions-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<name>WSO2 Carbon - FCM Based Push Notification Provider Feature</name> <name>WSO2 Carbon - FCM Based Push Notification Provider Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description> <description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId> <artifactId>device-mgt-extensions-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<name>WSO2 Carbon - MQTT Based Push Notification Provider Feature</name> <name>WSO2 Carbon - MQTT Based Push Notification Provider Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description> <description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description>

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId> <artifactId>device-mgt-extensions-feature</artifactId>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.2.9-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<name>WSO2 Carbon - MQTT Based Push Notification Provider Feature</name> <name>WSO2 Carbon - MQTT Based Push Notification Provider Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description> <description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save