Merge branch 'master' of ssh://repository.entgra.net:222/community/device-mgt-core into billing-delete-9713

fixesInAPIpublisher
osh 1 year ago
commit 0abf955fe0

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>grafana-mgt</artifactId> <artifactId>grafana-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>grafana-mgt</artifactId> <artifactId>grafana-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>grafana-mgt</artifactId> <artifactId>grafana-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>analytics-mgt</artifactId> <artifactId>analytics-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -20,7 +20,7 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -513,8 +513,15 @@ public class APIPublisherServiceImpl implements APIPublisherService {
if (scopeObj.getString("name").equals(scopeMapping[2] != null ? if (scopeObj.getString("name").equals(scopeMapping[2] != null ?
StringUtils.trim(scopeMapping[2]) : StringUtils.EMPTY)) { StringUtils.trim(scopeMapping[2]) : StringUtils.EMPTY)) {
scope.setId(scopeObj.getString("id")); scope.setId(scopeObj.getString("id"));
// Including already existing roles
JSONArray existingRolesArray = (JSONArray) scopeObj.get("bindings");
for (int j = 0; j < existingRolesArray.length(); j++) {
roleString = roleString + "," + existingRolesArray.get(j);
}
} }
} }
scope.setRoles(roleString);
if (publisherRESTAPIServices.isSharedScopeNameExists(apiApplicationKey, accessTokenInfo, scope.getKey())) { if (publisherRESTAPIServices.isSharedScopeNameExists(apiApplicationKey, accessTokenInfo, scope.getKey())) {
publisherRESTAPIServices.updateSharedScope(apiApplicationKey, accessTokenInfo, scope); publisherRESTAPIServices.updateSharedScope(apiApplicationKey, accessTokenInfo, scope);

@ -63,7 +63,7 @@ public class AnnotationProcessor {
private static final String PACKAGE_ORG_APACHE = "org.apache"; private static final String PACKAGE_ORG_APACHE = "org.apache";
private static final String PACKAGE_ORG_CODEHAUS = "org.codehaus"; private static final String PACKAGE_ORG_CODEHAUS = "org.codehaus";
private static final String PACKAGE_ORG_SPRINGFRAMEWORK = "org.springframework"; private static final String PACKAGE_ORG_SPRINGFRAMEWORK = "org.springframework";
public static final String WILD_CARD = "/*"; public static final String WILD_CARD = "/";
private static final String SWAGGER_ANNOTATIONS_INFO = "info"; private static final String SWAGGER_ANNOTATIONS_INFO = "info";
private static final String SWAGGER_ANNOTATIONS_TAGS = "tags"; private static final String SWAGGER_ANNOTATIONS_TAGS = "tags";
private static final String SWAGGER_ANNOTATIONS_EXTENSIONS = "extensions"; private static final String SWAGGER_ANNOTATIONS_EXTENSIONS = "extensions";

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>application-mgt</artifactId> <artifactId>application-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>application-mgt</artifactId> <artifactId>application-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
@ -112,6 +112,11 @@
</build> </build>
<dependencies> <dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.eclipse.osgi</groupId> <groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId> <artifactId>org.eclipse.osgi</artifactId>

@ -26,18 +26,20 @@ import io.entgra.device.mgt.core.application.mgt.core.dao.VppApplicationDAO;
import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException;
import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants;
import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException; import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException;
import io.entgra.device.mgt.core.application.mgt.core.util.VppHttpUtil;
import io.entgra.device.mgt.core.device.mgt.extensions.logger.spi.EntgraLogger; import io.entgra.device.mgt.core.device.mgt.extensions.logger.spi.EntgraLogger;
import io.entgra.device.mgt.core.notification.logger.AppInstallLogContext; import io.entgra.device.mgt.core.notification.logger.AppInstallLogContext;
import io.entgra.device.mgt.core.notification.logger.impl.EntgraAppInstallLoggerImpl; import io.entgra.device.mgt.core.notification.logger.impl.EntgraAppInstallLoggerImpl;
import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpMethodBase;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.StringRequestEntity;
import org.apache.commons.lang.StringUtils; 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.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.ssl.SSLContextBuilder;
import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONObject; import org.json.JSONObject;
import io.entgra.device.mgt.core.apimgt.application.extension.dto.ApiApplicationKey; import io.entgra.device.mgt.core.apimgt.application.extension.dto.ApiApplicationKey;
@ -106,6 +108,9 @@ import java.io.InputStreamReader;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
@ -1297,38 +1302,37 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
} }
} }
private int invokeIOTCoreAPI(HttpMethodBase request) throws UserStoreException, APIManagerException, IOException { private int invokeIOTCoreAPI(HttpPost request) throws UserStoreException, APIManagerException, IOException,
HttpClient httpClient; ApplicationManagementException {
CloseableHttpClient httpClient = getHttpClient();
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
ApiApplicationKey apiApplicationKey = OAuthUtils.getClientCredentials(tenantDomain); ApiApplicationKey apiApplicationKey = OAuthUtils.getClientCredentials(tenantDomain);
String username = String username =
PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getRealmConfiguration() PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getRealmConfiguration()
.getAdminUserName() + Constants.ApplicationInstall.AT + tenantDomain; .getAdminUserName() + Constants.ApplicationInstall.AT + tenantDomain;
AccessTokenInfo tokenInfo = OAuthUtils.getOAuthCredentials(apiApplicationKey, username); AccessTokenInfo tokenInfo = OAuthUtils.getOAuthCredentials(apiApplicationKey, username);
request.addRequestHeader(Constants.ApplicationInstall.AUTHORIZATION, request.addHeader(Constants.ApplicationInstall.AUTHORIZATION,
Constants.ApplicationInstall.AUTHORIZATION_HEADER_VALUE + tokenInfo.getAccessToken()); Constants.ApplicationInstall.AUTHORIZATION_HEADER_VALUE + tokenInfo.getAccessToken());
httpClient = new HttpClient(); HttpResponse response = httpClient.execute(request);
httpClient.executeMethod(request); return response.getStatusLine().getStatusCode();
return request.getStatusCode();
} }
public int installEnrollmentApplications(ApplicationPolicyDTO applicationPolicyDTO) public int installEnrollmentApplications(ApplicationPolicyDTO applicationPolicyDTO)
throws ApplicationManagementException { throws ApplicationManagementException {
String requestUrl =null;
PostMethod request;
try { try {
String requestUrl = Constants.ApplicationInstall.ENROLLMENT_APP_INSTALL_PROTOCOL + System requestUrl = Constants.ApplicationInstall.ENROLLMENT_APP_INSTALL_PROTOCOL + System
.getProperty(Constants.ApplicationInstall.IOT_CORE_HOST) + Constants.ApplicationInstall.COLON .getProperty(Constants.ApplicationInstall.IOT_GATEWAY_HOST) + Constants.ApplicationInstall.COLON
+ System.getProperty(Constants.ApplicationInstall.IOT_CORE_PORT) + System.getProperty(Constants.ApplicationInstall.IOT_CORE_PORT)
+ Constants.ApplicationInstall.GOOGLE_APP_INSTALL_URL; + Constants.ApplicationInstall.GOOGLE_APP_INSTALL_URL;
Gson gson = new Gson(); Gson gson = new Gson();
String payload = gson.toJson(applicationPolicyDTO); String payload = gson.toJson(applicationPolicyDTO);
HttpPost httpPost = new HttpPost(requestUrl);
StringRequestEntity requestEntity = new StringRequestEntity(payload, MediaType.APPLICATION_JSON, StringEntity stringEntity = new StringEntity(payload, Constants.ApplicationInstall.ENCODING);
Constants.ApplicationInstall.ENCODING); httpPost.addHeader("Content-Type",MediaType.APPLICATION_JSON);
request = new PostMethod(requestUrl); httpPost.setEntity(stringEntity);
request.setRequestEntity(requestEntity); return invokeIOTCoreAPI(httpPost);
return invokeIOTCoreAPI(request);
} catch (UserStoreException e) { } catch (UserStoreException e) {
String msg = "Error while accessing user store for user with Android device."; String msg = "Error while accessing user store for user with Android device.";
log.error(msg, e); log.error(msg, e);
@ -1337,18 +1341,38 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
String msg = "Error while retrieving access token for Android device"; String msg = "Error while retrieving access token for Android device";
log.error(msg, e); log.error(msg, e);
throw new ApplicationManagementException(msg, e); throw new ApplicationManagementException(msg, e);
} catch (HttpException e) {
String msg = "Error while calling the app store to install enrollment app with id: " + applicationPolicyDTO
.getApplicationDTO().getId() + " on device";
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
} catch (IOException e) { } catch (IOException e) {
String msg = String msg =
"Error while installing the enrollment with id: " + applicationPolicyDTO.getApplicationDTO().getId() "Error while installing the enrollment with id: " + applicationPolicyDTO.getApplicationDTO().getId()
+ " on device"; + " on device: request URL: " + requestUrl;
log.error(msg + "request url: " + requestUrl, e);
throw new ApplicationManagementException(msg, e);
}
}
private CloseableHttpClient getHttpClient() throws ApplicationManagementException {
try {
SSLContextBuilder builder = new SSLContextBuilder();
builder.loadTrustMaterial(null, new TrustSelfSignedStrategy());
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(builder.build());
return HttpClients.custom().setSSLSocketFactory(sslsf).useSystemProperties().build();
} catch (NoSuchAlgorithmException e) {
String msg = "Failed while building the http client for EntApp installation. " +
"Used SSL algorithm not available";
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
} catch (KeyStoreException e) {
String msg = "Failed while building the http client for EntApp installation. " +
"Failed to load required key stores";
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
} catch (KeyManagementException e) {
String msg = "Failed while building the http client for EntApp installation. " +
"Failed while building SSL context";
log.error(msg, e); log.error(msg, e);
throw new ApplicationManagementException(msg, e); throw new ApplicationManagementException(msg, e);
} }
} }
private String getIOTCoreBaseUrl() { private String getIOTCoreBaseUrl() {

@ -178,6 +178,8 @@ public class Constants {
public static final String DEVICE_TYPE_ANDROID = "android"; public static final String DEVICE_TYPE_ANDROID = "android";
public static final String COLON = ":"; public static final String COLON = ":";
public static final String IOT_CORE_HOST = "iot.core.host"; public static final String IOT_CORE_HOST = "iot.core.host";
public static final String IOT_GATEWAY_HOST = "iot.gateway.host";
public static final String IOT_CORE_PORT = "iot.core.https.port"; public static final String IOT_CORE_PORT = "iot.core.https.port";
public static final String ENROLLMENT_APP_INSTALL_PROTOCOL = "https://"; public static final String ENROLLMENT_APP_INSTALL_PROTOCOL = "https://";
public static final String GOOGLE_APP_INSTALL_URL = "/api/device-mgt/android/v1.0/enterprise/change-app"; public static final String GOOGLE_APP_INSTALL_URL = "/api/device-mgt/android/v1.0/enterprise/change-app";

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -838,9 +838,9 @@ public interface DeviceManagementService {
Response getDeviceByIdList(List<String> deviceIds); Response getDeviceByIdList(List<String> deviceIds);
@PUT @GET
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
@Path("/{type}/{id}") @Path("/{type}/{id}/status")
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",

@ -355,6 +355,52 @@ public interface GroupManagementService {
@QueryParam("limit") @QueryParam("limit")
int limit); int limit);
@Path("/hierarchy/count")
@GET
@ApiOperation(
produces = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_GET,
value = "Getting the Number of Hirarchical Device Groups",
notes = "Get the number of hierarchical device groups in the server that the current signed in user can access.",
tags = "Device Group Management",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = Constants.SCOPE, value = "perm:groups:count")
})
},
nickname = "getGroupCountNonAdmin"
)
@ApiResponses(value = {
@ApiResponse(code = 200, message = "OK. \n Successfully fetched the hierarchical device group count.",
response = DeviceGroupList.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 has been modified the last time.\n" +
"Used by caches, or in conditional requests."),
}),
@ApiResponse(
code = 304,
message = "Not Modified. \n Empty body because the client has already the latest version of " +
"the requested resource."),
@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 group count.",
response = ErrorResponse.class)
})
Response getHierarchicalGroupCount();
@Path("/count") @Path("/count")
@GET @GET
@ApiOperation( @ApiOperation(

@ -256,6 +256,58 @@ public interface GroupManagementAdminService {
@QueryParam("limit") @QueryParam("limit")
int limit); int limit);
@Path("/hierarchy/count")
@GET
@ApiOperation(
produces = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_GET,
value = "Get the count of all hierarchical groups belongs to current admin user.",
notes = "Returns count of all permitted hierarchical groups enrolled with the system.",
tags = "Device Group Management",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = Constants.SCOPE, value = "perm:admin-groups:count")
})
}
)
@ApiResponses(value = {
@ApiResponse(code = 200, message = "OK. \n Successfully fetched the hierarchical device group count.",
response = Integer.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 has been modified the last time.\n" +
"Used by caches, or in conditional requests."),
}),
@ApiResponse(
code = 304,
message = "Not Modified. \n Empty body because the client has already the latest version of " +
"the requested resource."),
@ApiResponse(
code = 404,
message = "No groups found.",
response = ErrorResponse.class),
@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 group count.",
response = ErrorResponse.class)
})
Response getHierarchicalGroupCount(@ApiParam(
name = "status",
value = "status of hierarchical groups of which count should be retrieved")
@QueryParam("status")
String status);
@Path("/count") @Path("/count")
@GET @GET
@ApiOperation( @ApiOperation(

@ -140,6 +140,19 @@ public class GroupManagementServiceImpl implements GroupManagementService {
} }
} }
@Override
public Response getHierarchicalGroupCount() {
try {
String currentUser = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
int count = DeviceMgtAPIUtils.getGroupManagementProviderService().getHierarchicalGroupCount(currentUser, null);
return Response.status(Response.Status.OK).entity(count).build();
} catch (GroupManagementException e) {
String msg = "Error occurred while retrieving hierarchical group count.";
log.error(msg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
}
}
@Override @Override
public Response getGroupCount() { public Response getGroupCount() {
try { try {

@ -133,6 +133,23 @@ public class GroupManagementAdminServiceImpl implements GroupManagementAdminServ
} }
} }
@Override
public Response getHierarchicalGroupCount(String status) {
try {
int count;
if (status == null || status.isEmpty()) {
count = DeviceMgtAPIUtils.getGroupManagementProviderService().getHierarchicalGroupCount();
} else {
count = DeviceMgtAPIUtils.getGroupManagementProviderService().getGroupCountByStatus(status);
}
return Response.status(Response.Status.OK).entity(count).build();
} catch (GroupManagementException e) {
String msg = "ErrorResponse occurred while retrieving hierarchical group count.";
log.error(msg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
}
}
@Override @Override
public Response getGroupCount(String status) { public Response getGroupCount(String status) {
try { try {

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -363,13 +363,6 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
DeviceManagementDAOFactory.beginTransaction(); DeviceManagementDAOFactory.beginTransaction();
DeviceLocation previousLocation = deviceDetailsDAO.getDeviceLocation(device.getId(), DeviceLocation previousLocation = deviceDetailsDAO.getDeviceLocation(device.getId(),
device.getEnrolmentInfo().getId()); device.getEnrolmentInfo().getId());
if (previousLocation == null) {
deviceDetailsDAO.addDeviceLocation(deviceLocation, device.getEnrolmentInfo().getId());
} else {
deviceDetailsDAO.updateDeviceLocation(deviceLocation, device.getEnrolmentInfo().getId());
}
deviceDetailsDAO.addDeviceLocationInfo(device, deviceLocation,
CarbonContext.getThreadLocalCarbonContext().getTenantId());
if (DeviceManagerUtil.isPublishLocationResponseEnabled()) { if (DeviceManagerUtil.isPublishLocationResponseEnabled()) {
Object[] metaData = {device.getDeviceIdentifier(), device.getEnrolmentInfo().getOwner(), device.getType()}; Object[] metaData = {device.getDeviceIdentifier(), device.getEnrolmentInfo().getOwner(), device.getType()};
Object[] payload = new Object[]{ Object[] payload = new Object[]{
@ -382,11 +375,17 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
deviceLocation.getDistance() deviceLocation.getDistance()
}; };
} }
//Tracker update GPS Location //Tracker update GPS Location
if (HttpReportingUtil.isLocationPublishing() && HttpReportingUtil.isTrackerEnabled()) { if (HttpReportingUtil.isLocationPublishing() && HttpReportingUtil.isTrackerEnabled()) {
DeviceManagementDataHolder.getInstance().getTraccarManagementService().updateLocation(device, deviceLocation); DeviceManagementDataHolder.getInstance().getTraccarManagementService().updateLocation(device, deviceLocation);
} else { } else {
if (previousLocation == null) {
deviceDetailsDAO.addDeviceLocation(deviceLocation, device.getEnrolmentInfo().getId());
} else {
deviceDetailsDAO.updateDeviceLocation(deviceLocation, device.getEnrolmentInfo().getId());
}
deviceDetailsDAO.addDeviceLocationInfo(device, deviceLocation,
CarbonContext.getThreadLocalCarbonContext().getTenantId());
if(!HttpReportingUtil.isLocationPublishing()) { if(!HttpReportingUtil.isLocationPublishing()) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Location publishing is disabled"); log.debug("Location publishing is disabled");
@ -453,29 +452,29 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
DeviceManagementDAOFactory.beginTransaction(); DeviceManagementDAOFactory.beginTransaction();
boolean previousLocation = deviceDetailsDAO.hasLocations(device.getId(), boolean previousLocation = deviceDetailsDAO.hasLocations(device.getId(),
device.getEnrolmentInfo().getId()); device.getEnrolmentInfo().getId());
if (previousLocation) { if(!HttpReportingUtil.isTrackerEnabled()) {
deviceDetailsDAO.updateDeviceLocation(mostRecentDeviceLocation, device.getEnrolmentInfo().getId()); if (previousLocation) {
} else { deviceDetailsDAO.updateDeviceLocation(mostRecentDeviceLocation, device.getEnrolmentInfo().getId());
deviceDetailsDAO.addDeviceLocation(mostRecentDeviceLocation, device.getEnrolmentInfo().getId()); } else {
deviceDetailsDAO.addDeviceLocation(mostRecentDeviceLocation, device.getEnrolmentInfo().getId());
}
deviceDetailsDAO.addDeviceLocationsInfo(device, deviceLocations,
CarbonContext.getThreadLocalCarbonContext().getTenantId());
} }
if (HttpReportingUtil.isLocationPublishing() && HttpReportingUtil.isTrackerEnabled()) {
deviceDetailsDAO.addDeviceLocationsInfo(device, deviceLocations, for (DeviceLocation deviceLocation: deviceLocations) {
CarbonContext.getThreadLocalCarbonContext().getTenantId()); //Tracker update GPS Location
for (DeviceLocation deviceLocation: deviceLocations) {
//Tracker update GPS Location
if (HttpReportingUtil.isLocationPublishing() && HttpReportingUtil.isTrackerEnabled()) {
DeviceManagementDataHolder.getInstance().getTraccarManagementService().updateLocation(device, deviceLocation); DeviceManagementDataHolder.getInstance().getTraccarManagementService().updateLocation(device, deviceLocation);
} else { }
if(!HttpReportingUtil.isLocationPublishing()) { } else {
if (log.isDebugEnabled()) { if(!HttpReportingUtil.isLocationPublishing()) {
log.debug("Location publishing is disabled"); if (log.isDebugEnabled()) {
} log.debug("Location publishing is disabled");
} }
if (!HttpReportingUtil.isTrackerEnabled()) { }
if (log.isDebugEnabled()) { if (!HttpReportingUtil.isTrackerEnabled()) {
log.debug("Traccar is disabled"); if (log.isDebugEnabled()) {
} log.debug("Traccar is disabled");
} }
} }
} }

@ -105,6 +105,10 @@ public interface OperationDAO {
Map<Integer, List<OperationMapping>> getOperationMappingsByStatus(Operation.Status opStatus, Operation.PushNotificationStatus pushNotificationStatus, Map<Integer, List<OperationMapping>> getOperationMappingsByStatus(Operation.Status opStatus, Operation.PushNotificationStatus pushNotificationStatus,
int limit) throws OperationManagementDAOException; int limit) throws OperationManagementDAOException;
Map<Integer, List<OperationMapping>> getAllocatedOperationMappingsByStatus(Operation.Status opStatus,
Operation.PushNotificationStatus pushNotificationStatus, int limit, int activeServerCount, int serverIndex)
throws OperationManagementDAOException;
List<Activity> getActivities(List<String> deviceTypes, String operationCode, long updatedSince, String operationStatus) List<Activity> getActivities(List<String> deviceTypes, String operationCode, long updatedSince, String operationStatus)
throws OperationManagementDAOException; throws OperationManagementDAOException;

@ -2010,6 +2010,54 @@ public class GenericOperationDAOImpl implements OperationDAO {
return operationMappingsTenantMap; return operationMappingsTenantMap;
} }
@Override
public Map<Integer, List<OperationMapping>> getAllocatedOperationMappingsByStatus(Operation.Status opStatus,
Operation.PushNotificationStatus pushNotificationStatus, int limit, int activeServerCount, int serverIndex)
throws OperationManagementDAOException {
PreparedStatement stmt = null;
ResultSet rs = null;
Connection conn;
OperationMapping operationMapping;
Map<Integer, List<OperationMapping>> operationMappingsTenantMap = new HashMap<>();
try {
conn = OperationManagementDAOFactory.getConnection();
String sql = "SELECT op.ENROLMENT_ID, op.OPERATION_ID, d.DEVICE_IDENTIFICATION, dt.NAME as DEVICE_TYPE, " +
"d.TENANT_ID FROM DM_DEVICE d, DM_ENROLMENT_OP_MAPPING op, DM_DEVICE_TYPE dt WHERE op.STATUS = ?" +
" AND op.PUSH_NOTIFICATION_STATUS = ? AND d.DEVICE_TYPE_ID = dt.ID AND d.ID=op.ENROLMENT_ID AND MOD(d.ID, ?) = ? ORDER" +
" BY op.OPERATION_ID LIMIT ?";
stmt = conn.prepareStatement(sql);
stmt.setString(1, opStatus.toString());
stmt.setString(2, pushNotificationStatus.toString());
stmt.setInt(3, activeServerCount);
stmt.setInt(4, serverIndex);
stmt.setInt(5, limit);
rs = stmt.executeQuery();
while (rs.next()) {
int tenantID = rs.getInt("TENANT_ID");
List<OperationMapping> operationMappings = operationMappingsTenantMap.get(tenantID);
if (operationMappings == null) {
operationMappings = new LinkedList<>();
operationMappingsTenantMap.put(tenantID, operationMappings);
}
operationMapping = new OperationMapping();
operationMapping.setOperationId(rs.getInt("OPERATION_ID"));
DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
deviceIdentifier.setId(rs.getString("DEVICE_IDENTIFICATION"));
deviceIdentifier.setType(rs.getString("DEVICE_TYPE"));
operationMapping.setDeviceIdentifier(deviceIdentifier);
operationMapping.setEnrollmentId(rs.getInt("ENROLMENT_ID"));
operationMapping.setTenantId(tenantID);
operationMappings.add(operationMapping);
}
} catch (SQLException e) {
throw new OperationManagementDAOException("SQL error while getting operation mappings from database. " +
e.getMessage(), e);
} finally {
OperationManagementDAOUtil.cleanupResources(stmt, rs);
}
return operationMappingsTenantMap;
}
public List<Activity> getActivities(List<String> deviceTypes, String operationCode, long updatedSince, String operationStatus) public List<Activity> getActivities(List<String> deviceTypes, String operationCode, long updatedSince, String operationStatus)
throws OperationManagementDAOException { throws OperationManagementDAOException {

@ -18,6 +18,7 @@
package io.entgra.device.mgt.core.device.mgt.core.operation.timeout.task.impl; package io.entgra.device.mgt.core.device.mgt.core.operation.timeout.task.impl;
import com.google.gson.Gson; import com.google.gson.Gson;
import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.exception.HeartBeatManagementException;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException;
@ -36,7 +37,6 @@ import java.util.List;
public class OperationTimeoutTask extends DynamicPartitionedScheduleTask { public class OperationTimeoutTask extends DynamicPartitionedScheduleTask {
private static final Log log = LogFactory.getLog(OperationTimeoutTask.class); private static final Log log = LogFactory.getLog(OperationTimeoutTask.class);
@Override @Override
protected void setup() { protected void setup() {
@ -44,45 +44,60 @@ public class OperationTimeoutTask extends DynamicPartitionedScheduleTask {
@Override @Override
protected void executeDynamicTask() { protected void executeDynamicTask() {
String operationTimeoutTaskConfigStr = getProperty( if (isQualifiedToExecuteTask()) { // this task will run only in one node when the deployment has multiple nodes
OperationTimeoutTaskManagerServiceImpl.OPERATION_TIMEOUT_TASK_CONFIG); String operationTimeoutTaskConfigStr = getProperty(
Gson gson = new Gson(); OperationTimeoutTaskManagerServiceImpl.OPERATION_TIMEOUT_TASK_CONFIG);
OperationTimeout operationTimeoutConfig = gson.fromJson(operationTimeoutTaskConfigStr, OperationTimeout.class); Gson gson = new Gson();
try { OperationTimeout operationTimeoutConfig = gson.fromJson(operationTimeoutTaskConfigStr, OperationTimeout.class);
long timeMillis = System.currentTimeMillis() - operationTimeoutConfig.getTimeout() * 60 * 1000; try {
List<String> deviceTypes = new ArrayList<>(); long timeMillis = System.currentTimeMillis() - (long) operationTimeoutConfig.getTimeout();
if (operationTimeoutConfig.getDeviceTypes().size() == 1 && List<String> deviceTypes = new ArrayList<>();
"ALL".equals(operationTimeoutConfig.getDeviceTypes().get(0))) { if (operationTimeoutConfig.getDeviceTypes().size() == 1 &&
try { "ALL".equals(operationTimeoutConfig.getDeviceTypes().get(0))) {
List<DeviceType> deviceTypeList = DeviceManagementDataHolder.getInstance() try {
.getDeviceManagementProvider().getDeviceTypes(); List<DeviceType> deviceTypeList = DeviceManagementDataHolder.getInstance()
for (DeviceType deviceType : deviceTypeList) { .getDeviceManagementProvider().getDeviceTypes();
deviceTypes.add(deviceType.getName()); for (DeviceType deviceType : deviceTypeList) {
deviceTypes.add(deviceType.getName());
}
} catch (DeviceManagementException e) {
log.error("Error occurred while reading device types", e);
} }
} catch (DeviceManagementException e) { } else {
log.error("Error occurred while reading device types", e); deviceTypes = operationTimeoutConfig.getDeviceTypes();
} }
} else { List<Activity> activities = DeviceManagementDataHolder.getInstance().getOperationManager()
deviceTypes = operationTimeoutConfig.getDeviceTypes(); .getActivities(deviceTypes, operationTimeoutConfig.getCode(), timeMillis,
} operationTimeoutConfig.getInitialStatus());
List<Activity> activities = DeviceManagementDataHolder.getInstance().getOperationManager() for (Activity activity : activities) {
.getActivities(deviceTypes, operationTimeoutConfig.getCode(), timeMillis, for (ActivityStatus activityStatus : activity.getActivityStatus()) {
operationTimeoutConfig.getInitialStatus()); String operationId = activity.getActivityId().replace("ACTIVITY_", "");
for (Activity activity : activities) { Operation operation = DeviceManagementDataHolder.getInstance().getOperationManager()
for (ActivityStatus activityStatus : activity.getActivityStatus()) { .getOperation(Integer.parseInt(operationId));
String operationId = activity.getActivityId().replace("ACTIVITY_", ""); operation.setStatus(Operation.Status.valueOf(operationTimeoutConfig.getNextStatus()));
Operation operation = DeviceManagementDataHolder.getInstance().getOperationManager() DeviceManagementDataHolder.getInstance().getOperationManager()
.getOperation(Integer.parseInt(operationId)); .updateOperation(activityStatus.getDeviceIdentifier(), operation);
operation.setStatus(Operation.Status.valueOf(operationTimeoutConfig.getNextStatus())); }
DeviceManagementDataHolder.getInstance().getOperationManager()
.updateOperation(activityStatus.getDeviceIdentifier(), operation);
} }
}
} catch (OperationManagementException e) { } catch (OperationManagementException e) {
String msg = "Error occurred while retrieving operations."; String msg = "Error occurred while retrieving operations.";
log.error(msg, e); log.error(msg, e);
}
} }
} }
private boolean isQualifiedToExecuteTask() {
if (isDynamicTaskEligible()) {
try {
return DeviceManagementDataHolder.getInstance().getHeartBeatService().isQualifiedToExecuteTask();
} catch (HeartBeatManagementException e) {
log.error("Error while checking is qualified to execute task", e);
}
} else {
return true;
}
return false;
}
} }

@ -57,14 +57,14 @@ public class OperationTimeoutTaskManagerServiceImpl implements OperationTimeoutT
log.debug("Operation timeout task is started for the device type(s) : " + config.getDeviceTypes() log.debug("Operation timeout task is started for the device type(s) : " + config.getDeviceTypes()
+ ", operation code : " + config.getInitialStatus()); + ", operation code : " + config.getInitialStatus());
log.debug( log.debug(
"Operation timeout task is at frequency of : " + config.getTimeout() + " minutes"); "Operation timeout task is at frequency of : " + config.getTimeout() + " milliseconds");
} }
TaskManager taskManager = taskService.getTaskManager(OPERATION_TIMEOUT_TASK); TaskManager taskManager = taskService.getTaskManager(OPERATION_TIMEOUT_TASK);
TaskInfo.TriggerInfo triggerInfo = new TaskInfo.TriggerInfo(); TaskInfo.TriggerInfo triggerInfo = new TaskInfo.TriggerInfo();
//Convert to milli seconds //Convert to milli seconds
triggerInfo.setIntervalMillis(config.getTimeout() * 60 * 1000); triggerInfo.setIntervalMillis(config.getTimeout());
triggerInfo.setRepeatCount(-1); triggerInfo.setRepeatCount(-1);
Gson gson = new Gson(); Gson gson = new Gson();
@ -125,7 +125,7 @@ public class OperationTimeoutTaskManagerServiceImpl implements OperationTimeoutT
if (taskManager.isTaskScheduled(taskName)) { if (taskManager.isTaskScheduled(taskName)) {
taskManager.deleteTask(taskName); taskManager.deleteTask(taskName);
TaskInfo.TriggerInfo triggerInfo = new TaskInfo.TriggerInfo(); TaskInfo.TriggerInfo triggerInfo = new TaskInfo.TriggerInfo();
triggerInfo.setIntervalMillis(config.getTimeout() * 60 * 1000); triggerInfo.setIntervalMillis(config.getTimeout());
triggerInfo.setRepeatCount(-1); triggerInfo.setRepeatCount(-1);
Map<String, String> properties = new HashMap<>(); Map<String, String> properties = new HashMap<>();

@ -17,6 +17,9 @@
*/ */
package io.entgra.device.mgt.core.device.mgt.core.push.notification.mgt.task; package io.entgra.device.mgt.core.device.mgt.core.push.notification.mgt.task;
import io.entgra.device.mgt.core.device.mgt.common.ServerCtxInfo;
import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.exception.HeartBeatManagementException;
import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext;
@ -63,9 +66,27 @@ public class PushNotificationSchedulerTask implements Runnable {
try { try {
//Get next available operation list per device batch //Get next available operation list per device batch
OperationManagementDAOFactory.openConnection(); OperationManagementDAOFactory.openConnection();
operationMappingsTenantMap = operationDAO.getOperationMappingsByStatus(Operation.Status try {
.PENDING, Operation.PushNotificationStatus.SCHEDULED, DeviceConfigurationManager.getInstance() if (DeviceManagementDataHolder.getInstance().getHeartBeatService().isTaskPartitioningEnabled()) {
.getDeviceManagementConfig().getPushNotificationConfiguration().getSchedulerBatchSize()); ServerCtxInfo serverCtxInfo = DeviceManagementDataHolder.getInstance().getHeartBeatService().getServerCtxInfo();
if (serverCtxInfo != null) {
operationMappingsTenantMap = operationDAO.getAllocatedOperationMappingsByStatus(Operation.Status
.PENDING, Operation.PushNotificationStatus.SCHEDULED, DeviceConfigurationManager.getInstance()
.getDeviceManagementConfig().getPushNotificationConfiguration().getSchedulerBatchSize(),
serverCtxInfo.getActiveServerCount(), serverCtxInfo.getLocalServerHashIdx());
} else {
if (log.isDebugEnabled()) {
log.debug("Active server information not recorded yet.");
}
}
} else {
operationMappingsTenantMap = operationDAO.getOperationMappingsByStatus(Operation.Status
.PENDING, Operation.PushNotificationStatus.SCHEDULED, DeviceConfigurationManager.getInstance()
.getDeviceManagementConfig().getPushNotificationConfiguration().getSchedulerBatchSize());
}
} catch (HeartBeatManagementException e) {
throw new RuntimeException(e);
}
} catch (OperationManagementDAOException e) { } catch (OperationManagementDAOException e) {
log.error("Unable to retrieve scheduled pending operations for task.", e); log.error("Unable to retrieve scheduled pending operations for task.", e);
} finally { } finally {

@ -189,6 +189,14 @@ public interface GroupManagementProviderService {
PaginationResult getGroupsWithHierarchy(String username, GroupPaginationRequest request, PaginationResult getGroupsWithHierarchy(String username, GroupPaginationRequest request,
boolean requireGroupProps) throws GroupManagementException; boolean requireGroupProps) throws GroupManagementException;
/**
* Get all hierarchical device groups count in tenant
*
* @return hierarchical group count
* @throws GroupManagementException
*/
int getHierarchicalGroupCount() throws GroupManagementException;
/** /**
* Get all device group count in tenant * Get all device group count in tenant
* *
@ -215,6 +223,16 @@ public interface GroupManagementProviderService {
*/ */
int getGroupCount(String username, String parentPath) throws GroupManagementException; int getGroupCount(String username, String parentPath) throws GroupManagementException;
/**
* Get hierarchical device groups count of user
*
* @param username of the user
* @param parentPath of the group
* @return hierarchical group count
* @throws GroupManagementException
*/
int getHierarchicalGroupCount(String username, String parentPath) throws GroupManagementException;
/** /**
* Manage device group sharing with user with list of roles. * Manage device group sharing with user with list of roles.
* *

@ -854,6 +854,28 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
return groupResult; return groupResult;
} }
@Override
public int getHierarchicalGroupCount() throws GroupManagementException {
if (log.isDebugEnabled()) {
log.debug("Get groups count");
}
try {
GroupManagementDAOFactory.openConnection();
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
return groupDAO.getGroupCount(tenantId, null);
} catch (GroupManagementDAOException e) {
String msg = "Error occurred while retrieving all groups in tenant";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (SQLException e) {
String msg = "Error occurred while opening a connection to the data source.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
}
@Override @Override
public int getGroupCount() throws GroupManagementException { public int getGroupCount() throws GroupManagementException {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
@ -962,6 +984,52 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
} }
} }
/**
* {@inheritDoc}
*/
@Override
public int getHierarchicalGroupCount(String username, String parentPath) throws GroupManagementException {
if (username == null || username.isEmpty()) {
String msg = "Received empty user name for getHierarchicalGroupCount";
log.error(msg);
throw new GroupManagementException(msg);
}
if (log.isDebugEnabled()) {
log.debug("Get groups count of '" + username + "'");
}
UserStoreManager userStoreManager;
int count;
try {
GroupManagementDAOFactory.openConnection();
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
userStoreManager = DeviceManagementDataHolder.getInstance().getRealmService().getTenantUserRealm(tenantId)
.getUserStoreManager();
if (isAdminUser(username, userStoreManager)) {
count = groupDAO.getGroupCount(tenantId, null);
return count;
} else {
String[] roleList = userStoreManager.getRoleListOfUser(username);
count = groupDAO.getOwnGroupsCount(username, tenantId, parentPath);
count += groupDAO.getGroupsCount(roleList, tenantId, parentPath);
return count;
}
} catch (UserStoreException e) {
String msg = "Error occurred while retrieving role list of user '" + username + "'";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (SQLException e) {
String msg = "Error occurred while opening db connection to get group count.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (GroupManagementDAOException e) {
String msg = "Error occurred while retrieving group count of user '" + username + "'";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */

@ -17,12 +17,6 @@
*/ */
package io.entgra.device.mgt.core.device.mgt.core.push.notification.mgt.task; package io.entgra.device.mgt.core.device.mgt.core.push.notification.mgt.task;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.mockito.Mockito;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException;
import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException;
import io.entgra.device.mgt.core.device.mgt.core.common.BaseDeviceManagementTest; import io.entgra.device.mgt.core.device.mgt.core.common.BaseDeviceManagementTest;
@ -37,6 +31,14 @@ import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationMana
import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory;
import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService;
import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl;
import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.exception.HeartBeatManagementException;
import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.mockito.Mockito;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.registry.core.exceptions.RegistryException;
import java.sql.SQLException; import java.sql.SQLException;
@ -52,13 +54,16 @@ public class PushNotificationSchedulerTaskTest extends BaseDeviceManagementTest
private PushNotificationSchedulerTask pushNotificationSchedulerTask; private PushNotificationSchedulerTask pushNotificationSchedulerTask;
private OperationDAO operationDAO; private OperationDAO operationDAO;
private HeartBeatManagementService heartBeatManagementService;
@BeforeClass @BeforeClass
public void init() throws DeviceManagementException, RegistryException { public void init() throws DeviceManagementException, RegistryException {
DeviceConfigurationManager.getInstance().initConfig(); DeviceConfigurationManager.getInstance().initConfig();
log.info("Initializing Push Notification Scheduler Test Class"); log.info("Initializing Push Notification Scheduler Test Class");
DeviceManagementServiceComponent.notifyStartupListeners(); DeviceManagementServiceComponent.notifyStartupListeners();
this.deviceMgtProviderService = Mockito.mock(DeviceManagementProviderServiceImpl.class, Mockito.CALLS_REAL_METHODS); this.deviceMgtProviderService = Mockito.mock(DeviceManagementProviderServiceImpl.class, Mockito.CALLS_REAL_METHODS);
this.heartBeatManagementService = Mockito.mock(HeartBeatManagementService.class, Mockito.CALLS_REAL_METHODS);
DeviceManagementDataHolder.getInstance().setDeviceManagementProvider(this.deviceMgtProviderService); DeviceManagementDataHolder.getInstance().setDeviceManagementProvider(this.deviceMgtProviderService);
DeviceManagementDataHolder.getInstance().setHeartBeatService(this.heartBeatManagementService);
this.operationDAO = OperationManagementDAOFactory.getOperationDAO(); this.operationDAO = OperationManagementDAOFactory.getOperationDAO();
this.pushNotificationSchedulerTask = new PushNotificationSchedulerTask(); this.pushNotificationSchedulerTask = new PushNotificationSchedulerTask();
} }
@ -69,6 +74,7 @@ public class PushNotificationSchedulerTaskTest extends BaseDeviceManagementTest
OperationManagementDAOException { OperationManagementDAOException {
try { try {
log.info("Attempting to execute push notification task scheduler"); log.info("Attempting to execute push notification task scheduler");
Mockito.when(this.heartBeatManagementService.isTaskPartitioningEnabled()).thenReturn(false);
Mockito.doReturn(new TestNotificationStrategy()).when(this.deviceMgtProviderService) Mockito.doReturn(new TestNotificationStrategy()).when(this.deviceMgtProviderService)
.getNotificationStrategyByDeviceType(Mockito.anyString()); .getNotificationStrategyByDeviceType(Mockito.anyString());
Mockito.doReturn(new io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation()) Mockito.doReturn(new io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation())
@ -81,6 +87,8 @@ public class PushNotificationSchedulerTaskTest extends BaseDeviceManagementTest
.getPushNotificationConfiguration().getSchedulerBatchSize()); .getPushNotificationConfiguration().getSchedulerBatchSize());
Assert.assertEquals(operationMappingsTenantMap.size(), 0); Assert.assertEquals(operationMappingsTenantMap.size(), 0);
log.info("Push notification task execution complete."); log.info("Push notification task execution complete.");
} catch (HeartBeatManagementException e) {
throw new RuntimeException(e);
} finally { } finally {
OperationManagementDAOFactory.closeConnection(); OperationManagementDAOFactory.closeConnection();
} }

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>heartbeat-management</artifactId> <artifactId>heartbeat-management</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
@ -70,6 +70,7 @@
!io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.internal, !io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.internal,
io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.* io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.*
</Export-Package> </Export-Package>
<DynamicImport-Package>*</DynamicImport-Package>
</instructions> </instructions>
</configuration> </configuration>
</plugin> </plugin>

@ -28,6 +28,7 @@ import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBea
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.osgi.service.component.ComponentContext; import org.osgi.service.component.ComponentContext;
import org.wso2.carbon.core.ServerStartupObserver;
import org.wso2.carbon.ndatasource.core.DataSourceService; import org.wso2.carbon.ndatasource.core.DataSourceService;
import java.util.List; import java.util.List;
@ -73,7 +74,9 @@ public class HeartBeatBeaconComponent {
clusterFormationChangedNotifierRepository); clusterFormationChangedNotifierRepository);
//Setting up executors to notify heart beat status */ //Setting up executors to notify heart beat status */
HeartBeatExecutor.setUpNotifiers(HeartBeatBeaconUtils.getServerDetails()); HeartBeatExecutor heartBeatExecutor = new HeartBeatExecutor();
componentContext.getBundleContext().registerService(
ServerStartupObserver.class.getName(), heartBeatExecutor, null);
} }

@ -26,13 +26,16 @@ import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dto.ServerContex
import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.exception.HeartBeatManagementException; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.exception.HeartBeatManagementException;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.core.ServerStartupObserver;
import java.io.IOException; import java.io.IOException;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
public class HeartBeatExecutor { public class HeartBeatExecutor implements ServerStartupObserver {
private static Log log = LogFactory.getLog(HeartBeatExecutor.class); private static Log log = LogFactory.getLog(HeartBeatExecutor.class);
private static final int DEFAULT__NOTIFIER_INTERVAL = 5; private static final int DEFAULT__NOTIFIER_INTERVAL = 5;
@ -43,6 +46,20 @@ public class HeartBeatExecutor {
CONFIG = HeartBeatBeaconConfig.getInstance(); CONFIG = HeartBeatBeaconConfig.getInstance();
} }
@Override
public void completingServerStartup() {
}
@Override
public void completedServerStartup() {
try {
setUpNotifiers(HeartBeatBeaconUtils.getServerDetails());
} catch (HeartBeatBeaconConfigurationException | UnknownHostException | SocketException e) {
throw new RuntimeException(e);
}
}
static void setUpNotifiers(ServerContext ctx) throws HeartBeatBeaconConfigurationException { static void setUpNotifiers(ServerContext ctx) throws HeartBeatBeaconConfigurationException {
ScheduledExecutorService executor = ScheduledExecutorService executor =
Executors.newSingleThreadScheduledExecutor(); Executors.newSingleThreadScheduledExecutor();

@ -235,6 +235,7 @@ public class HeartBeatManagementServiceImpl implements HeartBeatManagementServic
} }
} else { } else {
//first time execution, elect if not present //first time execution, elect if not present
heartBeatDAO.purgeCandidates();
electCandidate(servers); electCandidate(servers);
} }
HeartBeatBeaconDAOFactory.commitTransaction(); HeartBeatBeaconDAOFactory.commitTransaction();
@ -268,6 +269,10 @@ public class HeartBeatManagementServiceImpl implements HeartBeatManagementServic
String serverUUID = HeartBeatBeaconDataHolder.getInstance().getLocalServerUUID(); String serverUUID = HeartBeatBeaconDataHolder.getInstance().getLocalServerUUID();
ServerContext serverContext = servers.get(serverUUID); ServerContext serverContext = servers.get(serverUUID);
if (log.isDebugEnabled()) {
log.debug("HashIndex (previous, current) : " + lastHashIndex + ", " + serverContext.getIndex());
log.debug("ActiveServerCount (previous, current) : " + lastActiveCount + ", " + servers.size());
}
// cluster change can be identified, either by changing hash index or changing active server count // cluster change can be identified, either by changing hash index or changing active server count
if ((lastHashIndex != serverContext.getIndex()) || (lastActiveCount != servers.size())) { if ((lastHashIndex != serverContext.getIndex()) || (lastActiveCount != servers.size())) {
lastHashIndex = serverContext.getIndex(); lastHashIndex = serverContext.getIndex();
@ -280,6 +285,9 @@ public class HeartBeatManagementServiceImpl implements HeartBeatManagementServic
Runnable r = new Runnable() { Runnable r = new Runnable() {
@Override @Override
public void run() { public void run() {
if (log.isDebugEnabled()) {
log.debug("notify cluster formation changed : " + notifier.getType());
}
notifier.notifyClusterFormationChanged(lastHashIndex, lastActiveCount); notifier.notifyClusterFormationChanged(lastHashIndex, lastActiveCount);
} }
}; };

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>identity-extensions</artifactId> <artifactId>identity-extensions</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>identity-extensions</artifactId> <artifactId>identity-extensions</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -23,7 +23,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>logger</artifactId> <artifactId>logger</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
</parent> </parent>
<artifactId>io.entgra.device.mgt.core.notification.logger</artifactId> <artifactId>io.entgra.device.mgt.core.notification.logger</artifactId>

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>operation-template-mgt</artifactId> <artifactId>operation-template-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -23,7 +23,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -20,7 +20,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>subtype-mgt</artifactId> <artifactId>subtype-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -20,7 +20,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -20,7 +20,7 @@
<parent> <parent>
<artifactId>task-manager</artifactId> <artifactId>task-manager</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>task-manager</artifactId> <artifactId>task-manager</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>task-mgt</artifactId> <artifactId>task-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>task-watcher</artifactId> <artifactId>task-watcher</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>task-mgt</artifactId> <artifactId>task-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -20,7 +20,7 @@
<parent> <parent>
<artifactId>tenant-mgt</artifactId> <artifactId>tenant-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -20,7 +20,7 @@
<parent> <parent>
<artifactId>tenant-mgt</artifactId> <artifactId>tenant-mgt</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -20,7 +20,7 @@
<parent> <parent>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>email-sender</artifactId> <artifactId>email-sender</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>transport-mgt</artifactId> <artifactId>transport-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>sms-handler</artifactId> <artifactId>sms-handler</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>sms-handler</artifactId> <artifactId>sms-handler</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>sms-handler</artifactId> <artifactId>sms-handler</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>transport-mgt</artifactId> <artifactId>transport-mgt</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>ui-request-interceptor</artifactId> <artifactId>ui-request-interceptor</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>webapp-authenticator-framework</artifactId> <artifactId>webapp-authenticator-framework</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>grafana-mgt-feature</artifactId> <artifactId>grafana-mgt-feature</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>grafana-mgt-feature</artifactId> <artifactId>grafana-mgt-feature</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>analytics-mgt-feature</artifactId> <artifactId>analytics-mgt-feature</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>io.entgra.device.mgt.core.parent</artifactId> <artifactId>io.entgra.device.mgt.core.parent</artifactId>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

@ -20,7 +20,7 @@
<parent> <parent>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>apimgt-extensions-feature</artifactId> <artifactId>apimgt-extensions-feature</artifactId>
<version>5.0.30-SNAPSHOT</version> <version>5.0.31-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

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

Loading…
Cancel
Save