Compare commits

Invalid templates have been ignored

1 invalid template(s) found pull_request_template.md: frontmatter must start with a separator line

...

26 Commits

Author SHA1 Message Date
builder 7c0adfbc89 [maven-release-plugin] prepare for next development iteration
1 year ago
builder f7c3e129c4 [maven-release-plugin] prepare release v5.0.29
1 year ago
Lasantha Dharmakeerthi a2b59c2a35 Add improvements to certificate component
1 year ago
Navod Zoysa dbc73d18ed Add improvements to certificate component
1 year ago
Nishan Sangeeth 017c70fa08 Fix Certificate test case and delete and search option
1 year ago
Pahansith Gunathilake 7afe7fca08 Merge pull request 'Add app details for UNMANAGED_APP_UNINSTALL' (#210) from osh.silva/device-mgt-core:unmanaged-install-9211 into master
1 year ago
Pahansith Gunathilake d83b417a0b Merge branch 'master' into unmanaged-install-9211
1 year ago
Charitha Goonetilleke 9e8b8efd4b Merge pull request 'Operation Template releated changes' (#212) from thameera/device-mgt-core:feature/operation-template into master
1 year ago
Thameera 70c27b647b Operation Template releated changes
1 year ago
osh 195bb64bea Resolve comments
1 year ago
osh 4fbcd75a61 Merge branch 'master' of ssh://repository.entgra.net:222/community/device-mgt-core into unmanaged-install-9211
1 year ago
Lasantha Dharmakeerthi 44f58ccbc0 Fix try-it meta-info getting issue
1 year ago
Lasantha Dharmakeerthi 6ae3990bba Remove not null constraints from metainfo field
1 year ago
Rajitha Kumara 127b554ef7 Remove not null constraints from metainfo field
1 year ago
osh 1fed47e8fd Add app details for UNMANAGED_APP_UNINSTALL
1 year ago
Pramila Niroshan 388f34e3b8 Fix try-it meta-info getting issue
1 year ago
Inosh Perara 5f5ac9d5ab Merge pull request 'Add firmware system version column' (#206) from shamalka1/device-mgt-core:device-info-config into master
1 year ago
shamalka bef4ff3768 Merge branch 'master' of https://repository.entgra.net/community/device-mgt-core into device-info-config
1 year ago
shamalka 6d6d3f4f40 Add firmware system version column
1 year ago
Lasantha Dharmakeerthi f6cd325bff Add device info config into mdm-ui-config.xml
1 year ago
shamalka f286cb2306 Merge branch 'master' of https://repository.entgra.net/community/device-mgt-core into device-info-config
1 year ago
shamalka 4ab0c77e8e Add i8n support
1 year ago
Lasantha Dharmakeerthi cf5664bb59 Fix APPs getting issue in APPM DAO
1 year ago
tcdlpds f9ae594326 Fix APPs getting issue in APPM DAO
1 year ago
shamalka d869159625 Add missing type params to device info xml
1 year ago
shamalka 67864cb762 Add deviceinfo config beans
1 year ago

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -247,14 +247,15 @@ public interface CertificateManagementAdminService {
*
* @return paginated result of certificate.
*/
@GET
@ApiOperation(
consumes = MediaType.APPLICATION_JSON,
produces = MediaType.APPLICATION_JSON,
httpMethod = "GET",
value = "Getting Details of Certificates",
notes = "Get all the details of the certificates you have used for mutual SSL. In a situation where you wish to "
+ "view all the certificate details, it is not feasible to show all the details on one "
value = "Getting Details of search Certificates",
notes = "Get all the details of the search certificates you have used for mutual SSL. In a situation where you wish to "
+ "view all the search certificate details, it is not feasible to show all the details on one "
+ "page. Therefore, the details are paginated.",
tags = "Certificate Management",
extensions = {
@ -307,6 +308,28 @@ public interface CertificateManagementAdminService {
response = ErrorResponse.class)
})
Response getAllCertificates(
@ApiParam(
name = "serialNumber",
value = "The serial number of the certificates",
required = false)
@QueryParam("serialNumber") String serialNumber,
@ApiParam(
name = "deviceIdentifier",
value = "The device identifier of the certificates",
required = false)
@QueryParam("deviceIdentifier") String deviceIdentifier,
@ApiParam(
name = "username",
value = "User name of the certificate added user",
required = false)
@QueryParam("username") String username,
@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,
@ApiParam(
name = "offset",
value = "The starting pagination index for the complete list of qualified items.",
@ -318,14 +341,7 @@ public interface CertificateManagementAdminService {
value = "Provide how many certificate details you require from the starting pagination index/offset.",
required = false,
defaultValue = "5")
@QueryParam("limit") int limit,
@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);
@QueryParam("limit") int limit);
@DELETE
@ApiOperation(

@ -18,7 +18,6 @@
package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.impl;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
@ -26,7 +25,9 @@ import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import io.entgra.device.mgt.core.device.mgt.common.CertificatePaginationRequest;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.CertificateManagementAdminService;
@ -84,6 +85,13 @@ public class CertificateManagementAdminServiceImpl implements CertificateManagem
certificate.setTenantId(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
certificate.setSerial(enrollmentCertificate.getSerial());
certificate.setCertificate(certificateService.pemToX509Certificate(enrollmentCertificate.getPem()));
CertificateResponse existingCertificate = certificateService.getCertificateBySerial(enrollmentCertificate.getSerial());
if (existingCertificate != null) {
return Response.status(Response.Status.BAD_REQUEST)
.entity("Certificate with serial number " + enrollmentCertificate.getSerial() + " already exists.")
.build();
}
certificates.add(certificate);
}
certificateService.saveCertificate(certificates);
@ -131,13 +139,27 @@ public class CertificateManagementAdminServiceImpl implements CertificateManagem
*/
@GET
public Response getAllCertificates(
@QueryParam("serialNumber") String serialNumber,
@QueryParam("deviceIdentifier") String deviceIdentifier,
@QueryParam("username") String username,
@HeaderParam("If-Modified-Since") String ifModifiedSince,
@QueryParam("offset") int offset,
@QueryParam("limit") int limit,
@HeaderParam("If-Modified-Since") String ifModifiedSince) {
@QueryParam("limit") int limit) {
RequestValidationUtil.validatePaginationInfo(offset, limit);
CertificateManagementService certificateService = CertificateMgtAPIUtils.getCertificateManagementService();
CertificatePaginationRequest request = new CertificatePaginationRequest(offset, limit);
if (StringUtils.isNotEmpty(serialNumber)) {
request.setSerialNumber(serialNumber);
}
if (StringUtils.isNotEmpty(deviceIdentifier)){
request.setDeviceIdentifier(deviceIdentifier);
}
if (StringUtils.isNotEmpty(username)){
request.setUsername(username);
}
try {
PaginationResult result = certificateService.getAllCertificates(offset, limit);
PaginationResult result = certificateService.getAllCertificates(request);
CertificateList certificates = new CertificateList();
certificates.setCount(result.getRecordsTotal());
certificates.setList((List<CertificateResponse>) result.getData());
@ -151,23 +173,38 @@ public class CertificateManagementAdminServiceImpl implements CertificateManagem
}
@DELETE
public Response removeCertificate(@QueryParam("certificateId") String certificateId) {
RequestValidationUtil.validateCertificateId(certificateId);
public Response removeCertificate(@QueryParam("serialNumber") String serialNumber) {
RequestValidationUtil.validateSerialNumber(serialNumber);
CertificateManagementService certificateService = CertificateMgtAPIUtils.getCertificateManagementService();
try {
boolean status = certificateService.removeCertificate(certificateId);
if (!status) {
return Response.status(Response.Status.NOT_FOUND).entity(
"No certificate is found with the given " +
"certificate id '" + certificateId + "'").build();
boolean decision = certificateService.getValidateMetaValue();
if (decision) {
try {
boolean status = certificateService.removeCertificate(serialNumber);
if (!status) {
return Response.status(Response.Status.NOT_FOUND).entity(
"No certificate is found with the given " +
"serial number '" + serialNumber + "'").build();
} else {
return Response.status(Response.Status.OK).entity(
"Certificate that carries the serial number '" +
serialNumber + "' has been removed").build();
}
} catch (CertificateManagementException e) {
String msg = "Error occurred while removing certificate with the given " +
"serial number '" + serialNumber + "'";
log.error(msg, e);
return Response.serverError().entity(
new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build();
}
} else {
return Response.status(Response.Status.OK).entity(
"Certificate that carries the certificate id '" +
certificateId + "' has been removed").build();
return Response.status(Response.Status.UNAUTHORIZED).entity(
"User unauthorized to delete certificate with " +
"serial number '" + serialNumber + "'").build();
}
} catch (CertificateManagementException e) {
String msg = "Error occurred while converting PEM file to X509Certificate";
String msg = "Error occurred while getting the metadata entry for certificate deletion.";
log.error(msg, e);
return Response.serverError().entity(
new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build();

@ -30,14 +30,6 @@ public class RequestValidationUtil {
}
}
public static void validateCertificateId(String certificateId) {
if (certificateId == null || certificateId.isEmpty()) {
throw new InputValidationException(
new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(
"Certificate Id cannot be null or empty").build());
}
}
public static void validatePaginationInfo(int offset, int limit) {
if (offset < 0) {
throw new InputValidationException(

@ -21,7 +21,7 @@
<parent>
<groupId>io.entgra.device.mgt.core</groupId>
<artifactId>certificate-mgt</artifactId>
<version>5.0.29-SNAPSHOT</version>
<version>5.0.30-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -56,6 +56,7 @@
<Import-Package>
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.apache.commons.lang,
org.apache.commons.logging,
org.apache.commons.collections.map,
javax.security.auth.x500,
@ -95,7 +96,8 @@
io.entgra.device.mgt.core.device.mgt.core.*,
org.wso2.carbon.registry.indexing.*,
javax.cache.*,
javax.naming.ldap
javax.naming.ldap,
com.google.gson.*
<!--org.bouncycastle.pkcs.jcajce-->
</Import-Package>
<Export-Package>
@ -253,6 +255,10 @@
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple.wso2</groupId>
<artifactId>json-simple</artifactId>
</dependency>
</dependencies>
</project>

@ -18,8 +18,10 @@
package io.entgra.device.mgt.core.certificate.mgt.core.dao;
import io.entgra.device.mgt.core.device.mgt.common.CertificatePaginationRequest;
import io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException;
import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult;
import java.util.List;
@ -75,13 +77,12 @@ public interface CertificateDAO {
/**
* Get all the certificates in a paginated manner.
*
* @param rowNum Stating index of the paginated result.
* @param limit Number of records to return.
* @param request index of the paginated result.
* @return Pagination result with data and the count of results.
* @throws CertificateManagementDAOException
*
*/
PaginationResult getAllCertificates(int rowNum, int limit) throws CertificateManagementDAOException;
PaginationResult getAllCertificates(CertificatePaginationRequest request) throws CertificateManagementDAOException;
/**
* Get all the certificates.
@ -95,10 +96,10 @@ public interface CertificateDAO {
/**
* Delete a certificate identified by a serial number()
*
* @param certificateId number
* @param serialNumber number
* @return whether the certificate was removed or not.
*/
boolean removeCertificate(String certificateId) throws CertificateManagementDAOException;
boolean removeCertificate(String serialNumber) throws CertificateManagementDAOException;
List<CertificateResponse> searchCertificate(String serialNumber) throws CertificateManagementDAOException;

@ -237,7 +237,7 @@ public abstract class AbstractCertificateDAOImpl implements CertificateDAO{
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
try {
Connection conn = this.getConnection();
String sql = "SELECT CERTIFICATE, SERIAL_NUMBER, ID, DEVICE_IDENTIFIER, TENANT_ID, USERNAME"
String sql = "SELECT CERTIFICATE, SERIAL_NUMBER, TENANT_ID, USERNAME"
+ " FROM DM_DEVICE_CERTIFICATE WHERE TENANT_ID = ? ORDER BY ID DESC";
stmt = conn.prepareStatement(sql);
stmt.setInt(1, tenantId);
@ -247,8 +247,6 @@ public abstract class AbstractCertificateDAOImpl implements CertificateDAO{
certificateResponse = new CertificateResponse();
byte[] certificateBytes = resultSet.getBytes("CERTIFICATE");
certificateResponse.setSerialNumber(resultSet.getString("SERIAL_NUMBER"));
certificateResponse.setCertificateId(resultSet.getString("ID"));
certificateResponse.setDeviceIdentifier(resultSet.getString("DEVICE_IDENTIFIER"));
certificateResponse.setTenantId(resultSet.getInt("TENANT_ID"));
certificateResponse.setUsername(resultSet.getString("USERNAME"));
CertificateGenerator.extractCertificateDetails(certificateBytes, certificateResponse);
@ -265,7 +263,7 @@ public abstract class AbstractCertificateDAOImpl implements CertificateDAO{
}
@Override
public boolean removeCertificate(String certificateId) throws CertificateManagementDAOException {
public boolean removeCertificate(String serialNumber) throws CertificateManagementDAOException {
Connection conn;
PreparedStatement stmt = null;
ResultSet resultSet = null;
@ -273,15 +271,15 @@ public abstract class AbstractCertificateDAOImpl implements CertificateDAO{
try {
conn = this.getConnection();
String query =
"DELETE FROM DM_DEVICE_CERTIFICATE WHERE ID = ?" +
"DELETE FROM DM_DEVICE_CERTIFICATE WHERE SERIAL_NUMBER = ?" +
" AND TENANT_ID = ? ";
stmt = conn.prepareStatement(query);
stmt.setString(1, certificateId);
stmt.setString(1, serialNumber);
stmt.setInt(2, tenantId);
return stmt.executeUpdate() > 0;
} catch (SQLException e) {
String msg = "Unable to get the read the certificate with certificate id" + certificateId;
String msg = "Unable to get the read the certificate with serialNumber" + serialNumber;
log.error(msg, e);
throw new CertificateManagementDAOException(msg, e);
} finally {

@ -18,13 +18,14 @@
package io.entgra.device.mgt.core.certificate.mgt.core.dao.impl;
import io.entgra.device.mgt.core.device.mgt.common.CertificatePaginationRequest;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOUtil;
import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult;
import org.wso2.carbon.context.PrivilegedCarbonContext;
@ -47,14 +48,47 @@ public class GenericCertificateDAOImpl extends AbstractCertificateDAOImpl {
private Connection getConnection() throws SQLException {
return CertificateManagementDAOFactory.getConnection();
}
private int getCertificateCount(int tenantId) throws CertificateManagementDAOException, SQLException {
private int getCertificateCount(CertificatePaginationRequest request) throws CertificateManagementDAOException {
int certificateCount = 0;
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
String serialNumber = request.getSerialNumber();
String deviceIdentifier = request.getDeviceIdentifier();
String username = request.getUsername();
try {
Connection conn = this.getConnection();
String sql =
"SELECT COUNT(*) AS DEVICE_CERTIFICATE_COUNT FROM DM_DEVICE_CERTIFICATE WHERE TENANT_ID = ?";
String sql = "SELECT COUNT(*) AS DEVICE_CERTIFICATE_COUNT " +
"FROM DM_DEVICE_CERTIFICATE " +
"WHERE TENANT_ID = ?";
if (StringUtils.isNotEmpty(serialNumber)) {
sql += " AND SERIAL_NUMBER = ?";
}
if (StringUtils.isNotEmpty(deviceIdentifier)) {
sql += " AND DEVICE_IDENTIFIER = ?";
}
if (StringUtils.isNotEmpty(username)) {
sql += " AND USERNAME LIKE ?";
}
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
stmt.setInt(1, tenantId);
int paramIdx = 2;
if (StringUtils.isNotEmpty(serialNumber)) {
stmt.setString(paramIdx++, serialNumber);
}
if (StringUtils.isNotEmpty(deviceIdentifier)) {
stmt.setString(paramIdx++, deviceIdentifier);
}
if (StringUtils.isNotEmpty(username)) {
stmt.setString(paramIdx, "%" + username + "%");
}
try (ResultSet rs = stmt.executeQuery()) {
if (rs.next()) {
certificateCount = rs.getInt("DEVICE_CERTIFICATE_COUNT");
@ -62,54 +96,86 @@ public class GenericCertificateDAOImpl extends AbstractCertificateDAOImpl {
}
}
} catch (SQLException e) {
String errorMsg = "SQL error occurred while retrieving the certificates.";
String errorMsg = "SQL error occurred while retrieving the certificate count.";
log.error(errorMsg, e);
throw new CertificateManagementDAOException(errorMsg, e);
}
return certificateCount;
}
@Override
public PaginationResult getAllCertificates(int rowNum, int limit) throws CertificateManagementDAOException {
PreparedStatement stmt = null;
ResultSet resultSet = null;
public PaginationResult getAllCertificates(CertificatePaginationRequest request) throws CertificateManagementDAOException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
CertificateResponse certificateResponse;
List<CertificateResponse> certificates = new ArrayList<>();
PaginationResult paginationResult;
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
String serialNumber = request.getSerialNumber();
String deviceIdentifier = request.getDeviceIdentifier();
String username = request.getUsername();
boolean isCertificateSerialNumberProvided = false;
boolean isCertificateDeviceIdentifierProvided = false;
boolean isCertificateUsernameProvided = false;
try {
Connection conn = this.getConnection();
String sql = "SELECT CERTIFICATE, SERIAL_NUMBER, ID, DEVICE_IDENTIFIER, TENANT_ID, USERNAME FROM "
+ "DM_DEVICE_CERTIFICATE WHERE TENANT_ID = ? ORDER BY ID DESC LIMIT ?,?";
stmt = conn.prepareStatement(sql);
stmt.setInt(1, tenantId);
stmt.setInt(2, rowNum);
stmt.setInt(3, limit);
resultSet = stmt.executeQuery();
int resultCount = 0;
while (resultSet.next()) {
certificateResponse = new CertificateResponse();
byte[] certificateBytes = resultSet.getBytes("CERTIFICATE");
certificateResponse.setSerialNumber(resultSet.getString("SERIAL_NUMBER"));
certificateResponse.setCertificateId(resultSet.getString("ID"));
certificateResponse.setDeviceIdentifier(resultSet.getString("DEVICE_IDENTIFIER"));
certificateResponse.setTenantId(resultSet.getInt("TENANT_ID"));
certificateResponse.setUsername(resultSet.getString("USERNAME"));
CertificateGenerator.extractCertificateDetails(certificateBytes, certificateResponse);
certificates.add(certificateResponse);
resultCount++;
String query = "SELECT * " +
"FROM DM_DEVICE_CERTIFICATE " +
"WHERE TENANT_ID = ? ";
if (StringUtils.isNotEmpty(serialNumber)) {
query += "AND SERIAL_NUMBER = ? ";
isCertificateSerialNumberProvided = true;
}
if (StringUtils.isNotEmpty(deviceIdentifier)) {
query += "AND DEVICE_IDENTIFIER = ? ";
isCertificateDeviceIdentifierProvided = true;
}
if (StringUtils.isNotEmpty(username)) {
query += "AND USERNAME LIKE ? ";
isCertificateUsernameProvided = true;
}
query += "ORDER BY ID LIMIT ?,?";
try (PreparedStatement stmt = conn.prepareStatement(query)) {
int paramIdx = 1;
stmt.setInt(paramIdx++, tenantId);
if (isCertificateSerialNumberProvided) {
stmt.setString(paramIdx++, serialNumber);
}
if (isCertificateDeviceIdentifierProvided) {
stmt.setString(paramIdx++, deviceIdentifier);
}
if (isCertificateUsernameProvided) {
stmt.setString(paramIdx++, "%" + username + "%");
}
stmt.setInt(paramIdx++, request.getStartIndex());
stmt.setInt(paramIdx++, request.getRowCount());
try (ResultSet resultSet = stmt.executeQuery()) {
while (resultSet.next()) {
certificateResponse = new CertificateResponse();
byte[] certificateBytes = resultSet.getBytes("CERTIFICATE");
certificateResponse.setSerialNumber(resultSet.getString("SERIAL_NUMBER"));
certificateResponse.setCertificateId(resultSet.getString("ID"));
certificateResponse.setDeviceIdentifier(resultSet.getString("DEVICE_IDENTIFIER"));
certificateResponse.setTenantId(resultSet.getInt("TENANT_ID"));
certificateResponse.setUsername(resultSet.getString("USERNAME"));
CertificateGenerator.extractCertificateDetails(certificateBytes, certificateResponse);
certificates.add(certificateResponse);
}
paginationResult = new PaginationResult();
paginationResult.setData(certificates);
paginationResult.setRecordsTotal(this.getCertificateCount(request));
}
}
paginationResult = new PaginationResult();
paginationResult.setData(certificates);
paginationResult.setRecordsTotal(this.getCertificateCount(tenantId));
} catch (SQLException e) {
String errorMsg = "SQL error occurred while retrieving the certificates.";
log.error(errorMsg, e);
throw new CertificateManagementDAOException(errorMsg, e);
} finally {
CertificateManagementDAOUtil.cleanupResources(stmt, resultSet);
}
return paginationResult;
}
}
}

@ -18,13 +18,14 @@
package io.entgra.device.mgt.core.certificate.mgt.core.dao.impl;
import io.entgra.device.mgt.core.device.mgt.common.CertificatePaginationRequest;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOUtil;
import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult;
import org.wso2.carbon.context.PrivilegedCarbonContext;
@ -44,45 +45,75 @@ public class OracleCertificateDAOImpl extends AbstractCertificateDAOImpl {
private static final Log log = LogFactory.getLog(OracleCertificateDAOImpl.class);
@Override
public PaginationResult getAllCertificates(int rowNum, int limit) throws CertificateManagementDAOException {
PreparedStatement stmt = null;
ResultSet resultSet = null;
public PaginationResult getAllCertificates(CertificatePaginationRequest request) throws CertificateManagementDAOException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
CertificateResponse certificateResponse;
List<CertificateResponse> certificates = new ArrayList<>();
PaginationResult paginationResult;
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
String serialNumber = request.getSerialNumber();
String deviceIdentifier = request.getDeviceIdentifier();
String username = request.getUsername();
boolean isCertificateSerialNumberProvided = false;
boolean isCertificateDeviceIdentifierProvided = false;
boolean isCertificateUsernameProvided = false;
try {
Connection conn = this.getConnection();
String sql = "SELECT CERTIFICATE, SERIAL_NUMBER, ID, DEVICE_IDENTIFIER, TENANT_ID, USERNAME FROM "
+ "DM_DEVICE_CERTIFICATE WHERE TENANT_ID = ? ORDER BY ID DESC OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";
stmt = conn.prepareStatement(sql);
stmt.setInt(1, tenantId);
stmt.setInt(2, rowNum);
stmt.setInt(3, limit);
resultSet = stmt.executeQuery();
int resultCount = 0;
while (resultSet.next()) {
certificateResponse = new CertificateResponse();
byte[] certificateBytes = resultSet.getBytes("CERTIFICATE");
certificateResponse.setSerialNumber(resultSet.getString("SERIAL_NUMBER"));
certificateResponse.setCertificateId(resultSet.getString("ID"));
certificateResponse.setDeviceIdentifier(resultSet.getString("DEVICE_IDENTIFIER"));
certificateResponse.setTenantId(resultSet.getInt("TENANT_ID"));
certificateResponse.setUsername(resultSet.getString("USERNAME"));
CertificateGenerator.extractCertificateDetails(certificateBytes, certificateResponse);
certificates.add(certificateResponse);
resultCount++;
String query = "SELECT * " +
"FROM DM_DEVICE_CERTIFICATE " +
"WHERE TENANT_ID = ? ";
if (StringUtils.isNotEmpty(serialNumber)) {
query += "AND SERIAL_NUMBER = ? ";
isCertificateSerialNumberProvided = true;
}
if (StringUtils.isNotEmpty(deviceIdentifier)) {
query += "AND DEVICE_IDENTIFIER = ? ";
isCertificateDeviceIdentifierProvided = true;
}
if (StringUtils.isNotEmpty(username)) {
query += "AND USERNAME LIKE ? ";
isCertificateUsernameProvided = true;
}
query += "ORDER BY ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";
try (PreparedStatement stmt = conn.prepareStatement(query)) {
int paramIdx = 1;
stmt.setInt(paramIdx++, tenantId);
if (isCertificateSerialNumberProvided) {
stmt.setString(paramIdx++, serialNumber);
}
if (isCertificateDeviceIdentifierProvided) {
stmt.setString(paramIdx++, deviceIdentifier);
}
if (isCertificateUsernameProvided) {
stmt.setString(paramIdx++, "%" + username + "%");
}
stmt.setInt(paramIdx++, request.getStartIndex());
stmt.setInt(paramIdx++, request.getRowCount());
try (ResultSet resultSet = stmt.executeQuery()) {
while (resultSet.next()) {
certificateResponse = new CertificateResponse();
byte[] certificateBytes = resultSet.getBytes("CERTIFICATE");
certificateResponse.setSerialNumber(resultSet.getString("SERIAL_NUMBER"));
certificateResponse.setCertificateId(resultSet.getString("ID"));
certificateResponse.setDeviceIdentifier(resultSet.getString("DEVICE_IDENTIFIER"));
certificateResponse.setTenantId(resultSet.getInt("TENANT_ID"));
certificateResponse.setUsername(resultSet.getString("USERNAME"));
CertificateGenerator.extractCertificateDetails(certificateBytes, certificateResponse);
certificates.add(certificateResponse);
}
paginationResult = new PaginationResult();
paginationResult.setData(certificates);
paginationResult.setRecordsTotal(this.getCertificateCount(request));
}
}
paginationResult = new PaginationResult();
paginationResult.setData(certificates);
paginationResult.setRecordsTotal(this.getCertificateCount(tenantId));
} catch (SQLException e) {
String errorMsg = "SQL error occurred while retrieving the certificates.";
log.error(errorMsg, e);
throw new CertificateManagementDAOException(errorMsg, e);
} finally {
CertificateManagementDAOUtil.cleanupResources(stmt, resultSet);
}
return paginationResult;
}
@ -91,14 +122,47 @@ public class OracleCertificateDAOImpl extends AbstractCertificateDAOImpl {
return CertificateManagementDAOFactory.getConnection();
}
private int getCertificateCount(int tenantId) throws CertificateManagementDAOException, SQLException {
private int getCertificateCount(CertificatePaginationRequest request) throws CertificateManagementDAOException {
int certificateCount = 0;
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
String serialNumber = request.getSerialNumber();
String deviceIdentifier = request.getDeviceIdentifier();
String username = request.getUsername();
try {
Connection conn = this.getConnection();
String sql =
"SELECT COUNT(*) AS DEVICE_CERTIFICATE_COUNT FROM DM_DEVICE_CERTIFICATE WHERE TENANT_ID = ?";
String sql = "SELECT COUNT(*) AS DEVICE_CERTIFICATE_COUNT " +
"FROM DM_DEVICE_CERTIFICATE " +
"WHERE TENANT_ID = ?";
if (StringUtils.isNotEmpty(serialNumber)) {
sql += " AND SERIAL_NUMBER = ?";
}
if (StringUtils.isNotEmpty(deviceIdentifier)) {
sql += " AND DEVICE_IDENTIFIER = ?";
}
if (StringUtils.isNotEmpty(username)) {
sql += " AND USERNAME LIKE ?";
}
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
stmt.setInt(1, tenantId);
int paramIdx = 2;
if (StringUtils.isNotEmpty(serialNumber)) {
stmt.setString(paramIdx++, serialNumber);
}
if (StringUtils.isNotEmpty(deviceIdentifier)) {
stmt.setString(paramIdx++, deviceIdentifier);
}
if (StringUtils.isNotEmpty(username)) {
stmt.setString(paramIdx, "%" + username + "%");
}
try (ResultSet rs = stmt.executeQuery()) {
if (rs.next()) {
certificateCount = rs.getInt("DEVICE_CERTIFICATE_COUNT");
@ -106,10 +170,11 @@ public class OracleCertificateDAOImpl extends AbstractCertificateDAOImpl {
}
}
} catch (SQLException e) {
String errorMsg = "SQL error occurred while retrieving the certificates.";
String errorMsg = "SQL error occurred while retrieving the certificate count.";
log.error(errorMsg, e);
throw new CertificateManagementDAOException(errorMsg, e);
}
return certificateCount;
}
}

@ -18,13 +18,14 @@
package io.entgra.device.mgt.core.certificate.mgt.core.dao.impl;
import io.entgra.device.mgt.core.device.mgt.common.CertificatePaginationRequest;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOUtil;
import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult;
import org.wso2.carbon.context.PrivilegedCarbonContext;
@ -44,45 +45,75 @@ public class PostgreSQLCertificateDAOImpl extends AbstractCertificateDAOImpl {
private static final Log log = LogFactory.getLog(PostgreSQLCertificateDAOImpl.class);
@Override
public PaginationResult getAllCertificates(int rowNum, int limit) throws CertificateManagementDAOException {
PreparedStatement stmt = null;
ResultSet resultSet = null;
public PaginationResult getAllCertificates(CertificatePaginationRequest request) throws CertificateManagementDAOException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
CertificateResponse certificateResponse;
List<CertificateResponse> certificates = new ArrayList<>();
PaginationResult paginationResult;
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
String serialNumber = request.getSerialNumber();
String deviceIdentifier = request.getDeviceIdentifier();
String username = request.getUsername();
boolean isCertificateSerialNumberProvided = false;
boolean isCertificateDeviceIdentifierProvided = false;
boolean isCertificateUsernameProvided = false;
try {
Connection conn = this.getConnection();
String sql = "SELECT CERTIFICATE, SERIAL_NUMBER, ID, DEVICE_IDENTIFIER, TENANT_ID, USERNAME FROM "
+ "DM_DEVICE_CERTIFICATE WHERE TENANT_ID = ? ORDER BY ID DESC LIMIT ? OFFSET ?";
stmt = conn.prepareStatement(sql);
stmt.setInt(1, tenantId);
stmt.setInt(2, limit);
stmt.setInt(3, rowNum);
resultSet = stmt.executeQuery();
int resultCount = 0;
while (resultSet.next()) {
certificateResponse = new CertificateResponse();
byte[] certificateBytes = resultSet.getBytes("CERTIFICATE");
certificateResponse.setSerialNumber(resultSet.getString("SERIAL_NUMBER"));
certificateResponse.setCertificateId(resultSet.getString("ID"));
certificateResponse.setDeviceIdentifier(resultSet.getString("DEVICE_IDENTIFIER"));
certificateResponse.setTenantId(resultSet.getInt("TENANT_ID"));
certificateResponse.setUsername(resultSet.getString("USERNAME"));
CertificateGenerator.extractCertificateDetails(certificateBytes, certificateResponse);
certificates.add(certificateResponse);
resultCount++;
String query = "SELECT * " +
"FROM DM_DEVICE_CERTIFICATE " +
"WHERE TENANT_ID = ? ";
if (StringUtils.isNotEmpty(serialNumber)) {
query += "AND SERIAL_NUMBER = ? ";
isCertificateSerialNumberProvided = true;
}
if (StringUtils.isNotEmpty(deviceIdentifier)) {
query += "AND DEVICE_IDENTIFIER = ? ";
isCertificateDeviceIdentifierProvided = true;
}
if (StringUtils.isNotEmpty(username)) {
query += "AND USERNAME LIKE ? ";
isCertificateUsernameProvided = true;
}
query += "ORDER BY ID LIMIT ? OFFSET ?";
try (PreparedStatement stmt = conn.prepareStatement(query)) {
int paramIdx = 1;
stmt.setInt(paramIdx++, tenantId);
if (isCertificateSerialNumberProvided) {
stmt.setString(paramIdx++, serialNumber);
}
if (isCertificateDeviceIdentifierProvided) {
stmt.setString(paramIdx++, deviceIdentifier);
}
if (isCertificateUsernameProvided) {
stmt.setString(paramIdx++, "%" + username + "%");
}
stmt.setInt(paramIdx++, request.getStartIndex());
stmt.setInt(paramIdx++, request.getRowCount());
try (ResultSet resultSet = stmt.executeQuery()) {
while (resultSet.next()) {
certificateResponse = new CertificateResponse();
byte[] certificateBytes = resultSet.getBytes("CERTIFICATE");
certificateResponse.setSerialNumber(resultSet.getString("SERIAL_NUMBER"));
certificateResponse.setCertificateId(resultSet.getString("ID"));
certificateResponse.setDeviceIdentifier(resultSet.getString("DEVICE_IDENTIFIER"));
certificateResponse.setTenantId(resultSet.getInt("TENANT_ID"));
certificateResponse.setUsername(resultSet.getString("USERNAME"));
CertificateGenerator.extractCertificateDetails(certificateBytes, certificateResponse);
certificates.add(certificateResponse);
}
paginationResult = new PaginationResult();
paginationResult.setData(certificates);
paginationResult.setRecordsTotal(this.getCertificateCount(request));
}
}
paginationResult = new PaginationResult();
paginationResult.setData(certificates);
paginationResult.setRecordsTotal(this.getCertificateCount(tenantId));
} catch (SQLException e) {
String errorMsg = "SQL error occurred while retrieving the certificates.";
log.error(errorMsg, e);
throw new CertificateManagementDAOException(errorMsg, e);
} finally {
CertificateManagementDAOUtil.cleanupResources(stmt, resultSet);
}
return paginationResult;
}
@ -91,14 +122,47 @@ public class PostgreSQLCertificateDAOImpl extends AbstractCertificateDAOImpl {
return CertificateManagementDAOFactory.getConnection();
}
private int getCertificateCount(int tenantId) throws CertificateManagementDAOException, SQLException {
private int getCertificateCount(CertificatePaginationRequest request) throws CertificateManagementDAOException {
int certificateCount = 0;
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
String serialNumber = request.getSerialNumber();
String deviceIdentifier = request.getDeviceIdentifier();
String username = request.getUsername();
try {
Connection conn = this.getConnection();
String sql =
"SELECT COUNT(*) AS DEVICE_CERTIFICATE_COUNT FROM DM_DEVICE_CERTIFICATE WHERE TENANT_ID = ?";
String sql = "SELECT COUNT(*) AS DEVICE_CERTIFICATE_COUNT " +
"FROM DM_DEVICE_CERTIFICATE " +
"WHERE TENANT_ID = ?";
if (StringUtils.isNotEmpty(serialNumber)) {
sql += " AND SERIAL_NUMBER = ?";
}
if (StringUtils.isNotEmpty(deviceIdentifier)) {
sql += " AND DEVICE_IDENTIFIER = ?";
}
if (StringUtils.isNotEmpty(username)) {
sql += " AND USERNAME ILIKE ?";
}
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
stmt.setInt(1, tenantId);
int paramIdx = 2;
if (StringUtils.isNotEmpty(serialNumber)) {
stmt.setString(paramIdx++, serialNumber);
}
if (StringUtils.isNotEmpty(deviceIdentifier)) {
stmt.setString(paramIdx++, deviceIdentifier);
}
if (StringUtils.isNotEmpty(username)) {
stmt.setString(paramIdx, "%" + username + "%");
}
try (ResultSet rs = stmt.executeQuery()) {
if (rs.next()) {
certificateCount = rs.getInt("DEVICE_CERTIFICATE_COUNT");
@ -106,10 +170,11 @@ public class PostgreSQLCertificateDAOImpl extends AbstractCertificateDAOImpl {
}
}
} catch (SQLException e) {
String errorMsg = "SQL error occurred while retrieving the certificates.";
String errorMsg = "SQL error occurred while retrieving the certificate count.";
log.error(errorMsg, e);
throw new CertificateManagementDAOException(errorMsg, e);
}
return certificateCount;
}
}

@ -18,13 +18,14 @@
package io.entgra.device.mgt.core.certificate.mgt.core.dao.impl;
import io.entgra.device.mgt.core.device.mgt.common.CertificatePaginationRequest;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOUtil;
import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult;
import org.wso2.carbon.context.PrivilegedCarbonContext;
@ -44,45 +45,75 @@ public class SQLServerCertificateDAOImpl extends AbstractCertificateDAOImpl {
private static final Log log = LogFactory.getLog(SQLServerCertificateDAOImpl.class);
@Override
public PaginationResult getAllCertificates(int rowNum, int limit) throws CertificateManagementDAOException {
PreparedStatement stmt = null;
ResultSet resultSet = null;
public PaginationResult getAllCertificates(CertificatePaginationRequest request) throws CertificateManagementDAOException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
CertificateResponse certificateResponse;
List<CertificateResponse> certificates = new ArrayList<>();
PaginationResult paginationResult;
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
String serialNumber = request.getSerialNumber();
String deviceIdentifier = request.getDeviceIdentifier();
String username = request.getUsername();
boolean isCertificateSerialNumberProvided = false;
boolean isCertificateDeviceIdentifierProvided = false;
boolean isCertificateUsernameProvided = false;
try {
Connection conn = this.getConnection();
String sql = "SELECT CERTIFICATE, SERIAL_NUMBER, ID, DEVICE_IDENTIFIER, TENANT_ID, USERNAME FROM "
+ "DM_DEVICE_CERTIFICATE WHERE TENANT_ID = ? ORDER BY ID DESC OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";
stmt = conn.prepareStatement(sql);
stmt.setInt(1, tenantId);
stmt.setInt(2, rowNum);
stmt.setInt(3, limit);
resultSet = stmt.executeQuery();
int resultCount = 0;
while (resultSet.next()) {
certificateResponse = new CertificateResponse();
byte[] certificateBytes = resultSet.getBytes("CERTIFICATE");
certificateResponse.setSerialNumber(resultSet.getString("SERIAL_NUMBER"));
certificateResponse.setCertificateId(resultSet.getString("ID"));
certificateResponse.setDeviceIdentifier(resultSet.getString("DEVICE_IDENTIFIER"));
certificateResponse.setTenantId(resultSet.getInt("TENANT_ID"));
certificateResponse.setUsername(resultSet.getString("USERNAME"));
CertificateGenerator.extractCertificateDetails(certificateBytes, certificateResponse);
certificates.add(certificateResponse);
resultCount++;
String query = "SELECT * " +
"FROM DM_DEVICE_CERTIFICATE " +
"WHERE TENANT_ID = ? ";
if (StringUtils.isNotEmpty(serialNumber)) {
query += "AND SERIAL_NUMBER = ? ";
isCertificateSerialNumberProvided = true;
}
if (StringUtils.isNotEmpty(deviceIdentifier)) {
query += "AND DEVICE_IDENTIFIER = ? ";
isCertificateDeviceIdentifierProvided = true;
}
if (StringUtils.isNotEmpty(username)) {
query += "AND USERNAME LIKE ? ";
isCertificateUsernameProvided = true;
}
query += "ORDER BY ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";
try (PreparedStatement stmt = conn.prepareStatement(query)) {
int paramIdx = 1;
stmt.setInt(paramIdx++, tenantId);
if (isCertificateSerialNumberProvided) {
stmt.setString(paramIdx++, serialNumber);
}
if (isCertificateDeviceIdentifierProvided) {
stmt.setString(paramIdx++, deviceIdentifier);
}
if (isCertificateUsernameProvided) {
stmt.setString(paramIdx++, "%" + username + "%");
}
stmt.setInt(paramIdx++, request.getStartIndex());
stmt.setInt(paramIdx++, request.getRowCount());
try (ResultSet resultSet = stmt.executeQuery()) {
while (resultSet.next()) {
certificateResponse = new CertificateResponse();
byte[] certificateBytes = resultSet.getBytes("CERTIFICATE");
certificateResponse.setSerialNumber(resultSet.getString("SERIAL_NUMBER"));
certificateResponse.setCertificateId(resultSet.getString("ID"));
certificateResponse.setDeviceIdentifier(resultSet.getString("DEVICE_IDENTIFIER"));
certificateResponse.setTenantId(resultSet.getInt("TENANT_ID"));
certificateResponse.setUsername(resultSet.getString("USERNAME"));
CertificateGenerator.extractCertificateDetails(certificateBytes, certificateResponse);
certificates.add(certificateResponse);
}
paginationResult = new PaginationResult();
paginationResult.setData(certificates);
paginationResult.setRecordsTotal(this.getCertificateCount(request));
}
}
paginationResult = new PaginationResult();
paginationResult.setData(certificates);
paginationResult.setRecordsTotal(this.getCertificateCount(tenantId));
} catch (SQLException e) {
String errorMsg = "SQL error occurred while retrieving the certificates.";
log.error(errorMsg, e);
throw new CertificateManagementDAOException(errorMsg, e);
} finally {
CertificateManagementDAOUtil.cleanupResources(stmt, resultSet);
}
return paginationResult;
}
@ -91,14 +122,47 @@ public class SQLServerCertificateDAOImpl extends AbstractCertificateDAOImpl {
return CertificateManagementDAOFactory.getConnection();
}
private int getCertificateCount(int tenantId) throws CertificateManagementDAOException, SQLException {
private int getCertificateCount(CertificatePaginationRequest request) throws CertificateManagementDAOException {
int certificateCount = 0;
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
String serialNumber = request.getSerialNumber();
String deviceIdentifier = request.getDeviceIdentifier();
String username = request.getUsername();
try {
Connection conn = this.getConnection();
String sql =
"SELECT COUNT(*) AS DEVICE_CERTIFICATE_COUNT FROM DM_DEVICE_CERTIFICATE WHERE TENANT_ID = ?";
String sql = "SELECT COUNT(*) AS DEVICE_CERTIFICATE_COUNT " +
"FROM DM_DEVICE_CERTIFICATE " +
"WHERE TENANT_ID = ?";
if (StringUtils.isNotEmpty(serialNumber)) {
sql += " AND SERIAL_NUMBER = ?";
}
if (StringUtils.isNotEmpty(deviceIdentifier)) {
sql += " AND DEVICE_IDENTIFIER = ?";
}
if (StringUtils.isNotEmpty(username)) {
sql += " AND USERNAME LIKE ?";
}
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
stmt.setInt(1, tenantId);
int paramIdx = 2;
if (StringUtils.isNotEmpty(serialNumber)) {
stmt.setString(paramIdx++, serialNumber);
}
if (StringUtils.isNotEmpty(deviceIdentifier)) {
stmt.setString(paramIdx++, deviceIdentifier);
}
if (StringUtils.isNotEmpty(username)) {
stmt.setString(paramIdx, "%" + username + "%");
}
try (ResultSet rs = stmt.executeQuery()) {
if (rs.next()) {
certificateCount = rs.getInt("DEVICE_CERTIFICATE_COUNT");
@ -106,10 +170,11 @@ public class SQLServerCertificateDAOImpl extends AbstractCertificateDAOImpl {
}
}
} catch (SQLException e) {
String errorMsg = "SQL error occurred while retrieving the certificates.";
String errorMsg = "SQL error occurred while retrieving the certificate count.";
log.error(errorMsg, e);
throw new CertificateManagementDAOException(errorMsg, e);
}
return certificateCount;
}
}

@ -17,6 +17,7 @@
*/
package io.entgra.device.mgt.core.certificate.mgt.core.service;
import io.entgra.device.mgt.core.device.mgt.common.CertificatePaginationRequest;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.SCEPResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException;
@ -71,9 +72,11 @@ public interface CertificateManagementService {
CertificateResponse retrieveCertificate(String serialNumber) throws CertificateManagementException;
PaginationResult getAllCertificates(int rowNum, int limit) throws CertificateManagementException;
PaginationResult getAllCertificates(CertificatePaginationRequest request) throws CertificateManagementException;
boolean removeCertificate(String certificateId) throws CertificateManagementException;
boolean removeCertificate(String serialNumber) throws CertificateManagementException;
boolean getValidateMetaValue() throws CertificateManagementException;
List<CertificateResponse> getCertificates() throws CertificateManagementException;

@ -17,6 +17,12 @@
*/
package io.entgra.device.mgt.core.certificate.mgt.core.service;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.JsonParser;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagerUtil;
import io.entgra.device.mgt.core.device.mgt.common.CertificatePaginationRequest;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateDAO;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
@ -27,12 +33,15 @@ import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreExceptio
import io.entgra.device.mgt.core.certificate.mgt.core.exception.TransactionManagementException;
import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator;
import io.entgra.device.mgt.core.certificate.mgt.core.impl.KeyStoreReader;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagerUtil;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.MetadataManagementException;
import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.bouncycastle.pkcs.PKCS10CertificationRequest;
import java.io.InputStream;
import java.security.PrivateKey;
import java.security.cert.Certificate;
@ -154,46 +163,70 @@ public class CertificateManagementServiceImpl implements CertificateManagementSe
}
@Override
public PaginationResult getAllCertificates(int rowNum, int limit) throws CertificateManagementException {
public PaginationResult getAllCertificates(CertificatePaginationRequest request) throws CertificateManagementException {
try {
CertificateManagementDAOFactory.openConnection();
CertificateDAO certificateDAO = CertificateManagementDAOFactory.getCertificateDAO();
return certificateDAO.getAllCertificates(rowNum, CertificateManagerUtil.validateCertificateListPageSize(limit));
return certificateDAO.getAllCertificates(request);
} catch (SQLException e) {
String msg = "Error occurred while opening a connection to the underlying data source";
log.error(msg, e);
throw new CertificateManagementException(msg, e);
} catch (CertificateManagementDAOException e) {
String msg = "Error occurred while looking up for the list of certificates managed in the underlying " +
"certificate repository";
"certificate repository";
log.error(msg, e);
throw new CertificateManagementException(msg, e);
} finally {
CertificateManagementDAOFactory.closeConnection();
}
}
@Override
public boolean removeCertificate(String certificateId) throws CertificateManagementException {
public boolean removeCertificate(String serialNumber) throws CertificateManagementException {
try {
CertificateManagementDAOFactory.beginTransaction();
CertificateDAO certificateDAO = CertificateManagementDAOFactory.getCertificateDAO();
boolean status = certificateDAO.removeCertificate(certificateId);
boolean status = certificateDAO.removeCertificate(serialNumber);
CertificateManagementDAOFactory.commitTransaction();
return status;
} catch (TransactionManagementException e) {
String msg = "Error occurred while removing certificate carrying certificate id '" + certificateId + "'";
String msg = "Error occurred while removing certificate carrying serialNumber '" + serialNumber + "'";
log.error(msg, e);
throw new CertificateManagementException(msg, e);
} catch (CertificateManagementDAOException e) {
CertificateManagementDAOFactory.rollbackTransaction();
String msg = "Error occurred while removing the certificate carrying certificate id '" + certificateId +
String msg = "Error occurred while removing the certificate carrying serialNumber '" + serialNumber +
"' from the certificate repository";
log.error(msg, e);
throw new CertificateManagementException(msg, e);
}
}
@Override
public boolean getValidateMetaValue() throws CertificateManagementException {
Metadata metadata;
try {
metadata = CertificateManagerUtil.getMetadataManagementService().retrieveMetadata(CertificateManagementConstants.CERTIFICATE_DELETE);
if (metadata != null) {
String metaValue = metadata.getMetaValue();
if (StringUtils.isNotEmpty(metaValue)) {
JsonParser parser = new JsonParser();
JsonObject jsonObject = parser.parse(metaValue).getAsJsonObject();
return jsonObject.get(CertificateManagementConstants.IS_CERTIFICATE_DELETE_ENABLE).getAsBoolean();
}
}
return false;
} catch (MetadataManagementException e) {
String msg = "Error occurred while getting the metadata entry for metaKey: " + CertificateManagementConstants.CERTIFICATE_DELETE;
log.error(msg, e);
throw new CertificateManagementException(msg, e);
} catch (JsonParseException e) {
String msg = "Error occurred while parsing the JSON metadata value for metaKey: " + CertificateManagementConstants.CERTIFICATE_DELETE;
log.error(msg, e);
throw new CertificateManagementException(msg, e);
}
}
@Override
public List<CertificateResponse> getCertificates() throws CertificateManagementException {
try {

@ -41,6 +41,12 @@ public final class CertificateManagementConstants {
public static final int RSA_KEY_LENGTH = 2048;
public static final String SIGNING_ALGORITHM = "SHA256withRSA";
public static final int DEFAULT_PAGE_LIMIT = 50;
public static final String CERTIFICATE_DELETE = "CERTIFICATE_DELETE";
public static final String IS_CERTIFICATE_DELETE_ENABLE = "isCertificateDelete";
public static final class DataBaseTypes {
private DataBaseTypes() {
throw new AssertionError();

@ -19,6 +19,7 @@
package io.entgra.device.mgt.core.certificate.mgt.core.util;
import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.MetadataManagementService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Document;
@ -28,6 +29,7 @@ import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.DataSour
import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.JNDILookupDefinition;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOUtil;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import javax.sql.DataSource;
import javax.xml.XMLConstants;
@ -41,6 +43,7 @@ public class CertificateManagerUtil {
public static final String GENERAL_CONFIG_RESOURCE_PATH = "general";
public static final String MONITORING_FREQUENCY = "notifierFrequency";
private static MetadataManagementService metadataManagementService;
private static final Log log = LogFactory.getLog(CertificateManagerUtil.class);
public static Document convertToDocument(File file) throws CertificateManagementException {
@ -105,4 +108,26 @@ public class CertificateManagerUtil {
return limit;
}
/**
* Initializing and accessing method for MetadataManagementService.
*
* @return MetadataManagementService instance
* @throws IllegalStateException if metadataManagementService cannot be initialized
*/
public static MetadataManagementService getMetadataManagementService() {
if (metadataManagementService == null) {
synchronized (CertificateManagerUtil.class) {
if (metadataManagementService == null) {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
metadataManagementService = (MetadataManagementService) ctx.getOSGiService(
MetadataManagementService.class, null);
if (metadataManagementService == null) {
throw new IllegalStateException("Metadata Management service not initialized.");
}
}
}
}
return metadataManagementService;
}
}

@ -18,6 +18,7 @@
package io.entgra.device.mgt.core.certificate.mgt.core.impl;
import io.entgra.device.mgt.core.device.mgt.common.CertificatePaginationRequest;
import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
@ -110,7 +111,8 @@ public class CertificateManagementServiceImplNegativeTests extends PowerMockTest
public void negativeTestGetAllCertificates() throws Exception {
PowerMockito.mockStatic(CertificateManagementDAOFactory.class);
PowerMockito.doThrow(new SQLException()).when(CertificateManagementDAOFactory.class, "openConnection");
instance.getAllCertificates(1, 2);
CertificatePaginationRequest request = new CertificatePaginationRequest(0, 2);
instance.getAllCertificates(request);
}
@Test(description = "This test case tests behaviour when an error occurs getting the list of certificates from repository"
@ -118,7 +120,8 @@ public class CertificateManagementServiceImplNegativeTests extends PowerMockTest
public void negativeTestGetAllCertificates2() throws Exception {
CertificateManagementDAOFactory.init(daoExceptionDatasource);
CertificateManagementServiceImpl instance1 = CertificateManagementServiceImpl.getInstance();
instance1.getAllCertificates(1, 2);
CertificatePaginationRequest request = new CertificatePaginationRequest(0, 2);
instance.getAllCertificates(request);
}
@Test(description = "This test case tests behaviour when data source transaction error occurs when removing the certificate"

@ -20,6 +20,7 @@ package io.entgra.device.mgt.core.certificate.mgt.core.impl;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CSRGenerator;
import io.entgra.device.mgt.core.certificate.mgt.core.util.DummyCertificate;
import io.entgra.device.mgt.core.device.mgt.common.CertificatePaginationRequest;
import org.apache.commons.io.FileUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -217,7 +218,8 @@ public class CertificateManagementServiceImplTests extends BaseDeviceManagementC
public void testGetAllCertificatesPaginated() throws CertificateManagementException, KeystoreException {
managementService.generateX509Certificate();
managementService.generateX509Certificate();
PaginationResult allCertificates = managementService.getAllCertificates(0, 2);
CertificatePaginationRequest request = new CertificatePaginationRequest(0,2);
PaginationResult allCertificates = managementService.getAllCertificates(request);
Assert.assertEquals(allCertificates.getData().size(), 2);
log.info("GetAllCertificatesPaginated Test Successful");
}

@ -37,6 +37,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_CERTIFICATE (
SERIAL_NUMBER VARCHAR(500) DEFAULT NULL,
CERTIFICATE BLOB DEFAULT NULL,
TENANT_ID INTEGER DEFAULT 0,
DEVICE_IDENTIFIER VARCHAR(300),
USERNAME VARCHAR(500) DEFAULT NULL,
PRIMARY KEY (ID)
);

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

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

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

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

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

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

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

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

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

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

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

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

@ -41,6 +41,14 @@ public class ApplicationUninstallation {
@Pattern(regexp = "^[A-Za-z]*$")
String type;
String name;
String platform;
String version;
String user;
public ApplicationUninstallation() {
}
@ -49,6 +57,47 @@ public class ApplicationUninstallation {
this.type = type;
}
public ApplicationUninstallation(String appIdentifier, String type, String name, String platform, String version, String user) {
this.appIdentifier = appIdentifier;
this.type = type;
this.name = name;
this.platform = platform;
this.version = version;
this.user = user;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPlatform() {
return platform;
}
public void setPlatform(String platform) {
this.platform = platform;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getAppIdentifier() {
return appIdentifier;
}

@ -1657,7 +1657,31 @@ public interface DeviceManagementService {
value = "The package name of the app user want to uninstall",
required = true)
@QueryParam("packageName")
String packageName);
String packageName,
@ApiParam(
name = "platform",
value = "The platform of the app user want to uninstall",
required = false)
@QueryParam("platform")
String platform,
@ApiParam(
name = "name",
value = "The name of the app user want to uninstall",
required = false)
@QueryParam("name")
String name,
@ApiParam(
name = "version",
value = "The version of the app user want to uninstall",
required = false)
@QueryParam("version")
String version,
@ApiParam(
name = "user",
value = "The user who triggered the app uninstall",
required = false)
@QueryParam("user")
String user);
@GET
@Produces(MediaType.APPLICATION_JSON)

@ -981,7 +981,11 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
public Response uninstallation(
@PathParam("type") @Size(max = 45) String type,
@PathParam("id") @Size(max = 45) String id,
@QueryParam("packageName") String packageName) {
@QueryParam("packageName") String packageName,
@QueryParam("platform") String platform,
@QueryParam("name") String name,
@QueryParam("version") String version,
@QueryParam("user") String user) {
List<DeviceIdentifier> deviceIdentifiers = new ArrayList<>();
Operation operation = new Operation();
try {
@ -1004,7 +1008,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
//if the applications not installed via entgra store
} else {
if (Constants.ANDROID.equals(type)) {
ApplicationUninstallation applicationUninstallation = new ApplicationUninstallation(packageName, "PUBLIC");
ApplicationUninstallation applicationUninstallation = new ApplicationUninstallation(packageName, "PUBLIC", name, platform, version, user);
Gson gson = new Gson();
operation.setCode(MDMAppConstants.AndroidConstants.UNMANAGED_APP_UNINSTALL);
operation.setType(Operation.Type.PROFILE);

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

@ -0,0 +1,77 @@
/*
* Copyright (c) 2018 - 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 io.entgra.device.mgt.core.device.mgt.common;
public class CertificatePaginationRequest {
private int startIndex;
private int rowCount;
private String serialNumber;
private String deviceIdentifier;
private String username;
public CertificatePaginationRequest(int start, int rowCount) {
this.startIndex = start;
this.rowCount = rowCount;
}
public int getStartIndex() {
return startIndex;
}
public void setStartIndex(int startIndex) {
this.startIndex = startIndex;
}
public int getRowCount() {
return rowCount;
}
public void setRowCount(int rowCount) {
this.rowCount = rowCount;
}
public String getSerialNumber() {
return serialNumber;
}
public void setSerialNumber(String serialNumber) {
this.serialNumber = serialNumber;
}
public String getDeviceIdentifier() {
return deviceIdentifier;
}
public void setDeviceIdentifier(String deviceIdentifier) {
this.deviceIdentifier = deviceIdentifier;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
@Override
public String toString() {
return "Certificate serial number '" + this.serialNumber + "' num of rows: " + this.rowCount + " start index: " + this.startIndex;
}
}

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

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

@ -0,0 +1,36 @@
/*
* Copyright (c) 2018 - 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 io.entgra.device.mgt.core.device.mgt.core.config.ui;
import javax.xml.bind.annotation.XmlElement;
import java.util.List;
class DeviceInfoConfigurations {
private List<DeviceInfoItem> deviceInfoItems;
@XmlElement(name = "DeviceInfoItem")
public List<DeviceInfoItem> getDeviceInfoItems() {
return deviceInfoItems;
}
public void setDeviceInfoItems(List<DeviceInfoItem> deviceInfoItems) {
this.deviceInfoItems = deviceInfoItems;
}
}

@ -0,0 +1,56 @@
/*
* Copyright (c) 2018 - 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 io.entgra.device.mgt.core.device.mgt.core.config.ui;
import javax.xml.bind.annotation.XmlElement;
class DeviceInfoItem {
private String definedValue;
private String displayValue;
private String type;
@XmlElement(name = "DefinedValue")
public String getDefinedValue() {
return definedValue;
}
public void setDefinedValue(String definedValue) {
this.definedValue = definedValue;
}
@XmlElement(name = "DisplayValue")
public String getDisplayValue() {
return displayValue;
}
public void setDisplayValue(String displayValue) {
this.displayValue = displayValue;
}
@XmlElement(name = "Type")
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}

@ -36,6 +36,8 @@ public class UIConfiguration {
private Billing billing;
private HubspotChat hubspotChat;
private DeviceInfoConfigurations deviceInfoConfigurations;
@XmlElement(name = "AppRegistration", required=true)
public AppRegistration getAppRegistration() {
return appRegistration;
@ -98,4 +100,13 @@ public class UIConfiguration {
public void setLoginCacheCapacity(int loginCacheCapacity) {
this.loginCacheCapacity = loginCacheCapacity;
}
@XmlElement(name = "DeviceInfoConfigurations", required = true)
public DeviceInfoConfigurations getDeviceInfoConfigurations() {
return deviceInfoConfigurations;
}
public void setDeviceInfoConfigurations(DeviceInfoConfigurations deviceInfoConfigurations) {
this.deviceInfoConfigurations = deviceInfoConfigurations;
}
}

@ -293,11 +293,11 @@ public class ApplicationDAOImpl implements ApplicationDAO {
"WHERE A.NAME = DM_APPLICATION.NAME " +
"AND A.ID < DM_APPLICATION.ID) " +
"AND PLATFORM = ? " +
"AND TENANT_ID = ?";
"AND TENANT_ID = ? ";
try {
String filter = request.getFilter();
if (filter != null) {
sql = sql + "AND NAME LIKE ?";
sql = sql + "AND NAME LIKE ? ";
}
sql = sql + "LIMIT ? OFFSET ?";
Connection conn = this.getConnection();

@ -17,6 +17,8 @@
*/
package io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl;
import io.entgra.device.mgt.core.device.mgt.common.MDMAppConstants;
import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.ProfileOperation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.PrivilegedCarbonContext;
@ -41,6 +43,8 @@ import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.util.Operatio
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.ObjectInputStream;
import java.io.ByteArrayInputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@ -1353,6 +1357,7 @@ public class GenericOperationDAOImpl implements OperationDAO {
List<Operation> operations = new ArrayList<>();
String createdTo = null;
String createdFrom = null;
ProfileOperation profileOperation = null;
DateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
boolean isCreatedDayProvided = false;
boolean isUpdatedDayProvided = false; //updated day = received day
@ -1375,6 +1380,7 @@ public class GenericOperationDAOImpl implements OperationDAO {
"o.RECEIVED_TIMESTAMP, " +
"o.OPERATION_CODE, " +
"o.INITIATED_BY, " +
"o.OPERATION_DETAILS, " +
"om.STATUS, " +
"om.ID AS OM_MAPPING_ID, " +
"om.UPDATED_TIMESTAMP " +
@ -1473,6 +1479,22 @@ public class GenericOperationDAOImpl implements OperationDAO {
}
operation.setCode(rs.getString("OPERATION_CODE"));
operation.setInitiatedBy(rs.getString("INITIATED_BY"));
if (MDMAppConstants.AndroidConstants.UNMANAGED_APP_UNINSTALL.equals(operation.getCode())) {
byte[] operationDetails = rs.getBytes("OPERATION_DETAILS");
try (ByteArrayInputStream bais = new ByteArrayInputStream(operationDetails);
ObjectInputStream ois = new ObjectInputStream(bais)) {
profileOperation = (ProfileOperation) ois.readObject();
operation.setPayLoad(profileOperation.getPayLoad());
} catch (IOException e) {
String msg = "IO Error occurred while retrieving app data of operation ";
log.error(msg, e);
throw new OperationManagementDAOException(msg, e);
} catch (ClassNotFoundException e) {
String msg = "Class not found error occurred while retrieving app data of operation ";
log.error(msg, e);
throw new OperationManagementDAOException(msg, e);
}
}
operation.setStatus(Operation.Status.valueOf(rs.getString("STATUS")));
OperationDAOUtil.setActivityId(operation, rs.getInt("ID"));
operations.add(operation);
@ -1493,6 +1515,7 @@ public class GenericOperationDAOImpl implements OperationDAO {
List<Operation> operations = new ArrayList<>();
String createdTo = null;
String createdFrom = null;
ProfileOperation profileOperation = null;
DateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
boolean isCreatedDayProvided = false;
boolean isUpdatedDayProvided = false; //updated day = received day
@ -1515,6 +1538,7 @@ public class GenericOperationDAOImpl implements OperationDAO {
"o.RECEIVED_TIMESTAMP, " +
"o.OPERATION_CODE, " +
"o.INITIATED_BY, " +
"o.OPERATION_DETAILS, " +
"om.STATUS, " +
"om.ID AS OM_MAPPING_ID, " +
"om.UPDATED_TIMESTAMP " +
@ -1613,6 +1637,22 @@ public class GenericOperationDAOImpl implements OperationDAO {
}
operation.setCode(rs.getString("OPERATION_CODE"));
operation.setInitiatedBy(rs.getString("INITIATED_BY"));
if (MDMAppConstants.AndroidConstants.UNMANAGED_APP_UNINSTALL.equals(operation.getCode())) {
byte[] operationDetails = rs.getBytes("OPERATION_DETAILS");
try (ByteArrayInputStream bais = new ByteArrayInputStream(operationDetails);
ObjectInputStream ois = new ObjectInputStream(bais)) {
profileOperation = (ProfileOperation) ois.readObject();
operation.setPayLoad(profileOperation.getPayLoad());
} catch (IOException e) {
String msg = "IO Error occurred while retrieving app data of operation ";
log.error(msg, e);
throw new OperationManagementDAOException(msg, e);
} catch (ClassNotFoundException e) {
String msg = "Class not found error occurred while retrieving app data of operation ";
log.error(msg, e);
throw new OperationManagementDAOException(msg, e);
}
}
operation.setStatus(Operation.Status.valueOf(rs.getString("STATUS")));
OperationDAOUtil.setActivityId(operation, rs.getInt("ID"));
operations.add(operation);

@ -276,9 +276,7 @@ public class OTPManagementServiceImpl implements OTPManagementService {
public OneTimePinDTO generateOneTimePin(OneTimePinDTO oneTimePinDTO, boolean persistPin) throws OTPManagementException {
String otpValue = UUID.randomUUID().toString();
Gson gson = new Gson();
String metaInfo = gson.toJson(oneTimePinDTO.getMetaInfo());
String metaInfo = oneTimePinDTO.getMetaInfo();
oneTimePinDTO.setMetaInfo(metaInfo);
oneTimePinDTO.setOtpToken(otpValue);

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

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

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

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

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

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

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

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

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

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

@ -21,7 +21,7 @@
<parent>
<groupId>io.entgra.device.mgt.core</groupId>
<artifactId>operation-template-mgt</artifactId>
<version>5.0.29-SNAPSHOT</version>
<version>5.0.30-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -79,7 +79,8 @@
io.entgra.device.mgt.core.device.mgt.extensions.license.mgt.registry,
javax.net.ssl,
org.wso2.carbon.core.util,
okhttp3
okhttp3,
com.google.common.cache.*
</Import-Package>
<Export-Package>
!io.entgra.device.mgt.core.operation.template.internal,
@ -300,6 +301,8 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>

@ -31,7 +31,7 @@ import org.osgi.service.component.ComponentContext;
import org.wso2.carbon.ndatasource.core.DataSourceService;
/**
* @scr.component name="io.entgra.device.mgt.operation.template.internal.OperationTemplateMgtServiceComponent" immediate="true"
* @scr.component name="io.entgra.device.mgt.core.operation.template.internal.OperationTemplateMgtServiceComponent" immediate="true"
* immediate="true"
* @scr.reference name="org.wso2.carbon.ndatasource"
* interface="org.wso2.carbon.ndatasource.core.DataSourceService"

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save