diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/pom.xml b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/pom.xml
index 564673ef8b..9d4d76223d 100644
--- a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/pom.xml
+++ b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
grafana-mgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.common/pom.xml b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.common/pom.xml
index 1ba9a75dd3..402e68a706 100644
--- a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.common/pom.xml
+++ b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.common/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
grafana-mgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.core/pom.xml b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.core/pom.xml
index 56aacfa64d..a66ba64fff 100644
--- a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.core/pom.xml
+++ b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.core/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
grafana-mgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/analytics-mgt/grafana-mgt/pom.xml b/components/analytics-mgt/grafana-mgt/pom.xml
index e48aeca1f7..92bc7f1721 100644
--- a/components/analytics-mgt/grafana-mgt/pom.xml
+++ b/components/analytics-mgt/grafana-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
analytics-mgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/analytics-mgt/pom.xml b/components/analytics-mgt/pom.xml
index ded09a6876..533b60c989 100644
--- a/components/analytics-mgt/pom.xml
+++ b/components/analytics-mgt/pom.xml
@@ -3,7 +3,7 @@
carbon-devicemgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml
index 0918920bdc..e9137ae00a 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml
@@ -22,7 +22,7 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml
index a064c551c1..2e7f50e997 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml
@@ -21,7 +21,7 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml
index 9ebf10c38f..1c29c246e5 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml
@@ -22,7 +22,7 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java
index 4ef90936b2..41ee18da8a 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java
@@ -256,10 +256,14 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
keyManagerId = keyManagerConfigurationDTO.getUuid();
}
}
+ String applicationAccessTokenExpiryTime = "N/A";
+ if (!StringUtils.isEmpty(validityTime)) {
+ applicationAccessTokenExpiryTime = validityTime;
+ }
String jsonString = "{\"grant_types\":\"refresh_token,access_token," +
"urn:ietf:params:oauth:grant-type:saml2-bearer," +
"password,client_credentials,iwa:ntlm,urn:ietf:params:oauth:grant-type:jwt-bearer\"," +
- "\"additionalProperties\":\"{\\\"application_access_token_expiry_time\\\":\\\"N\\/A\\\"," +
+ "\"additionalProperties\":\"{\\\"application_access_token_expiry_time\\\":\\\"" + applicationAccessTokenExpiryTime + "\\\"," +
"\\\"user_access_token_expiry_time\\\":\\\"N\\/A\\\"," +
"\\\"refresh_token_expiry_time\\\":\\\"N\\/A\\\"," +
"\\\"id_token_expiry_time\\\":\\\"N\\/A\\\"}\"," +
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/pom.xml
index 95be718e7a..dd957864f2 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/pom.xml
@@ -3,7 +3,7 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
4.0.0
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/DCRRequest.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/DCRRequest.java
index 5054e2220d..7d45e71ef6 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/DCRRequest.java
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/DCRRequest.java
@@ -40,6 +40,9 @@ public class DCRRequest {
@XmlElement
private boolean isSaasApp;
+ @XmlElement
+ private int validityPeriod;
+
public String getApplicationName() {
return applicationName;
}
@@ -87,4 +90,12 @@ public class DCRRequest {
public void setIsSaasApp(boolean saasApp) {
isSaasApp = saasApp;
}
+
+ public int getValidityPeriod() {
+ return validityPeriod;
+ }
+
+ public void setValidityPeriod(int validityPeriod) {
+ this.validityPeriod = validityPeriod;
+ }
}
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/KeyManagerService.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/KeyManagerService.java
index dfd6af295a..3775d6d9f1 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/KeyManagerService.java
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/KeyManagerService.java
@@ -46,5 +46,6 @@ public interface KeyManagerService {
@FormParam("assertion") String assertion,
@FormParam("admin_access_token") String admin_access_token,
@FormParam("username") String username,
- @FormParam("password") String password);
+ @FormParam("password") String password,
+ @FormParam("validityPeriod") int validityPeriod);
}
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/KeyManagerServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/KeyManagerServiceImpl.java
index 961951f865..59d93912b0 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/KeyManagerServiceImpl.java
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/KeyManagerServiceImpl.java
@@ -51,7 +51,7 @@ public class KeyManagerServiceImpl implements KeyManagerService {
try {
KeyMgtService keyMgtService = new KeyMgtServiceImpl();
DCRResponse resp = keyMgtService.dynamicClientRegistration(dcrRequest.getApplicationName(), dcrRequest.getUsername(),
- dcrRequest.getGrantTypes(), dcrRequest.getCallBackUrl(), dcrRequest.getTags(), dcrRequest.getIsSaasApp());
+ dcrRequest.getGrantTypes(), dcrRequest.getCallBackUrl(), dcrRequest.getTags(), dcrRequest.getIsSaasApp(), dcrRequest.getValidityPeriod());
return Response.status(Response.Status.CREATED).entity(gson.toJson(resp)).build();
} catch (KeyMgtException e) {
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build();
@@ -69,7 +69,8 @@ public class KeyManagerServiceImpl implements KeyManagerService {
@FormParam("assertion") String assertion,
@FormParam("admin_access_token") String admin_access_token,
@FormParam("username") String username,
- @FormParam("password") String password) {
+ @FormParam("password") String password,
+ @FormParam("validityPeriod") int validityPeriod) {
try {
if (basicAuthHeader == null) {
String msg = "Invalid credentials. Make sure your API call is invoked with a Basic Authorization header.";
@@ -80,7 +81,7 @@ public class KeyManagerServiceImpl implements KeyManagerService {
TokenResponse resp = keyMgtService.generateAccessToken(
new TokenRequest(encodedClientCredentials.split(":")[0],
encodedClientCredentials.split(":")[1], refreshToken, scope,
- grantType, assertion, admin_access_token, username, password));
+ grantType, assertion, admin_access_token, username, password, validityPeriod));
return Response.status(Response.Status.OK).entity(gson.toJson(resp)).build();
} catch (KeyMgtException e) {
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build();
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension/pom.xml
index 6c7db5b264..4379709bef 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension/pom.xml
@@ -3,7 +3,7 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/TokenRequest.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/TokenRequest.java
index 860b267161..6bddd30d0b 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/TokenRequest.java
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/TokenRequest.java
@@ -29,8 +29,10 @@ public class TokenRequest {
private String username;
private String password;
+ private int validityPeriod;
+
public TokenRequest(String clientId, String clientSecret, String refreshToken, String scope, String grantType,
- String assertion, String admin_access_token, String username, String password) {
+ String assertion, String admin_access_token, String username, String password, int validityPeriod) {
this.clientId = clientId;
this.clientSecret = clientSecret;
this.refreshToken = refreshToken;
@@ -40,6 +42,7 @@ public class TokenRequest {
this.admin_access_token = admin_access_token;
this.username = username;
this.password = password;
+ this.validityPeriod = validityPeriod;
}
public String getClientId() {
@@ -113,4 +116,12 @@ public class TokenRequest {
public void setPassword(String password) {
this.password = password;
}
+
+ public int getValidityPeriod() {
+ return validityPeriod;
+ }
+
+ public void setValidityPeriod(int validityPeriod) {
+ this.validityPeriod = validityPeriod;
+ }
}
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/service/KeyMgtService.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/service/KeyMgtService.java
index a9aa2d346a..4e185d2f4d 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/service/KeyMgtService.java
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/service/KeyMgtService.java
@@ -39,7 +39,7 @@ public interface KeyMgtService {
* @throws KeyMgtException if any error occurs during DCR process
*/
DCRResponse dynamicClientRegistration(String clientName, String owner, String grantTypes, String callBackUrl,
- String[] tags, boolean isSaasApp) throws KeyMgtException;
+ String[] tags, boolean isSaasApp, int validityPeriod) throws KeyMgtException;
/***
* This method will handle the access token requests
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/service/KeyMgtServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/service/KeyMgtServiceImpl.java
index 4640fc9a57..1a564e1246 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/service/KeyMgtServiceImpl.java
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/service/KeyMgtServiceImpl.java
@@ -77,7 +77,7 @@ public class KeyMgtServiceImpl implements KeyMgtService {
String subTenantUserUsername, subTenantUserPassword, keyManagerName, msg = null;
public DCRResponse dynamicClientRegistration(String clientName, String owner, String grantTypes, String callBackUrl,
- String[] tags, boolean isSaasApp) throws KeyMgtException {
+ String[] tags, boolean isSaasApp, int validityPeriod) throws KeyMgtException {
if (owner == null) {
PrivilegedCarbonContext threadLocalCarbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
@@ -105,13 +105,13 @@ public class KeyMgtServiceImpl implements KeyMgtService {
kmConfig = getKeyManagerConfig();
if (KeyMgtConstants.SUPER_TENANT.equals(tenantDomain)) {
- OAuthApplication dcrApplication = createOauthApplication(clientName, kmConfig.getAdminUsername(), tags);
+ OAuthApplication dcrApplication = createOauthApplication(clientName, kmConfig.getAdminUsername(), tags, validityPeriod);
return new DCRResponse(dcrApplication.getClientId(), dcrApplication.getClientSecret());
} else {
// super-tenant admin dcr and token generation
OAuthApplication superTenantOauthApp = createOauthApplication(
KeyMgtConstants.RESERVED_OAUTH_APP_NAME_PREFIX + KeyMgtConstants.SUPER_TENANT,
- kmConfig.getAdminUsername(), null);
+ kmConfig.getAdminUsername(), null, validityPeriod);
String superAdminAccessToken = createAccessToken(superTenantOauthApp);
// create new key manager for the tenant, under super-tenant space
@@ -133,7 +133,7 @@ public class KeyMgtServiceImpl implements KeyMgtService {
createUserIfNotExists(subTenantUserUsername, subTenantUserPassword);
// DCR for the requesting user
- OAuthApplication dcrApplication = createOauthApplication(clientName, owner, tags);
+ OAuthApplication dcrApplication = createOauthApplication(clientName, owner, tags, validityPeriod);
String requestingUserAccessToken = createAccessToken(dcrApplication);
// get application id
@@ -167,7 +167,8 @@ public class KeyMgtServiceImpl implements KeyMgtService {
case "client_credentials":
appTokenPayload = new FormBody.Builder()
.add("grant_type", "client_credentials")
- .add("scope", tokenRequest.getScope()).build();
+ .add("scope", tokenRequest.getScope())
+ .add("validityPeriod", String.valueOf(tokenRequest.getValidityPeriod())).build();
break;
case "password":
appTokenPayload = new FormBody.Builder()
@@ -322,8 +323,8 @@ public class KeyMgtServiceImpl implements KeyMgtService {
* @return @{@link OAuthApplication} OAuth application object
* @throws KeyMgtException if any error occurs while creating response object
*/
- private OAuthApplication createOauthApplication (String clientName, String owner, String[] tags) throws KeyMgtException {
- String oauthAppCreationPayloadStr = createOauthAppCreationPayload(clientName, owner, tags);
+ private OAuthApplication createOauthApplication (String clientName, String owner, String[] tags, int validityPeriod) throws KeyMgtException {
+ String oauthAppCreationPayloadStr = createOauthAppCreationPayload(clientName, owner, tags, validityPeriod);
RequestBody oauthAppCreationPayload = RequestBody.Companion.create(oauthAppCreationPayloadStr, JSON);
kmConfig = getKeyManagerConfig();
String dcrEndpoint = kmConfig.getServerUrl() + KeyMgtConstants.DCR_ENDPOINT;
@@ -442,11 +443,12 @@ public class KeyMgtServiceImpl implements KeyMgtService {
}
}
- private String createOauthAppCreationPayload(String clientName, String owner, String[] tags) {
+ private String createOauthAppCreationPayload(String clientName, String owner, String[] tags, int validityPeriod) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("applicationName", clientName);
jsonObject.put("username", owner);
jsonObject.put("tags", tags);
+ jsonObject.put("validityPeriod", validityPeriod);
return jsonObject.toString();
}
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml
index 81aea0503d..1e9e44a4a5 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml
@@ -22,7 +22,7 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/apimgt-extensions/pom.xml b/components/apimgt-extensions/pom.xml
index a2c8ece854..ba99795a04 100644
--- a/components/apimgt-extensions/pom.xml
+++ b/components/apimgt-extensions/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/components/application-mgt/io.entgra.application.mgt.addons/pom.xml b/components/application-mgt/io.entgra.application.mgt.addons/pom.xml
index a67eb8592f..66df7e582b 100644
--- a/components/application-mgt/io.entgra.application.mgt.addons/pom.xml
+++ b/components/application-mgt/io.entgra.application.mgt.addons/pom.xml
@@ -20,7 +20,7 @@
application-mgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/application-mgt/io.entgra.application.mgt.api/pom.xml b/components/application-mgt/io.entgra.application.mgt.api/pom.xml
index 4f42850568..f869b39c73 100644
--- a/components/application-mgt/io.entgra.application.mgt.api/pom.xml
+++ b/components/application-mgt/io.entgra.application.mgt.api/pom.xml
@@ -22,7 +22,7 @@
application-mgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/application-mgt/io.entgra.application.mgt.common/pom.xml b/components/application-mgt/io.entgra.application.mgt.common/pom.xml
index 2e058b82dd..d753086d86 100644
--- a/components/application-mgt/io.entgra.application.mgt.common/pom.xml
+++ b/components/application-mgt/io.entgra.application.mgt.common/pom.xml
@@ -21,7 +21,7 @@
org.wso2.carbon.devicemgt
application-mgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/application-mgt/io.entgra.application.mgt.core/pom.xml b/components/application-mgt/io.entgra.application.mgt.core/pom.xml
index e93b704269..ec9127ea06 100644
--- a/components/application-mgt/io.entgra.application.mgt.core/pom.xml
+++ b/components/application-mgt/io.entgra.application.mgt.core/pom.xml
@@ -21,7 +21,7 @@
org.wso2.carbon.devicemgt
application-mgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/pom.xml b/components/application-mgt/io.entgra.application.mgt.publisher.api/pom.xml
index adddc4026a..80e1bd83ea 100644
--- a/components/application-mgt/io.entgra.application.mgt.publisher.api/pom.xml
+++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/pom.xml
@@ -22,7 +22,7 @@
application-mgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/application-mgt/io.entgra.application.mgt.store.api/pom.xml b/components/application-mgt/io.entgra.application.mgt.store.api/pom.xml
index ff4e816abc..760accf4ba 100644
--- a/components/application-mgt/io.entgra.application.mgt.store.api/pom.xml
+++ b/components/application-mgt/io.entgra.application.mgt.store.api/pom.xml
@@ -22,7 +22,7 @@
application-mgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/application-mgt/pom.xml b/components/application-mgt/pom.xml
index dfb1d48017..9ac074925c 100644
--- a/components/application-mgt/pom.xml
+++ b/components/application-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml
index f70a1fa72c..36b4e164f1 100644
--- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml
+++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml
@@ -22,7 +22,7 @@
certificate-mgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml
index a5a16ab3c6..ee2ac87f57 100644
--- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml
+++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml
@@ -22,7 +22,7 @@
certificate-mgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml
index fdd5660b81..dbd94e3b22 100644
--- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml
+++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml
@@ -38,7 +38,7 @@
org.wso2.carbon.devicemgt
certificate-mgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/certificate-mgt/pom.xml b/components/certificate-mgt/pom.xml
index 99af2f9561..1bd757ac9b 100644
--- a/components/certificate-mgt/pom.xml
+++ b/components/certificate-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.extensions.defaultrole.manager/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.extensions.defaultrole.manager/pom.xml
index e36b58f55e..5ede05302d 100644
--- a/components/device-mgt-extensions/io.entgra.device.mgt.extensions.defaultrole.manager/pom.xml
+++ b/components/device-mgt-extensions/io.entgra.device.mgt.extensions.defaultrole.manager/pom.xml
@@ -23,7 +23,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.extensions.logger/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.extensions.logger/pom.xml
index 475c8b4e6e..37dcc4ec1b 100644
--- a/components/device-mgt-extensions/io.entgra.device.mgt.extensions.logger/pom.xml
+++ b/components/device-mgt-extensions/io.entgra.device.mgt.extensions.logger/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.extensions.stateengine/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.extensions.stateengine/pom.xml
index 229e8d6e3e..ef88e49a2a 100644
--- a/components/device-mgt-extensions/io.entgra.device.mgt.extensions.stateengine/pom.xml
+++ b/components/device-mgt-extensions/io.entgra.device.mgt.extensions.stateengine/pom.xml
@@ -23,7 +23,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml
index 9a11f603e7..1641e9e38d 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml
index 7625a603b3..b35311d91b 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml
index ec894c7900..9cb045b700 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml
index 2e107b2543..cab4f2afbe 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml
index 1cde061ac1..9536f5e514 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml
index 3fdd250307..354033a4c3 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/pom.xml b/components/device-mgt-extensions/pom.xml
index d141f2ff6f..250815e9ba 100644
--- a/components/device-mgt-extensions/pom.xml
+++ b/components/device-mgt-extensions/pom.xml
@@ -22,7 +22,7 @@
carbon-devicemgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml
index 2c0ea76ceb..4888ed0155 100644
--- a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml
+++ b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml
@@ -22,7 +22,7 @@
device-mgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml
index aca43d379e..f43128fc6c 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml
@@ -22,7 +22,7 @@
device-mgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
@@ -425,5 +425,30 @@
io.entgra.application.mgt.core
provided
+
+ org.wso2.carbon.devicemgt
+ org.wso2.carbon.apimgt.keymgt.extension
+ provided
+
+
+ org.wso2.carbon.analytics-common
+ org.wso2.carbon.event.stream.core
+ provided
+
+
+ org.wso2.carbon.analytics-common
+ org.wso2.carbon.event.receiver.core
+ provided
+
+
+ org.wso2.carbon.analytics-common
+ org.wso2.carbon.event.publisher.core
+ provided
+
+
+ org.wso2.carbon.analytics-common
+ org.wso2.carbon.event.output.adapter.rdbms
+ provided
+
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceConfig.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceConfig.java
new file mode 100644
index 0000000000..158153fd91
--- /dev/null
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceConfig.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2023, Entgra (Pvt) Ltd. (http://www.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;
+
+import io.swagger.annotations.ApiModel;
+import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
+
+import java.util.List;
+
+@ApiModel(value = "DeviceConfig", description = "Device config")
+public class DeviceConfig {
+ private String clientId;
+ private String clientSecret;
+ private String deviceId;
+ private String type;
+ private String accessToken;
+ private String refreshToken;
+ private String mqttGateway;
+ private String httpsGateway;
+ private String httpGateway;
+ private PlatformConfiguration platformConfiguration;
+ public String getClientId() {
+ return clientId;
+ }
+
+ public void setClientId(String clientId) {
+ this.clientId = clientId;
+ }
+
+ public String getClientSecret() {
+ return clientSecret;
+ }
+
+ public void setClientSecret(String clientSecret) {
+ this.clientSecret = clientSecret;
+ }
+
+ public String getDeviceId() {
+ return deviceId;
+ }
+
+ public void setDeviceId(String deviceId) {
+ this.deviceId = deviceId;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getAccessToken() {
+ return accessToken;
+ }
+
+ public void setAccessToken(String accessToken) {
+ this.accessToken = accessToken;
+ }
+
+ public String getRefreshToken() {
+ return refreshToken;
+ }
+
+ public void setRefreshToken(String refreshToken) {
+ this.refreshToken = refreshToken;
+ }
+
+ public String getMqttGateway() {
+ return mqttGateway;
+ }
+
+ public void setMqttGateway(String mqttGateway) {
+ this.mqttGateway = mqttGateway;
+ }
+
+ public String getHttpsGateway() {
+ return httpsGateway;
+ }
+
+ public void setHttpsGateway(String httpsGateway) {
+ this.httpsGateway = httpsGateway;
+ }
+
+ public String getHttpGateway() {
+ return httpGateway;
+ }
+
+ public void setHttpGateway(String httpGateway) {
+ this.httpGateway = httpGateway;
+ }
+
+ public PlatformConfiguration getPlatformConfiguration() {
+ return platformConfiguration;
+ }
+
+ public void setPlatformConfiguration(PlatformConfiguration platformConfiguration) {
+ this.platformConfiguration = platformConfiguration;
+ }
+}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/analytics/DeviceTypeEvent.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/analytics/DeviceTypeEvent.java
index b8e07df6d5..b5a715135e 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/analytics/DeviceTypeEvent.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/analytics/DeviceTypeEvent.java
@@ -20,14 +20,18 @@ package org.wso2.carbon.device.mgt.jaxrs.beans.analytics;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
+import java.util.List;
+
/**
* This hold stats data record
*/
public class DeviceTypeEvent {
+ private String eventName;
private EventAttributeList eventAttributes;
private TransportType transport;
+ private String eventTopicStructure;
@ApiModelProperty(value = "Attributes related to device type event")
@JsonProperty("eventAttributes")
public EventAttributeList getEventAttributeList() {
@@ -48,5 +52,25 @@ public class DeviceTypeEvent {
public void setTransportType(TransportType transport) {
this.transport = transport;
}
+
+ @ApiModelProperty(value = "event topic structure")
+ @JsonProperty("eventTopicStructure")
+ public String getEventTopicStructure() {
+ return eventTopicStructure;
+ }
+
+ public void setEventTopicStructure(String eventTopicStructure) {
+ this.eventTopicStructure = eventTopicStructure;
+ }
+
+ @ApiModelProperty(value = "event topic name")
+ @JsonProperty("eventName")
+ public String getEventName() {
+ return eventName;
+ }
+
+ public void setEventName(String eventName) {
+ this.eventName = eventName;
+ }
}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java
index 82e0cdb897..83503248fc 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java
@@ -29,6 +29,7 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import java.util.List;
@SwaggerDefinition(
info = @Info(
@@ -69,64 +70,64 @@ import javax.ws.rs.core.Response;
@Consumes(MediaType.APPLICATION_JSON)
public interface DeviceEventManagementService {
-// @POST
-// @Path("/{type}")
-// @ApiOperation(
-// produces = MediaType.APPLICATION_JSON,
-// httpMethod = "POST",
-// value = "Adding the Event Type Definition",
-// notes = "Add the event definition for a device.",
-// tags = "Device Event Management",
-// extensions = {
-// @Extension(properties = {
-// @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events")
-// })
-// }
-// )
-// @ApiResponses(
-// value = {
-// @ApiResponse(
-// code = 200,
-// message = "OK. \n Successfully added the event defintion.",
-// responseHeaders = {
-// @ResponseHeader(
-// name = "Content-Type",
-// description = "The content type of the body"),
-// @ResponseHeader(
-// name = "ETag",
-// description = "Entity Tag of the response resource.\n" +
-// "Used by caches, or in conditional requests."),
-// @ResponseHeader(
-// name = "Last-Modified",
-// description =
-// "Date and time the resource was last modified.\n" +
-// "Used by caches, or in conditional requests."),
-// }
-// ),
-// @ApiResponse(
-// code = 400,
-// message =
-// "Bad Request. \n"),
-// @ApiResponse(
-// code = 406,
-// message = "Not Acceptable.\n The requested media type is not supported"),
-// @ApiResponse(
-// code = 500,
-// message = "Internal Server Error. \n Server error occurred while fetching the " +
-// "list of supported device types.",
-// response = ErrorResponse.class)
-// }
-// )
-// Response deployDeviceTypeEventDefinition(
-// @ApiParam(name = "type", value = "The device type, such as android, ios, and windows.")
-// @PathParam("type")String deviceType,
-// @ApiParam(name = "skipPersist", value = "Is it required to persist the data or not")
-// @QueryParam("skipPersist") boolean skipPersist,
-// @ApiParam(name = "isSharedWithAllTenants", value = "Should artifacts be available to all tenants")
-// @QueryParam("isSharedWithAllTenants") boolean isSharedWithAllTenants,
-// @ApiParam(name = "deviceTypeEvent", value = "Add the data to complete the DeviceTypeEvent object.",
-// required = true)
-// @Valid DeviceTypeEvent deviceTypeEvent);
+ @POST
+ @Path("/{type}")
+ @ApiOperation(
+ produces = MediaType.APPLICATION_JSON,
+ httpMethod = "POST",
+ value = "Adding the Event Type Definition",
+ notes = "Add the event definition for a device.",
+ tags = "Device Event Management",
+ extensions = {
+ @Extension(properties = {
+ @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events")
+ })
+ }
+ )
+ @ApiResponses(
+ value = {
+ @ApiResponse(
+ code = 200,
+ message = "OK. \n Successfully added the event defintion.",
+ responseHeaders = {
+ @ResponseHeader(
+ name = "Content-Type",
+ description = "The content type of the body"),
+ @ResponseHeader(
+ name = "ETag",
+ description = "Entity Tag of the response resource.\n" +
+ "Used by caches, or in conditional requests."),
+ @ResponseHeader(
+ name = "Last-Modified",
+ description =
+ "Date and time the resource was last modified.\n" +
+ "Used by caches, or in conditional requests."),
+ }
+ ),
+ @ApiResponse(
+ code = 400,
+ message =
+ "Bad Request. \n"),
+ @ApiResponse(
+ code = 406,
+ message = "Not Acceptable.\n The requested media type is not supported"),
+ @ApiResponse(
+ code = 500,
+ message = "Internal Server Error. \n Server error occurred while fetching the " +
+ "list of supported device types.",
+ response = ErrorResponse.class)
+ }
+ )
+ Response deployDeviceTypeEventDefinition(
+ @ApiParam(name = "type", value = "The device type, such as android, ios, and windows.")
+ @PathParam("type")String deviceType,
+ @ApiParam(name = "skipPersist", value = "Is it required to persist the data or not")
+ @QueryParam("skipPersist") boolean skipPersist,
+ @ApiParam(name = "isSharedWithAllTenants", value = "Should artifacts be available to all tenants")
+ @QueryParam("isSharedWithAllTenants") boolean isSharedWithAllTenants,
+ @ApiParam(name = "deviceTypeEvents", value = "Add the data to complete the DeviceTypeEvent object.",
+ required = true)
+ @Valid List deviceTypeEvent);
@DELETE
@Path("/{type}")
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java
index 874b46db3d..66867545b2 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java
@@ -1120,6 +1120,82 @@ public interface DeviceManagementService {
@HeaderParam("If-Modified-Since")
String ifModifiedSince);
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/{type}/{id}/config")
+ @ApiOperation(
+ produces = MediaType.APPLICATION_JSON,
+ httpMethod = "GET",
+ value = "Getting the Configuration of a Device",
+ notes = "Get the configuration of a device by specifying the device type and device identifier.",
+ tags = "Device Management",
+ extensions = {
+ @Extension(properties = {
+ @ExtensionProperty(name = Constants.SCOPE, value = "perm:devices:details")
+ })
+ }
+ )
+ @ApiResponses(
+ value = {
+ @ApiResponse(
+ code = 200,
+ message = "OK. \n Successfully fetched the configuration of the device.",
+ response = DeviceInfo.class,
+ responseHeaders = {
+ @ResponseHeader(
+ name = "Content-Type",
+ description = "The content type of the body"),
+ @ResponseHeader(
+ name = "ETag",
+ description = "Entity Tag of the response resource.\n" +
+ "Used by caches, or in conditional requests."),
+ @ResponseHeader(
+ name = "Last-Modified",
+ description = "Date and time the resource was last modified.\n" +
+ "Used by caches, or in conditional requests."),
+ }),
+ @ApiResponse(
+ code = 304,
+ message = "Not Modified. Empty body because the client already has the latest version" +
+ " of the requested resource.\n"),
+ @ApiResponse(
+ code = 400,
+ message = "Bad Request. \n Invalid request or validation error.",
+ response = ErrorResponse.class),
+ @ApiResponse(
+ code = 404,
+ message = "Not Found. \n Location data for the specified device was not found.",
+ response = ErrorResponse.class),
+ @ApiResponse(
+ code = 500,
+ message = "Internal Server Error. \n " +
+ "Server error occurred while retrieving the device details.",
+ response = ErrorResponse.class)
+ })
+ Response getDeviceConfiguration(
+ @ApiParam(
+ name = "type",
+ value = "The device type name, such as ios, android, windows, or fire-alarm.",
+ required = true)
+ @PathParam("type")
+ @Size(max = 45)
+ String type,
+ @ApiParam(
+ name = "id",
+ value = "The device identifier of the device you want ot get details.",
+ required = true)
+ @PathParam("id")
+ @Size(max = 45)
+ String id,
+ @ApiParam(
+ name = "If-Modified-Since",
+ value = "Checks if the requested variant was modified, since the specified date-time. \n" +
+ "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z. \n" +
+ "Example: Mon, 05 Jan 2014 15:10:00 +0200",
+ required = false)
+ @HeaderParam("If-Modified-Since")
+ String ifModifiedSince);
+
//device rename request would looks like follows
//POST devices/type/virtual_firealarm/id/us06ww93auzp/rename
@POST
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java
index 4cba178f12..49cbdae59a 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java
@@ -1,12 +1,30 @@
package org.wso2.carbon.device.mgt.jaxrs.service.impl;
+import edu.emory.mathcs.backport.java.util.Arrays;
import org.apache.axis2.AxisFault;
import org.apache.axis2.client.Stub;
+import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.velocity.util.ArrayListWrapper;
+import org.json.JSONObject;
+import org.opensaml.xml.signature.J;
+import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminService;
+import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException;
+import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub;
+import org.wso2.carbon.analytics.stream.persistence.stub.dto.AnalyticsTable;
+import org.wso2.carbon.analytics.stream.persistence.stub.dto.AnalyticsTableRecord;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.context.PrivilegedCarbonContext;
+import org.wso2.carbon.databridge.commons.StreamDefinition;
+import org.wso2.carbon.databridge.commons.exception.MalformedStreamDefinitionException;
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
+import org.wso2.carbon.device.mgt.core.dto.DeviceType;
+import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.Attribute;
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.AttributeType;
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.DeviceTypeEvent;
@@ -15,26 +33,50 @@ import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.TransportType;
import org.wso2.carbon.device.mgt.jaxrs.service.api.DeviceEventManagementService;
import org.wso2.carbon.device.mgt.jaxrs.util.Constants;
import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils;
+import org.wso2.carbon.event.input.adapter.core.InputEventAdapterConfiguration;
+import org.wso2.carbon.event.input.adapter.core.MessageType;
+import org.wso2.carbon.event.output.adapter.core.OutputEventAdapterConfiguration;
+import org.wso2.carbon.event.output.adapter.core.OutputEventAdapterService;
+import org.wso2.carbon.event.output.adapter.rdbms.RDBMSEventAdapter;
+import org.wso2.carbon.event.output.adapter.rdbms.internal.ds.RDBMSEventAdapterServiceDS;
+import org.wso2.carbon.event.processor.manager.core.EventProcessorManagementService;
+import org.wso2.carbon.event.processor.manager.core.EventPublisherManagementService;
+import org.wso2.carbon.event.publisher.core.EventPublisherService;
+import org.wso2.carbon.event.publisher.core.config.EventPublisherConfiguration;
+import org.wso2.carbon.event.publisher.core.config.mapping.JSONOutputMapping;
+import org.wso2.carbon.event.publisher.core.config.mapping.MapOutputMapping;
+import org.wso2.carbon.event.publisher.core.exception.EventPublisherConfigurationException;
+import org.wso2.carbon.event.publisher.core.internal.ds.EventPublisherServiceDS;
import org.wso2.carbon.event.publisher.stub.EventPublisherAdminServiceCallbackHandler;
import org.wso2.carbon.event.publisher.stub.EventPublisherAdminServiceStub;
+import org.wso2.carbon.event.receiver.core.EventReceiverService;
+import org.wso2.carbon.event.receiver.core.config.EventReceiverConfiguration;
+import org.wso2.carbon.event.receiver.core.config.InputMapping;
+import org.wso2.carbon.event.receiver.core.config.mapping.JSONInputMapping;
+import org.wso2.carbon.event.receiver.core.config.mapping.WSO2EventInputMapping;
+import org.wso2.carbon.event.receiver.core.exception.EventReceiverConfigurationException;
import org.wso2.carbon.event.receiver.stub.EventReceiverAdminServiceCallbackHandler;
import org.wso2.carbon.event.receiver.stub.EventReceiverAdminServiceStub;
import org.wso2.carbon.event.receiver.stub.types.BasicInputAdapterPropertyDto;
import org.wso2.carbon.event.receiver.stub.types.EventReceiverConfigurationDto;
+import org.wso2.carbon.event.receiver.stub.types.InputAdapterConfigurationDto;
+import org.wso2.carbon.event.stream.core.EventStreamService;
+import org.wso2.carbon.event.stream.core.exception.EventStreamConfigurationException;
import org.wso2.carbon.event.stream.stub.EventStreamAdminServiceStub;
import org.wso2.carbon.event.stream.stub.types.EventStreamAttributeDto;
import org.wso2.carbon.event.stream.stub.types.EventStreamDefinitionDto;
import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException;
import org.wso2.carbon.user.api.UserStoreException;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
+import javax.validation.Valid;
+import javax.ws.rs.*;
import javax.ws.rs.core.Response;
+import java.io.IOException;
import java.rmi.RemoteException;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
@@ -173,65 +215,73 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe
/**
* Deploy Event Stream, Receiver, Publisher and Store Configuration.
*/
-// @POST
-// @Path("/{type}")
-// @Override
-// public Response deployDeviceTypeEventDefinition(@PathParam("type") String deviceType,
-// @QueryParam("skipPersist") boolean skipPersist,
-// @QueryParam("isSharedWithAllTenants") boolean isSharedWithAllTenants,
-// @Valid DeviceTypeEvent deviceTypeEvent) {
-// TransportType transportType = deviceTypeEvent.getTransportType();
-// EventAttributeList eventAttributes = deviceTypeEvent.getEventAttributeList();
-// String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
-// try {
-// if (eventAttributes == null || eventAttributes.getList() == null || eventAttributes.getList().size() == 0 ||
-// deviceType == null || transportType == null ||
-// !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) {
-// String errorMessage = "Invalid Payload";
-// log.error(errorMessage);
-// return Response.status(Response.Status.BAD_REQUEST).build();
-// }
-// String streamName = DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain);
-// String streamNameWithVersion = streamName + ":" + Constants.DEFAULT_STREAM_VERSION;
-// publishStreamDefinitons(streamName, Constants.DEFAULT_STREAM_VERSION, deviceType, eventAttributes);
-// publishEventReceivers(streamNameWithVersion, transportType, tenantDomain, isSharedWithAllTenants, deviceType);
-// if (!skipPersist) {
-// publishEventStore(streamName, Constants.DEFAULT_STREAM_VERSION, eventAttributes);
-// }
-// publishWebsocketPublisherDefinition(streamNameWithVersion, deviceType);
-// try {
-// PrivilegedCarbonContext.startTenantFlow();
-// PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(
-// MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, true);
-// if (!MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) {
-// publishStreamDefinitons(streamName, Constants.DEFAULT_STREAM_VERSION, deviceType, eventAttributes);
-// publishEventReceivers(streamNameWithVersion, transportType, tenantDomain, isSharedWithAllTenants, deviceType);
-// }
-// } finally {
-// PrivilegedCarbonContext.endTenantFlow();
-// }
-// return Response.ok().build();
-// } catch (AxisFault e) {
-// log.error("Failed to create event definitions for tenantDomain:" + tenantDomain, e);
-// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
-// } catch (RemoteException e) {
-// log.error("Failed to connect with the remote services:" + tenantDomain, e);
-// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
-// } catch (JWTClientException e) {
-// log.error("Failed to generate jwt token for tenantDomain:" + tenantDomain, e);
-// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
-// } catch (UserStoreException e) {
-// log.error("Failed to connect with the user store, tenantDomain: " + tenantDomain, e);
-// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
-// } catch (DeviceManagementException e) {
-// log.error("Failed to access device management service, tenantDomain: " + tenantDomain, e);
-// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
-// } catch (EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException e) {
-// log.error("Failed to create event store for, tenantDomain: " + tenantDomain + " deviceType" + deviceType,
-// e);
-// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
-// }
-// }
+ @POST
+ @Path("/{type}")
+ @Override
+ public Response deployDeviceTypeEventDefinition(@PathParam("type") String deviceType,
+ @QueryParam("skipPersist") boolean skipPersist,
+ @QueryParam("isSharedWithAllTenants") boolean isSharedWithAllTenants,
+ @Valid List deviceTypeEvents) {
+
+
+ String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
+ try {
+ for (DeviceTypeEvent deviceTypeEvent : deviceTypeEvents) {
+ TransportType transportType = deviceTypeEvent.getTransportType();
+ EventAttributeList eventAttributes = deviceTypeEvent.getEventAttributeList();
+ String eventName = deviceTypeEvent.getEventName();
+
+
+ if (eventAttributes == null || eventAttributes.getList() == null || eventAttributes.getList().size() == 0 ||
+ deviceType == null || transportType == null ||
+ !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) {
+ String errorMessage = "Invalid Payload";
+ log.error(errorMessage);
+ return Response.status(Response.Status.BAD_REQUEST).build();
+ }
+ String streamName = DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain, eventName);
+ publishStreamDefinitons(streamName, Constants.DEFAULT_STREAM_VERSION, eventAttributes);
+
+ String receiverName = getReceiverName(deviceType, tenantDomain, transportType, eventName);
+ publishEventReceivers(streamName, Constants.DEFAULT_STREAM_VERSION, transportType, tenantDomain,
+ isSharedWithAllTenants, deviceType, deviceTypeEvent.getEventTopicStructure(), receiverName);
+ if (!skipPersist) {
+ String rdbmsPublisherName = getPublisherName(deviceType, tenantDomain, eventName) + "_rdbms_publisher";
+ publishEventStore(streamName, Constants.DEFAULT_STREAM_VERSION, rdbmsPublisherName);
+ }
+ String wsPublisherName = getPublisherName(deviceType, tenantDomain, eventName) + "_ws_publisher";
+ publishWebsocketPublisherDefinition(streamName, Constants.DEFAULT_STREAM_VERSION, wsPublisherName);
+ try {
+ PrivilegedCarbonContext.startTenantFlow();
+ PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(
+ MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, true);
+ if (!MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) {
+ publishStreamDefinitons(streamName, Constants.DEFAULT_STREAM_VERSION, eventAttributes);
+ publishEventReceivers(streamName, Constants.DEFAULT_STREAM_VERSION, transportType, tenantDomain,
+ isSharedWithAllTenants, deviceType, deviceTypeEvent.getEventTopicStructure(), receiverName);
+ }
+ } finally {
+ PrivilegedCarbonContext.endTenantFlow();
+ }
+ }
+ return Response.ok().build();
+ } catch (DeviceManagementException e) {
+ log.error("Failed to access device management service, tenantDomain: " + tenantDomain, e);
+ return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
+ } catch (MalformedStreamDefinitionException e) {
+ log.error("Failed while creating stream definition, tenantDomain: " + tenantDomain, e);
+ return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
+ } catch (EventStreamConfigurationException e) {
+ log.error("Failed while configuring stream definition, tenantDomain: " + tenantDomain, e);
+ return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
+ } catch (EventPublisherConfigurationException e) {
+ log.error("Failed while configuring event publisher, tenantDomain: " + tenantDomain, e);
+ return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
+ } catch (EventReceiverConfigurationException e) {
+ log.error("Failed while configuring event receiver, tenantDomain: " + tenantDomain, e);
+ return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
+ }
+ }
/**
* Delete device type specific artifacts from DAS.
@@ -498,158 +548,172 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe
// return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
// }
// }
-
-
- private void publishEventReceivers(String streamNameWithVersion, TransportType transportType
- , String requestedTenantDomain, boolean isSharedWithAllTenants, String deviceType)
- throws RemoteException, UserStoreException, JWTClientException {
- EventReceiverAdminServiceStub receiverAdminServiceStub = DeviceMgtAPIUtils.getEventReceiverAdminServiceStub();
+ private void publishEventReceivers(String streamName, String version, TransportType transportType
+ , String requestedTenantDomain, boolean isSharedWithAllTenants, String deviceType,
+ String eventTopicStructure, String receiverName) throws EventReceiverConfigurationException {
+ EventReceiverService eventReceiverService = DeviceMgtAPIUtils.getEventReceiverService();
try {
- TransportType transportTypeToBeRemoved = TransportType.HTTP;
- if (transportType == TransportType.HTTP) {
- transportTypeToBeRemoved = TransportType.MQTT;
- }
- String eventRecieverNameTobeRemoved = getReceiverName(deviceType, requestedTenantDomain, transportTypeToBeRemoved);
- EventReceiverConfigurationDto eventReceiverConfigurationDto = receiverAdminServiceStub
- .getActiveEventReceiverConfiguration(eventRecieverNameTobeRemoved);
- if (eventReceiverConfigurationDto != null) {
- EventReceiverAdminServiceCallbackHandler eventReceiverAdminServiceCallbackHandler =
- new EventReceiverAdminServiceCallbackHandler() {
- };
- receiverAdminServiceStub.startundeployActiveEventReceiverConfiguration(eventRecieverNameTobeRemoved
- , eventReceiverAdminServiceCallbackHandler);
+// TransportType transportTypeToBeRemoved = TransportType.HTTP;
+// if (transportType == TransportType.HTTP) {
+// transportTypeToBeRemoved = TransportType.MQTT;
+// }
+// String eventRecieverNameTobeRemoved = getReceiverName(deviceType, requestedTenantDomain, transportTypeToBeRemoved);
+ EventReceiverConfiguration eventReceiverConfiguration =
+ eventReceiverService.getActiveEventReceiverConfiguration(receiverName);
+ if (eventReceiverConfiguration != null) {
+ eventReceiverService.undeployActiveEventReceiverConfiguration(receiverName);
}
- String adapterType = OAUTH_MQTT_ADAPTER_TYPE;
- BasicInputAdapterPropertyDto basicInputAdapterPropertyDtos[];
+ InputEventAdapterConfiguration inputEventAdapterConfiguration = new InputEventAdapterConfiguration();
+ Map propertyMap = new HashMap<>();
if (transportType == TransportType.MQTT) {
- basicInputAdapterPropertyDtos = new BasicInputAdapterPropertyDto[3];
+ inputEventAdapterConfiguration.setType(OAUTH_MQTT_ADAPTER_TYPE);
String topic;
- if (isSharedWithAllTenants) {
- topic = "+/" + deviceType + "/+/events";
+ if (!StringUtils.isEmpty(eventTopicStructure)) {
+ if (isSharedWithAllTenants) {
+ topic = eventTopicStructure.replace("${deviceId}", "+")
+ .replace("${deviceType}", deviceType)
+ .replace("${tenantDomain}", "+");
+ } else {
+ topic = eventTopicStructure.replace("${deviceId}", "+")
+ .replace("${deviceType}", deviceType)
+ .replace("${tenantDomain}", requestedTenantDomain);
+ }
} else {
- topic = requestedTenantDomain + "/" + deviceType + "/+/events";
+ if (isSharedWithAllTenants) {
+ topic = "+/" + deviceType + "/+/events";
+ } else {
+ topic = requestedTenantDomain + "/" + deviceType + "/+/events";
+ }
}
- basicInputAdapterPropertyDtos[0] = getBasicInputAdapterPropertyDto("topic", topic);
- basicInputAdapterPropertyDtos[1] = getBasicInputAdapterPropertyDto(MQTT_CONTENT_TRANSFORMER_TYPE
- , MQTT_CONTENT_TRANSFORMER);
- basicInputAdapterPropertyDtos[2] = getBasicInputAdapterPropertyDto(MQTT_CONTENT_VALIDATOR_TYPE
- , MQTT_CONTENT_VALIDATOR);
+ propertyMap.put("topic", topic);
+ propertyMap.put(MQTT_CONTENT_TRANSFORMER_TYPE, MQTT_CONTENT_TRANSFORMER);
+ propertyMap.put(MQTT_CONTENT_VALIDATOR_TYPE, MQTT_CONTENT_VALIDATOR);
} else {
- adapterType = THRIFT_ADAPTER_TYPE;
- basicInputAdapterPropertyDtos = new BasicInputAdapterPropertyDto[1];
- basicInputAdapterPropertyDtos[0] = getBasicInputAdapterPropertyDto("events.duplicated.in.cluster", "false");
+ inputEventAdapterConfiguration.setType(THRIFT_ADAPTER_TYPE);
+ propertyMap.put("events.duplicated.in.cluster", "false");
}
- String eventRecieverName = getReceiverName(deviceType, requestedTenantDomain, transportType);
- if (receiverAdminServiceStub.getActiveEventReceiverConfiguration(eventRecieverName) == null) {
+ inputEventAdapterConfiguration.setProperties(propertyMap);
+
+ if (eventReceiverService.getActiveEventReceiverConfiguration(receiverName) == null) {
+ EventReceiverConfiguration configuration = new EventReceiverConfiguration();
+ configuration.setEventReceiverName(receiverName);
+ configuration.setToStreamName(streamName);
+ configuration.setToStreamVersion(version);
+ configuration.setFromAdapterConfiguration(inputEventAdapterConfiguration);
if (transportType == TransportType.MQTT) {
- receiverAdminServiceStub.deployJsonEventReceiverConfiguration(eventRecieverName, streamNameWithVersion
- , adapterType, null, basicInputAdapterPropertyDtos, false);
+ JSONInputMapping jsonInputMapping = new JSONInputMapping();
+ jsonInputMapping.setCustomMappingEnabled(false);
+ configuration.setInputMapping(jsonInputMapping);
+ eventReceiverService.deployEventReceiverConfiguration(configuration);
} else {
- receiverAdminServiceStub.deployWso2EventReceiverConfiguration(eventRecieverName, streamNameWithVersion
- , adapterType, null, null, null, basicInputAdapterPropertyDtos, false, null);
+ WSO2EventInputMapping wso2EventInputMapping = new WSO2EventInputMapping();
+ wso2EventInputMapping.setCustomMappingEnabled(false);
+ configuration.setInputMapping(wso2EventInputMapping);
+ eventReceiverService.deployEventReceiverConfiguration(configuration);
}
}
- } finally {
- cleanup(receiverAdminServiceStub);
+ } catch (EventReceiverConfigurationException e) {
+ log.error("Error while publishing event receiver" , e);
+ throw new EventReceiverConfigurationException(e);
}
+
}
- private void publishStreamDefinitons(String streamName, String version, String deviceType
- , EventAttributeList eventAttributes)
- throws RemoteException, UserStoreException, JWTClientException {
- EventStreamAdminServiceStub eventStreamAdminServiceStub = DeviceMgtAPIUtils.getEventStreamAdminServiceStub();
+ private void publishStreamDefinitons(String streamName, String version, EventAttributeList eventAttributes)
+ throws MalformedStreamDefinitionException, EventStreamConfigurationException {
+ EventStreamService eventStreamService = DeviceMgtAPIUtils.getEventStreamService();
+
try {
- EventStreamDefinitionDto eventStreamDefinitionDto = new EventStreamDefinitionDto();
- eventStreamDefinitionDto.setName(streamName);
- eventStreamDefinitionDto.setVersion(version);
- EventStreamAttributeDto eventStreamAttributeDtos[] =
- new EventStreamAttributeDto[eventAttributes.getList().size()];
- EventStreamAttributeDto metaStreamAttributeDtos[] =
- new EventStreamAttributeDto[1];
- int i = 0;
+ StreamDefinition streamDefinition = new StreamDefinition(streamName, version);
+
+ List payloadDataAttributes = new ArrayList<>();
for (Attribute attribute : eventAttributes.getList()) {
- EventStreamAttributeDto eventStreamAttributeDto = new EventStreamAttributeDto();
- eventStreamAttributeDto.setAttributeName(attribute.getName());
- eventStreamAttributeDto.setAttributeType(attribute.getType().toString());
- eventStreamAttributeDtos[i] = eventStreamAttributeDto;
- i++;
+ payloadDataAttributes.add(new org.wso2.carbon.databridge.commons.Attribute(attribute.getName(),
+ org.wso2.carbon.databridge.commons.AttributeType.valueOf(attribute.getType().name())));
}
+ streamDefinition.setPayloadData(payloadDataAttributes);
+
+ List metaDataAttributes = new ArrayList<>();
+ metaDataAttributes.add(new org.wso2.carbon.databridge.commons.Attribute(DEFAULT_DEVICE_ID_ATTRIBUTE,
+ org.wso2.carbon.databridge.commons.AttributeType.STRING));
+ streamDefinition.setMetaData(metaDataAttributes);
- EventStreamAttributeDto eventStreamAttributeDto = new EventStreamAttributeDto();
- eventStreamAttributeDto.setAttributeName(DEFAULT_DEVICE_ID_ATTRIBUTE);
- eventStreamAttributeDto.setAttributeType(AttributeType.STRING.toString());
- metaStreamAttributeDtos[0] = eventStreamAttributeDto;
- eventStreamDefinitionDto.setPayloadData(eventStreamAttributeDtos);
- eventStreamDefinitionDto.setMetaData(metaStreamAttributeDtos);
- String streamId = streamName + ":" + version;
- if (eventStreamAdminServiceStub.getStreamDefinitionDto(streamId) != null) {
- eventStreamAdminServiceStub.editEventStreamDefinitionAsDto(eventStreamDefinitionDto, streamId);
+ if (eventStreamService.getStreamDefinition(streamDefinition.getStreamId()) != null) {
+ eventStreamService.removeEventStreamDefinition(streamName, version);
+ eventStreamService.addEventStreamDefinition(streamDefinition);
} else {
- eventStreamAdminServiceStub.addEventStreamDefinitionAsDto(eventStreamDefinitionDto);
+ eventStreamService.addEventStreamDefinition(streamDefinition);
}
- } finally {
- cleanup(eventStreamAdminServiceStub);
+
+ } catch (MalformedStreamDefinitionException e) {
+ log.error("Error while initializing stream definition " , e);
+ throw new MalformedStreamDefinitionException(e);
+ } catch (EventStreamConfigurationException e) {
+ log.error("Error while configuring stream definition " , e);
+ throw new EventStreamConfigurationException(e);
}
}
+ /*
-// private void publishEventStore(String streamName, String version, EventAttributeList eventAttributes)
-// throws RemoteException, UserStoreException, JWTClientException,
-// EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException {
-// EventStreamPersistenceAdminServiceStub eventStreamPersistenceAdminServiceStub =
-// DeviceMgtAPIUtils.getEventStreamPersistenceAdminServiceStub();
-// try {
-// AnalyticsTable analyticsTable = new AnalyticsTable();
-// analyticsTable.setRecordStoreName(DEFAULT_EVENT_STORE_NAME);
-// analyticsTable.setStreamVersion(version);
-// analyticsTable.setTableName(streamName);
-// analyticsTable.setMergeSchema(false);
-// analyticsTable.setPersist(true);
-// AnalyticsTableRecord analyticsTableRecords[] = new AnalyticsTableRecord[eventAttributes.getList().size() + 1];
-// int i = 0;
-// for (Attribute attribute : eventAttributes.getList()) {
-// AnalyticsTableRecord analyticsTableRecord = new AnalyticsTableRecord();
-// analyticsTableRecord.setColumnName(attribute.getName());
-// analyticsTableRecord.setColumnType(attribute.getType().toString().toUpperCase());
-// analyticsTableRecord.setFacet(false);
-// analyticsTableRecord.setIndexed(false);
-// analyticsTableRecord.setPersist(true);
-// analyticsTableRecord.setPrimaryKey(false);
-// analyticsTableRecord.setScoreParam(false);
-// analyticsTableRecords[i] = analyticsTableRecord;
-// i++;
-// }
-// AnalyticsTableRecord analyticsTableRecord = new AnalyticsTableRecord();
-// analyticsTableRecord.setColumnName(DEFAULT_META_DEVICE_ID_ATTRIBUTE);
-// analyticsTableRecord.setColumnType(AttributeType.STRING.toString().toUpperCase());
-// analyticsTableRecord.setFacet(false);
-// analyticsTableRecord.setIndexed(true);
-// analyticsTableRecord.setPersist(true);
-// analyticsTableRecord.setPrimaryKey(false);
-// analyticsTableRecord.setScoreParam(false);
-// analyticsTableRecords[i] = analyticsTableRecord;
-// analyticsTable.setAnalyticsTableRecords(analyticsTableRecords);
-// eventStreamPersistenceAdminServiceStub.addAnalyticsTable(analyticsTable);
-// } finally {
-// cleanup(eventStreamPersistenceAdminServiceStub);
-// }
-// }
+ */
+
+ private void publishEventStore(String streamName, String version, String publisherName)
+ throws EventPublisherConfigurationException {
+
+ EventPublisherService eventPublisherService = DeviceMgtAPIUtils.getEventPublisherService();
- private void publishWebsocketPublisherDefinition(String streamNameWithVersion, String deviceType)
- throws RemoteException, UserStoreException, JWTClientException {
- EventPublisherAdminServiceStub eventPublisherAdminServiceStub = DeviceMgtAPIUtils
- .getEventPublisherAdminServiceStub();
try {
- String eventPublisherName = deviceType.trim().replace(" ", "_") + "_websocket_publisher";
- if (eventPublisherAdminServiceStub.getActiveEventPublisherConfiguration(eventPublisherName) == null) {
- eventPublisherAdminServiceStub.deployJsonEventPublisherConfiguration(eventPublisherName
- , streamNameWithVersion, DEFAULT_WEBSOCKET_PUBLISHER_ADAPTER_TYPE, null, null
- , null, false);
+ if (eventPublisherService.getActiveEventPublisherConfiguration(publisherName) == null) {
+ EventPublisherConfiguration configuration = new EventPublisherConfiguration();
+ configuration.setEventPublisherName(publisherName);
+ configuration.setFromStreamName(streamName);
+ configuration.setFromStreamVersion(version);
+ MapOutputMapping mapOutputMapping = new MapOutputMapping();
+ mapOutputMapping.setCustomMappingEnabled(false);
+ configuration.setOutputMapping(mapOutputMapping);
+ OutputEventAdapterConfiguration outputEventAdapterConfiguration = new OutputEventAdapterConfiguration();
+ outputEventAdapterConfiguration.setType("rdbms");
+ Map staticProperties = new HashMap<>();
+ staticProperties.put("datasource.name", "EVENT_DB");
+ staticProperties.put("execution.mode", "insert");
+ staticProperties.put("table.name", "table_" + publisherName.replace(".", ""));
+ outputEventAdapterConfiguration.setStaticProperties(staticProperties);
+ configuration.setProcessEnabled(true);
+ configuration.setToAdapterConfiguration(outputEventAdapterConfiguration);
+ eventPublisherService.deployEventPublisherConfiguration(configuration);
}
- } finally {
- cleanup(eventPublisherAdminServiceStub);
+
+ } catch (EventPublisherConfigurationException e) {
+ log.error("Error while publishing to rdbms store" , e);
+ throw new EventPublisherConfigurationException(e);
+ }
+ }
+
+ private void publishWebsocketPublisherDefinition(String streamName, String version, String publisherName)
+ throws EventPublisherConfigurationException {
+ EventPublisherService eventPublisherService = DeviceMgtAPIUtils.getEventPublisherService();
+
+ try {
+ if (eventPublisherService.getActiveEventPublisherConfiguration(publisherName) == null) {
+ EventPublisherConfiguration configuration = new EventPublisherConfiguration();
+ configuration.setEventPublisherName(publisherName);
+ configuration.setFromStreamName(streamName);
+ configuration.setFromStreamVersion(version);
+ JSONOutputMapping jsonOutputMapping = new JSONOutputMapping();
+ jsonOutputMapping.setCustomMappingEnabled(false);
+ configuration.setOutputMapping(jsonOutputMapping);
+ OutputEventAdapterConfiguration outputEventAdapterConfiguration = new OutputEventAdapterConfiguration();
+ outputEventAdapterConfiguration.setType("websocket-local");
+ configuration.setToAdapterConfiguration(outputEventAdapterConfiguration);
+ eventPublisherService.deployEventPublisherConfiguration(configuration);
+ }
+ } catch (EventPublisherConfigurationException e) {
+ log.error("Error while publishing to websocket-local" , e);
+ throw new EventPublisherConfigurationException(e);
}
+
}
private BasicInputAdapterPropertyDto getBasicInputAdapterPropertyDto(String key, String value) {
@@ -667,6 +731,13 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe
return deviceType.replace(" ", "_").trim() + "-" + tenantDomain + "-" + transportType.toString() + "-receiver";
}
+ private String getReceiverName(String deviceType, String tenantDomain, TransportType transportType, String eventName) {
+ return eventName + "-" + getReceiverName(deviceType, tenantDomain, transportType);
+ }
+
+ private String getPublisherName(String tenantDomain, String deviceType, String eventName) {
+ return eventName + "_" + tenantDomain.replace(".", "_") + "_" + deviceType;
+ }
private void cleanup(Stub stub) {
if (stub != null) {
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java
index 80e70aaeff..813222a1b1 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java
@@ -37,33 +37,26 @@
package org.wso2.carbon.device.mgt.jaxrs.service.impl;
import com.google.gson.Gson;
+import io.entgra.application.mgt.common.ApplicationInstallResponse;
+import io.entgra.application.mgt.common.SubscriptionType;
+import io.entgra.application.mgt.common.exception.SubscriptionManagementException;
import io.entgra.application.mgt.common.services.ApplicationManager;
+import io.entgra.application.mgt.common.services.SubscriptionManager;
+import io.entgra.application.mgt.core.util.HelperUtil;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.json.JSONException;
import org.json.JSONObject;
+import org.wso2.carbon.apimgt.keymgt.extension.DCRResponse;
+import org.wso2.carbon.apimgt.keymgt.extension.TokenRequest;
+import org.wso2.carbon.apimgt.keymgt.extension.TokenResponse;
+import org.wso2.carbon.apimgt.keymgt.extension.exception.KeyMgtException;
+import org.wso2.carbon.apimgt.keymgt.extension.service.KeyMgtService;
+import org.wso2.carbon.apimgt.keymgt.extension.service.KeyMgtServiceImpl;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
-import io.entgra.application.mgt.common.ApplicationInstallResponse;
-import io.entgra.application.mgt.common.SubscriptionType;
-import io.entgra.application.mgt.common.exception.SubscriptionManagementException;
-import io.entgra.application.mgt.common.services.SubscriptionManager;
-import io.entgra.application.mgt.core.util.HelperUtil;
-import org.wso2.carbon.device.mgt.common.DeviceFilters;
-import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
-import org.wso2.carbon.device.mgt.common.OperationLogFilters;
-import org.wso2.carbon.device.mgt.common.MDMAppConstants;
-import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
-import org.wso2.carbon.device.mgt.common.Feature;
-import org.wso2.carbon.device.mgt.common.FeatureManager;
-import org.wso2.carbon.device.mgt.common.Device;
-import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
-import org.wso2.carbon.device.mgt.common.PaginationRequest;
-import org.wso2.carbon.device.mgt.common.PaginationResult;
-import org.wso2.carbon.device.mgt.common.TrackerDeviceInfo;
-import org.wso2.carbon.device.mgt.common.TrackerPermissionInfo;
+import org.wso2.carbon.device.mgt.common.*;
import org.wso2.carbon.device.mgt.common.app.mgt.Application;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
@@ -73,12 +66,8 @@ import org.wso2.carbon.device.mgt.common.device.details.DeviceData;
import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo;
import org.wso2.carbon.device.mgt.common.device.details.DeviceLocation;
import org.wso2.carbon.device.mgt.common.device.details.DeviceLocationHistorySnapshotWrapper;
-import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
-import org.wso2.carbon.device.mgt.common.exceptions.DeviceTypeNotFoundException;
-import org.wso2.carbon.device.mgt.common.exceptions.InvalidConfigurationException;
-import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException;
import org.wso2.carbon.device.mgt.common.exceptions.BadRequestException;
-import org.wso2.carbon.device.mgt.common.exceptions.UnAuthorizedException;
+import org.wso2.carbon.device.mgt.common.exceptions.*;
import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException;
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
@@ -102,22 +91,12 @@ import org.wso2.carbon.device.mgt.core.operation.mgt.ProfileOperation;
import org.wso2.carbon.device.mgt.core.search.mgt.SearchManagerService;
import org.wso2.carbon.device.mgt.core.search.mgt.SearchMgtException;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
-import org.wso2.carbon.device.mgt.core.service.EmailMetaInfo;
import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderService;
import org.wso2.carbon.device.mgt.core.traccar.api.service.DeviceAPIClientService;
-import org.wso2.carbon.device.mgt.core.traccar.api.service.impl.DeviceAPIClientServiceImpl;
import org.wso2.carbon.device.mgt.core.traccar.common.TraccarHandlerConstants;
import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil;
import org.wso2.carbon.device.mgt.core.util.HttpReportingUtil;
-import org.wso2.carbon.device.mgt.jaxrs.beans.DeviceList;
-import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse;
-import org.wso2.carbon.device.mgt.jaxrs.beans.DeviceCompliance;
-import org.wso2.carbon.device.mgt.jaxrs.beans.ApplicationList;
-import org.wso2.carbon.device.mgt.jaxrs.beans.OperationStatusBean;
-import org.wso2.carbon.device.mgt.jaxrs.beans.ComplianceDeviceList;
-import org.wso2.carbon.device.mgt.jaxrs.beans.OperationRequest;
-import org.wso2.carbon.device.mgt.jaxrs.beans.OperationList;
-import org.wso2.carbon.device.mgt.jaxrs.beans.ApplicationUninstallation;
+import org.wso2.carbon.device.mgt.jaxrs.beans.*;
import org.wso2.carbon.device.mgt.jaxrs.service.api.DeviceManagementService;
import org.wso2.carbon.device.mgt.jaxrs.service.impl.util.InputValidationException;
import org.wso2.carbon.device.mgt.jaxrs.service.impl.util.RequestValidationUtil;
@@ -130,30 +109,17 @@ import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerSer
import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
import org.wso2.carbon.policy.mgt.core.PolicyManagerService;
import org.wso2.carbon.user.api.UserStoreException;
-import org.wso2.carbon.user.core.service.RealmService;
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
import javax.validation.Valid;
-import javax.ws.rs.Consumes;
import javax.validation.constraints.Size;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.QueryParam;
+import javax.ws.rs.*;
import javax.ws.rs.core.Response;
-import java.io.IOException;
-import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
import java.util.Date;
import java.util.List;
-import java.util.ArrayList;
import java.util.Properties;
import java.util.concurrent.ExecutionException;
@@ -910,6 +876,100 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
}
return Response.status(Response.Status.OK).entity(deviceInfo).build();
+ }
+ @GET
+ @Path("/{type}/{id}/config")
+ @Override
+ public Response getDeviceConfiguration(
+ @PathParam("type") @Size(max = 45) String type,
+ @PathParam("id") @Size(max = 45) String id,
+ @HeaderParam("If-Modified-Since") String ifModifiedSince) {
+
+ DeviceConfig deviceConfig = new DeviceConfig();
+ deviceConfig.setDeviceId(id);
+ deviceConfig.setType(type);
+
+ // find token validity time
+ DeviceManagementProviderService deviceManagementProviderService =
+ DeviceMgtAPIUtils.getDeviceManagementService();
+ int validityTime = 3600;
+ List mqttEventTopicStructure = new ArrayList<>();
+ try {
+ DeviceType deviceType = deviceManagementProviderService.getDeviceType(type);
+ if (deviceType != null) {
+ if (deviceType.getDeviceTypeMetaDefinition().isLongLivedToken()) {
+ validityTime = Integer.MAX_VALUE;
+ }
+ mqttEventTopicStructure = deviceType.getDeviceTypeMetaDefinition().getMqttEventTopicStructures();
+ } else {
+ String msg = "Device not found, device id : " + id + ", device type : " + type;
+ log.error(msg);
+ return Response.serverError().entity(
+ new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build();
+ }
+ } catch (DeviceManagementException e) {
+ String msg = "Error occurred while retrieving device, device id : " + id + ", device type : " + type;
+ log.error(msg, e);
+ return Response.serverError().entity(
+ new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build();
+ }
+
+ String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain();
+ String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
+ String applicationName = type.replace(" ", "").replace("_", "")
+ + "_" + tenantDomain;
+
+ KeyMgtService keyMgtService = new KeyMgtServiceImpl();
+ try {
+ DCRResponse dcrResponse = keyMgtService.dynamicClientRegistration(applicationName, username,
+ "client_credentials", null, new String[] {"device_management"}, false, validityTime);
+ deviceConfig.setClientId(dcrResponse.getClientId());
+ deviceConfig.setClientSecret(dcrResponse.getClientSecret());
+
+ StringBuilder scopes = new StringBuilder("device_" + type.replace(" ", "")
+ .replace("_", "") + "_" + id);
+ for (String topic : mqttEventTopicStructure) {
+ if (topic.contains("${deviceId}")) {
+ topic = topic.replace("${deviceId}", id);
+ }
+ topic = topic.replace("/",":");
+ scopes.append(" perm:topic:sub:".concat(topic));
+ scopes.append(" perm:topic:pub:".concat(topic));
+ }
+
+ TokenRequest tokenRequest = new TokenRequest(dcrResponse.getClientId(), dcrResponse.getClientSecret(),
+ null, scopes.toString(), "client_credentials", null,
+ null, null, null, validityTime);
+ TokenResponse tokenResponse = keyMgtService.generateAccessToken(tokenRequest);
+ deviceConfig.setAccessToken(tokenResponse.getAccessToken());
+ deviceConfig.setRefreshToken(tokenResponse.getRefreshToken());
+
+ try {
+ deviceConfig.setPlatformConfiguration(deviceManagementProviderService.getConfiguration(type));
+ } catch (DeviceManagementException e) {
+ String msg = "Error occurred while reading platform configurations token, device id : " + id + ", device type : " + type;
+ log.error(msg, e);
+ return Response.serverError().entity(
+ new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build();
+ }
+
+ deviceConfig.setMqttGateway("tcp://" + System.getProperty("mqtt.broker.host") + ":" + System.getProperty("mqtt.broker.port"));
+ deviceConfig.setHttpGateway("http://" + System.getProperty("iot.gateway.host") + ":" + System.getProperty("iot.gateway.http.port"));
+ deviceConfig.setHttpsGateway("https://" + System.getProperty("iot.gateway.host") + ":" + System.getProperty("iot.gateway.https.port"));
+
+ } catch (KeyMgtException e) {
+ String msg = "Error occurred while creating oauth application, device id : " + id + ", device type : " + type;
+ log.error(msg, e);
+ return Response.serverError().entity(
+ new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build();
+ } catch (org.wso2.carbon.apimgt.keymgt.extension.exception.BadRequestException e) {
+ String msg = "Error occurred while generating token, device id : " + id + ", device type : " + type;
+ log.error(msg, e);
+ return Response.serverError().entity(
+ new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build();
+ }
+ return Response.status(Response.Status.OK).entity(deviceConfig).build();
+
}
@GET
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java
index 92bc2790d4..c7be9690ee 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java
@@ -50,15 +50,12 @@ import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.CarbonConstants;
import org.wso2.carbon.analytics.api.AnalyticsDataAPI;
import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub;
+import org.wso2.carbon.authenticator.stub.AuthenticationAdminStub;
import org.wso2.carbon.base.ServerConfiguration;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.core.util.Utils;
-import org.wso2.carbon.device.mgt.common.Device;
-import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
-import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
-import org.wso2.carbon.device.mgt.common.MonitoringOperation;
-import org.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig;
+import org.wso2.carbon.device.mgt.common.*;
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationService;
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
@@ -95,8 +92,11 @@ import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.EventAttributeList;
import org.wso2.carbon.device.mgt.jaxrs.service.impl.util.InputValidationException;
import org.wso2.carbon.device.mgt.jaxrs.service.impl.util.RequestValidationUtil;
import org.wso2.carbon.event.processor.stub.EventProcessorAdminServiceStub;
+import org.wso2.carbon.event.publisher.core.EventPublisherService;
import org.wso2.carbon.event.publisher.stub.EventPublisherAdminServiceStub;
+import org.wso2.carbon.event.receiver.core.EventReceiverService;
import org.wso2.carbon.event.receiver.stub.EventReceiverAdminServiceStub;
+import org.wso2.carbon.event.stream.core.EventStreamService;
import org.wso2.carbon.event.stream.stub.EventStreamAdminServiceStub;
import org.wso2.carbon.identity.claim.metadata.mgt.dto.ClaimPropertyDTO;
import org.wso2.carbon.identity.jwt.client.extension.JWTClient;
@@ -111,11 +111,7 @@ import org.wso2.carbon.policy.mgt.common.PolicyMonitoringTaskException;
import org.wso2.carbon.policy.mgt.core.PolicyManagerService;
import org.wso2.carbon.policy.mgt.core.task.TaskScheduleService;
import org.wso2.carbon.registry.core.service.RegistryService;
-import org.wso2.carbon.user.api.AuthorizationManager;
-import org.wso2.carbon.user.api.RealmConfiguration;
-import org.wso2.carbon.user.api.UserRealm;
-import org.wso2.carbon.user.api.UserStoreException;
-import org.wso2.carbon.user.api.UserStoreManager;
+import org.wso2.carbon.user.api.*;
import org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager;
import org.wso2.carbon.user.core.service.RealmService;
import org.wso2.carbon.user.mgt.common.UIPermissionNode;
@@ -128,11 +124,7 @@ import javax.net.ssl.TrustManagerFactory;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.security.KeyManagementException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.UnrecoverableKeyException;
+import java.security.*;
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.LinkedList;
@@ -172,7 +164,7 @@ public class DeviceMgtAPIUtils {
private static KeyStore trustStore;
private static char[] keyStorePassword;
-// private static IntegrationClientService integrationClientService;
+ // private static IntegrationClientService integrationClientService;
private static MetadataManagementService metadataManagementService;
private static OTPManagementService otpManagementService;
@@ -581,6 +573,36 @@ public class DeviceMgtAPIUtils {
return geoService;
}
+ public static EventStreamService getEventStreamService() {
+ PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+ EventStreamService
+ eventStreamService = (EventStreamService) ctx.getOSGiService(EventStreamService.class, null);
+ if (eventStreamService == null) {
+ throw new IllegalStateException("Event Stream Service has not been initialized.");
+ }
+ return eventStreamService;
+ }
+
+ public static EventReceiverService getEventReceiverService() {
+ PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+ EventReceiverService
+ eventReceiverService = (EventReceiverService) ctx.getOSGiService(EventReceiverService.class, null);
+ if (eventReceiverService == null) {
+ throw new IllegalStateException("Event Receiver Service has not been initialized.");
+ }
+ return eventReceiverService;
+ }
+
+ public static EventPublisherService getEventPublisherService() {
+ PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+ EventPublisherService
+ eventPublisherService = (EventPublisherService) ctx.getOSGiService(EventPublisherService.class, null);
+ if (eventPublisherService == null) {
+ throw new IllegalStateException("Event Receiver Service has not been initialized.");
+ }
+ return eventPublisherService;
+ }
+
public static AnalyticsDataAPI getAnalyticsDataAPI() {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
AnalyticsDataAPI analyticsDataAPI =
@@ -642,10 +664,13 @@ public class DeviceMgtAPIUtils {
// return eventsPublisherService;
// }
+ public static String getStreamDefinition(String deviceType, String tenantDomain, String eventName) {
+ return getStreamDefinition(deviceType, tenantDomain) + "." + eventName;
+ }
+
public static String getStreamDefinition(String deviceType, String tenantDomain) {
return STREAM_DEFINITION_PREFIX + tenantDomain + "." + deviceType.replace(" ", ".");
}
-
public static EventStreamAdminServiceStub getEventStreamAdminServiceStub()
throws AxisFault, UserStoreException, JWTClientException {
EventStreamAdminServiceStub eventStreamAdminServiceStub = new EventStreamAdminServiceStub(
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml
index 1abb0dca0c..8e7e132f26 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml
@@ -21,7 +21,7 @@
device-mgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/type/mgt/DeviceTypeMetaDefinition.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/type/mgt/DeviceTypeMetaDefinition.java
index dcc7ff47cd..835f450bb7 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/type/mgt/DeviceTypeMetaDefinition.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/type/mgt/DeviceTypeMetaDefinition.java
@@ -5,6 +5,7 @@ import org.wso2.carbon.device.mgt.common.InitialOperationConfig;
import org.wso2.carbon.device.mgt.common.license.mgt.License;
import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig;
+import java.util.ArrayList;
import java.util.List;
public class DeviceTypeMetaDefinition {
@@ -19,6 +20,10 @@ public class DeviceTypeMetaDefinition {
private String description;
private boolean isSharedWithAllTenants;
+ private List mqttEventTopicStructures;
+
+ private boolean longLivedToken = false;
+
public String getDescription() {
return description;
}
@@ -83,4 +88,20 @@ public class DeviceTypeMetaDefinition {
public void setSharedWithAllTenants(boolean sharedWithAllTenants) {
isSharedWithAllTenants = sharedWithAllTenants;
}
+
+ public List getMqttEventTopicStructures() {
+ return mqttEventTopicStructures;
+ }
+
+ public void setMqttEventTopicStructures(List mqttEventTopicStructures) {
+ this.mqttEventTopicStructures = mqttEventTopicStructures;
+ }
+
+ public boolean isLongLivedToken() {
+ return longLivedToken;
+ }
+
+ public void setLongLivedToken(boolean longLivedToken) {
+ this.longLivedToken = longLivedToken;
+ }
}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml
index a55ae5faff..cb9d37a5b4 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java
index 27882f4fbd..55e9279760 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java
@@ -18,6 +18,7 @@
package org.wso2.carbon.device.mgt.core.operation.mgt;
+import com.google.gson.Gson;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -792,9 +793,7 @@ public class OperationManagerImpl implements OperationManager {
if (dtoOperation != null) {
long currentTime = Calendar.getInstance().getTime().getTime();
- log.info("Current timestamp:" + currentTime);
long updatedTime = Timestamp.valueOf(dtoOperation.getReceivedTimeStamp()).getTime();
- log.info("Updated timestamp: " + updatedTime);
// check if notnow frequency is met and set next pending operation if not, otherwise let notnow
// operation to proceed
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml
index c359b575ef..8ecdd1dea7 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml
@@ -22,7 +22,7 @@
device-mgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml
index ce0834d4a7..dec22c688c 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml
@@ -23,7 +23,7 @@
device-mgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml
index d21057f7c5..480b375d31 100644
--- a/components/device-mgt/pom.xml
+++ b/components/device-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml
index b77baba84f..2b3cd78219 100644
--- a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml
+++ b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
heartbeat-management
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/heartbeat-management/pom.xml b/components/heartbeat-management/pom.xml
index 8a34ff769a..272466b326 100644
--- a/components/heartbeat-management/pom.xml
+++ b/components/heartbeat-management/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml
index 15ce3a51ca..37b1f466a7 100644
--- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml
+++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
identity-extensions
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml
index 7c963d6254..e98ae105c3 100644
--- a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml
+++ b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
identity-extensions
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/identity-extensions/pom.xml b/components/identity-extensions/pom.xml
index b1bdcdf8e3..454b046f52 100644
--- a/components/identity-extensions/pom.xml
+++ b/components/identity-extensions/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml
index d8c8483db2..d20a058c01 100644
--- a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml
+++ b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml
@@ -3,7 +3,7 @@
org.wso2.carbon.devicemgt
policy-mgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml
index 0dd2f16187..ae24f2c103 100644
--- a/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml
+++ b/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml
@@ -3,7 +3,7 @@
org.wso2.carbon.devicemgt
policy-mgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml
index d13c9bb1ec..065e6db69c 100644
--- a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml
+++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
policy-mgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml
index 6991bb4e5f..2d4cb3f782 100644
--- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml
+++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
policy-mgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/policy-mgt/pom.xml b/components/policy-mgt/pom.xml
index 2f0a6b7bf6..8c0bc9058e 100644
--- a/components/policy-mgt/pom.xml
+++ b/components/policy-mgt/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/components/task-mgt/pom.xml b/components/task-mgt/pom.xml
index d9ab379c3b..f46835f8be 100755
--- a/components/task-mgt/pom.xml
+++ b/components/task-mgt/pom.xml
@@ -17,13 +17,11 @@
~ under the License.
-->
-
+
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/components/task-mgt/task-manager/io.entgra.task.mgt.common/pom.xml b/components/task-mgt/task-manager/io.entgra.task.mgt.common/pom.xml
index ad7c991872..39551beebb 100755
--- a/components/task-mgt/task-manager/io.entgra.task.mgt.common/pom.xml
+++ b/components/task-mgt/task-manager/io.entgra.task.mgt.common/pom.xml
@@ -16,13 +16,11 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
+
task-manager
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/task-mgt/task-manager/io.entgra.task.mgt.core/pom.xml b/components/task-mgt/task-manager/io.entgra.task.mgt.core/pom.xml
index f0ffd6c1f5..6eeba4c8bc 100755
--- a/components/task-mgt/task-manager/io.entgra.task.mgt.core/pom.xml
+++ b/components/task-mgt/task-manager/io.entgra.task.mgt.core/pom.xml
@@ -16,14 +16,12 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
+
org.wso2.carbon.devicemgt
task-manager
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/task-mgt/task-manager/pom.xml b/components/task-mgt/task-manager/pom.xml
index a263d338e7..344ee82cfc 100755
--- a/components/task-mgt/task-manager/pom.xml
+++ b/components/task-mgt/task-manager/pom.xml
@@ -16,14 +16,12 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
+
org.wso2.carbon.devicemgt
task-mgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/task-mgt/task-watcher/io.entgra.task.mgt.watcher/pom.xml b/components/task-mgt/task-watcher/io.entgra.task.mgt.watcher/pom.xml
index d546c28698..34eaf2c430 100755
--- a/components/task-mgt/task-watcher/io.entgra.task.mgt.watcher/pom.xml
+++ b/components/task-mgt/task-watcher/io.entgra.task.mgt.watcher/pom.xml
@@ -16,14 +16,12 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
+
org.wso2.carbon.devicemgt
task-watcher
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/task-mgt/task-watcher/pom.xml b/components/task-mgt/task-watcher/pom.xml
index a570d9f279..23d376c072 100755
--- a/components/task-mgt/task-watcher/pom.xml
+++ b/components/task-mgt/task-watcher/pom.xml
@@ -16,14 +16,12 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
+
org.wso2.carbon.devicemgt
task-mgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml b/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml
index a57921baf3..e36ee469ff 100644
--- a/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml
+++ b/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
email-sender
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/transport-mgt/email-sender/pom.xml b/components/transport-mgt/email-sender/pom.xml
index 8e4d752874..e5d79a0c6c 100644
--- a/components/transport-mgt/email-sender/pom.xml
+++ b/components/transport-mgt/email-sender/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
transport-mgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/transport-mgt/pom.xml b/components/transport-mgt/pom.xml
index 9702d7f32c..fb8cf3777c 100644
--- a/components/transport-mgt/pom.xml
+++ b/components/transport-mgt/pom.xml
@@ -3,7 +3,7 @@
carbon-devicemgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml
index ae4b3ec78b..c2f4f05076 100644
--- a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml
+++ b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
sms-handler
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.common/pom.xml b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.common/pom.xml
index 9f4858d961..6fcf7686ac 100644
--- a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.common/pom.xml
+++ b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.common/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
sms-handler
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.core/pom.xml b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.core/pom.xml
index b9dc37e51c..6088ee0053 100644
--- a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.core/pom.xml
+++ b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.core/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
sms-handler
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/transport-mgt/sms-handler/pom.xml b/components/transport-mgt/sms-handler/pom.xml
index 1124fd5609..63039c781f 100644
--- a/components/transport-mgt/sms-handler/pom.xml
+++ b/components/transport-mgt/sms-handler/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
transport-mgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml
index 4f4a7e546d..1c585b5b74 100644
--- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml
+++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml
@@ -21,7 +21,7 @@
ui-request-interceptor
io.entgra.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
4.0.0
diff --git a/components/ui-request-interceptor/pom.xml b/components/ui-request-interceptor/pom.xml
index e16c2d3f4b..d849368d9b 100644
--- a/components/ui-request-interceptor/pom.xml
+++ b/components/ui-request-interceptor/pom.xml
@@ -21,7 +21,7 @@
carbon-devicemgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml
index fdfc56c1dd..f11df1e3a4 100644
--- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml
+++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml
@@ -21,7 +21,7 @@
org.wso2.carbon.devicemgt
webapp-authenticator-framework
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/components/webapp-authenticator-framework/pom.xml b/components/webapp-authenticator-framework/pom.xml
index 6945454311..b1a10ee9f5 100644
--- a/components/webapp-authenticator-framework/pom.xml
+++ b/components/webapp-authenticator-framework/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/features/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api.feature/pom.xml b/features/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api.feature/pom.xml
index e0ce823ef5..0c7462faaf 100644
--- a/features/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api.feature/pom.xml
+++ b/features/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
grafana-mgt-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.server.feature/pom.xml b/features/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.server.feature/pom.xml
index 6f52cf112c..6d3e16a063 100644
--- a/features/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.server.feature/pom.xml
+++ b/features/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.server.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
grafana-mgt-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/analytics-mgt/grafana-mgt/pom.xml b/features/analytics-mgt/grafana-mgt/pom.xml
index f9c33243fd..787ea0747f 100644
--- a/features/analytics-mgt/grafana-mgt/pom.xml
+++ b/features/analytics-mgt/grafana-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
analytics-mgt-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/analytics-mgt/pom.xml b/features/analytics-mgt/pom.xml
index f6a2860e0b..ccb9f84d26 100644
--- a/features/analytics-mgt/pom.xml
+++ b/features/analytics-mgt/pom.xml
@@ -3,7 +3,7 @@
carbon-devicemgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml
index 5e789d64cb..0d9d2b9d6a 100644
--- a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml
+++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml
@@ -21,7 +21,7 @@
org.wso2.carbon.devicemgt
apimgt-extensions-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.feature/pom.xml
index 69c6b280e3..b6a28994d8 100644
--- a/features/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.feature/pom.xml
+++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.feature/pom.xml
@@ -21,7 +21,7 @@
org.wso2.carbon.devicemgt
apimgt-extensions-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml
index c2ee07f0c9..c1b4c92172 100644
--- a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml
+++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml
@@ -21,7 +21,7 @@
org.wso2.carbon.devicemgt
apimgt-extensions-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/apimgt-extensions/pom.xml b/features/apimgt-extensions/pom.xml
index c169946fd3..45a706e7a9 100644
--- a/features/apimgt-extensions/pom.xml
+++ b/features/apimgt-extensions/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/features/application-mgt/io.entgra.application.mgt.api.feature/pom.xml b/features/application-mgt/io.entgra.application.mgt.api.feature/pom.xml
index 4c1f3edd29..d215fd6e29 100644
--- a/features/application-mgt/io.entgra.application.mgt.api.feature/pom.xml
+++ b/features/application-mgt/io.entgra.application.mgt.api.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
application-mgt-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/application-mgt/io.entgra.application.mgt.server.feature/pom.xml b/features/application-mgt/io.entgra.application.mgt.server.feature/pom.xml
index e46d58bb91..e1447edb86 100644
--- a/features/application-mgt/io.entgra.application.mgt.server.feature/pom.xml
+++ b/features/application-mgt/io.entgra.application.mgt.server.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
application-mgt-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/application-mgt/pom.xml b/features/application-mgt/pom.xml
index 5e855e60c9..527c8a633d 100644
--- a/features/application-mgt/pom.xml
+++ b/features/application-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml
index 7a149fb63d..2bd79de79e 100644
--- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml
+++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
certificate-mgt-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml
index 6829f4a0d6..7c9fb7153e 100644
--- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml
+++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
certificate-mgt-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml
index 27a40bd0a4..b730341140 100644
--- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml
+++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
certificate-mgt-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/certificate-mgt/pom.xml b/features/certificate-mgt/pom.xml
index f86d0bb8ef..05fdb44cc1 100644
--- a/features/certificate-mgt/pom.xml
+++ b/features/certificate-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/features/device-mgt-extensions/io.entgra.device.mgt.extensions.defaultrole.manager.feature/pom.xml b/features/device-mgt-extensions/io.entgra.device.mgt.extensions.defaultrole.manager.feature/pom.xml
index 7d18bd12d5..54e8544e67 100644
--- a/features/device-mgt-extensions/io.entgra.device.mgt.extensions.defaultrole.manager.feature/pom.xml
+++ b/features/device-mgt-extensions/io.entgra.device.mgt.extensions.defaultrole.manager.feature/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt
device-mgt-extensions-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/io.entgra.device.mgt.extensions.logger.feature/pom.xml b/features/device-mgt-extensions/io.entgra.device.mgt.extensions.logger.feature/pom.xml
index 1dc330f67f..b9eaed372f 100644
--- a/features/device-mgt-extensions/io.entgra.device.mgt.extensions.logger.feature/pom.xml
+++ b/features/device-mgt-extensions/io.entgra.device.mgt.extensions.logger.feature/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt
device-mgt-extensions-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/io.entgra.device.mgt.extensions.stateengine.feature/pom.xml b/features/device-mgt-extensions/io.entgra.device.mgt.extensions.stateengine.feature/pom.xml
index f178b51f53..1046d773c9 100644
--- a/features/device-mgt-extensions/io.entgra.device.mgt.extensions.stateengine.feature/pom.xml
+++ b/features/device-mgt-extensions/io.entgra.device.mgt.extensions.stateengine.feature/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt
device-mgt-extensions-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml
index b36bc24864..0678d1bbe6 100644
--- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml
+++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-extensions-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml
index 822f213a82..4d38c3719b 100644
--- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml
+++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-extensions-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature/pom.xml
index e8121a2b25..5ee749568c 100644
--- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature/pom.xml
+++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-extensions-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml
index 469735e0c6..ae887ab14c 100644
--- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml
+++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-extensions-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml
index 91fddccc4e..314b1a82b3 100644
--- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml
+++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-extensions-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/pom.xml b/features/device-mgt-extensions/pom.xml
index 92cc4a384f..1c98737cfa 100644
--- a/features/device-mgt-extensions/pom.xml
+++ b/features/device-mgt-extensions/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml
index 0c2a6df02f..0bb36492df 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml
index 701de1d1b7..ba9e88437c 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/datasources/cdm-datasources.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/datasources/cdm-datasources.xml
index 78db49688e..4494b4fcd6 100755
--- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/datasources/cdm-datasources.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/datasources/cdm-datasources.xml
@@ -61,5 +61,25 @@
+
+ EVENT_DB
+ The datasource used for event storing
+
+ jdbc/EVENT_DB
+
+
+
+ jdbc:h2:./repository/database/EVENT_DB;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE;LOCK_TIMEOUT=60000
+ wso2carbon
+ wso2carbon
+ org.h2.Driver
+ 50
+ 60000
+ true
+ SELECT 1
+ 30000
+
+
+
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/cdm-datasources.xml.j2 b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/cdm-datasources.xml.j2
index e9105a8d3e..81e6ed9714 100755
--- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/cdm-datasources.xml.j2
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/cdm-datasources.xml.j2
@@ -83,5 +83,36 @@
+
+ EVENT_DB
+ The datasource used for event storing
+
+ jdbc/EVENT_DB
+
+
+
+ {% if database.device_mgt_event_db is defined %}
+ {{database.device_mgt_event_db.url}}
+ {{database.device_mgt_event_db.username}}
+ {{database.device_mgt_event_db.password}}
+ {{database.device_mgt_event_db.driver}}
+ {{database.device_mgt_event_db.validationQuery}}
+ {% for property_name,property_value in database.device_mgt_event_db.pool_options.items() %}
+ <{{property_name}}>{{property_value}}{{property_name}}>
+ {% endfor %}
+ {% else %}
+ jdbc:h2:./repository/database/EVENT_DB;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE;LOCK_TIMEOUT=60000
+ wso2carbon
+ wso2carbon
+ org.h2.Driver
+ 50
+ 60000
+ true
+ SELECT 1
+ 30000
+ {% endif %}
+
+
+
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml
index 7ae15434ee..31ff541dfc 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml
@@ -4,7 +4,7 @@
org.wso2.carbon.devicemgt
device-mgt-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml
index 1f5a22014f..ae68720cf9 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml
index 3d009aa9cb..59113b6e91 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml
index 43a0145b6e..e606feaa46 100644
--- a/features/device-mgt/pom.xml
+++ b/features/device-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml b/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml
index e5f9d4a316..6c21432c0b 100644
--- a/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml
+++ b/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
heart-beat-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/heartbeat-management/pom.xml b/features/heartbeat-management/pom.xml
index 0616963355..42febcc76b 100644
--- a/features/heartbeat-management/pom.xml
+++ b/features/heartbeat-management/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml
index 9d375e95c4..31f48b995e 100644
--- a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml
+++ b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt
jwt-client-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/jwt-client/pom.xml b/features/jwt-client/pom.xml
index 5eced82de5..50925e545a 100644
--- a/features/jwt-client/pom.xml
+++ b/features/jwt-client/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml b/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml
index 0a9bff010c..eb28b067bf 100644
--- a/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml
+++ b/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt
policy-mgt-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/policy-mgt/pom.xml b/features/policy-mgt/pom.xml
index 833e11aba4..9a9f371f78 100644
--- a/features/policy-mgt/pom.xml
+++ b/features/policy-mgt/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/features/task-mgt/io.entgra.task.mgt.feature/pom.xml b/features/task-mgt/io.entgra.task.mgt.feature/pom.xml
index c285c53040..4094f312fb 100755
--- a/features/task-mgt/io.entgra.task.mgt.feature/pom.xml
+++ b/features/task-mgt/io.entgra.task.mgt.feature/pom.xml
@@ -16,14 +16,12 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
+
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../../pom.xml
diff --git a/features/task-mgt/pom.xml b/features/task-mgt/pom.xml
index 26638a6aa2..189a163b78 100755
--- a/features/task-mgt/pom.xml
+++ b/features/task-mgt/pom.xml
@@ -16,14 +16,12 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
+
carbon-devicemgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/pom.xml b/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/pom.xml
index c86636d487..dba94063ed 100644
--- a/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/pom.xml
+++ b/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
email-sender-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/transport-mgt/email-sender/pom.xml b/features/transport-mgt/email-sender/pom.xml
index d0cbbef027..0e3241ad88 100644
--- a/features/transport-mgt/email-sender/pom.xml
+++ b/features/transport-mgt/email-sender/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
transport-mgt-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/transport-mgt/pom.xml b/features/transport-mgt/pom.xml
index 5de9c8c47c..07ecebe2ff 100644
--- a/features/transport-mgt/pom.xml
+++ b/features/transport-mgt/pom.xml
@@ -3,7 +3,7 @@
carbon-devicemgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api.feature/pom.xml b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api.feature/pom.xml
index 1a8e65ea70..47cb040d27 100644
--- a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api.feature/pom.xml
+++ b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
sms-handler-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/pom.xml b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/pom.xml
index 2ba975d2d4..41b8d3b338 100644
--- a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/pom.xml
+++ b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
sms-handler-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/transport-mgt/sms-handler/pom.xml b/features/transport-mgt/sms-handler/pom.xml
index 629c08ba50..d4bb6a06a6 100644
--- a/features/transport-mgt/sms-handler/pom.xml
+++ b/features/transport-mgt/sms-handler/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
transport-mgt-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/pom.xml b/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/pom.xml
index 0afc3933c9..d7fec7d0ca 100644
--- a/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/pom.xml
+++ b/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/pom.xml
@@ -21,7 +21,7 @@
ui-request-interceptor-feature
io.entgra.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
4.0.0
diff --git a/features/ui-request-interceptor/pom.xml b/features/ui-request-interceptor/pom.xml
index 6692653264..40c07d7c8d 100644
--- a/features/ui-request-interceptor/pom.xml
+++ b/features/ui-request-interceptor/pom.xml
@@ -21,7 +21,7 @@
carbon-devicemgt
org.wso2.carbon.devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml
index 86fd0c7ae2..15dbbd671f 100644
--- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml
+++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
webapp-authenticator-framework-feature
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../pom.xml
diff --git a/features/webapp-authenticator-framework/pom.xml b/features/webapp-authenticator-framework/pom.xml
index 35e608903c..80a6f00d3c 100644
--- a/features/webapp-authenticator-framework/pom.xml
+++ b/features/webapp-authenticator-framework/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
../../pom.xml
diff --git a/pom.xml b/pom.xml
index baed2c7543..cf130f5b40 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
pom
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
WSO2 Carbon - Device Management - Parent
http://wso2.org
WSO2 Connected Device Manager Components
@@ -351,6 +351,11 @@
org.wso2.carbon.apimgt.keymgt.extension.api
${carbon.device.mgt.version}
+
+ org.wso2.carbon.devicemgt
+ org.wso2.carbon.apimgt.keymgt.extension
+ ${carbon.device.mgt.version}
+
@@ -1446,6 +1451,31 @@
org.wso2.carbon.databridge.core
${carbon.analytics.common.version}
+
+ org.wso2.carbon.analytics-common
+ org.wso2.carbon.event.stream.core
+ ${carbon.analytics.common.version}
+
+
+ org.wso2.carbon.analytics-common
+ org.wso2.carbon.event.receiver.core
+ ${carbon.analytics.common.version}
+
+
+ org.wso2.carbon.analytics-common
+ org.wso2.carbon.event.publisher.core
+ ${carbon.analytics.common.version}
+
+
+ org.wso2.carbon.analytics-common
+ org.wso2.carbon.event.core
+ ${carbon.analytics.common.version}
+
+
+ org.wso2.carbon.analytics-common
+ org.wso2.carbon.event.output.adapter.rdbms
+ ${carbon.analytics.common.version}
+
@@ -2059,7 +2089,7 @@
1.2.11.wso2v10
- 5.0.20-SNAPSHOT
+ 5.0.21-SNAPSHOT
4.7.35
@@ -2074,8 +2104,8 @@
[9.0.0, 10.0.0)
- 5.1.37
- [5.1.3,6.0.0)
+ 5.2.34
+ [5.2.34,6.0.0)
1.3.25
[1.3.0,2.0.0)
2.1.23