diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java
index d1882b3096..f6c051ebc2 100755
--- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java
+++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java
@@ -288,6 +288,19 @@ public class CertificateGenerator {
return lookUpCertificate;
}
+ public CertificateResponse verifyCertificateDN(String distinguishedName) throws KeystoreException {
+ CertificateResponse lookUpCertificate = null;
+ KeyStoreReader keyStoreReader = new KeyStoreReader();
+ if (distinguishedName != null && !distinguishedName.isEmpty()) {
+ String[] dnSplits = distinguishedName.split("/CN=");
+ if (dnSplits != null) {
+ String commonNameExtracted = dnSplits[dnSplits.length-1];
+ lookUpCertificate = keyStoreReader.getCertificateBySerial(commonNameExtracted);
+ }
+ }
+ return lookUpCertificate;
+ }
+
public static String getCommonName(X509Certificate requestCertificate) {
String distinguishedName = requestCertificate.getSubjectDN().getName();
if(distinguishedName != null && !distinguishedName.isEmpty()) {
diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/service/CertificateManagementService.java b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/service/CertificateManagementService.java
index c91f0f34d6..d294dbc224 100644
--- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/service/CertificateManagementService.java
+++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/service/CertificateManagementService.java
@@ -56,6 +56,8 @@ public interface CertificateManagementService {
public CertificateResponse verifyPEMSignature(X509Certificate requestCertificate) throws KeystoreException;
+ public CertificateResponse verifySubjectDN(String requestDN) throws KeystoreException;
+
public X509Certificate extractCertificateFromSignature(String headerSignature) throws KeystoreException;
String extractChallengeToken(X509Certificate certificate);
diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/service/CertificateManagementServiceImpl.java b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/service/CertificateManagementServiceImpl.java
index 7157d08e6b..89fd9b4827 100644
--- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/service/CertificateManagementServiceImpl.java
+++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/service/CertificateManagementServiceImpl.java
@@ -108,6 +108,10 @@ public class CertificateManagementServiceImpl implements CertificateManagementSe
return certificateGenerator.verifyPEMSignature(requestCertificate);
}
+ @Override public CertificateResponse verifySubjectDN(String requestDN) throws KeystoreException {
+ return certificateGenerator.verifyCertificateDN(requestDN);
+ }
+
public X509Certificate extractCertificateFromSignature(String headerSignature) throws KeystoreException {
return certificateGenerator.extractCertificateFromSignature(headerSignature);
}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml
index fd1790f61b..35aa312a0f 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml
@@ -64,7 +64,8 @@
org.wso2.carbon.device.mgt.analytics.dashboard,
- org.wso2.carbon.device.mgt.analytics.dashboard.dao.exception
+ org.wso2.carbon.device.mgt.analytics.dashboard.dao.exception,
+ org.wso2.carbon.device.mgt.analytics.dashboard.dao.bean
org.osgi.framework,
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/GadgetDataService.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/GadgetDataService.java
index 3931e72fc2..c17dcfb263 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/GadgetDataService.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/GadgetDataService.java
@@ -18,12 +18,12 @@
package org.wso2.carbon.device.mgt.analytics.dashboard;
-import org.wso2.carbon.device.mgt.analytics.dashboard.dao.exception.InvalidParameterException;
+import org.wso2.carbon.device.mgt.analytics.dashboard.dao.bean.*;
+import org.wso2.carbon.device.mgt.analytics.dashboard.dao.exception.InvalidParameterValueException;
import org.wso2.carbon.device.mgt.common.PaginationResult;
import java.sql.SQLException;
import java.util.List;
-import java.util.Map;
/**
* To be updated...
@@ -31,62 +31,56 @@ import java.util.Map;
public interface GadgetDataService {
@SuppressWarnings("unused")
- int getTotalDeviceCount() throws SQLException;
+ DeviceCountByGroupEntry getDeviceCount(FilterSet filterSet) throws InvalidParameterValueException, SQLException;
@SuppressWarnings("unused")
- int getActiveDeviceCount() throws SQLException;
+ DeviceCountByGroupEntry getFeatureNonCompliantDeviceCount(String nonCompliantFeatureCode,
+ FilterSet filterSet) throws InvalidParameterValueException, SQLException;
@SuppressWarnings("unused")
- int getInactiveDeviceCount() throws SQLException;
+ DeviceCountByGroupEntry getTotalDeviceCount() throws SQLException;
@SuppressWarnings("unused")
- int getRemovedDeviceCount() throws SQLException;
+ List getDeviceCountsByConnectivityStatuses() throws SQLException;
@SuppressWarnings("unused")
- int getNonCompliantDeviceCount() throws SQLException;
-
- @SuppressWarnings("unused")
- int getUnmonitoredDeviceCount() throws SQLException;
+ List getDeviceCountsByPotentialVulnerabilities() throws SQLException;
@SuppressWarnings("unused")
PaginationResult getNonCompliantDeviceCountsByFeatures(int startIndex, int resultCount)
- throws InvalidParameterException, SQLException;
+ throws InvalidParameterValueException, SQLException;
@SuppressWarnings("unused")
- int getDeviceCount(Map filters) throws SQLException;
+ List getDeviceCountsByPlatforms(FilterSet filterSet)
+ throws InvalidParameterValueException, SQLException;
@SuppressWarnings("unused")
- int getFeatureNonCompliantDeviceCount(String nonCompliantFeatureCode,
- Map filters) throws InvalidParameterException, SQLException;
+ List getFeatureNonCompliantDeviceCountsByPlatforms(String nonCompliantFeatureCode,
+ FilterSet filterSet) throws InvalidParameterValueException, SQLException;
@SuppressWarnings("unused")
- Map getDeviceCountsByPlatforms(Map filters) throws SQLException;
+ List getDeviceCountsByOwnershipTypes(FilterSet filterSet)
+ throws InvalidParameterValueException, SQLException;
@SuppressWarnings("unused")
- Map getFeatureNonCompliantDeviceCountsByPlatforms(String nonCompliantFeatureCode,
- Map filters) throws InvalidParameterException, SQLException;
+ List getFeatureNonCompliantDeviceCountsByOwnershipTypes(String nonCompliantFeatureCode,
+ FilterSet filterSet) throws InvalidParameterValueException, SQLException;
@SuppressWarnings("unused")
- Map getDeviceCountsByOwnershipTypes(Map filters) throws SQLException;
-
- @SuppressWarnings("unused")
- Map getFeatureNonCompliantDeviceCountsByOwnershipTypes(String nonCompliantFeatureCode,
- Map filters) throws InvalidParameterException, SQLException;
-
- @SuppressWarnings("unused")
- PaginationResult getDevicesWithDetails(Map filters,
- int startIndex, int resultCount) throws InvalidParameterException, SQLException;
+ PaginationResult getDevicesWithDetails(FilterSet filterSet, int startIndex, int resultCount)
+ throws InvalidParameterValueException, SQLException;
@SuppressWarnings("unused")
PaginationResult getFeatureNonCompliantDevicesWithDetails(String nonCompliantFeatureCode,
- Map filters, int startIndex, int resultCount)
- throws InvalidParameterException, SQLException;
+ FilterSet filterSet, int startIndex, int resultCount)
+ throws InvalidParameterValueException, SQLException;
@SuppressWarnings("unused")
- List