mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge pull request #1 from warunalakshitha/master
upgrade product iot to carbon 4.4.9
This commit is contained in:
commit
5c8c28d28c
@ -78,6 +78,7 @@
|
|||||||
org.apache.commons.logging,
|
org.apache.commons.logging,
|
||||||
javax.servlet,
|
javax.servlet,
|
||||||
javax.xml.*,
|
javax.xml.*,
|
||||||
|
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional,
|
||||||
org.apache.commons.lang,
|
org.apache.commons.lang,
|
||||||
</Import-Package>
|
</Import-Package>
|
||||||
<Embed-Dependency>
|
<Embed-Dependency>
|
||||||
|
|||||||
@ -159,14 +159,8 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] allowedDomains = new String[1];
|
|
||||||
if (isAllowedAllDomains) {
|
|
||||||
allowedDomains[0] = ApiApplicationConstants.ALLOWED_DOMAINS;
|
|
||||||
} else {
|
|
||||||
allowedDomains[0] = APIManagerUtil.getTenantDomain();
|
|
||||||
}
|
|
||||||
apiConsumer.mapExistingOAuthClient(jsonString, username, clientId, applicationName,
|
apiConsumer.mapExistingOAuthClient(jsonString, username, clientId, applicationName,
|
||||||
ApiApplicationConstants.DEFAULT_TOKEN_TYPE, allowedDomains);
|
ApiApplicationConstants.DEFAULT_TOKEN_TYPE);
|
||||||
if (tags != null && tags.length > 0) {
|
if (tags != null && tags.length > 0) {
|
||||||
createApplicationAndSubscribeToAPIs(applicationName, tags, username);
|
createApplicationAndSubscribeToAPIs(applicationName, tags, username);
|
||||||
}
|
}
|
||||||
@ -327,11 +321,7 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
|
|||||||
if (consumer != null) {
|
if (consumer != null) {
|
||||||
synchronized (consumer) {
|
synchronized (consumer) {
|
||||||
if (consumer.getSubscriber(subscriberName) == null) {
|
if (consumer.getSubscriber(subscriberName) == null) {
|
||||||
Subscriber subscriber = new Subscriber(subscriberName);
|
consumer.addSubscriber(subscriberName, groupId);
|
||||||
subscriber.setSubscribedDate(new Date());
|
|
||||||
subscriber.setEmail(subscriberEmail);
|
|
||||||
subscriber.setTenantId(tenantId);
|
|
||||||
consumer.addSubscriber(subscriber, groupId);
|
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("Successfully created subscriber with name : " + subscriberName +
|
log.debug("Successfully created subscriber with name : " + subscriberName +
|
||||||
" with groupID : " + groupId);
|
" with groupID : " + groupId);
|
||||||
@ -365,7 +355,7 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
|
|||||||
Subscriber subscriber = apiConsumer.getSubscriber(username);
|
Subscriber subscriber = apiConsumer.getSubscriber(username);
|
||||||
Set<API> userVisibleAPIs = null;
|
Set<API> userVisibleAPIs = null;
|
||||||
for (String tag : tags) {
|
for (String tag : tags) {
|
||||||
Set<API> tagAPIs = apiConsumer.getAPIsWithTag(tag);
|
Set<API> tagAPIs = apiConsumer.getAPIsWithTag(tag, APIManagerUtil.getTenantDomain());
|
||||||
if (userVisibleAPIs == null) {
|
if (userVisibleAPIs == null) {
|
||||||
userVisibleAPIs = tagAPIs;
|
userVisibleAPIs = tagAPIs;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -143,6 +143,7 @@
|
|||||||
org.apache.commons.logging,
|
org.apache.commons.logging,
|
||||||
javax.servlet,
|
javax.servlet,
|
||||||
javax.xml.*,
|
javax.xml.*,
|
||||||
|
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional,
|
||||||
com.google.gson.*,
|
com.google.gson.*,
|
||||||
org.apache.catalina,
|
org.apache.catalina,
|
||||||
org.apache.catalina.core,
|
org.apache.catalina.core,
|
||||||
|
|||||||
@ -56,6 +56,7 @@ public class APIConfig {
|
|||||||
private String contextTemplate;
|
private String contextTemplate;
|
||||||
private String endpoint;
|
private String endpoint;
|
||||||
private String version;
|
private String version;
|
||||||
|
private String policy;
|
||||||
private String transports;
|
private String transports;
|
||||||
private APIProvider provider;
|
private APIProvider provider;
|
||||||
private boolean isSecured;
|
private boolean isSecured;
|
||||||
@ -73,6 +74,16 @@ public class APIConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XmlElement(name = "Policy", required = true)
|
||||||
|
public String getPolicy() {
|
||||||
|
return policy;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public void setPolicy(String policy) {
|
||||||
|
this.policy = policy;
|
||||||
|
}
|
||||||
|
|
||||||
@XmlElement(name = "ContextTemplate", required = true)
|
@XmlElement(name = "ContextTemplate", required = true)
|
||||||
public String getContextTemplate() {
|
public String getContextTemplate() {
|
||||||
return contextTemplate;
|
return contextTemplate;
|
||||||
|
|||||||
@ -47,6 +47,7 @@ public class APIPublisherUtil {
|
|||||||
private static final String PARAM_MANAGED_API_ENDPOINT = "managed-api-endpoint";
|
private static final String PARAM_MANAGED_API_ENDPOINT = "managed-api-endpoint";
|
||||||
private static final String PARAM_MANAGED_API_OWNER = "managed-api-owner";
|
private static final String PARAM_MANAGED_API_OWNER = "managed-api-owner";
|
||||||
private static final String PARAM_MANAGED_API_TRANSPORTS = "managed-api-transports";
|
private static final String PARAM_MANAGED_API_TRANSPORTS = "managed-api-transports";
|
||||||
|
private static final String PARAM_MANAGED_API_POLICY = "managed-api-policy";
|
||||||
private static final String PARAM_MANAGED_API_IS_SECURED = "managed-api-isSecured";
|
private static final String PARAM_MANAGED_API_IS_SECURED = "managed-api-isSecured";
|
||||||
private static final String PARAM_SHARED_WITH_ALL_TENANTS = "isSharedWithAllTenants";
|
private static final String PARAM_SHARED_WITH_ALL_TENANTS = "isSharedWithAllTenants";
|
||||||
private static final String PARAM_PROVIDER_TENANT_DOMAIN = "providerTenantDomain";
|
private static final String PARAM_PROVIDER_TENANT_DOMAIN = "providerTenantDomain";
|
||||||
@ -80,6 +81,7 @@ public class APIPublisherUtil {
|
|||||||
api.setEndpointSecured(true);
|
api.setEndpointSecured(true);
|
||||||
api.setStatus(APIStatus.CREATED);
|
api.setStatus(APIStatus.CREATED);
|
||||||
api.setTransports(config.getTransports());
|
api.setTransports(config.getTransports());
|
||||||
|
api.setApiLevelPolicy(config.getPolicy());
|
||||||
api.setContextTemplate(config.getContextTemplate());
|
api.setContextTemplate(config.getContextTemplate());
|
||||||
Set<String> environments = new HashSet<>();
|
Set<String> environments = new HashSet<>();
|
||||||
environments.add(API_PUBLISH_ENVIRONMENT);
|
environments.add(API_PUBLISH_ENVIRONMENT);
|
||||||
@ -309,6 +311,16 @@ public class APIPublisherUtil {
|
|||||||
}
|
}
|
||||||
apiConfig.setUriTemplates(uriTemplates);
|
apiConfig.setUriTemplates(uriTemplates);
|
||||||
|
|
||||||
|
String policy = servletContext.getInitParameter(PARAM_MANAGED_API_POLICY);
|
||||||
|
if (policy == null || policy.isEmpty()) {
|
||||||
|
if (log.isDebugEnabled()) {
|
||||||
|
log.debug("'managed-api-policy' attribute is not configured. Therefore using the default, " +
|
||||||
|
"which is 'null'");
|
||||||
|
}
|
||||||
|
policy = null;
|
||||||
|
}
|
||||||
|
apiConfig.setPolicy(policy);
|
||||||
|
|
||||||
return apiConfig;
|
return apiConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -161,6 +161,10 @@
|
|||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-core</artifactId>
|
<artifactId>swagger-core</artifactId>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.wso2.orbit.com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-annotations</artifactId>
|
||||||
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
@ -170,6 +174,16 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-jaxrs</artifactId>
|
<artifactId>swagger-jaxrs</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.fasterxml.jackson.module</groupId>
|
||||||
|
<artifactId>jackson-module-jaxb-annotations</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>javax.servlet</groupId>
|
||||||
|
|||||||
@ -166,6 +166,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-jaxrs</artifactId>
|
<artifactId>swagger-jaxrs</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>javax.servlet</groupId>
|
||||||
|
|||||||
@ -57,13 +57,14 @@
|
|||||||
org.apache.commons.logging,
|
org.apache.commons.logging,
|
||||||
javax.security.auth.x500,
|
javax.security.auth.x500,
|
||||||
javax.xml.*,
|
javax.xml.*,
|
||||||
|
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional,
|
||||||
org.apache.commons.codec.binary,
|
org.apache.commons.codec.binary,
|
||||||
org.bouncycastle.asn1,
|
org.bouncycastle.asn1,
|
||||||
org.bouncycastle.asn1.x500,
|
org.bouncycastle.asn1.x500,
|
||||||
org.bouncycastle.asn1.x509,
|
org.bouncycastle.asn1.x509,
|
||||||
org.bouncycastle.asn1.pkcs,
|
org.bouncycastle.asn1.pkcs,
|
||||||
org.bouncycastle.cert,
|
org.bouncycastle.cert; version="${bcprov.wso2.version.range}",
|
||||||
org.bouncycastle.cert.jcajce,
|
org.bouncycastle.cert.jcajce; version="${bcprov.wso2.version.range}",
|
||||||
org.bouncycastle.cms,
|
org.bouncycastle.cms,
|
||||||
org.bouncycastle.jce.provider,
|
org.bouncycastle.jce.provider,
|
||||||
org.bouncycastle.operator,
|
org.bouncycastle.operator,
|
||||||
@ -89,6 +90,7 @@
|
|||||||
org.wso2.carbon.device.mgt.common.*,
|
org.wso2.carbon.device.mgt.common.*,
|
||||||
io.swagger.annotations.*;resolution:=optional,
|
io.swagger.annotations.*;resolution:=optional,
|
||||||
org.wso2.carbon.device.mgt.core.*,
|
org.wso2.carbon.device.mgt.core.*,
|
||||||
|
org.wso2.carbon.registry.indexing.*,
|
||||||
<!--org.bouncycastle.pkcs.jcajce-->
|
<!--org.bouncycastle.pkcs.jcajce-->
|
||||||
</Import-Package>
|
</Import-Package>
|
||||||
<Export-Package>
|
<Export-Package>
|
||||||
@ -134,19 +136,15 @@
|
|||||||
<artifactId>org.wso2.carbon.logging</artifactId>
|
<artifactId>org.wso2.carbon.logging</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle.wso2</groupId>
|
<groupId>org.wso2.orbit.org.bouncycastle</groupId>
|
||||||
<artifactId>bcprov-jdk15on</artifactId>
|
<artifactId>bcprov-jdk15on</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle.wso2</groupId>
|
<groupId>org.wso2.orbit.org.bouncycastle</groupId>
|
||||||
<artifactId>bcpkix-jdk15on</artifactId>
|
<artifactId>bcpkix-jdk15on</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle.wso2</groupId>
|
<groupId>org.wso2.orbit.com.google.code.jscep</groupId>
|
||||||
<artifactId>bcmail-jdk15on</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.google.code.jscep.wso2</groupId>
|
|
||||||
<artifactId>jscep</artifactId>
|
<artifactId>jscep</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -179,7 +177,15 @@
|
|||||||
<artifactId>org.wso2.carbon.user.core</artifactId>
|
<artifactId>org.wso2.carbon.user.core</artifactId>
|
||||||
<version>4.4.3</version>
|
<version>4.4.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.wso2.carbon.registry</groupId>
|
||||||
|
<artifactId>org.wso2.carbon.registry.indexing</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-simple</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,8 @@ import org.wso2.carbon.certificate.mgt.core.config.CertificateManagementConfig;
|
|||||||
import org.wso2.carbon.certificate.mgt.core.config.datasource.DataSourceConfig;
|
import org.wso2.carbon.certificate.mgt.core.config.datasource.DataSourceConfig;
|
||||||
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOFactory;
|
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOFactory;
|
||||||
import org.wso2.carbon.certificate.mgt.core.exception.CertificateManagementException;
|
import org.wso2.carbon.certificate.mgt.core.exception.CertificateManagementException;
|
||||||
|
import org.wso2.carbon.certificate.mgt.core.scep.SCEPManager;
|
||||||
|
import org.wso2.carbon.certificate.mgt.core.scep.SCEPManagerImpl;
|
||||||
import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementService;
|
import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementService;
|
||||||
import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementServiceImpl;
|
import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementServiceImpl;
|
||||||
import org.wso2.carbon.certificate.mgt.core.util.CertificateManagementConstants;
|
import org.wso2.carbon.certificate.mgt.core.util.CertificateManagementConstants;
|
||||||
@ -72,6 +74,9 @@ public class CertificateManagementServiceComponent {
|
|||||||
bundleContext.registerService(CertificateManagementService.class.getName(),
|
bundleContext.registerService(CertificateManagementService.class.getName(),
|
||||||
CertificateManagementServiceImpl.getInstance(), null);
|
CertificateManagementServiceImpl.getInstance(), null);
|
||||||
|
|
||||||
|
bundleContext.registerService(SCEPManager.class.getName(),
|
||||||
|
new SCEPManagerImpl(), null);
|
||||||
|
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("Certificate management core bundle has been successfully initialized");
|
log.debug("Certificate management core bundle has been successfully initialized");
|
||||||
}
|
}
|
||||||
@ -101,9 +106,14 @@ public class CertificateManagementServiceComponent {
|
|||||||
|
|
||||||
private void setupDeviceManagementSchema(DataSourceConfig config) throws CertificateManagementException {
|
private void setupDeviceManagementSchema(DataSourceConfig config) throws CertificateManagementException {
|
||||||
CertificateMgtSchemaInitializer initializer = new CertificateMgtSchemaInitializer(config);
|
CertificateMgtSchemaInitializer initializer = new CertificateMgtSchemaInitializer(config);
|
||||||
log.info("Initializing Certificate management repository database schema");
|
String checkSql = "select * from DM_DEVICE_CERTIFICATE";
|
||||||
try {
|
try {
|
||||||
|
if (!initializer.isDatabaseStructureCreated(checkSql)) {
|
||||||
|
log.info("Initializing Certificate management repository database schema");
|
||||||
initializer.createRegistryDatabase();
|
initializer.createRegistryDatabase();
|
||||||
|
} else {
|
||||||
|
log.info("Certificate management repository database already exists. Not creating a new database.");
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new CertificateManagementException(
|
throw new CertificateManagementException(
|
||||||
"Error occurred while initializing Certificate Management database schema", e);
|
"Error occurred while initializing Certificate Management database schema", e);
|
||||||
@ -112,6 +122,4 @@ public class CertificateManagementServiceComponent {
|
|||||||
log.debug("Certificate management metadata repository schema has been successfully initialized");
|
log.debug("Certificate management metadata repository schema has been successfully initialized");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,60 +0,0 @@
|
|||||||
package org.wso2.carbon.certificate.mgt.core.internal;
|
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
import org.osgi.framework.BundleContext;
|
|
||||||
import org.osgi.service.component.ComponentContext;
|
|
||||||
import org.wso2.carbon.certificate.mgt.core.scep.SCEPManager;
|
|
||||||
import org.wso2.carbon.certificate.mgt.core.scep.SCEPManagerImpl;
|
|
||||||
import org.wso2.carbon.device.mgt.core.app.mgt.ApplicationManagementProviderService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @scr.component name="org.wso2.carbon.certificate.mgt.core.scep" immediate="true"
|
|
||||||
* @scr.reference name="app.mgt.service"
|
|
||||||
* interface="org.wso2.carbon.device.mgt.core.app.mgt.ApplicationManagementProviderService"
|
|
||||||
* cardinality="1..1"
|
|
||||||
* policy="dynamic"
|
|
||||||
* bind="setApplicationManagementProviderService"
|
|
||||||
* unbind="unsetApplicationManagementProviderService"
|
|
||||||
*/
|
|
||||||
public class SCEPManagerServiceComponent {
|
|
||||||
|
|
||||||
private static final Log log = LogFactory.getLog(SCEPManagerServiceComponent.class);
|
|
||||||
|
|
||||||
protected void activate(ComponentContext componentContext) {
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (log.isDebugEnabled()) {
|
|
||||||
log.debug("Initializing SCEP core bundle");
|
|
||||||
}
|
|
||||||
|
|
||||||
BundleContext bundleContext = componentContext.getBundleContext();
|
|
||||||
bundleContext.registerService(SCEPManager.class.getName(),
|
|
||||||
new SCEPManagerImpl(), null);
|
|
||||||
|
|
||||||
if (log.isDebugEnabled()) {
|
|
||||||
log.debug("SCEP core bundle has been successfully initialized");
|
|
||||||
}
|
|
||||||
} catch (Throwable e) {
|
|
||||||
String msg = "Error occurred while initializing SCEP core bundle";
|
|
||||||
log.error(msg, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void deactivate(ComponentContext ctx) {
|
|
||||||
if (log.isDebugEnabled()) {
|
|
||||||
log.debug("Deactivating SCEP core bundle");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void unsetApplicationManagementProviderService(ApplicationManagementProviderService
|
|
||||||
applicationManagementProviderService) {
|
|
||||||
//do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setApplicationManagementProviderService(ApplicationManagementProviderService
|
|
||||||
applicationManagementProviderService) {
|
|
||||||
//do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -19,12 +19,12 @@ package org.wso2.carbon.certificate.mgt.core.scep;
|
|||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.wso2.carbon.certificate.mgt.core.internal.CertificateManagementDataHolder;
|
||||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||||
import org.wso2.carbon.device.mgt.common.Device;
|
import org.wso2.carbon.device.mgt.common.Device;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
import org.wso2.carbon.device.mgt.core.dao.DeviceDAO;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException;
|
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
|
||||||
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
|
|
||||||
import org.wso2.carbon.user.api.UserStoreException;
|
import org.wso2.carbon.user.api.UserStoreException;
|
||||||
import org.wso2.carbon.user.core.service.RealmService;
|
import org.wso2.carbon.user.core.service.RealmService;
|
||||||
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
|
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
|
||||||
@ -33,19 +33,18 @@ import java.sql.SQLException;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class SCEPManagerImpl implements SCEPManager {
|
public class SCEPManagerImpl implements SCEPManager {
|
||||||
private DeviceDAO deviceDAO;
|
|
||||||
private static final Log log = LogFactory.getLog(SCEPManagerImpl.class);
|
private static final Log log = LogFactory.getLog(SCEPManagerImpl.class);
|
||||||
|
DeviceManagementProviderService dms;
|
||||||
|
|
||||||
public SCEPManagerImpl() {
|
public SCEPManagerImpl() {
|
||||||
deviceDAO = DeviceManagementDAOFactory.getDeviceDAO();
|
this.dms = CertificateManagementDataHolder.getInstance().getDeviceManagementService();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TenantedDeviceWrapper getValidatedDevice(DeviceIdentifier deviceIdentifier) throws SCEPException {
|
public TenantedDeviceWrapper getValidatedDevice(DeviceIdentifier deviceIdentifier) throws SCEPException {
|
||||||
TenantedDeviceWrapper tenantedDeviceWrapper = new TenantedDeviceWrapper();
|
TenantedDeviceWrapper tenantedDeviceWrapper = new TenantedDeviceWrapper();
|
||||||
try {
|
try {
|
||||||
DeviceManagementDAOFactory.openConnection();
|
HashMap<Integer, Device> deviceHashMap = dms.getTenantedDevice(deviceIdentifier);
|
||||||
HashMap<Integer, Device> deviceHashMap = deviceDAO.getDevice(deviceIdentifier);
|
|
||||||
Object[] keySet = deviceHashMap.keySet().toArray();
|
Object[] keySet = deviceHashMap.keySet().toArray();
|
||||||
|
|
||||||
if (keySet == null || keySet.length == 0) {
|
if (keySet == null || keySet.length == 0) {
|
||||||
@ -71,15 +70,12 @@ public class SCEPManagerImpl implements SCEPManager {
|
|||||||
|
|
||||||
String tenantDomain = realmService.getTenantManager().getDomain(tenantId);
|
String tenantDomain = realmService.getTenantManager().getDomain(tenantId);
|
||||||
tenantedDeviceWrapper.setTenantDomain(tenantDomain);
|
tenantedDeviceWrapper.setTenantDomain(tenantDomain);
|
||||||
} catch (SQLException e) {
|
|
||||||
throw new SCEPException("Error occurred while getting the datasource connection.", e);
|
|
||||||
} catch (DeviceManagementDAOException e) {
|
|
||||||
throw new SCEPException("Error occurred while reading the device dao.", e);
|
|
||||||
} catch (UserStoreException e) {
|
} catch (UserStoreException e) {
|
||||||
throw new SCEPException("Error occurred while getting the tenant domain.", e);
|
throw new SCEPException("Error occurred while getting the tenant domain.", e);
|
||||||
|
} catch (DeviceManagementException e) {
|
||||||
|
throw new SCEPException("Error occurred while getting device '" + deviceIdentifier + "'.", e);
|
||||||
} finally {
|
} finally {
|
||||||
PrivilegedCarbonContext.endTenantFlow();
|
PrivilegedCarbonContext.endTenantFlow();
|
||||||
DeviceManagementDAOFactory.closeConnection();
|
|
||||||
}
|
}
|
||||||
return tenantedDeviceWrapper;
|
return tenantedDeviceWrapper;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,8 +55,8 @@
|
|||||||
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.ws.commons.axiom</groupId>
|
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
||||||
<artifactId>axiom-api</artifactId>
|
<artifactId>axiom</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon</groupId>
|
<groupId>org.wso2.carbon</groupId>
|
||||||
|
|||||||
@ -55,8 +55,8 @@
|
|||||||
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.ws.commons.axiom</groupId>
|
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
||||||
<artifactId>axiom-api</artifactId>
|
<artifactId>axiom</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon</groupId>
|
<groupId>org.wso2.carbon</groupId>
|
||||||
|
|||||||
@ -55,8 +55,8 @@
|
|||||||
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.ws.commons.axiom</groupId>
|
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
||||||
<artifactId>axiom-api</artifactId>
|
<artifactId>axiom</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon</groupId>
|
<groupId>org.wso2.carbon</groupId>
|
||||||
|
|||||||
@ -82,6 +82,10 @@
|
|||||||
<groupId>org.wso2.carbon.registry</groupId>
|
<groupId>org.wso2.carbon.registry</groupId>
|
||||||
<artifactId>org.wso2.carbon.registry.indexing</artifactId>
|
<artifactId>org.wso2.carbon.registry.indexing</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.wso2.carbon.registry</groupId>
|
||||||
|
<artifactId>org.wso2.carbon.registry.common</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.json.wso2</groupId>
|
<groupId>org.json.wso2</groupId>
|
||||||
<artifactId>json</artifactId>
|
<artifactId>json</artifactId>
|
||||||
@ -122,6 +126,7 @@
|
|||||||
org.wso2.carbon.registry.indexing.*; version="${carbon.registry.imp.pkg.version.range}",
|
org.wso2.carbon.registry.indexing.*; version="${carbon.registry.imp.pkg.version.range}",
|
||||||
org.json;version="${commons-json.version}",
|
org.json;version="${commons-json.version}",
|
||||||
javax.xml.*,
|
javax.xml.*,
|
||||||
|
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional,
|
||||||
org.w3c.dom,
|
org.w3c.dom,
|
||||||
org.wso2.carbon.base
|
org.wso2.carbon.base
|
||||||
</Import-Package>
|
</Import-Package>
|
||||||
|
|||||||
@ -222,15 +222,37 @@
|
|||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-core</artifactId>
|
<artifactId>swagger-core</artifactId>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.fasterxml.jackson.module</groupId>
|
||||||
|
<artifactId>jackson-module-jaxb-annotations</artifactId>
|
||||||
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.wso2.orbit.com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-core</artifactId>
|
||||||
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-jaxrs</artifactId>
|
<artifactId>swagger-jaxrs</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.fasterxml.jackson.module</groupId>
|
||||||
|
<artifactId>jackson-module-jaxb-annotations</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.wso2.orbit.com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-core</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>javax.servlet</groupId>
|
||||||
@ -248,9 +270,8 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>org.wso2.orbit.com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-annotations</artifactId>
|
<artifactId>jackson-annotations</artifactId>
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate</groupId>
|
||||||
|
|||||||
@ -48,10 +48,10 @@
|
|||||||
org.wso2.carbon.device.mgt.common.*
|
org.wso2.carbon.device.mgt.common.*
|
||||||
</Export-Package>
|
</Export-Package>
|
||||||
<Import-Package>
|
<Import-Package>
|
||||||
javax.xml.bind.annotation,
|
javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}",
|
||||||
com.fasterxml.jackson.annotation,
|
com.fasterxml.jackson.annotation;version="${jackson-annotations.version}",
|
||||||
org.wso2.carbon.apimgt.api.model,
|
org.wso2.carbon.apimgt.api.model.*;version="${carbon.api.mgt.version.range}",
|
||||||
io.swagger.annotations.*;resolution:=optional
|
io.swagger.annotations; version="${swagger.annotations.version}"
|
||||||
</Import-Package>
|
</Import-Package>
|
||||||
</instructions>
|
</instructions>
|
||||||
</configuration>
|
</configuration>
|
||||||
@ -66,7 +66,7 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>org.wso2.orbit.com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-annotations</artifactId>
|
<artifactId>jackson-annotations</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@ -58,6 +58,7 @@
|
|||||||
org.apache.commons.logging,
|
org.apache.commons.logging,
|
||||||
javax.naming,
|
javax.naming,
|
||||||
javax.xml.*,
|
javax.xml.*,
|
||||||
|
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional,
|
||||||
javax.servlet.*,
|
javax.servlet.*,
|
||||||
org.xml.sax,
|
org.xml.sax,
|
||||||
javax.sql.*,
|
javax.sql.*,
|
||||||
@ -142,6 +143,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon</groupId>
|
<groupId>org.wso2.carbon</groupId>
|
||||||
<artifactId>org.wso2.carbon.ndatasource.core</artifactId>
|
<artifactId>org.wso2.carbon.ndatasource.core</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>commons-lang</groupId>
|
||||||
|
<artifactId>commons-lang</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.h2database.wso2</groupId>
|
<groupId>com.h2database.wso2</groupId>
|
||||||
@ -185,17 +192,17 @@
|
|||||||
<artifactId>axis2-transport-mail</artifactId>
|
<artifactId>axis2-transport-mail</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.ws.commons.axiom</groupId>
|
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
||||||
<artifactId>axiom-api</artifactId>
|
<artifactId>axiom</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<!--dependency>
|
||||||
<groupId>org.apache.ws.commons.axiom</groupId>
|
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
||||||
<artifactId>axiom-impl</artifactId>
|
<artifactId>axiom-impl</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
||||||
<artifactId>axiom</artifactId>
|
<artifactId>axiom</artifactId>
|
||||||
</dependency>
|
</dependency-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.apimgt</groupId>
|
<groupId>org.wso2.carbon.apimgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.apimgt.api</artifactId>
|
<artifactId>org.wso2.carbon.apimgt.api</artifactId>
|
||||||
|
|||||||
@ -19,7 +19,6 @@
|
|||||||
package org.wso2.carbon.device.mgt.core.app.mgt;
|
package org.wso2.carbon.device.mgt.core.app.mgt;
|
||||||
|
|
||||||
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager;
|
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager;
|
||||||
import org.wso2.carbon.device.mgt.core.DeviceManagementPluginRepository;
|
|
||||||
import org.wso2.carbon.device.mgt.core.app.mgt.config.AppManagementConfig;
|
import org.wso2.carbon.device.mgt.core.app.mgt.config.AppManagementConfig;
|
||||||
|
|
||||||
public class ApplicationManagerFactory {
|
public class ApplicationManagerFactory {
|
||||||
|
|||||||
@ -241,11 +241,6 @@ public class DeviceManagementServiceComponent {
|
|||||||
= new NotificationManagementServiceImpl();
|
= new NotificationManagementServiceImpl();
|
||||||
bundleContext.registerService(NotificationManagementService.class.getName(), notificationManagementService, null);
|
bundleContext.registerService(NotificationManagementService.class.getName(), notificationManagementService, null);
|
||||||
|
|
||||||
/* Registering PermissionManager Service */
|
|
||||||
PermissionManagerService permissionManagerService
|
|
||||||
= PermissionManagerServiceImpl.getInstance();
|
|
||||||
bundleContext.registerService(PermissionManagerService.class.getName(), permissionManagerService, null);
|
|
||||||
|
|
||||||
/* Registering DeviceAccessAuthorization Service */
|
/* Registering DeviceAccessAuthorization Service */
|
||||||
DeviceAccessAuthorizationService deviceAccessAuthorizationService = new DeviceAccessAuthorizationServiceImpl();
|
DeviceAccessAuthorizationService deviceAccessAuthorizationService = new DeviceAccessAuthorizationServiceImpl();
|
||||||
DeviceManagementDataHolder.getInstance().setDeviceAccessAuthorizationService(deviceAccessAuthorizationService);
|
DeviceManagementDataHolder.getInstance().setDeviceAccessAuthorizationService(deviceAccessAuthorizationService);
|
||||||
@ -262,13 +257,22 @@ public class DeviceManagementServiceComponent {
|
|||||||
} catch (ApplicationManagementException e) {
|
} catch (ApplicationManagementException e) {
|
||||||
log.error("Application management service not registered.", e);
|
log.error("Application management service not registered.", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Registering PermissionManager Service */
|
||||||
|
PermissionManagerService permissionManagerService = PermissionManagerServiceImpl.getInstance();
|
||||||
|
bundleContext.registerService(PermissionManagerService.class.getName(), permissionManagerService, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupDeviceManagementSchema(DataSourceConfig config) throws DeviceManagementException {
|
private void setupDeviceManagementSchema(DataSourceConfig config) throws DeviceManagementException {
|
||||||
DeviceManagementSchemaInitializer initializer = new DeviceManagementSchemaInitializer(config);
|
DeviceManagementSchemaInitializer initializer = new DeviceManagementSchemaInitializer(config);
|
||||||
log.info("Initializing device management repository database schema");
|
String checkSql = "select * from DM_DEVICE_TYPE";
|
||||||
try {
|
try {
|
||||||
|
if (!initializer.isDatabaseStructureCreated(checkSql)) {
|
||||||
|
log.info("Initializing device management repository database schema");
|
||||||
initializer.createRegistryDatabase();
|
initializer.createRegistryDatabase();
|
||||||
|
} else {
|
||||||
|
log.info("Device management database already exists. Not creating a new database.");
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new DeviceManagementException(
|
throw new DeviceManagementException(
|
||||||
"Error occurred while initializing Device Management database schema", e);
|
"Error occurred while initializing Device Management database schema", e);
|
||||||
|
|||||||
@ -18,12 +18,8 @@
|
|||||||
|
|
||||||
package org.wso2.carbon.device.mgt.core.notification.mgt.dao.impl;
|
package org.wso2.carbon.device.mgt.core.notification.mgt.dao.impl;
|
||||||
|
|
||||||
import org.wso2.carbon.device.mgt.common.PaginationRequest;
|
|
||||||
import org.wso2.carbon.device.mgt.common.PaginationResult;
|
|
||||||
import org.wso2.carbon.device.mgt.common.notification.mgt.Notification;
|
import org.wso2.carbon.device.mgt.common.notification.mgt.Notification;
|
||||||
import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementException;
|
import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementException;
|
||||||
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException;
|
|
||||||
import org.wso2.carbon.device.mgt.core.dao.util.DeviceManagementDAOUtil;
|
|
||||||
import org.wso2.carbon.device.mgt.core.notification.mgt.dao.NotificationDAO;
|
import org.wso2.carbon.device.mgt.core.notification.mgt.dao.NotificationDAO;
|
||||||
import org.wso2.carbon.device.mgt.core.notification.mgt.dao.NotificationManagementDAOFactory;
|
import org.wso2.carbon.device.mgt.core.notification.mgt.dao.NotificationManagementDAOFactory;
|
||||||
import org.wso2.carbon.device.mgt.core.notification.mgt.dao.util.NotificationDAOUtil;
|
import org.wso2.carbon.device.mgt.core.notification.mgt.dao.util.NotificationDAOUtil;
|
||||||
@ -165,7 +161,7 @@ public abstract class AbstractNotificationDAOImpl implements NotificationDAO {
|
|||||||
rs = stmt.executeQuery();
|
rs = stmt.executeQuery();
|
||||||
notifications = new ArrayList<>();
|
notifications = new ArrayList<>();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
notifications.add(NotificationDAOUtil.getNotification(rs));
|
notifications.add(NotificationDAOUtil.getNotificationWithDeviceInfo(rs));
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new NotificationManagementException(
|
throw new NotificationManagementException(
|
||||||
@ -238,7 +234,7 @@ public abstract class AbstractNotificationDAOImpl implements NotificationDAO {
|
|||||||
rs = stmt.executeQuery();
|
rs = stmt.executeQuery();
|
||||||
notifications = new ArrayList<>();
|
notifications = new ArrayList<>();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
notifications.add(NotificationDAOUtil.getNotification(rs));
|
notifications.add(NotificationDAOUtil.getNotificationWithDeviceInfo(rs));
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new NotificationManagementException(
|
throw new NotificationManagementException(
|
||||||
|
|||||||
@ -64,7 +64,7 @@ public class GenericNotificationDAOImpl extends AbstractNotificationDAOImpl {
|
|||||||
rs = stmt.executeQuery();
|
rs = stmt.executeQuery();
|
||||||
notifications = new ArrayList<>();
|
notifications = new ArrayList<>();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
notifications.add(NotificationDAOUtil.getNotification(rs));
|
notifications.add(NotificationDAOUtil.getNotificationWithDeviceInfo(rs));
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new NotificationManagementException(
|
throw new NotificationManagementException(
|
||||||
@ -108,7 +108,7 @@ public class GenericNotificationDAOImpl extends AbstractNotificationDAOImpl {
|
|||||||
rs = stmt.executeQuery();
|
rs = stmt.executeQuery();
|
||||||
notifications = new ArrayList<>();
|
notifications = new ArrayList<>();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
notifications.add(NotificationDAOUtil.getNotification(rs));
|
notifications.add(NotificationDAOUtil.getNotificationWithDeviceInfo(rs));
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new NotificationManagementException(
|
throw new NotificationManagementException(
|
||||||
|
|||||||
@ -64,7 +64,7 @@ public class OracleNotificationDAOImpl extends AbstractNotificationDAOImpl {
|
|||||||
rs = stmt.executeQuery();
|
rs = stmt.executeQuery();
|
||||||
notifications = new ArrayList<>();
|
notifications = new ArrayList<>();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
notifications.add(NotificationDAOUtil.getNotification(rs));
|
notifications.add(NotificationDAOUtil.getNotificationWithDeviceInfo(rs));
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new NotificationManagementException(
|
throw new NotificationManagementException(
|
||||||
@ -85,14 +85,14 @@ public class OracleNotificationDAOImpl extends AbstractNotificationDAOImpl {
|
|||||||
List<Notification> notifications = null;
|
List<Notification> notifications = null;
|
||||||
try {
|
try {
|
||||||
conn = NotificationManagementDAOFactory.getConnection();
|
conn = NotificationManagementDAOFactory.getConnection();
|
||||||
String sql = "SELECT n1.NOTIFICATION_ID, n1.DEVICE_ID, n1.OPERATION_ID, n1.STATUS," +
|
String sql = "SELECT n1.NOTIFICATION_ID, n1.DEVICE_ID, n1.OPERATION_ID, n1.STATUS,"
|
||||||
" n1.DESCRIPTION, d.DEVICE_IDENTIFICATION, d.NAME as DEVICE_NAME, t.NAME AS DEVICE_TYPE FROM " +
|
+ " n1.DESCRIPTION, d.DEVICE_IDENTIFICATION, d.NAME as DEVICE_NAME, t.NAME AS DEVICE_TYPE FROM "
|
||||||
"DM_DEVICE d, DM_DEVICE_TYPE t, (SELECT NOTIFICATION_ID, DEVICE_ID, " +
|
+ "DM_DEVICE d, DM_DEVICE_TYPE t, (SELECT NOTIFICATION_ID, DEVICE_ID, "
|
||||||
"OPERATION_ID, STATUS, DESCRIPTION FROM DM_NOTIFICATION WHERE " +
|
+ "OPERATION_ID, STATUS, DESCRIPTION FROM DM_NOTIFICATION WHERE "
|
||||||
"TENANT_ID = ? AND STATUS = ?) n1 WHERE n1.DEVICE_ID = d.ID AND d.DEVICE_TYPE_ID=t.ID " +
|
+ "TENANT_ID = ? AND STATUS = ?) n1 WHERE n1.DEVICE_ID = d.ID AND d.DEVICE_TYPE_ID=t.ID "
|
||||||
"AND TENANT_ID = ?";
|
+ "AND TENANT_ID = ?";
|
||||||
|
|
||||||
sql = sql + " OFFSET >= ? AND ROWNUM <= ?";
|
sql = sql + " ORDER BY n1.NOTIFICATION_ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";
|
||||||
|
|
||||||
stmt = conn.prepareStatement(sql);
|
stmt = conn.prepareStatement(sql);
|
||||||
stmt.setInt(1, tenantId);
|
stmt.setInt(1, tenantId);
|
||||||
@ -108,7 +108,7 @@ public class OracleNotificationDAOImpl extends AbstractNotificationDAOImpl {
|
|||||||
rs = stmt.executeQuery();
|
rs = stmt.executeQuery();
|
||||||
notifications = new ArrayList<>();
|
notifications = new ArrayList<>();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
notifications.add(NotificationDAOUtil.getNotification(rs));
|
notifications.add(NotificationDAOUtil.getNotificationWithDeviceInfo(rs));
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new NotificationManagementException(
|
throw new NotificationManagementException(
|
||||||
|
|||||||
@ -64,7 +64,7 @@ public class PostgreSQLNotificationDAOImpl extends AbstractNotificationDAOImpl {
|
|||||||
rs = stmt.executeQuery();
|
rs = stmt.executeQuery();
|
||||||
notifications = new ArrayList<>();
|
notifications = new ArrayList<>();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
notifications.add(NotificationDAOUtil.getNotification(rs));
|
notifications.add(NotificationDAOUtil.getNotificationWithDeviceInfo(rs));
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new NotificationManagementException(
|
throw new NotificationManagementException(
|
||||||
@ -108,7 +108,7 @@ public class PostgreSQLNotificationDAOImpl extends AbstractNotificationDAOImpl {
|
|||||||
rs = stmt.executeQuery();
|
rs = stmt.executeQuery();
|
||||||
notifications = new ArrayList<>();
|
notifications = new ArrayList<>();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
notifications.add(NotificationDAOUtil.getNotification(rs));
|
notifications.add(NotificationDAOUtil.getNotificationWithDeviceInfo(rs));
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new NotificationManagementException(
|
throw new NotificationManagementException(
|
||||||
|
|||||||
@ -64,7 +64,7 @@ public class SQLServerNotificationDAOImpl extends AbstractNotificationDAOImpl {
|
|||||||
rs = stmt.executeQuery();
|
rs = stmt.executeQuery();
|
||||||
notifications = new ArrayList<>();
|
notifications = new ArrayList<>();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
notifications.add(NotificationDAOUtil.getNotification(rs));
|
notifications.add(NotificationDAOUtil.getNotificationWithDeviceInfo(rs));
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new NotificationManagementException(
|
throw new NotificationManagementException(
|
||||||
@ -108,7 +108,7 @@ public class SQLServerNotificationDAOImpl extends AbstractNotificationDAOImpl {
|
|||||||
rs = stmt.executeQuery();
|
rs = stmt.executeQuery();
|
||||||
notifications = new ArrayList<>();
|
notifications = new ArrayList<>();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
notifications.add(NotificationDAOUtil.getNotification(rs));
|
notifications.add(NotificationDAOUtil.getNotificationWithDeviceInfo(rs));
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new NotificationManagementException(
|
throw new NotificationManagementException(
|
||||||
|
|||||||
@ -126,6 +126,15 @@ public class NotificationDAOUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Notification getNotification(ResultSet rs) throws SQLException {
|
public static Notification getNotification(ResultSet rs) throws SQLException {
|
||||||
|
Notification notification = new Notification();
|
||||||
|
notification.setNotificationId(rs.getInt("NOTIFICATION_ID"));
|
||||||
|
notification.setOperationId(rs.getInt("OPERATION_ID"));
|
||||||
|
notification.setDescription(rs.getString("DESCRIPTION"));
|
||||||
|
notification.setStatus(rs.getString("STATUS"));
|
||||||
|
return notification;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Notification getNotificationWithDeviceInfo(ResultSet rs) throws SQLException {
|
||||||
Notification notification = new Notification();
|
Notification notification = new Notification();
|
||||||
notification.setNotificationId(rs.getInt("NOTIFICATION_ID"));
|
notification.setNotificationId(rs.getInt("NOTIFICATION_ID"));
|
||||||
notification.setOperationId(rs.getInt("OPERATION_ID"));
|
notification.setOperationId(rs.getInt("OPERATION_ID"));
|
||||||
|
|||||||
@ -120,8 +120,8 @@ public class OperationManagerImpl implements OperationManager {
|
|||||||
boolean isNotRepeated = false;
|
boolean isNotRepeated = false;
|
||||||
boolean hasExistingTaskOperation;
|
boolean hasExistingTaskOperation;
|
||||||
int enrolmentId;
|
int enrolmentId;
|
||||||
if (operationDto.getControl() ==
|
if (org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Control.NO_REPEAT == operationDto.
|
||||||
org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Control.NO_REPEAT) {
|
getControl()) {
|
||||||
isNotRepeated = true;
|
isNotRepeated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,12 +357,25 @@ public class OperationManagerImpl implements OperationManager {
|
|||||||
deviceId.getId() + "'");
|
deviceId.getId() + "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
int enrolmentId = this.getEnrolmentByStatus(deviceId, EnrolmentInfo.Status.ACTIVE);
|
//
|
||||||
if (enrolmentId < 0) {
|
EnrolmentInfo enrolmentInfo = this.getEnrolmentInfo(deviceId);
|
||||||
|
if (enrolmentInfo == null) {
|
||||||
throw new OperationManagementException("Device not found for the given device Identifier:" +
|
throw new OperationManagementException("Device not found for the given device Identifier:" +
|
||||||
deviceId.getId() + " and given type:" +
|
deviceId.getId() + " and given type:" +
|
||||||
deviceId.getType());
|
deviceId.getType());
|
||||||
}
|
}
|
||||||
|
int enrolmentId = enrolmentInfo.getId();
|
||||||
|
//Changing the enrollment status & attempt count if the device is marked as inactive or unreachable
|
||||||
|
switch (enrolmentInfo.getStatus()) {
|
||||||
|
case ACTIVE:
|
||||||
|
this.resetAttemptCount(enrolmentId);
|
||||||
|
break;
|
||||||
|
case INACTIVE:
|
||||||
|
case UNREACHABLE:
|
||||||
|
this.resetAttemptCount(enrolmentId);
|
||||||
|
this.setEnrolmentStatus(deviceId, EnrolmentInfo.Status.ACTIVE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
OperationManagementDAOFactory.openConnection();
|
OperationManagementDAOFactory.openConnection();
|
||||||
@ -886,6 +899,65 @@ public class OperationManagerImpl implements OperationManager {
|
|||||||
return enrolmentId;
|
return enrolmentId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private EnrolmentInfo getEnrolmentInfo(DeviceIdentifier deviceId) throws OperationManagementException {
|
||||||
|
EnrolmentInfo enrolmentInfo;
|
||||||
|
try {
|
||||||
|
DeviceManagementDAOFactory.openConnection();
|
||||||
|
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
|
||||||
|
String user = this.getUser();
|
||||||
|
enrolmentInfo = deviceDAO.getEnrolment(deviceId, user, tenantId);
|
||||||
|
} catch (DeviceManagementDAOException e) {
|
||||||
|
throw new OperationManagementException("Error occurred while retrieving enrollment data of '" +
|
||||||
|
deviceId.getType() + "' device carrying the identifier '" +
|
||||||
|
deviceId.getId() + "'", e);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
throw new OperationManagementException(
|
||||||
|
"Error occurred while opening a connection to the data source", e);
|
||||||
|
} finally {
|
||||||
|
DeviceManagementDAOFactory.closeConnection();
|
||||||
|
}
|
||||||
|
return enrolmentInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean setEnrolmentStatus(DeviceIdentifier deviceId, EnrolmentInfo.Status status) throws OperationManagementException {
|
||||||
|
boolean updateStatus;
|
||||||
|
try {
|
||||||
|
DeviceManagementDAOFactory.beginTransaction();
|
||||||
|
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
|
||||||
|
String user = this.getUser();
|
||||||
|
updateStatus = deviceDAO.setEnrolmentStatus(deviceId, user, status, tenantId);
|
||||||
|
DeviceManagementDAOFactory.commitTransaction();
|
||||||
|
} catch (DeviceManagementDAOException e) {
|
||||||
|
DeviceManagementDAOFactory.rollbackTransaction();
|
||||||
|
throw new OperationManagementException("Error occurred while updating enrollment status of '" +
|
||||||
|
deviceId.getType() + "' device carrying the identifier '" +
|
||||||
|
deviceId.getId() + "'", e);
|
||||||
|
} catch (TransactionManagementException e) {
|
||||||
|
throw new OperationManagementException("Error occurred while initiating a transaction", e);
|
||||||
|
} finally {
|
||||||
|
DeviceManagementDAOFactory.closeConnection();
|
||||||
|
}
|
||||||
|
return updateStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean resetAttemptCount(int enrolmentId) throws OperationManagementException {
|
||||||
|
boolean resetStatus;
|
||||||
|
try {
|
||||||
|
OperationManagementDAOFactory.beginTransaction();
|
||||||
|
resetStatus = operationDAO.resetAttemptCount(enrolmentId);
|
||||||
|
OperationManagementDAOFactory.commitTransaction();
|
||||||
|
} catch (OperationManagementDAOException e) {
|
||||||
|
OperationManagementDAOFactory.rollbackTransaction();
|
||||||
|
throw new OperationManagementException("Error occurred while resetting attempt count of device id : '" +
|
||||||
|
enrolmentId + "'", e);
|
||||||
|
} catch (TransactionManagementException e) {
|
||||||
|
throw new OperationManagementException("Error occurred while initiating a transaction", e);
|
||||||
|
} finally {
|
||||||
|
OperationManagementDAOFactory.closeConnection();
|
||||||
|
}
|
||||||
|
return resetStatus;
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isTaskScheduledOperation(Operation operation) {
|
private boolean isTaskScheduledOperation(Operation operation) {
|
||||||
TaskConfiguration taskConfiguration = DeviceConfigurationManager.getInstance().getDeviceManagementConfig().
|
TaskConfiguration taskConfiguration = DeviceConfigurationManager.getInstance().getDeviceManagementConfig().
|
||||||
getTaskConfiguration();
|
getTaskConfiguration();
|
||||||
@ -896,5 +968,4 @@ public class OperationManagerImpl implements OperationManager {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -79,4 +79,6 @@ public interface OperationDAO {
|
|||||||
|
|
||||||
int getActivityCountUpdatedAfter(long timestamp) throws OperationManagementDAOException;
|
int getActivityCountUpdatedAfter(long timestamp) throws OperationManagementDAOException;
|
||||||
|
|
||||||
|
boolean resetAttemptCount(int enrolmentId) throws OperationManagementDAOException;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -37,6 +37,7 @@ import org.wso2.carbon.device.mgt.core.operation.mgt.dao.util.OperationDAOUtil;
|
|||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -1072,4 +1073,29 @@ public class GenericOperationDAOImpl implements OperationDAO {
|
|||||||
}
|
}
|
||||||
return operations;
|
return operations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean resetAttemptCount(int enrolmentId) throws OperationManagementDAOException {
|
||||||
|
boolean status = false;
|
||||||
|
Connection conn;
|
||||||
|
PreparedStatement stmt = null;
|
||||||
|
Timestamp currentTimestamp = new Timestamp(Calendar.getInstance().getTime().getTime());
|
||||||
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
|
||||||
|
try {
|
||||||
|
conn = OperationManagementDAOFactory.getConnection();
|
||||||
|
String query = "UPDATE DM_POLICY_COMPLIANCE_STATUS SET ATTEMPTS = 0, LAST_REQUESTED_TIME = ? " +
|
||||||
|
"WHERE ENROLMENT_ID = ? AND TENANT_ID = ?";
|
||||||
|
stmt = conn.prepareStatement(query);
|
||||||
|
stmt.setTimestamp(1, currentTimestamp);
|
||||||
|
stmt.setInt(2, enrolmentId);
|
||||||
|
stmt.setInt(3, tenantId);
|
||||||
|
stmt.executeUpdate();
|
||||||
|
status = true;
|
||||||
|
} catch (SQLException e) {
|
||||||
|
throw new OperationManagementDAOException("Unable to reset the attempt count in database.", e);
|
||||||
|
} finally {
|
||||||
|
OperationManagementDAOUtil.cleanupResources(stmt, null);
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,6 +24,7 @@ import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
|
|||||||
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
|
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
|
||||||
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -33,8 +34,23 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface DeviceManagementProviderService {
|
public interface DeviceManagementProviderService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to retrieve all the devices of a given device type.
|
||||||
|
*
|
||||||
|
* @param deviceType Device-type of the required devices
|
||||||
|
* @return List of devices of given device-type.
|
||||||
|
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
|
||||||
|
* devices.
|
||||||
|
*/
|
||||||
List<Device> getAllDevices(String deviceType) throws DeviceManagementException;
|
List<Device> getAllDevices(String deviceType) throws DeviceManagementException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to retrieve all the devices registered in the system.
|
||||||
|
*
|
||||||
|
* @return List of registered devices.
|
||||||
|
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
|
||||||
|
* devices.
|
||||||
|
*/
|
||||||
List<Device> getAllDevices() throws DeviceManagementException;
|
List<Device> getAllDevices() throws DeviceManagementException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -207,6 +223,8 @@ public interface DeviceManagementProviderService {
|
|||||||
|
|
||||||
Device getDevice(DeviceIdentifier deviceId, Date since) throws DeviceManagementException;
|
Device getDevice(DeviceIdentifier deviceId, Date since) throws DeviceManagementException;
|
||||||
|
|
||||||
|
HashMap<Integer, Device> getTenantedDevice(DeviceIdentifier deviceIdentifier) throws DeviceManagementException;
|
||||||
|
|
||||||
Device getDevice(DeviceIdentifier deviceId, EnrolmentInfo.Status status) throws DeviceManagementException;
|
Device getDevice(DeviceIdentifier deviceId, EnrolmentInfo.Status status) throws DeviceManagementException;
|
||||||
|
|
||||||
List<String> getAvailableDeviceTypes() throws DeviceManagementException;
|
List<String> getAvailableDeviceTypes() throws DeviceManagementException;
|
||||||
|
|||||||
@ -757,6 +757,30 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HashMap<Integer, Device> getTenantedDevice(DeviceIdentifier deviceIdentifier) throws DeviceManagementException {
|
||||||
|
HashMap<Integer, Device> deviceHashMap;
|
||||||
|
try {
|
||||||
|
DeviceManagementDAOFactory.openConnection();
|
||||||
|
deviceHashMap = deviceDAO.getDevice(deviceIdentifier);
|
||||||
|
if (deviceHashMap == null) {
|
||||||
|
if (log.isDebugEnabled()) {
|
||||||
|
log.debug("No device is found upon the type '" + deviceIdentifier.getType() + "' and id '" +
|
||||||
|
deviceIdentifier.getId() + "'");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (DeviceManagementDAOException e) {
|
||||||
|
throw new DeviceManagementException("Error occurred while obtaining the device for id " +
|
||||||
|
"'" + deviceIdentifier.getId() + "'", e);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
throw new DeviceManagementException("Error occurred while opening a connection to the data source", e);
|
||||||
|
} finally {
|
||||||
|
DeviceManagementDAOFactory.closeConnection();
|
||||||
|
}
|
||||||
|
return deviceHashMap;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException {
|
public Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException {
|
||||||
Device device;
|
Device device;
|
||||||
|
|||||||
@ -84,31 +84,30 @@ public class DeviceTaskManagerImpl implements DeviceTaskManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addOperations() throws DeviceMgtTaskException {
|
public void addOperations() throws DeviceMgtTaskException {
|
||||||
DeviceManagementProviderService deviceManagementProviderService =
|
DeviceManagementProviderService deviceManagementProviderService = DeviceManagementDataHolder.getInstance().
|
||||||
DeviceManagementDataHolder.getInstance().getDeviceManagementProvider();
|
getDeviceManagementProvider();
|
||||||
try {
|
try {
|
||||||
List<Device> devices = deviceManagementProviderService.getAllDevices();
|
List<String> deviceTypes = deviceManagementProviderService.getAvailableDeviceTypes();
|
||||||
|
List<Device> devices;
|
||||||
List<String> operations = this.getValidOperationNames();
|
List<String> operations = this.getValidOperationNames();
|
||||||
|
|
||||||
|
for (String deviceType : deviceTypes) {
|
||||||
|
devices = deviceManagementProviderService.getAllDevices(deviceType);
|
||||||
if (!devices.isEmpty()) {
|
if (!devices.isEmpty()) {
|
||||||
for (String str : operations) {
|
for (String str : operations) {
|
||||||
CommandOperation operation = new CommandOperation();
|
CommandOperation operation = new CommandOperation();
|
||||||
operation.setEnabled(true);
|
operation.setEnabled(true);
|
||||||
operation.setType(Operation.Type.COMMAND);
|
operation.setType(Operation.Type.COMMAND);
|
||||||
operation.setCode(str);
|
operation.setCode(str);
|
||||||
//TODO: Fix this properly later adding device type to be passed in when the task manage executes "addOperations()"
|
deviceManagementProviderService.addOperation(deviceType, operation,
|
||||||
String type = null;
|
DeviceManagerUtil.getValidDeviceIdentifiers(devices));
|
||||||
if (devices.size() > 0) {
|
|
||||||
type = devices.get(0).getType();
|
|
||||||
}
|
|
||||||
deviceManagementProviderService.addOperation(type, operation,
|
|
||||||
DeviceManagerUtil.convertDevices(devices));
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("No devices are available to perform the operations.");
|
log.debug("No devices are available to perform the operations.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (InvalidDeviceException e) {
|
} catch (InvalidDeviceException e) {
|
||||||
throw new DeviceMgtTaskException("Invalid DeviceIdentifiers found.", e);
|
throw new DeviceMgtTaskException("Invalid DeviceIdentifiers found.", e);
|
||||||
} catch (DeviceManagementException e) {
|
} catch (DeviceManagementException e) {
|
||||||
|
|||||||
@ -184,6 +184,27 @@ public final class DeviceManagerUtil {
|
|||||||
return deviceIdentifiers;
|
return deviceIdentifiers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<DeviceIdentifier> getValidDeviceIdentifiers(List<Device> devices) {
|
||||||
|
List<DeviceIdentifier> deviceIdentifiers = new ArrayList<>();
|
||||||
|
for (Device device : devices) {
|
||||||
|
if (device.getEnrolmentInfo() != null) {
|
||||||
|
switch (device.getEnrolmentInfo().getStatus()) {
|
||||||
|
case BLOCKED:
|
||||||
|
case REMOVED:
|
||||||
|
case SUSPENDED:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
DeviceIdentifier identifier = new DeviceIdentifier();
|
||||||
|
identifier.setId(device.getDeviceIdentifier());
|
||||||
|
identifier.setType(device.getType());
|
||||||
|
deviceIdentifiers.add(identifier);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return deviceIdentifiers;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String getServerBaseHttpsUrl() {
|
public static String getServerBaseHttpsUrl() {
|
||||||
String hostName = "localhost";
|
String hostName = "localhost";
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -55,8 +55,8 @@
|
|||||||
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.ws.commons.axiom</groupId>
|
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
||||||
<artifactId>axiom-api</artifactId>
|
<artifactId>axiom</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon</groupId>
|
<groupId>org.wso2.carbon</groupId>
|
||||||
|
|||||||
@ -20,26 +20,14 @@ var deviceModule;
|
|||||||
deviceModule = function () {
|
deviceModule = function () {
|
||||||
var log = new Log("/app/modules/business-controllers/device.js");
|
var log = new Log("/app/modules/business-controllers/device.js");
|
||||||
|
|
||||||
var utility = require('/app/modules/utility.js').utility;
|
var utility = require('/app/modules/utility.js')["utility"];
|
||||||
var constants = require('/app/modules/constants.js');
|
var constants = require('/app/modules/constants.js');
|
||||||
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
|
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
|
||||||
var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"];
|
var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"];
|
||||||
|
|
||||||
// var ArrayList = Packages.java.util.ArrayList;
|
|
||||||
// var Properties = Packages.java.util.Properties;
|
|
||||||
// var DeviceIdentifier = Packages.org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
|
||||||
// var DeviceManagerUtil = Packages.org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil;
|
|
||||||
// var SimpleOperation = Packages.org.wso2.carbon.device.mgt.core.operation.mgt.SimpleOperation;
|
|
||||||
// var ConfigOperation = Packages.org.wso2.carbon.device.mgt.core.operation.mgt.ConfigOperation;
|
|
||||||
// var CommandOperation = Packages.org.wso2.carbon.device.mgt.core.operation.mgt.CommandOperation;
|
|
||||||
|
|
||||||
var deviceManagementService = utility.getDeviceManagementService();
|
|
||||||
|
|
||||||
var publicMethods = {};
|
var publicMethods = {};
|
||||||
var privateMethods = {};
|
var privateMethods = {};
|
||||||
|
|
||||||
// var deviceCloudService = devicemgtProps["httpsURL"] + "/common/device_manager";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Only GET method is implemented for now since there are no other type of methods used this method.
|
* Only GET method is implemented for now since there are no other type of methods used this method.
|
||||||
* @param url - URL to call the backend without the host
|
* @param url - URL to call the backend without the host
|
||||||
@ -67,170 +55,9 @@ deviceModule = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
privateMethods.validateAndReturn = function (value) {
|
privateMethods.validateAndReturn = function (value) {
|
||||||
return (value == undefined || value == null) ? constants.UNSPECIFIED : value;
|
return (value == undefined || value == null) ? constants["UNSPECIFIED"] : value;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
@Deprecated
|
|
||||||
*/
|
|
||||||
// publicMethods.listDevices = function () {
|
|
||||||
// var carbonUser = session.get(constants.USER_SESSION_KEY);
|
|
||||||
// var utility = require('/app/modules/utility.js').utility;
|
|
||||||
// if (!carbonUser) {
|
|
||||||
// log.error("User object was not found in the session");
|
|
||||||
// throw constants.ERRORS.USER_NOT_FOUND;
|
|
||||||
// }
|
|
||||||
// try {
|
|
||||||
// utility.startTenantFlow(carbonUser);
|
|
||||||
// var deviceManagementService = utility.getDeviceManagementService();
|
|
||||||
// var devices = deviceManagementService.getAllDevices();
|
|
||||||
// var deviceList = [];
|
|
||||||
// var i, device, propertiesList, deviceObject;
|
|
||||||
// for (i = 0; i < devices.size(); i++) {
|
|
||||||
// device = devices.get(i);
|
|
||||||
// propertiesList = DeviceManagerUtil.convertDevicePropertiesToMap(device.getProperties());
|
|
||||||
//
|
|
||||||
// deviceObject = {};
|
|
||||||
// deviceObject[constants.DEVICE_IDENTIFIER] =
|
|
||||||
// privateMethods.validateAndReturn(device.getDeviceIdentifier());
|
|
||||||
// deviceObject[constants.DEVICE_NAME] =
|
|
||||||
// privateMethods.validateAndReturn(device.getName());
|
|
||||||
// deviceObject[constants.DEVICE_OWNERSHIP] =
|
|
||||||
// privateMethods.validateAndReturn(device.getEnrolmentInfo().getOwnership());
|
|
||||||
// deviceObject[constants.DEVICE_OWNER] =
|
|
||||||
// privateMethods.validateAndReturn(device.getEnrolmentInfo().getOwner());
|
|
||||||
// deviceObject[constants.DEVICE_TYPE] =
|
|
||||||
// privateMethods.validateAndReturn(device.getType());
|
|
||||||
// deviceObject[constants.DEVICE_PROPERTIES] = {};
|
|
||||||
// if (device.getType() == constants.PLATFORM_IOS) {
|
|
||||||
// deviceObject[constants.DEVICE_PROPERTIES][constants.DEVICE_MODEL] =
|
|
||||||
// privateMethods.validateAndReturn(propertiesList.get(constants.DEVICE_PRODUCT));
|
|
||||||
// deviceObject[constants.DEVICE_PROPERTIES][constants.DEVICE_VENDOR] = constants.VENDOR_APPLE;
|
|
||||||
// } else {
|
|
||||||
// deviceObject[constants.DEVICE_PROPERTIES][constants.DEVICE_MODEL] =
|
|
||||||
// privateMethods.validateAndReturn(propertiesList.get(constants.DEVICE_MODEL));
|
|
||||||
// deviceObject[constants.DEVICE_PROPERTIES][constants.DEVICE_VENDOR] =
|
|
||||||
// privateMethods.validateAndReturn(propertiesList.get(constants.DEVICE_VENDOR));
|
|
||||||
// }
|
|
||||||
// deviceObject[constants.DEVICE_PROPERTIES][constants.DEVICE_OS_VERSION] =
|
|
||||||
// privateMethods.validateAndReturn(propertiesList.get(constants.DEVICE_OS_VERSION));
|
|
||||||
//
|
|
||||||
// deviceList.push(deviceObject);
|
|
||||||
// }
|
|
||||||
// return deviceList;
|
|
||||||
// } catch (e) {
|
|
||||||
// throw e;
|
|
||||||
// } finally {
|
|
||||||
// utility.endTenantFlow();
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
/*
|
|
||||||
@Deprecated
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
Get the supported features by the device type
|
|
||||||
*/
|
|
||||||
// publicMethods.getFeatures = function (deviceType) {
|
|
||||||
// var carbonUser = session.get(constants.USER_SESSION_KEY);
|
|
||||||
// var utility = require('/app/modules/utility.js').utility;
|
|
||||||
// if (!carbonUser) {
|
|
||||||
// log.error("User object was not found in the session");
|
|
||||||
// throw constants.ERRORS.USER_NOT_FOUND;
|
|
||||||
// }
|
|
||||||
// try {
|
|
||||||
// utility.startTenantFlow(carbonUser);
|
|
||||||
// var deviceManagementService = utility.getDeviceManagementService();
|
|
||||||
// var features = deviceManagementService.getFeatureManager(deviceType).getFeatures();
|
|
||||||
// var featuresConverted = {};
|
|
||||||
// if (features) {
|
|
||||||
// var i, feature, featureObject;
|
|
||||||
// for (i = 0; i < features.size(); i++) {
|
|
||||||
// feature = features.get(i);
|
|
||||||
// featureObject = {};
|
|
||||||
// featureObject[constants.FEATURE_NAME] = feature.getName();
|
|
||||||
// featureObject[constants.FEATURE_DESCRIPTION] = feature.getDescription();
|
|
||||||
// featuresConverted[feature.getName()] = featureObject;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return featuresConverted;
|
|
||||||
// } catch (e) {
|
|
||||||
// throw e;
|
|
||||||
// } finally {
|
|
||||||
// utility.endTenantFlow();
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
/*
|
|
||||||
@Deprecated
|
|
||||||
*/
|
|
||||||
// publicMethods.performOperation = function (devices, operation) {
|
|
||||||
// var carbonUser = session.get(constants.USER_SESSION_KEY);
|
|
||||||
// var utility = require('/app/modules/utility.js').utility;
|
|
||||||
// if (!carbonUser) {
|
|
||||||
// log.error("User object was not found in the session");
|
|
||||||
// throw constants.ERRORS.USER_NOT_FOUND;
|
|
||||||
// }
|
|
||||||
// try {
|
|
||||||
// utility.startTenantFlow(carbonUser);
|
|
||||||
// var deviceManagementService = utility.getDeviceManagementService();
|
|
||||||
// var operationInstance;
|
|
||||||
// if (operation.type == "COMMAND") {
|
|
||||||
// operationInstance = new CommandOperation();
|
|
||||||
// } else if (operation.type == "CONFIG") {
|
|
||||||
// operationInstance = new ConfigOperation();
|
|
||||||
// } else {
|
|
||||||
// operationInstance = new SimpleOperation();
|
|
||||||
// }
|
|
||||||
// operationInstance.setCode(operation.featureName);
|
|
||||||
// var props = new Properties();
|
|
||||||
// var i, object;
|
|
||||||
// for (i = 0; i < operation.properties.length; i++) {
|
|
||||||
// object = properties[i];
|
|
||||||
// props.setProperty(object.key, object.value);
|
|
||||||
// }
|
|
||||||
// operationInstance.setProperties(props);
|
|
||||||
// var deviceList = new ArrayList();
|
|
||||||
// var j, device, deviceIdentifier;
|
|
||||||
// for (j = 0; j < devices.length; i++) {
|
|
||||||
// device = devices[j];
|
|
||||||
// deviceIdentifier = new DeviceIdentifier();
|
|
||||||
// deviceIdentifier.setId(device.id);
|
|
||||||
// deviceIdentifier.setType(device.type);
|
|
||||||
// deviceList.add(deviceIdentifier);
|
|
||||||
// }
|
|
||||||
// deviceManagementService.addOperation(operationInstance, deviceList);
|
|
||||||
// } catch (e) {
|
|
||||||
// throw e;
|
|
||||||
// } finally {
|
|
||||||
// utility.endTenantFlow();
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
/*
|
|
||||||
@Deprecated
|
|
||||||
*/
|
|
||||||
// privateMethods.getDevice = function (type, deviceId) {
|
|
||||||
// var carbonUser = session.get(constants.USER_SESSION_KEY);
|
|
||||||
// var utility = require('/app/modules/utility.js').utility;
|
|
||||||
// if (!carbonUser) {
|
|
||||||
// log.error("User object was not found in the session");
|
|
||||||
// throw constants.ERRORS.USER_NOT_FOUND;
|
|
||||||
// }
|
|
||||||
// try {
|
|
||||||
// utility.startTenantFlow(carbonUser);
|
|
||||||
// var deviceManagementService = utility.getDeviceManagementService();
|
|
||||||
// var deviceIdentifier = new DeviceIdentifier();
|
|
||||||
// deviceIdentifier.setType(type);
|
|
||||||
// deviceIdentifier.setId(deviceId);
|
|
||||||
// return deviceManagementService.getDevice(deviceIdentifier);
|
|
||||||
// } catch (e) {
|
|
||||||
// throw e;
|
|
||||||
// } finally {
|
|
||||||
// utility.endTenantFlow();
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@Updated
|
@Updated
|
||||||
*/
|
*/
|
||||||
@ -243,39 +70,82 @@ deviceModule = function () {
|
|||||||
var utility = require('/app/modules/utility.js')["utility"];
|
var utility = require('/app/modules/utility.js')["utility"];
|
||||||
try {
|
try {
|
||||||
utility.startTenantFlow(carbonUser);
|
utility.startTenantFlow(carbonUser);
|
||||||
//var url = mdmProps["httpsURL"] + "/mdm-admin/devices/view?type=" + deviceType + "&id=" + deviceId;
|
|
||||||
var url = devicemgtProps["httpsURL"] + "/api/device-mgt/v1.0/devices/" + deviceType + "/" + deviceId;
|
var url = devicemgtProps["httpsURL"] + "/api/device-mgt/v1.0/devices/" + deviceType + "/" + deviceId;
|
||||||
return serviceInvokers.XMLHttp.get(
|
return serviceInvokers.XMLHttp.get(
|
||||||
url,
|
url,
|
||||||
function (backendResponse) {
|
function (backendResponse) {
|
||||||
var response = {};
|
var response = {};
|
||||||
if (backendResponse.status == 200 && backendResponse.responseText) {
|
if (backendResponse.status == 200 && backendResponse.responseText) {
|
||||||
response["status"] = "success";
|
|
||||||
var device = parse(backendResponse.responseText);
|
var device = parse(backendResponse.responseText);
|
||||||
|
|
||||||
|
var filteredDeviceData = {};
|
||||||
|
if (device["deviceIdentifier"]) {
|
||||||
|
filteredDeviceData["deviceIdentifier"] = device["deviceIdentifier"];
|
||||||
|
}
|
||||||
|
if (device["type"]) {
|
||||||
|
filteredDeviceData["type"] = device["type"];
|
||||||
|
}
|
||||||
|
if (device["name"]) {
|
||||||
|
filteredDeviceData["name"] = device["name"];
|
||||||
|
}
|
||||||
|
if (device["enrolmentInfo"]) {
|
||||||
|
var enrolmentInfo = {};
|
||||||
|
if (device["enrolmentInfo"]["status"]) {
|
||||||
|
enrolmentInfo["status"] = device["enrolmentInfo"]["status"];
|
||||||
|
}
|
||||||
|
if (device["enrolmentInfo"]["owner"]) {
|
||||||
|
enrolmentInfo["owner"] = device["enrolmentInfo"]["owner"];
|
||||||
|
}
|
||||||
|
if (device["enrolmentInfo"]["ownership"]) {
|
||||||
|
enrolmentInfo["ownership"] = device["enrolmentInfo"]["ownership"];
|
||||||
|
}
|
||||||
|
filteredDeviceData["enrolmentInfo"] = enrolmentInfo;
|
||||||
|
}
|
||||||
|
if (device["properties"] && device["properties"].length > 0) {
|
||||||
var propertiesList = device["properties"];
|
var propertiesList = device["properties"];
|
||||||
var properties = {};
|
var properties = {};
|
||||||
for (var i = 0; i < propertiesList.length; i++) {
|
for (var i = 0; i < propertiesList.length; i++) {
|
||||||
|
if (propertiesList[i]["value"]) {
|
||||||
properties[propertiesList[i]["name"]] =
|
properties[propertiesList[i]["name"]] =
|
||||||
propertiesList[i]["value"];
|
propertiesList[i]["value"];
|
||||||
}
|
}
|
||||||
var deviceObject = {};
|
|
||||||
deviceObject[constants["DEVICE_IDENTIFIER"]] = device["deviceIdentifier"];
|
|
||||||
deviceObject[constants["DEVICE_NAME"]] = device["name"];
|
|
||||||
deviceObject[constants["DEVICE_OWNERSHIP"]] = device["enrolmentInfo"]["ownership"];
|
|
||||||
deviceObject[constants["DEVICE_OWNER"]] = device["enrolmentInfo"]["owner"];
|
|
||||||
deviceObject[constants["DEVICE_STATUS"]] = device["enrolmentInfo"]["status"];
|
|
||||||
deviceObject[constants["DEVICE_TYPE"]] = device["type"];
|
|
||||||
if (device["type"] == constants["PLATFORM_IOS"]) {
|
|
||||||
properties[constants["DEVICE_MODEL"]] = properties[constants["DEVICE_PRODUCT"]];
|
|
||||||
delete properties[constants["DEVICE_PRODUCT"]];
|
|
||||||
properties[constants["DEVICE_VENDOR"]] = constants["VENDOR_APPLE"];
|
|
||||||
}
|
}
|
||||||
deviceObject[constants["DEVICE_PROPERTIES"]] = properties;
|
|
||||||
response["content"] = deviceObject;
|
filteredDeviceData["initialDeviceInfo"] = properties;
|
||||||
|
|
||||||
|
if (properties["DEVICE_INFO"]) {
|
||||||
|
var initialDeviceInfoList = parse(properties["DEVICE_INFO"]);
|
||||||
|
var initialDeviceInfo = {};
|
||||||
|
for (var j = 0; j < initialDeviceInfoList.length; j++) {
|
||||||
|
if (initialDeviceInfoList[j]["value"]) {
|
||||||
|
initialDeviceInfo[initialDeviceInfoList[j]["name"]] =
|
||||||
|
initialDeviceInfoList[j]["value"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"] = initialDeviceInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (filteredDeviceData["type"]) {
|
||||||
|
if (filteredDeviceData["type"] == constants["PLATFORM_IOS"]) {
|
||||||
|
if (filteredDeviceData["properties"]) {
|
||||||
|
filteredDeviceData["properties"]["VENDOR"] = "Apple";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (device["deviceInfo"]) {
|
||||||
|
filteredDeviceData["latestDeviceInfo"] = device["deviceInfo"];
|
||||||
|
}
|
||||||
|
response["content"] = filteredDeviceData;
|
||||||
|
response["status"] = "success";
|
||||||
return response;
|
return response;
|
||||||
} else if (backendResponse.status == 401) {
|
} else if (backendResponse.status == 401) {
|
||||||
response["status"] = "unauthorized";
|
response["status"] = "unauthorized";
|
||||||
return response;
|
return response;
|
||||||
|
} else if (backendResponse.status == 404) {
|
||||||
|
response["status"] = "notFound";
|
||||||
|
return response;
|
||||||
} else {
|
} else {
|
||||||
response["status"] = "error";
|
response["status"] = "error";
|
||||||
return response;
|
return response;
|
||||||
@ -330,8 +200,6 @@ deviceModule = function () {
|
|||||||
return response;
|
return response;
|
||||||
};
|
};
|
||||||
|
|
||||||
//Old methods
|
|
||||||
//TODO: make sure these methods are updated
|
|
||||||
/*
|
/*
|
||||||
@Updated
|
@Updated
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -34,6 +34,7 @@ var DEVICE_OS_BUILD_DATE = "osBuildDate";
|
|||||||
var DEVICE_PROPERTIES = "properties";
|
var DEVICE_PROPERTIES = "properties";
|
||||||
var DEVICE_ENROLLMENT_INFO = "enrolmentInfo";
|
var DEVICE_ENROLLMENT_INFO = "enrolmentInfo";
|
||||||
var DEVICE_STATUS = "status";
|
var DEVICE_STATUS = "status";
|
||||||
|
var DEVICE_INFO = "deviceInfo";
|
||||||
|
|
||||||
var FEATURE_NAME = "featureName";
|
var FEATURE_NAME = "featureName";
|
||||||
var FEATURE_DESCRIPTION = "featureDescription";
|
var FEATURE_DESCRIPTION = "featureDescription";
|
||||||
|
|||||||
@ -37,7 +37,17 @@ var modalPopupContainer = modalPopup + " .modal-content";
|
|||||||
var modalPopupContent = modalPopup + " .modal-content";
|
var modalPopupContent = modalPopup + " .modal-content";
|
||||||
var body = "body";
|
var body = "body";
|
||||||
var isInit = true;
|
var isInit = true;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Fires the res_text when ever a data table redraw occurs making
|
||||||
|
* the font icons change the size to respective screen resolution.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
$(document).on( 'draw.dt', function () {
|
||||||
$(".icon .text").res_text(0.2);
|
$(".icon .text").res_text(0.2);
|
||||||
|
} );
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -103,12 +103,12 @@
|
|||||||
<label class=" hidden error email-invalid" for="summary">Invalid Email
|
<label class=" hidden error email-invalid" for="summary">Invalid Email
|
||||||
Address.</label>
|
Address.</label>
|
||||||
</div>
|
</div>
|
||||||
|
{{#if canViewRoles}}
|
||||||
<label class="wr-input-label"
|
<label class="wr-input-label"
|
||||||
title="Optional field that can have 0-to-many roles for the user">
|
title="Optional field that can have 0-to-many roles for the user">
|
||||||
User Roles
|
User Roles
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
||||||
</label>
|
</label>
|
||||||
{{#if canViewRoles}}
|
|
||||||
<div class="wr-input-control">
|
<div class="wr-input-control">
|
||||||
<select id="roles" class="form-control select2" multiple="multiple">
|
<select id="roles" class="form-control select2" multiple="multiple">
|
||||||
{{#each roles}}
|
{{#each roles}}
|
||||||
|
|||||||
@ -179,6 +179,7 @@ $("#userStore").change(
|
|||||||
$("select option:selected").each(function () {
|
$("select option:selected").each(function () {
|
||||||
str += $(this).text() + "";
|
str += $(this).text() + "";
|
||||||
});
|
});
|
||||||
|
if ($("#roles").length > 0) {
|
||||||
var getRolesAPI = deviceMgtAPIsBasePath + "/roles?user-store=" + str + "&limit=100";
|
var getRolesAPI = deviceMgtAPIsBasePath + "/roles?user-store=" + str + "&limit=100";
|
||||||
|
|
||||||
invokerUtil.get(
|
invokerUtil.get(
|
||||||
@ -200,6 +201,8 @@ $("#userStore").change(
|
|||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
}
|
||||||
}).change();
|
}).change();
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
@ -224,7 +227,10 @@ $(document).ready(function () {
|
|||||||
var firstname = firstnameInput.val();
|
var firstname = firstnameInput.val();
|
||||||
var lastname = lastnameInput.val();
|
var lastname = lastnameInput.val();
|
||||||
var emailAddress = $("input#emailAddress").val();
|
var emailAddress = $("input#emailAddress").val();
|
||||||
var roles = $("select#roles").val();
|
var roles ;
|
||||||
|
if ($("#roles").length > 0) {
|
||||||
|
roles = $("select#roles").val();
|
||||||
|
}
|
||||||
var errorMsgWrapper = "#user-create-error-msg";
|
var errorMsgWrapper = "#user-create-error-msg";
|
||||||
var errorMsg = "#user-create-error-msg span";
|
var errorMsg = "#user-create-error-msg span";
|
||||||
if (!username) {
|
if (!username) {
|
||||||
@ -272,7 +278,9 @@ $(document).ready(function () {
|
|||||||
$("input#firstname").val("");
|
$("input#firstname").val("");
|
||||||
$("input#lastname").val("");
|
$("input#lastname").val("");
|
||||||
$("input#email").val("");
|
$("input#email").val("");
|
||||||
|
if ($("#roles").length > 0) {
|
||||||
$("select#roles").select2("val", "");
|
$("select#roles").select2("val", "");
|
||||||
|
}
|
||||||
// Refreshing with success message
|
// Refreshing with success message
|
||||||
$("#user-create-form").addClass("hidden");
|
$("#user-create-form").addClass("hidden");
|
||||||
$("#user-created-msg").removeClass("hidden");
|
$("#user-created-msg").removeClass("hidden");
|
||||||
|
|||||||
@ -51,7 +51,8 @@
|
|||||||
<div id="user-create-error-msg" class="alert alert-danger hidden" role="alert">
|
<div id="user-create-error-msg" class="alert alert-danger hidden" role="alert">
|
||||||
<i class="icon fw fw-error"></i><span></span>
|
<i class="icon fw fw-error"></i><span></span>
|
||||||
</div>
|
</div>
|
||||||
<label class="wr-input-label" title="Select the domain of the user store from the drop-down given below. The domain of the default user store is PRIMARY">
|
<label class="wr-input-label"
|
||||||
|
title="Select the domain of the user store from the drop-down given below. The domain of the default user store is PRIMARY">
|
||||||
User Store Domain
|
User Store Domain
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
||||||
</label>
|
</label>
|
||||||
@ -94,8 +95,10 @@
|
|||||||
<span class="glyphicon glyphicon-remove form-control-feedback hidden emailError"></span>
|
<span class="glyphicon glyphicon-remove form-control-feedback hidden emailError"></span>
|
||||||
<label class=" hidden error email-required" for="summary">This field is
|
<label class=" hidden error email-required" for="summary">This field is
|
||||||
required.</label>
|
required.</label>
|
||||||
<label class=" hidden error email-invalid" for="summary">Invalid Email Address.</label>
|
<label class=" hidden error email-invalid" for="summary">Invalid Email
|
||||||
|
Address.</label>
|
||||||
</div>
|
</div>
|
||||||
|
{{#if canViewRoles}}
|
||||||
<label class="wr-input-label"
|
<label class="wr-input-label"
|
||||||
title="Optional field that can have 0-to-many roles for the user">
|
title="Optional field that can have 0-to-many roles for the user">
|
||||||
User Roles
|
User Roles
|
||||||
@ -109,6 +112,7 @@
|
|||||||
{{/each}}
|
{{/each}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
@ -63,6 +63,9 @@ function onRequest() {
|
|||||||
if (userModule.isAuthorized("/permission/admin/device-mgt/users/manage")) {
|
if (userModule.isAuthorized("/permission/admin/device-mgt/users/manage")) {
|
||||||
page.canManage = true;
|
page.canManage = true;
|
||||||
}
|
}
|
||||||
|
if (userModule.isAuthorized("/permission/admin/device-mgt/roles/view")) {
|
||||||
|
page.canViewRoles = true;
|
||||||
|
}
|
||||||
|
|
||||||
page["usernameJSRegEx"] = devicemgtProps["userValidationConfig"]["usernameJSRegEx"];
|
page["usernameJSRegEx"] = devicemgtProps["userValidationConfig"]["usernameJSRegEx"];
|
||||||
page["usernameRegExViolationErrorMsg"] = devicemgtProps["userValidationConfig"]["usernameRegExViolationErrorMsg"];
|
page["usernameRegExViolationErrorMsg"] = devicemgtProps["userValidationConfig"]["usernameRegExViolationErrorMsg"];
|
||||||
|
|||||||
@ -168,11 +168,16 @@ $(document).ready(function () {
|
|||||||
$("select.select2[multiple=multiple]").select2({
|
$("select.select2[multiple=multiple]").select2({
|
||||||
tags: false
|
tags: false
|
||||||
});
|
});
|
||||||
var roleList = $("#roles").attr("selectedVals").trim().replace(/ /g, "");
|
var roleList, roleArr;
|
||||||
|
if ($("#roles").length > 0) {
|
||||||
|
roleList = $("#roles").attr("selectedVals").trim().replace(/ /g, "");
|
||||||
roleList = roleList.replace(/(\r\n|\n|\r)/gm, "");
|
roleList = roleList.replace(/(\r\n|\n|\r)/gm, "");
|
||||||
var roleArr = roleList.split(",");
|
roleArr = roleList.split(",");
|
||||||
$("#roles").val(roleArr).trigger("change");
|
}
|
||||||
|
|
||||||
|
if ($("#roles").length > 0) {
|
||||||
|
$("#roles").val(roleArr).trigger("change");
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Following click function would execute
|
* Following click function would execute
|
||||||
* when a user clicks on "Add User" button
|
* when a user clicks on "Add User" button
|
||||||
@ -188,7 +193,10 @@ $(document).ready(function () {
|
|||||||
var firstname = firstnameInput.val();
|
var firstname = firstnameInput.val();
|
||||||
var lastname = lastnameInput.val();
|
var lastname = lastnameInput.val();
|
||||||
var emailAddress = $("input#emailAddress").val();
|
var emailAddress = $("input#emailAddress").val();
|
||||||
|
var roles;
|
||||||
|
if ($("#roles").length > 0) {
|
||||||
var roles = $("select#roles").val();
|
var roles = $("select#roles").val();
|
||||||
|
}
|
||||||
var errorMsgWrapper = "#user-create-error-msg";
|
var errorMsgWrapper = "#user-create-error-msg";
|
||||||
var errorMsg = "#user-create-error-msg span";
|
var errorMsg = "#user-create-error-msg span";
|
||||||
if (!username) {
|
if (!username) {
|
||||||
|
|||||||
@ -43,7 +43,16 @@ var modalPopup = ".modal";
|
|||||||
var modalPopupContainer = modalPopup + " .modal-content";
|
var modalPopupContainer = modalPopup + " .modal-content";
|
||||||
var modalPopupContent = modalPopup + " .modal-content";
|
var modalPopupContent = modalPopup + " .modal-content";
|
||||||
var body = "body";
|
var body = "body";
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Fires the res_text when ever a data table redraw occurs making
|
||||||
|
* the font icons change the size to respective screen resolution.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
$(document).on( 'draw.dt', function () {
|
||||||
$(".icon .text").res_text(0.2);
|
$(".icon .text").res_text(0.2);
|
||||||
|
} );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* set popup maximum height function.
|
* set popup maximum height function.
|
||||||
|
|||||||
@ -37,6 +37,10 @@ $.fn.datatables_extended_serverside_paging = function (settings , url, dataFilte
|
|||||||
if (InitiateViewOption) {
|
if (InitiateViewOption) {
|
||||||
$(".viewEnabledIcon").bind("click", InitiateViewOption);
|
$(".viewEnabledIcon").bind("click", InitiateViewOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var deviceType;
|
||||||
|
var ownership;
|
||||||
|
|
||||||
//--- End of EMM related codes
|
//--- End of EMM related codes
|
||||||
|
|
||||||
$(elem).DataTable(
|
$(elem).DataTable(
|
||||||
@ -65,6 +69,9 @@ $.fn.datatables_extended_serverside_paging = function (settings , url, dataFilte
|
|||||||
// params.filter = params.search.value;
|
// params.filter = params.search.value;
|
||||||
// }
|
// }
|
||||||
params.url = url;
|
params.url = url;
|
||||||
|
|
||||||
|
//Remove this line to add url parameters which is included by data tables it self
|
||||||
|
delete params.columns;
|
||||||
},
|
},
|
||||||
dataFilter: dataFilter
|
dataFilter: dataFilter
|
||||||
},
|
},
|
||||||
@ -108,14 +115,32 @@ $.fn.datatables_extended_serverside_paging = function (settings , url, dataFilte
|
|||||||
.draw();
|
.draw();
|
||||||
|
|
||||||
if (filterColumn.eq(column.index()).hasClass('data-platform')) {
|
if (filterColumn.eq(column.index()).hasClass('data-platform')) {
|
||||||
if (!val) {
|
deviceType = val;
|
||||||
|
if (!deviceType || !ownership) {
|
||||||
$("#operation-bar").addClass("hidden");
|
$("#operation-bar").addClass("hidden");
|
||||||
$("#operation-guide").removeClass("hidden");
|
$("#operation-guide").removeClass("hidden");
|
||||||
} else {
|
} else {
|
||||||
$("#operation-guide").addClass("hidden");
|
$("#operation-guide").addClass("hidden");
|
||||||
$("#operation-bar").removeClass("hidden");
|
$("#operation-bar").removeClass("hidden");
|
||||||
//noinspection JSUnresolvedFunction
|
//noinspection JSUnresolvedFunction
|
||||||
loadOperationBar(val);
|
if (deviceType && ownership) {
|
||||||
|
loadOperationBar(deviceType, ownership, operationBarModeConstants.BULK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (filterColumn.eq(column.index()).hasClass('data-ownership')) {
|
||||||
|
ownership = val;
|
||||||
|
if (!deviceType || !ownership) {
|
||||||
|
$("#operation-bar").addClass("hidden");
|
||||||
|
$("#operation-guide").removeClass("hidden");
|
||||||
|
} else {
|
||||||
|
$("#operation-guide").addClass("hidden");
|
||||||
|
$("#operation-bar").removeClass("hidden");
|
||||||
|
//noinspection JSUnresolvedFunction
|
||||||
|
if (deviceType && ownership) {
|
||||||
|
loadOperationBar(deviceType, ownership, operationBarModeConstants.BULK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -107,7 +107,6 @@ var operationModule = function () {
|
|||||||
"NOTIFICATION_OPERATION_CODE": "NOTIFICATION",
|
"NOTIFICATION_OPERATION_CODE": "NOTIFICATION",
|
||||||
"CALENDAR_SUBSCRIPTION_OPERATION_CODE": "CALENDAR_SUBSCRIPTION",
|
"CALENDAR_SUBSCRIPTION_OPERATION_CODE": "CALENDAR_SUBSCRIPTION",
|
||||||
"APN_OPERATION_CODE": "APN",
|
"APN_OPERATION_CODE": "APN",
|
||||||
"DOMAIN_CODE": "DOMAIN",
|
|
||||||
"CELLULAR_OPERATION_CODE": "CELLULAR",
|
"CELLULAR_OPERATION_CODE": "CELLULAR",
|
||||||
"PER_APP_VPN_OPERATION_CODE": "PER_APP_VPN",
|
"PER_APP_VPN_OPERATION_CODE": "PER_APP_VPN",
|
||||||
"APP_TO_PER_APP_VPN_MAPPING_OPERATION_CODE": "APP_TO_PER_APP_VPN_MAPPING"
|
"APP_TO_PER_APP_VPN_MAPPING_OPERATION_CODE": "APP_TO_PER_APP_VPN_MAPPING"
|
||||||
@ -116,20 +115,10 @@ var operationModule = function () {
|
|||||||
publicMethods.getIOSServiceEndpoint = function (operationCode) {
|
publicMethods.getIOSServiceEndpoint = function (operationCode) {
|
||||||
var featureMap = {
|
var featureMap = {
|
||||||
"DEVICE_LOCK": "lock",
|
"DEVICE_LOCK": "lock",
|
||||||
"VPN": "vpn",
|
|
||||||
"PER_APP_VPN": "per-app-vpn",
|
|
||||||
"APP_TO_PER_APP_VPN_MAPPING": "app-to-per-app-vpn-mapping",
|
|
||||||
"RING": "ring",
|
|
||||||
"LOCATION": "location",
|
"LOCATION": "location",
|
||||||
|
"ENTERPRISE_WIPE": "enterprise-wipe",
|
||||||
"NOTIFICATION": "notification",
|
"NOTIFICATION": "notification",
|
||||||
"AIR_PLAY": "airplay",
|
"RING": "ring"
|
||||||
"RESTRICTION": "restriction",
|
|
||||||
"CELLULAR": "cellular",
|
|
||||||
"WIFI": "wifi",
|
|
||||||
"INSTALL_STORE_APPLICATION": "store-application",
|
|
||||||
"INSTALL_ENTERPRISE_APPLICATION": "enterprise-application",
|
|
||||||
"REMOVE_APPLICATION": "remove-application",
|
|
||||||
"ENTERPRISE_WIPE": "enterprise-wipe"
|
|
||||||
};
|
};
|
||||||
return "/api/device-mgt/ios/v1.0/admin/devices/" + featureMap[operationCode];
|
return "/api/device-mgt/ios/v1.0/admin/devices/" + featureMap[operationCode];
|
||||||
};
|
};
|
||||||
@ -851,6 +840,24 @@ var operationModule = function () {
|
|||||||
"restrictedApplications": operationPayload["restricted-applications"]
|
"restrictedApplications": operationPayload["restricted-applications"]
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
case androidOperationConstants["SYSTEM_UPDATE_POLICY_CODE"]:
|
||||||
|
if (operationPayload["type"] != "window") {
|
||||||
|
payload = {
|
||||||
|
"cosuSystemUpdatePolicyType": operationPayload["type"]
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
payload = {
|
||||||
|
"cosuSystemUpdatePolicyType": operationPayload["type"],
|
||||||
|
"cosuSystemUpdatePolicyWindowStartTime": operationPayload["startTime"],
|
||||||
|
"cosuSystemUpdatePolicyWindowEndTime": operationPayload["endTime"]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case androidOperationConstants["KIOSK_APPS_CODE"]:
|
||||||
|
payload = {
|
||||||
|
"cosuWhitelistedApplications": operationPayload["whitelistedApplications"]
|
||||||
|
};
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return payload;
|
return payload;
|
||||||
};
|
};
|
||||||
@ -1187,12 +1194,13 @@ var operationModule = function () {
|
|||||||
publicMethods.getWindowsServiceEndpoint = function (operationCode) {
|
publicMethods.getWindowsServiceEndpoint = function (operationCode) {
|
||||||
var featureMap = {
|
var featureMap = {
|
||||||
"DEVICE_LOCK": "lock-devices",
|
"DEVICE_LOCK": "lock-devices",
|
||||||
|
"DISENROLL": "disenroll",
|
||||||
"DEVICE_RING": "ring-devices",
|
"DEVICE_RING": "ring-devices",
|
||||||
"LOCK_RESET": "lock-reset-devices",
|
"LOCK_RESET": "lock-reset-devices",
|
||||||
"WIPE_DATA": "wipe-devices"
|
"WIPE_DATA": "wipe-devices"
|
||||||
};
|
};
|
||||||
//return "/mdm-windows-agent/services/windows/operation/" + featureMap[operationCode];
|
//return "/mdm-windows-agent/services/windows/operation/" + featureMap[operationCode];
|
||||||
return "/api/device-mgt/windows/v1.0/admin/devices/" + featureMap[operationCode];
|
return "/api/device-mgt/windows/v1.0/services/windows/admin/devices/" + featureMap[operationCode];
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* Get the icon for the featureCode
|
* Get the icon for the featureCode
|
||||||
@ -1203,16 +1211,16 @@ var operationModule = function () {
|
|||||||
var featureMap = {
|
var featureMap = {
|
||||||
"DEVICE_LOCK": "fw-lock",
|
"DEVICE_LOCK": "fw-lock",
|
||||||
"DEVICE_LOCATION": "fw-map-location",
|
"DEVICE_LOCATION": "fw-map-location",
|
||||||
"CLEAR_PASSWORD": "fw-key",
|
"CLEAR_PASSWORD": "fw-clear",
|
||||||
"ENTERPRISE_WIPE": "fw-clear",
|
"ENTERPRISE_WIPE": "fw-block",
|
||||||
"WIPE_DATA": "fw-database",
|
"WIPE_DATA": "fw-delete",
|
||||||
"DEVICE_RING": "fw-dial-up",
|
"DEVICE_RING": "fw-dial-up",
|
||||||
"DEVICE_REBOOT": "fw-refresh",
|
"DEVICE_REBOOT": "fw-refresh",
|
||||||
"UPGRADE_FIRMWARE": "fw-up-arrow",
|
"UPGRADE_FIRMWARE": "fw-hardware",
|
||||||
"DEVICE_MUTE": "fw-mute",
|
"DEVICE_MUTE": "fw-mute",
|
||||||
"NOTIFICATION": "fw-message",
|
"NOTIFICATION": "fw-message",
|
||||||
"CHANGE_LOCK_CODE": "fw-security",
|
"CHANGE_LOCK_CODE": "fw-security",
|
||||||
"DEVICE_UNLOCK": "fw-lock"
|
"DEVICE_UNLOCK": "fw-key"
|
||||||
};
|
};
|
||||||
return featureMap[operationCode];
|
return featureMap[operationCode];
|
||||||
};
|
};
|
||||||
@ -1226,8 +1234,9 @@ var operationModule = function () {
|
|||||||
var featureMap = {
|
var featureMap = {
|
||||||
"DEVICE_LOCK": "fw-lock",
|
"DEVICE_LOCK": "fw-lock",
|
||||||
"DEVICE_RING": "fw-dial-up",
|
"DEVICE_RING": "fw-dial-up",
|
||||||
|
"DISENROLL": "fw-export",
|
||||||
"LOCK_RESET": "fw-key",
|
"LOCK_RESET": "fw-key",
|
||||||
"WIPE_DATA": "fw-clear"
|
"WIPE_DATA": "fw-delete"
|
||||||
};
|
};
|
||||||
return featureMap[operationCode];
|
return featureMap[operationCode];
|
||||||
};
|
};
|
||||||
@ -1241,7 +1250,7 @@ var operationModule = function () {
|
|||||||
var featureMap = {
|
var featureMap = {
|
||||||
"DEVICE_LOCK": "fw-lock",
|
"DEVICE_LOCK": "fw-lock",
|
||||||
"LOCATION": "fw-map-location",
|
"LOCATION": "fw-map-location",
|
||||||
"ENTERPRISE_WIPE": "fw-clear",
|
"ENTERPRISE_WIPE": "fw-block",
|
||||||
"NOTIFICATION": "fw-message",
|
"NOTIFICATION": "fw-message",
|
||||||
"RING": "fw-dial-up"
|
"RING": "fw-dial-up"
|
||||||
};
|
};
|
||||||
|
|||||||
@ -72,7 +72,7 @@
|
|||||||
<button class="wr-btn" onclick="window.location.href='{{@app.context}}/roles'">
|
<button class="wr-btn" onclick="window.location.href='{{@app.context}}/roles'">
|
||||||
View Role List
|
View Role List
|
||||||
</button>
|
</button>
|
||||||
<a href="{{@app.context}}/roles/add-role" class="cu-btn-inner">
|
<a href="{{@app.context}}/role/add" class="cu-btn-inner">
|
||||||
<span class="fw-stack">
|
<span class="fw-stack">
|
||||||
<i class="fw fw-ring fw-stack-2x"></i>
|
<i class="fw fw-ring fw-stack-2x"></i>
|
||||||
<i class="fw fw-add fw-stack-1x"></i>
|
<i class="fw fw-add fw-stack-1x"></i>
|
||||||
|
|||||||
@ -15,8 +15,28 @@
|
|||||||
specific language governing permissions and limitations
|
specific language governing permissions and limitations
|
||||||
under the License.
|
under the License.
|
||||||
}}
|
}}
|
||||||
|
{{#zone "userMenu"}}
|
||||||
{{#zone "userMenu-items"}}
|
<ul class="nav navbar-right float-remove-xs text-center-xs">
|
||||||
|
<li class="visible-inline-block">
|
||||||
|
<a href="#" class="dropdown" data-toggle="dropdown">
|
||||||
|
<span class="icon fw-stack fw-lg">
|
||||||
|
<i class="fw fw-circle fw-stack-2x"></i>
|
||||||
|
<i class="fw fw-user fw-stack-1x fw-inverse"></i>
|
||||||
|
</span>
|
||||||
|
<span class="hidden-xs add-padding-left-1x">
|
||||||
|
{{#if isSuperTenant }}
|
||||||
|
{{@user.username}}<span class="caret"></span>
|
||||||
|
{{else}}
|
||||||
|
{{@user.username}}@{{@user.domain}}<span class="caret"></span>
|
||||||
|
{{/if}}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-right float-remove-xs position-static-xs text-center-xs remove-margin-xs slideInDown"
|
||||||
|
role="menu">
|
||||||
|
<li class="dropdown-header visible-xs">
|
||||||
|
{{@user.username}}<span class="caret"></span>
|
||||||
|
</li>
|
||||||
|
<li class="divider visible-xs"></li>
|
||||||
<li>
|
<li>
|
||||||
<a href="javascript:void(0)" id="change-password">Change password</a>
|
<a href="javascript:void(0)" id="change-password">Change password</a>
|
||||||
</li>
|
</li>
|
||||||
@ -39,7 +59,8 @@
|
|||||||
</span>
|
</span>
|
||||||
Change password
|
Change password
|
||||||
</h4>
|
</h4>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i
|
||||||
|
class="fw fw-cancel"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
|
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
|
||||||
@ -85,7 +106,8 @@
|
|||||||
</span>
|
</span>
|
||||||
Password has been successfully updated
|
Password has been successfully updated
|
||||||
</h4>
|
</h4>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i
|
||||||
|
class="fw fw-cancel"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
|
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
|
||||||
@ -99,7 +121,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
{{/zone}}
|
{{/zone}}
|
||||||
|
|
||||||
{{#zone "bottomJs"}}
|
{{#zone "bottomJs"}}
|
||||||
{{js "/js/user-menu.js"}}
|
{{js "/js/user-menu.js"}}
|
||||||
{{/zone}}
|
{{/zone}}
|
||||||
@ -16,7 +16,15 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function onRequest() {
|
function onRequest(context) {
|
||||||
var constants = require("/app/modules/constants.js");
|
var constants = require("/app/modules/constants.js");
|
||||||
return session.get(constants["USER_SESSION_KEY"]);
|
var user = context.user;
|
||||||
|
var isSuperTenant = false;
|
||||||
|
if (user.tenantId == -1234){
|
||||||
|
isSuperTenant = true;
|
||||||
|
}
|
||||||
|
var viewModal = {};
|
||||||
|
viewModal.isSuperTenant = isSuperTenant;
|
||||||
|
viewModal.USER_SESSION_KEY = session.get(constants["USER_SESSION_KEY"]);
|
||||||
|
return viewModal;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -598,6 +598,7 @@ var module = {};
|
|||||||
if (isAuthenticated) {
|
if (isAuthenticated) {
|
||||||
var tenantUser = carbonServer.tenantUser(username);
|
var tenantUser = carbonServer.tenantUser(username);
|
||||||
utils.setCurrentUser(tenantUser.username, tenantUser.domain, tenantUser.tenantId);
|
utils.setCurrentUser(tenantUser.username, tenantUser.domain, tenantUser.tenantId);
|
||||||
|
module.loadTenant(username);
|
||||||
var scriptArgument = {
|
var scriptArgument = {
|
||||||
input: {username: username, password: password},
|
input: {username: username, password: password},
|
||||||
user: module.getCurrentUser()
|
user: module.getCurrentUser()
|
||||||
|
|||||||
@ -57,16 +57,17 @@
|
|||||||
org.osgi.service.component,
|
org.osgi.service.component,
|
||||||
org.apache.commons.logging,
|
org.apache.commons.logging,
|
||||||
javax.xml.*,
|
javax.xml.*,
|
||||||
|
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional,
|
||||||
org.wso2.carbon.context,
|
org.wso2.carbon.context,
|
||||||
org.wso2.carbon.utils.*,
|
org.wso2.carbon.utils.*,
|
||||||
org.wso2.carbon.registry.api,
|
org.wso2.carbon.registry.api,
|
||||||
org.w3c.dom,
|
org.w3c.dom,
|
||||||
org.apache.velocity,
|
org.apache.velocity;version="${velocity.version}",
|
||||||
org.apache.velocity.app,
|
org.apache.velocity.app;version="${velocity.version}",
|
||||||
org.apache.velocity.context,
|
org.apache.velocity.context;version="${velocity.version}",
|
||||||
org.apache.velocity.exception,
|
org.apache.velocity.exception;version="${velocity.version}",
|
||||||
org.apache.velocity.runtime.resource,
|
org.apache.velocity.runtime.resource;version="${velocity.version}",
|
||||||
org.apache.velocity.runtime.resource.loader,
|
org.apache.velocity.runtime.resource.loader;version="${velocity.version}",
|
||||||
org.apache.commons.io,
|
org.apache.commons.io,
|
||||||
org.apache.axis2.transport.mail,
|
org.apache.axis2.transport.mail,
|
||||||
org.wso2.carbon.registry.core.service,
|
org.wso2.carbon.registry.core.service,
|
||||||
@ -129,7 +130,7 @@
|
|||||||
<artifactId>axis2</artifactId>
|
<artifactId>axis2</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.velocity</groupId>
|
<groupId>org.wso2.orbit.org.apache.velocity</groupId>
|
||||||
<artifactId>velocity</artifactId>
|
<artifactId>velocity</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@ -55,16 +55,16 @@
|
|||||||
<artifactId>org.wso2.carbon.utils</artifactId>
|
<artifactId>org.wso2.carbon.utils</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<!--dependency>
|
||||||
<groupId>org.apache.ws.commons.axiom</groupId>
|
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
||||||
<artifactId>axiom-api</artifactId>
|
<artifactId>axiom-api</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.ws.commons.axiom</groupId>
|
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
||||||
<artifactId>axiom-impl</artifactId>
|
<artifactId>axiom-impl</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
||||||
<artifactId>axiom</artifactId>
|
<artifactId>axiom</artifactId>
|
||||||
|
|||||||
@ -60,16 +60,16 @@
|
|||||||
</build>
|
</build>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<!--dependency>
|
||||||
<groupId>org.apache.ws.commons.axiom</groupId>
|
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
||||||
<artifactId>axiom-api</artifactId>
|
<artifactId>axiom-api</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.ws.commons.axiom</groupId>
|
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
||||||
<artifactId>axiom-impl</artifactId>
|
<artifactId>axiom-impl</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
||||||
<artifactId>axiom</artifactId>
|
<artifactId>axiom</artifactId>
|
||||||
|
|||||||
@ -125,7 +125,7 @@
|
|||||||
org.wso2.carbon.device.mgt.core.*,
|
org.wso2.carbon.device.mgt.core.*,
|
||||||
javax.xml.bind,
|
javax.xml.bind,
|
||||||
javax.xml.bind.annotation,
|
javax.xml.bind.annotation,
|
||||||
javax.xml.parsers,
|
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional,
|
||||||
org.w3c.dom,
|
org.w3c.dom,
|
||||||
org.wso2.carbon.apimgt.keymgt,
|
org.wso2.carbon.apimgt.keymgt,
|
||||||
org.wso2.carbon.apimgt.keymgt.handlers,
|
org.wso2.carbon.apimgt.keymgt.handlers,
|
||||||
@ -133,7 +133,7 @@
|
|||||||
org.apache.commons.codec.binary,
|
org.apache.commons.codec.binary,
|
||||||
org.wso2.carbon.identity.application.authentication.framework.model,
|
org.wso2.carbon.identity.application.authentication.framework.model,
|
||||||
org.apache.oltu.oauth2.common,
|
org.apache.oltu.oauth2.common,
|
||||||
org.wso2.carbon.base
|
org.wso2.carbon.base,
|
||||||
</Import-Package>
|
</Import-Package>
|
||||||
</instructions>
|
</instructions>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@ -96,7 +96,7 @@ public class OAuthExtensionServiceComponent {
|
|||||||
List<String> whiteList;
|
List<String> whiteList;
|
||||||
|
|
||||||
// Read scope whitelist from Configuration.
|
// Read scope whitelist from Configuration.
|
||||||
whiteList = configuration.getProperty(APIConstants.API_KEY_MANGER_SCOPE_WHITELIST);
|
whiteList = configuration.getProperty(APIConstants.WHITELISTED_SCOPES);
|
||||||
|
|
||||||
// If whitelist is null, default scopes will be put.
|
// If whitelist is null, default scopes will be put.
|
||||||
if (whiteList == null) {
|
if (whiteList == null) {
|
||||||
|
|||||||
@ -51,8 +51,8 @@
|
|||||||
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.ws.commons.axiom</groupId>
|
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
||||||
<artifactId>axiom-api</artifactId>
|
<artifactId>axiom</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon</groupId>
|
<groupId>org.wso2.carbon</groupId>
|
||||||
|
|||||||
@ -32,6 +32,8 @@ public interface ComplianceDecisionPoint {
|
|||||||
|
|
||||||
void setDevicesAsUnreachable(List<DeviceIdentifier> deviceIdentifiers) throws PolicyComplianceException;
|
void setDevicesAsUnreachable(List<DeviceIdentifier> deviceIdentifiers) throws PolicyComplianceException;
|
||||||
|
|
||||||
|
void setDevicesAsInactive(List<DeviceIdentifier> deviceIdentifiers) throws PolicyComplianceException;
|
||||||
|
|
||||||
void setDevicesAsUnreachableWith(List<Device> devices) throws PolicyComplianceException;
|
void setDevicesAsUnreachableWith(List<Device> devices) throws PolicyComplianceException;
|
||||||
|
|
||||||
void setDeviceAsReachable(DeviceIdentifier deviceIdentifier) throws PolicyComplianceException;
|
void setDeviceAsReachable(DeviceIdentifier deviceIdentifier) throws PolicyComplianceException;
|
||||||
|
|||||||
@ -61,6 +61,7 @@
|
|||||||
javax.cache,
|
javax.cache,
|
||||||
javax.naming,
|
javax.naming,
|
||||||
javax.xml.*,
|
javax.xml.*,
|
||||||
|
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional,
|
||||||
org.w3c.dom,
|
org.w3c.dom,
|
||||||
org.wso2.carbon.policy.mgt.common.*,
|
org.wso2.carbon.policy.mgt.common.*,
|
||||||
org.wso2.carbon.user.core.*,
|
org.wso2.carbon.user.core.*,
|
||||||
|
|||||||
@ -54,6 +54,8 @@ public class PolicyManagerServiceImpl implements PolicyManagerService {
|
|||||||
policyAdministratorPoint = new PolicyAdministratorPointImpl();
|
policyAdministratorPoint = new PolicyAdministratorPointImpl();
|
||||||
monitoringManager = new MonitoringManagerImpl();
|
monitoringManager = new MonitoringManagerImpl();
|
||||||
policyManager = new PolicyManagerImpl();
|
policyManager = new PolicyManagerImpl();
|
||||||
|
PolicyManagementDataHolder.getInstance().setMonitoringManager(monitoringManager);
|
||||||
|
PolicyManagementDataHolder.getInstance().setPolicyManager(policyManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -60,9 +60,8 @@ public interface MonitoringDAO {
|
|||||||
|
|
||||||
void deleteNoneComplianceData(int policyComplianceStatusId) throws MonitoringDAOException;
|
void deleteNoneComplianceData(int policyComplianceStatusId) throws MonitoringDAOException;
|
||||||
|
|
||||||
void updateAttempts(int deviceId, boolean reset) throws MonitoringDAOException;
|
boolean updateAttempts(int deviceId, boolean reset) throws MonitoringDAOException;
|
||||||
|
|
||||||
void updateAttempts(List<Integer> deviceId, boolean reset) throws MonitoringDAOException;
|
void updateAttempts(List<Integer> deviceId, boolean reset) throws MonitoringDAOException;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -400,7 +400,8 @@ public class MonitoringDAOImpl implements MonitoringDAO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateAttempts(int deviceId, boolean reset) throws MonitoringDAOException {
|
public boolean updateAttempts(int deviceId, boolean reset) throws MonitoringDAOException {
|
||||||
|
boolean status = false;
|
||||||
Connection conn;
|
Connection conn;
|
||||||
PreparedStatement stmt = null;
|
PreparedStatement stmt = null;
|
||||||
Timestamp currentTimestamp = new Timestamp(Calendar.getInstance().getTime().getTime());
|
Timestamp currentTimestamp = new Timestamp(Calendar.getInstance().getTime().getTime());
|
||||||
@ -420,11 +421,13 @@ public class MonitoringDAOImpl implements MonitoringDAO {
|
|||||||
stmt.setInt(2, deviceId);
|
stmt.setInt(2, deviceId);
|
||||||
stmt.setInt(3, tenantId);
|
stmt.setInt(3, tenantId);
|
||||||
stmt.executeUpdate();
|
stmt.executeUpdate();
|
||||||
|
status = true;
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new MonitoringDAOException("Unable to update the attempts data in database.", e);
|
throw new MonitoringDAOException("Unable to update the attempts data in database.", e);
|
||||||
} finally {
|
} finally {
|
||||||
PolicyManagementDAOUtil.cleanupResources(stmt, null);
|
PolicyManagementDAOUtil.cleanupResources(stmt, null);
|
||||||
}
|
}
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -66,6 +66,22 @@ public class ComplianceDecisionPointImpl implements ComplianceDecisionPoint {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setDevicesAsInactive(List<DeviceIdentifier> deviceIdentifiers) throws PolicyComplianceException {
|
||||||
|
try {
|
||||||
|
DeviceManagementProviderService service = this.getDeviceManagementProviderService();
|
||||||
|
for (DeviceIdentifier deviceIdentifier : deviceIdentifiers) {
|
||||||
|
Device device = service.getDevice(deviceIdentifier);
|
||||||
|
service.setStatus(deviceIdentifier, device.getEnrolmentInfo().getOwner(),
|
||||||
|
EnrolmentInfo.Status.INACTIVE);
|
||||||
|
}
|
||||||
|
} catch (DeviceManagementException e) {
|
||||||
|
String msg = "Error occurred while setting the device as inactive";
|
||||||
|
log.error(msg, e);
|
||||||
|
throw new PolicyComplianceException(msg, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDevicesAsUnreachableWith(List<Device> devices) throws PolicyComplianceException {
|
public void setDevicesAsUnreachableWith(List<Device> devices) throws PolicyComplianceException {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -23,6 +23,8 @@ import org.wso2.carbon.ntask.core.service.TaskService;
|
|||||||
import org.wso2.carbon.policy.mgt.common.PolicyEvaluationPoint;
|
import org.wso2.carbon.policy.mgt.common.PolicyEvaluationPoint;
|
||||||
import org.wso2.carbon.policy.mgt.common.PolicyInformationPoint;
|
import org.wso2.carbon.policy.mgt.common.PolicyInformationPoint;
|
||||||
import org.wso2.carbon.policy.mgt.common.spi.PolicyMonitoringService;
|
import org.wso2.carbon.policy.mgt.common.spi.PolicyMonitoringService;
|
||||||
|
import org.wso2.carbon.policy.mgt.core.mgt.MonitoringManager;
|
||||||
|
import org.wso2.carbon.policy.mgt.core.mgt.PolicyManager;
|
||||||
import org.wso2.carbon.user.core.service.RealmService;
|
import org.wso2.carbon.user.core.service.RealmService;
|
||||||
import org.wso2.carbon.user.core.tenant.TenantManager;
|
import org.wso2.carbon.user.core.tenant.TenantManager;
|
||||||
|
|
||||||
@ -36,6 +38,8 @@ public class PolicyManagementDataHolder {
|
|||||||
private PolicyEvaluationPoint policyEvaluationPoint;
|
private PolicyEvaluationPoint policyEvaluationPoint;
|
||||||
private PolicyInformationPoint policyInformationPoint;
|
private PolicyInformationPoint policyInformationPoint;
|
||||||
private DeviceManagementProviderService deviceManagementService;
|
private DeviceManagementProviderService deviceManagementService;
|
||||||
|
private MonitoringManager monitoringManager;
|
||||||
|
private PolicyManager policyManager;
|
||||||
private Map<String, PolicyMonitoringService> policyMonitoringServiceMap = new HashMap<>();
|
private Map<String, PolicyMonitoringService> policyMonitoringServiceMap = new HashMap<>();
|
||||||
private TaskService taskService;
|
private TaskService taskService;
|
||||||
|
|
||||||
@ -47,6 +51,22 @@ public class PolicyManagementDataHolder {
|
|||||||
return thisInstance;
|
return thisInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PolicyManager getPolicyManager() {
|
||||||
|
return policyManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPolicyManager(PolicyManager policyManager) {
|
||||||
|
this.policyManager = policyManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MonitoringManager getMonitoringManager() {
|
||||||
|
return monitoringManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMonitoringManager(MonitoringManager monitoringManager) {
|
||||||
|
this.monitoringManager = monitoringManager;
|
||||||
|
}
|
||||||
|
|
||||||
public RealmService getRealmService() {
|
public RealmService getRealmService() {
|
||||||
return realmService;
|
return realmService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,6 @@ package org.wso2.carbon.policy.mgt.core.mgt;
|
|||||||
|
|
||||||
import org.wso2.carbon.device.mgt.common.Device;
|
import org.wso2.carbon.device.mgt.common.Device;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
import org.wso2.carbon.device.mgt.core.dto.DeviceType;
|
|
||||||
import org.wso2.carbon.policy.mgt.common.monitor.ComplianceData;
|
import org.wso2.carbon.policy.mgt.common.monitor.ComplianceData;
|
||||||
import org.wso2.carbon.policy.mgt.common.monitor.ComplianceFeature;
|
import org.wso2.carbon.policy.mgt.common.monitor.ComplianceFeature;
|
||||||
import org.wso2.carbon.policy.mgt.common.monitor.PolicyComplianceException;
|
import org.wso2.carbon.policy.mgt.common.monitor.PolicyComplianceException;
|
||||||
@ -40,6 +39,6 @@ public interface MonitoringManager {
|
|||||||
|
|
||||||
void addMonitoringOperation(List<Device> devices) throws PolicyComplianceException;
|
void addMonitoringOperation(List<Device> devices) throws PolicyComplianceException;
|
||||||
|
|
||||||
List<DeviceType> getDeviceTypes() throws PolicyComplianceException;
|
List<String> getDeviceTypes() throws PolicyComplianceException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,12 +16,10 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package org.wso2.carbon.policy.mgt.core.mgt.impl;
|
package org.wso2.carbon.policy.mgt.core.mgt.impl;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|
||||||
import org.wso2.carbon.device.mgt.common.Device;
|
import org.wso2.carbon.device.mgt.common.Device;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||||
@ -30,12 +28,8 @@ import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
|
|||||||
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
||||||
import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager;
|
import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager;
|
||||||
import org.wso2.carbon.device.mgt.core.config.policy.PolicyConfiguration;
|
import org.wso2.carbon.device.mgt.core.config.policy.PolicyConfiguration;
|
||||||
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
|
|
||||||
import org.wso2.carbon.device.mgt.core.dao.DeviceTypeDAO;
|
|
||||||
import org.wso2.carbon.device.mgt.core.dto.DeviceType;
|
|
||||||
import org.wso2.carbon.device.mgt.core.operation.mgt.CommandOperation;
|
import org.wso2.carbon.device.mgt.core.operation.mgt.CommandOperation;
|
||||||
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
|
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
|
||||||
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderServiceImpl;
|
|
||||||
import org.wso2.carbon.policy.mgt.common.Policy;
|
import org.wso2.carbon.policy.mgt.common.Policy;
|
||||||
import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
|
import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
|
||||||
import org.wso2.carbon.policy.mgt.common.ProfileFeature;
|
import org.wso2.carbon.policy.mgt.common.ProfileFeature;
|
||||||
@ -56,8 +50,6 @@ import java.util.Map;
|
|||||||
public class MonitoringManagerImpl implements MonitoringManager {
|
public class MonitoringManagerImpl implements MonitoringManager {
|
||||||
|
|
||||||
private PolicyDAO policyDAO;
|
private PolicyDAO policyDAO;
|
||||||
// private DeviceDAO deviceDAO;
|
|
||||||
private DeviceTypeDAO deviceTypeDAO;
|
|
||||||
private MonitoringDAO monitoringDAO;
|
private MonitoringDAO monitoringDAO;
|
||||||
private ComplianceDecisionPoint complianceDecisionPoint;
|
private ComplianceDecisionPoint complianceDecisionPoint;
|
||||||
private PolicyConfiguration policyConfiguration;
|
private PolicyConfiguration policyConfiguration;
|
||||||
@ -69,8 +61,6 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|||||||
|
|
||||||
public MonitoringManagerImpl() {
|
public MonitoringManagerImpl() {
|
||||||
this.policyDAO = PolicyManagementDAOFactory.getPolicyDAO();
|
this.policyDAO = PolicyManagementDAOFactory.getPolicyDAO();
|
||||||
// this.deviceDAO = DeviceManagementDAOFactory.getDeviceDAO();
|
|
||||||
this.deviceTypeDAO = DeviceManagementDAOFactory.getDeviceTypeDAO();
|
|
||||||
this.monitoringDAO = PolicyManagementDAOFactory.getMonitoringDAO();
|
this.monitoringDAO = PolicyManagementDAOFactory.getMonitoringDAO();
|
||||||
this.complianceDecisionPoint = new ComplianceDecisionPointImpl();
|
this.complianceDecisionPoint = new ComplianceDecisionPointImpl();
|
||||||
this.policyConfiguration =
|
this.policyConfiguration =
|
||||||
@ -84,8 +74,9 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|||||||
|
|
||||||
List<ComplianceFeature> complianceFeatures = new ArrayList<>();
|
List<ComplianceFeature> complianceFeatures = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
|
DeviceManagementProviderService service =
|
||||||
PolicyManager manager = new PolicyManagerImpl();
|
PolicyManagementDataHolder.getInstance().getDeviceManagementService();
|
||||||
|
PolicyManager manager = PolicyManagementDataHolder.getInstance().getPolicyManager();
|
||||||
Device device = service.getDevice(deviceIdentifier);
|
Device device = service.getDevice(deviceIdentifier);
|
||||||
Policy policy = manager.getAppliedPolicyToDevice(deviceIdentifier);
|
Policy policy = manager.getAppliedPolicyToDevice(deviceIdentifier);
|
||||||
if (policy != null) {
|
if (policy != null) {
|
||||||
@ -109,7 +100,8 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new PolicyComplianceException("Error occurred while opening a data source connection", e);
|
throw new PolicyComplianceException("Error occurred while opening a data source connection", e);
|
||||||
} catch (MonitoringDAOException e) {
|
} catch (MonitoringDAOException e) {
|
||||||
throw new PolicyComplianceException("Unable to add the none compliance features to database for device " +
|
throw new PolicyComplianceException(
|
||||||
|
"Unable to add the none compliance features to database for device " +
|
||||||
deviceIdentifier.getId() + " - " + deviceIdentifier.getType(), e);
|
deviceIdentifier.getId() + " - " + deviceIdentifier.getType(), e);
|
||||||
} finally {
|
} finally {
|
||||||
PolicyManagementDAOFactory.closeConnection();
|
PolicyManagementDAOFactory.closeConnection();
|
||||||
@ -132,7 +124,8 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|||||||
PolicyManagementDAOFactory.commitTransaction();
|
PolicyManagementDAOFactory.commitTransaction();
|
||||||
} catch (MonitoringDAOException e) {
|
} catch (MonitoringDAOException e) {
|
||||||
PolicyManagementDAOFactory.rollbackTransaction();
|
PolicyManagementDAOFactory.rollbackTransaction();
|
||||||
throw new PolicyComplianceException("Unable to add the none compliance features to database for device " +
|
throw new PolicyComplianceException(
|
||||||
|
"Unable to add the none compliance features to database for device " +
|
||||||
deviceIdentifier.getId() + " - " + deviceIdentifier.getType(), e);
|
deviceIdentifier.getId() + " - " + deviceIdentifier.getType(), e);
|
||||||
} finally {
|
} finally {
|
||||||
PolicyManagementDAOFactory.closeConnection();
|
PolicyManagementDAOFactory.closeConnection();
|
||||||
@ -155,7 +148,8 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|||||||
PolicyManagementDAOFactory.commitTransaction();
|
PolicyManagementDAOFactory.commitTransaction();
|
||||||
} catch (MonitoringDAOException e) {
|
} catch (MonitoringDAOException e) {
|
||||||
PolicyManagementDAOFactory.rollbackTransaction();
|
PolicyManagementDAOFactory.rollbackTransaction();
|
||||||
throw new PolicyComplianceException("Unable to remove the none compliance features from database for device " +
|
throw new PolicyComplianceException(
|
||||||
|
"Unable to remove the none compliance features from database for device " +
|
||||||
deviceIdentifier.getId() + " - " + deviceIdentifier.getType(), e);
|
deviceIdentifier.getId() + " - " + deviceIdentifier.getType(), e);
|
||||||
} finally {
|
} finally {
|
||||||
PolicyManagementDAOFactory.closeConnection();
|
PolicyManagementDAOFactory.closeConnection();
|
||||||
@ -179,7 +173,8 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|||||||
@Override
|
@Override
|
||||||
public boolean isCompliance(DeviceIdentifier deviceIdentifier) throws PolicyComplianceException {
|
public boolean isCompliance(DeviceIdentifier deviceIdentifier) throws PolicyComplianceException {
|
||||||
try {
|
try {
|
||||||
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
|
DeviceManagementProviderService service =
|
||||||
|
PolicyManagementDataHolder.getInstance().getDeviceManagementService();
|
||||||
Device device = service.getDevice(deviceIdentifier);
|
Device device = service.getDevice(deviceIdentifier);
|
||||||
PolicyManagementDAOFactory.openConnection();
|
PolicyManagementDAOFactory.openConnection();
|
||||||
ComplianceData complianceData = monitoringDAO.getCompliance(device.getId(), device.getEnrolmentInfo()
|
ComplianceData complianceData = monitoringDAO.getCompliance(device.getId(), device.getEnrolmentInfo()
|
||||||
@ -205,11 +200,11 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|||||||
@Override
|
@Override
|
||||||
public ComplianceData getDevicePolicyCompliance(DeviceIdentifier deviceIdentifier) throws
|
public ComplianceData getDevicePolicyCompliance(DeviceIdentifier deviceIdentifier) throws
|
||||||
PolicyComplianceException {
|
PolicyComplianceException {
|
||||||
|
|
||||||
ComplianceData complianceData;
|
ComplianceData complianceData;
|
||||||
try {
|
try {
|
||||||
PolicyManagementDAOFactory.openConnection();
|
PolicyManagementDAOFactory.openConnection();
|
||||||
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
|
DeviceManagementProviderService service =
|
||||||
|
PolicyManagementDataHolder.getInstance().getDeviceManagementService();
|
||||||
Device device = service.getDevice(deviceIdentifier);
|
Device device = service.getDevice(deviceIdentifier);
|
||||||
complianceData = monitoringDAO.getCompliance(device.getId(), device.getEnrolmentInfo().getId());
|
complianceData = monitoringDAO.getCompliance(device.getId(), device.getEnrolmentInfo().getId());
|
||||||
List<ComplianceFeature> complianceFeatures =
|
List<ComplianceFeature> complianceFeatures =
|
||||||
@ -241,6 +236,7 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
PolicyManagementDAOFactory.openConnection();
|
PolicyManagementDAOFactory.openConnection();
|
||||||
|
//TODO: Return a map from getCompliance to reduce O(n^2) -> O(n)
|
||||||
List<ComplianceData> cd = monitoringDAO.getCompliance();
|
List<ComplianceData> cd = monitoringDAO.getCompliance();
|
||||||
|
|
||||||
for (Device device : devices) {
|
for (Device device : devices) {
|
||||||
@ -275,7 +271,7 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|||||||
Map<Integer, Device> deviceIdsToAddOperation = new HashMap<>();
|
Map<Integer, Device> deviceIdsToAddOperation = new HashMap<>();
|
||||||
Map<Integer, Device> deviceIdsWithExistingOperation = new HashMap<>();
|
Map<Integer, Device> deviceIdsWithExistingOperation = new HashMap<>();
|
||||||
Map<Integer, Device> inactiveDeviceIds = new HashMap<>();
|
Map<Integer, Device> inactiveDeviceIds = new HashMap<>();
|
||||||
Map<Integer, Device> deviceToMarkUnreachable = new HashMap<>();
|
Map<Integer, Device> devicesToMarkUnreachable = new HashMap<>();
|
||||||
//Map<Integer, Integer> firstTimeDeviceIdsWithPolicyIds = new HashMap<>();
|
//Map<Integer, Integer> firstTimeDeviceIdsWithPolicyIds = new HashMap<>();
|
||||||
|
|
||||||
List<PolicyDeviceWrapper> firstTimeDevices = new ArrayList<>();
|
List<PolicyDeviceWrapper> firstTimeDevices = new ArrayList<>();
|
||||||
@ -295,7 +291,7 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|||||||
deviceIdsWithExistingOperation.put(complianceData.getDeviceId(),
|
deviceIdsWithExistingOperation.put(complianceData.getDeviceId(),
|
||||||
deviceIds.get(complianceData.getDeviceId()));
|
deviceIds.get(complianceData.getDeviceId()));
|
||||||
if (complianceData.getAttempts() >= policyConfiguration.getMinRetriesToMarkUnreachable()) {
|
if (complianceData.getAttempts() >= policyConfiguration.getMinRetriesToMarkUnreachable()) {
|
||||||
deviceToMarkUnreachable.put(complianceData.getDeviceId(),
|
devicesToMarkUnreachable.put(complianceData.getDeviceId(),
|
||||||
deviceIds.get(complianceData.getDeviceId()));
|
deviceIds.get(complianceData.getDeviceId()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -365,26 +361,29 @@ public class MonitoringManagerImpl implements MonitoringManager {
|
|||||||
// TODO : This should be uncommented, this is to mark the device as unreachable, But given the current
|
// TODO : This should be uncommented, this is to mark the device as unreachable, But given the current
|
||||||
// implementation we are not able to do so.
|
// implementation we are not able to do so.
|
||||||
|
|
||||||
// if(!deviceToMarkUnreachable.isEmpty()) {
|
if (!devicesToMarkUnreachable.isEmpty()) {
|
||||||
// ComplianceDecisionPoint decisionPoint = new ComplianceDecisionPointImpl();
|
ComplianceDecisionPoint decisionPoint = new ComplianceDecisionPointImpl();
|
||||||
// decisionPoint.setDevicesAsUnreachable(this.getDeviceIdentifiersFromDevices(
|
decisionPoint.setDevicesAsUnreachable(this.getDeviceIdentifiersFromDevices(
|
||||||
// new ArrayList<>(deviceToMarkUnreachable.values())));
|
new ArrayList<>(devicesToMarkUnreachable.values())));
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
if (!inactiveDeviceIds.isEmpty()) {
|
||||||
|
ComplianceDecisionPoint decisionPoint = new ComplianceDecisionPointImpl();
|
||||||
|
decisionPoint.setDevicesAsInactive(this.getDeviceIdentifiersFromDevices(
|
||||||
|
new ArrayList<>(inactiveDeviceIds.values())));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DeviceType> getDeviceTypes() throws PolicyComplianceException {
|
public List<String> getDeviceTypes() throws PolicyComplianceException {
|
||||||
|
|
||||||
List<DeviceType> deviceTypes = new ArrayList<>();
|
List<String> deviceTypes = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
DeviceManagementDAOFactory.openConnection();
|
deviceTypes =
|
||||||
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
|
PolicyManagementDataHolder.getInstance().getDeviceManagementService().getAvailableDeviceTypes();
|
||||||
deviceTypes = deviceTypeDAO.getDeviceTypes(tenantId);
|
} catch (DeviceManagementException e) {
|
||||||
} catch (Exception e) {
|
throw new PolicyComplianceException("Error occurred while getting the device types.", e);
|
||||||
log.error("Error occurred while getting the device types.", e);
|
|
||||||
} finally {
|
|
||||||
DeviceManagementDAOFactory.closeConnection();
|
|
||||||
}
|
}
|
||||||
return deviceTypes;
|
return deviceTypes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,9 +26,6 @@ import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
|||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup;
|
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup;
|
||||||
import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException;
|
import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException;
|
||||||
import org.wso2.carbon.device.mgt.core.dao.DeviceDAO;
|
|
||||||
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
|
|
||||||
import org.wso2.carbon.device.mgt.core.dto.DeviceType;
|
|
||||||
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
|
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
|
||||||
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderServiceImpl;
|
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderServiceImpl;
|
||||||
import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderService;
|
import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderService;
|
||||||
@ -50,14 +47,12 @@ public class PolicyManagerImpl implements PolicyManager {
|
|||||||
private ProfileDAO profileDAO;
|
private ProfileDAO profileDAO;
|
||||||
private FeatureDAO featureDAO;
|
private FeatureDAO featureDAO;
|
||||||
private ProfileManager profileManager;
|
private ProfileManager profileManager;
|
||||||
private DeviceDAO deviceDAO;
|
|
||||||
private static Log log = LogFactory.getLog(PolicyManagerImpl.class);
|
private static Log log = LogFactory.getLog(PolicyManagerImpl.class);
|
||||||
|
|
||||||
public PolicyManagerImpl() {
|
public PolicyManagerImpl() {
|
||||||
this.policyDAO = PolicyManagementDAOFactory.getPolicyDAO();
|
this.policyDAO = PolicyManagementDAOFactory.getPolicyDAO();
|
||||||
this.profileDAO = PolicyManagementDAOFactory.getProfileDAO();
|
this.profileDAO = PolicyManagementDAOFactory.getProfileDAO();
|
||||||
this.featureDAO = PolicyManagementDAOFactory.getFeatureDAO();
|
this.featureDAO = PolicyManagementDAOFactory.getFeatureDAO();
|
||||||
this.deviceDAO = DeviceManagementDAOFactory.getDeviceDAO();
|
|
||||||
this.profileManager = new ProfileManagerImpl();
|
this.profileManager = new ProfileManagerImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,146 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2015 WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
||||||
*
|
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
|
||||||
* in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.wso2.carbon.policy.mgt.core.service;
|
|
||||||
|
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
|
||||||
import org.wso2.carbon.device.mgt.common.Feature;
|
|
||||||
import org.wso2.carbon.policy.mgt.common.*;
|
|
||||||
import org.wso2.carbon.policy.mgt.common.monitor.ComplianceData;
|
|
||||||
import org.wso2.carbon.policy.mgt.common.monitor.ComplianceFeature;
|
|
||||||
import org.wso2.carbon.policy.mgt.common.monitor.PolicyComplianceException;
|
|
||||||
import org.wso2.carbon.policy.mgt.core.PolicyManagerService;
|
|
||||||
import org.wso2.carbon.policy.mgt.core.PolicyManagerServiceImpl;
|
|
||||||
import org.wso2.carbon.policy.mgt.core.task.TaskScheduleService;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class PolicyManagementService implements PolicyManagerService {
|
|
||||||
|
|
||||||
|
|
||||||
PolicyManagerService policyManagerService;
|
|
||||||
|
|
||||||
public PolicyManagementService() {
|
|
||||||
policyManagerService = new PolicyManagerServiceImpl();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Profile addProfile(Profile profile) throws PolicyManagementException {
|
|
||||||
return policyManagerService.addProfile(profile);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Profile updateProfile(Profile profile) throws PolicyManagementException {
|
|
||||||
return policyManagerService.updateProfile(profile);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Policy addPolicy(Policy policy) throws PolicyManagementException {
|
|
||||||
return policyManagerService.addPolicy(policy);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Policy updatePolicy(Policy policy) throws PolicyManagementException {
|
|
||||||
return policyManagerService.updatePolicy(policy);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean deletePolicy(Policy policy) throws PolicyManagementException {
|
|
||||||
return policyManagerService.deletePolicy(policy);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean deletePolicy(int policyId) throws PolicyManagementException {
|
|
||||||
return policyManagerService.deletePolicy(policyId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Policy getEffectivePolicy(DeviceIdentifier deviceIdentifier) throws PolicyManagementException {
|
|
||||||
return policyManagerService.getEffectivePolicy(deviceIdentifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ProfileFeature> getEffectiveFeatures(DeviceIdentifier deviceIdentifier) throws
|
|
||||||
FeatureManagementException {
|
|
||||||
return policyManagerService.getEffectiveFeatures(deviceIdentifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Policy> getPolicies(String deviceType) throws PolicyManagementException {
|
|
||||||
return policyManagerService.getPolicies(deviceType);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Feature> getFeatures() throws FeatureManagementException {
|
|
||||||
return policyManagerService.getFeatures();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PolicyAdministratorPoint getPAP() throws PolicyManagementException {
|
|
||||||
return policyManagerService.getPAP();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PolicyInformationPoint getPIP() throws PolicyManagementException {
|
|
||||||
return policyManagerService.getPIP();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PolicyEvaluationPoint getPEP() throws PolicyManagementException {
|
|
||||||
return policyManagerService.getPEP();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TaskScheduleService getTaskScheduleService() throws PolicyMonitoringTaskException {
|
|
||||||
return policyManagerService.getTaskScheduleService();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getPolicyCount() throws PolicyManagementException {
|
|
||||||
return policyManagerService.getPolicyCount();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Policy getAppliedPolicyToDevice(
|
|
||||||
DeviceIdentifier deviceIdentifier) throws PolicyManagementException {
|
|
||||||
return policyManagerService.getAppliedPolicyToDevice(deviceIdentifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ComplianceFeature> checkPolicyCompliance(DeviceIdentifier deviceIdentifier, Object
|
|
||||||
deviceResponse) throws PolicyComplianceException {
|
|
||||||
return policyManagerService.checkPolicyCompliance(deviceIdentifier, deviceResponse);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkCompliance(DeviceIdentifier deviceIdentifier, Object response) throws
|
|
||||||
PolicyComplianceException {
|
|
||||||
return policyManagerService.checkCompliance(deviceIdentifier, response);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ComplianceData getDeviceCompliance(DeviceIdentifier deviceIdentifier) throws PolicyComplianceException {
|
|
||||||
return policyManagerService.getDeviceCompliance(deviceIdentifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isCompliance(DeviceIdentifier deviceIdentifier) throws PolicyComplianceException {
|
|
||||||
return policyManagerService.isCompliance(deviceIdentifier);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -40,7 +40,6 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class MonitoringTask implements Task {
|
public class MonitoringTask implements Task {
|
||||||
|
|
||||||
private DeviceTypeDAO deviceTypeDAO;
|
|
||||||
private static Log log = LogFactory.getLog(MonitoringTask.class);
|
private static Log log = LogFactory.getLog(MonitoringTask.class);
|
||||||
|
|
||||||
Map<String, String> properties;
|
Map<String, String> properties;
|
||||||
@ -53,7 +52,6 @@ public class MonitoringTask implements Task {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
deviceTypeDAO = DeviceManagementDAOFactory.getDeviceTypeDAO();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -63,9 +61,9 @@ public class MonitoringTask implements Task {
|
|||||||
log.debug("Monitoring task started to run.");
|
log.debug("Monitoring task started to run.");
|
||||||
}
|
}
|
||||||
|
|
||||||
MonitoringManager monitoringManager = new MonitoringManagerImpl();
|
MonitoringManager monitoringManager = PolicyManagementDataHolder.getInstance().getMonitoringManager();
|
||||||
|
|
||||||
List<DeviceType> deviceTypes = new ArrayList<>();
|
List<String> deviceTypes = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
deviceTypes = monitoringManager.getDeviceTypes();
|
deviceTypes = monitoringManager.getDeviceTypes();
|
||||||
} catch (PolicyComplianceException e) {
|
} catch (PolicyComplianceException e) {
|
||||||
@ -79,15 +77,15 @@ public class MonitoringTask implements Task {
|
|||||||
DeviceManagementProviderService deviceManagementProviderService =
|
DeviceManagementProviderService deviceManagementProviderService =
|
||||||
PolicyManagementDataHolder.getInstance().getDeviceManagementService();
|
PolicyManagementDataHolder.getInstance().getDeviceManagementService();
|
||||||
|
|
||||||
for (DeviceType deviceType : deviceTypes) {
|
for (String deviceType : deviceTypes) {
|
||||||
|
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("Running task for device type : " + deviceType.getName());
|
log.debug("Running task for device type : " + deviceType);
|
||||||
}
|
}
|
||||||
|
|
||||||
PolicyMonitoringService monitoringService =
|
PolicyMonitoringService monitoringService =
|
||||||
PolicyManagementDataHolder.getInstance().getPolicyMonitoringService(deviceType.getName());
|
PolicyManagementDataHolder.getInstance().getPolicyMonitoringService(deviceType);
|
||||||
List<Device> devices = deviceManagementProviderService.getAllDevices(deviceType.getName());
|
List<Device> devices = deviceManagementProviderService.getAllDevices(deviceType);
|
||||||
if (monitoringService != null && !devices.isEmpty()) {
|
if (monitoringService != null && !devices.isEmpty()) {
|
||||||
|
|
||||||
|
|
||||||
@ -95,12 +93,11 @@ public class MonitoringTask implements Task {
|
|||||||
|
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("Removing inactive and blocked devices from the list for the device type : " +
|
log.debug("Removing inactive and blocked devices from the list for the device type : " +
|
||||||
deviceType.getName());
|
deviceType);
|
||||||
}
|
}
|
||||||
for (Device device : devices) {
|
for (Device device : devices) {
|
||||||
EnrolmentInfo.Status status = device.getEnrolmentInfo().getStatus();
|
EnrolmentInfo.Status status = device.getEnrolmentInfo().getStatus();
|
||||||
if (status.equals(EnrolmentInfo.Status.INACTIVE) ||
|
if (status.equals(EnrolmentInfo.Status.BLOCKED) ||
|
||||||
status.equals(EnrolmentInfo.Status.BLOCKED) ||
|
|
||||||
status.equals(EnrolmentInfo.Status.REMOVED) ||
|
status.equals(EnrolmentInfo.Status.REMOVED) ||
|
||||||
status.equals(EnrolmentInfo.Status.UNCLAIMED) ||
|
status.equals(EnrolmentInfo.Status.UNCLAIMED) ||
|
||||||
status.equals(EnrolmentInfo.Status.DISENROLLMENT_REQUESTED) ||
|
status.equals(EnrolmentInfo.Status.DISENROLLMENT_REQUESTED) ||
|
||||||
@ -111,8 +108,7 @@ public class MonitoringTask implements Task {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("Following devices selected to send the notification for " +
|
log.debug("Following devices selected to send the notification for " + deviceType);
|
||||||
deviceType.getName());
|
|
||||||
for (Device device : notifiableDevices) {
|
for (Device device : notifiableDevices) {
|
||||||
log.debug(device.getDeviceIdentifier());
|
log.debug(device.getDeviceIdentifier());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,7 @@ import org.apache.commons.logging.Log;
|
|||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.wso2.carbon.device.mgt.common.Device;
|
import org.wso2.carbon.device.mgt.common.Device;
|
||||||
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
|
|||||||
@ -61,9 +61,8 @@
|
|||||||
com.nimbusds.jwt,
|
com.nimbusds.jwt,
|
||||||
javax.xml.bind,
|
javax.xml.bind,
|
||||||
javax.xml.bind.annotation,
|
javax.xml.bind.annotation,
|
||||||
javax.xml.parsers,
|
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional,
|
||||||
javax.xml.validation,
|
javax.xml.validation,
|
||||||
org.apache.axiom.util.base64,
|
|
||||||
org.apache.catalina,
|
org.apache.catalina,
|
||||||
org.apache.catalina.connector,
|
org.apache.catalina.connector,
|
||||||
org.apache.catalina.util,
|
org.apache.catalina.util,
|
||||||
@ -110,13 +109,9 @@
|
|||||||
org.apache.commons.pool.impl,
|
org.apache.commons.pool.impl,
|
||||||
org.apache.http.conn,
|
org.apache.http.conn,
|
||||||
org.apache.http.impl.conn,
|
org.apache.http.impl.conn,
|
||||||
javax.xml.soap,
|
javax.xml.soap; version="${javax.xml.soap.imp.pkg.version}",
|
||||||
javax.xml.stream,
|
javax.xml.stream,
|
||||||
org.apache.axiom.soap,
|
org.apache.axiom.*; version="${axiom.osgi.version.range}",
|
||||||
org.apache.axiom.soap.impl.builder,
|
|
||||||
org.apache.axiom.om,
|
|
||||||
org.apache.axiom.om.impl.builder,
|
|
||||||
org.apache.axiom.om.util,
|
|
||||||
org.wso2.carbon.registry.core.*,
|
org.wso2.carbon.registry.core.*,
|
||||||
org.wso2.carbon.registry.common.*;version="${carbon.registry.imp.pkg.version.range}",
|
org.wso2.carbon.registry.common.*;version="${carbon.registry.imp.pkg.version.range}",
|
||||||
org.wso2.carbon.registry.indexing.*; version="${carbon.registry.imp.pkg.version.range}",
|
org.wso2.carbon.registry.indexing.*; version="${carbon.registry.imp.pkg.version.range}",
|
||||||
@ -166,10 +161,10 @@
|
|||||||
<groupId>org.wso2.carbon</groupId>
|
<groupId>org.wso2.carbon</groupId>
|
||||||
<artifactId>org.wso2.carbon.tomcat.ext</artifactId>
|
<artifactId>org.wso2.carbon.tomcat.ext</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<!--dependency>
|
||||||
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
||||||
<artifactId>axiom</artifactId>
|
<artifactId>axiom</artifactId>
|
||||||
</dependency>
|
</dependency-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.identity</groupId>
|
<groupId>org.wso2.carbon.identity</groupId>
|
||||||
<artifactId>org.wso2.carbon.identity.base</artifactId>
|
<artifactId>org.wso2.carbon.identity.base</artifactId>
|
||||||
|
|||||||
@ -57,7 +57,7 @@ public class AuthenticationFrameworkUtil {
|
|||||||
}
|
}
|
||||||
APITokenValidator tokenValidator = new APITokenValidator();
|
APITokenValidator tokenValidator = new APITokenValidator();
|
||||||
APIKeyValidationInfoDTO apiKeyValidationDTO = tokenValidator.validateKey(context, version, accessToken,
|
APIKeyValidationInfoDTO apiKeyValidationDTO = tokenValidator.validateKey(context, version, accessToken,
|
||||||
requiredAuthenticationLevel, clientDomain);
|
requiredAuthenticationLevel);
|
||||||
if (apiKeyValidationDTO.isAuthorized()) {
|
if (apiKeyValidationDTO.isAuthorized()) {
|
||||||
String username = apiKeyValidationDTO.getEndUserName();
|
String username = apiKeyValidationDTO.getEndUserName();
|
||||||
PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(username);
|
PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(username);
|
||||||
|
|||||||
@ -41,19 +41,15 @@
|
|||||||
<artifactId>org.wso2.carbon.certificate.mgt.core</artifactId>
|
<artifactId>org.wso2.carbon.certificate.mgt.core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle.wso2</groupId>
|
<groupId>org.wso2.orbit.org.bouncycastle</groupId>
|
||||||
<artifactId>bcprov-jdk15on</artifactId>
|
<artifactId>bcprov-jdk15on</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle.wso2</groupId>
|
<groupId>org.wso2.orbit.org.bouncycastle</groupId>
|
||||||
<artifactId>bcpkix-jdk15on</artifactId>
|
<artifactId>bcpkix-jdk15on</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle.wso2</groupId>
|
<groupId>org.wso2.orbit.com.google.code.jscep</groupId>
|
||||||
<artifactId>bcmail-jdk15on</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.google.code.jscep.wso2</groupId>
|
|
||||||
<artifactId>jscep</artifactId>
|
<artifactId>jscep</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -68,6 +64,10 @@
|
|||||||
<groupId>commons-codec.wso2</groupId>
|
<groupId>commons-codec.wso2</groupId>
|
||||||
<artifactId>commons-codec</artifactId>
|
<artifactId>commons-codec</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.wso2.carbon.registry</groupId>
|
||||||
|
<artifactId>org.wso2.carbon.registry.indexing</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@ -122,16 +122,10 @@
|
|||||||
org.wso2.carbon.devicemgt:org.wso2.carbon.certificate.mgt.core:${carbon.device.mgt.version}
|
org.wso2.carbon.devicemgt:org.wso2.carbon.certificate.mgt.core:${carbon.device.mgt.version}
|
||||||
</bundleDef>
|
</bundleDef>
|
||||||
<bundleDef>
|
<bundleDef>
|
||||||
org.bouncycastle.wso2:bcprov-jdk15on:${bcprov.wso2.version}
|
org.wso2.orbit.org.bouncycastle:bcpkix-jdk15on:${bcpkix.wso2.version}
|
||||||
</bundleDef>
|
</bundleDef>
|
||||||
<bundleDef>
|
<bundleDef>
|
||||||
org.bouncycastle.wso2:bcpkix-jdk15on:${bcpkix.wso2.version}
|
org.wso2.orbit.com.google.code.jscep:jscep:${jscep.version}
|
||||||
</bundleDef>
|
|
||||||
<bundleDef>
|
|
||||||
org.bouncycastle.wso2:bcmail-jdk15on:${bcmail.wso2.version}
|
|
||||||
</bundleDef>
|
|
||||||
<bundleDef>
|
|
||||||
com.google.code.jscep.wso2:jscep:${jscep.version}
|
|
||||||
</bundleDef>
|
</bundleDef>
|
||||||
<bundleDef>
|
<bundleDef>
|
||||||
commons-io.wso2:commons-io:${version.commons.io}
|
commons-io.wso2:commons-io:${version.commons.io}
|
||||||
@ -146,6 +140,9 @@
|
|||||||
<importFeatures>
|
<importFeatures>
|
||||||
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
|
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
|
||||||
</importFeatures>
|
</importFeatures>
|
||||||
|
<importBundles>
|
||||||
|
<importBundleDef>org.wso2.carbon.registry:org.wso2.carbon.registry.indexing:${carbon.registry.version}</importBundleDef>
|
||||||
|
</importBundles>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
|||||||
@ -6,3 +6,15 @@ CREATE TABLE DM_DEVICE_CERTIFICATE (
|
|||||||
USERNAME VARCHAR2(500) DEFAULT NULL,
|
USERNAME VARCHAR2(500) DEFAULT NULL,
|
||||||
PRIMARY KEY (ID)
|
PRIMARY KEY (ID)
|
||||||
)
|
)
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Generate ID using sequence and trigger
|
||||||
|
CREATE SEQUENCE DM_DEVICE_CERTIFICATE_seq START WITH 1 INCREMENT BY 1 NOCACHE
|
||||||
|
/
|
||||||
|
CREATE OR REPLACE TRIGGER DM_DEVICE_CERTIFICATE_seq_tr
|
||||||
|
BEFORE INSERT ON DM_DEVICE_CERTIFICATE FOR EACH ROW
|
||||||
|
WHEN (NEW.ID IS NULL)
|
||||||
|
BEGIN
|
||||||
|
SELECT DM_DEVICE_CERTIFICATE_seq.NEXTVAL INTO :NEW.ID FROM DUAL;
|
||||||
|
END;
|
||||||
|
/
|
||||||
@ -39,6 +39,14 @@
|
|||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.wso2.carbon.registry</groupId>
|
||||||
|
<artifactId>org.wso2.carbon.registry.indexing</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.wso2.carbon.registry</groupId>
|
||||||
|
<artifactId>org.wso2.carbon.registry.common</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@ -96,6 +104,10 @@
|
|||||||
<importFeatures>
|
<importFeatures>
|
||||||
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
|
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
|
||||||
</importFeatures>
|
</importFeatures>
|
||||||
|
<importBundles>
|
||||||
|
<importBundleDef>org.wso2.carbon.registry:org.wso2.carbon.registry.indexing:${carbon.registry.version}</importBundleDef>
|
||||||
|
<importBundleDef>org.wso2.carbon.registry:org.wso2.carbon.registry.common:${carbon.registry.version}</importBundleDef>
|
||||||
|
</importBundles>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
|||||||
@ -86,7 +86,7 @@
|
|||||||
<importFeatures>
|
<importFeatures>
|
||||||
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
|
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
|
||||||
</importFeatureDef>
|
</importFeatureDef>
|
||||||
<importFeatureDef>org.wso2.carbon.governance.metadata:${carbon.governance.version}
|
<importFeatureDef>org.wso2.carbon.governance.metadata.server:${carbon.governance.version}
|
||||||
</importFeatureDef>
|
</importFeatureDef>
|
||||||
</importFeatures>
|
</importFeatures>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@ -44,6 +44,10 @@
|
|||||||
<artifactId>org.wso2.carbon.device.mgt.ui.feature</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.ui.feature</artifactId>
|
||||||
<type>zip</type>
|
<type>zip</type>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet.jsp</groupId>
|
||||||
|
<artifactId>javax.servlet.jsp-api</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@ -70,6 +74,9 @@
|
|||||||
<includedFeatureDef>org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.server.feature:${carbon.device.mgt.version}</includedFeatureDef>
|
<includedFeatureDef>org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.server.feature:${carbon.device.mgt.version}</includedFeatureDef>
|
||||||
<includedFeatureDef>org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.ui.feature:${carbon.device.mgt.version}</includedFeatureDef>
|
<includedFeatureDef>org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.ui.feature:${carbon.device.mgt.version}</includedFeatureDef>
|
||||||
</includedFeatures>
|
</includedFeatures>
|
||||||
|
<bundles>
|
||||||
|
<bundleDef>javax.servlet.jsp:javax.servlet.jsp-api</bundleDef>
|
||||||
|
</bundles>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
|||||||
@ -53,10 +53,10 @@
|
|||||||
<groupId>org.wso2.orbit.org.apache.pdfbox</groupId>
|
<groupId>org.wso2.orbit.org.apache.pdfbox</groupId>
|
||||||
<artifactId>pdfbox</artifactId>
|
<artifactId>pdfbox</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--<dependency>-->
|
<dependency>
|
||||||
<!--<groupId>org.wso2.carbon.commons</groupId>-->
|
<groupId>org.wso2.carbon.registry</groupId>
|
||||||
<!--<artifactId>org.wso2.carbon.email.verification</artifactId>-->
|
<artifactId>org.wso2.carbon.registry.indexing</artifactId>
|
||||||
<!--</dependency>-->
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@ -122,20 +122,22 @@
|
|||||||
<!--org.wso2.carbon.commons:org.wso2.carbon.email.verification-->
|
<!--org.wso2.carbon.commons:org.wso2.carbon.email.verification-->
|
||||||
<!--</bundleDef>-->
|
<!--</bundleDef>-->
|
||||||
<bundleDef>
|
<bundleDef>
|
||||||
org.wso2.carbon.identity:org.wso2.carbon.identity.oauth.stub:${carbon.identity.version}
|
org.wso2.carbon.identity:org.wso2.carbon.identity.oauth.stub:${identity.inbound.auth.oauth.version}
|
||||||
</bundleDef>
|
</bundleDef>
|
||||||
<bundleDef>
|
<bundleDef>
|
||||||
com.fasterxml.jackson.core:jackson-annotations:${jackson-annotations.version}
|
org.wso2.orbit.com.fasterxml.jackson.core:jackson-annotations:${jackson-annotations.version}
|
||||||
</bundleDef>
|
</bundleDef>
|
||||||
|
|
||||||
<!-- Below should be bundled with the email verification -->
|
<!-- Below should be bundled with the email verification -->
|
||||||
</bundles>
|
</bundles>
|
||||||
<importBundles>
|
<importBundles>
|
||||||
|
<importBundleDef>org.wso2.carbon.apimgt:org.wso2.carbon.apimgt.keymgt:${carbon.api.mgt.version}</importBundleDef>
|
||||||
<importBundleDef>org.wso2.orbit.org.apache.pdfbox:pdfbox:${orbit.version.pdfbox}</importBundleDef>
|
<importBundleDef>org.wso2.orbit.org.apache.pdfbox:pdfbox:${orbit.version.pdfbox}</importBundleDef>
|
||||||
|
<importBundleDef>org.wso2.carbon.registry:org.wso2.carbon.registry.indexing:${carbon.registry.version}</importBundleDef>
|
||||||
</importBundles>
|
</importBundles>
|
||||||
<importFeatures>
|
<importFeatures>
|
||||||
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
|
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
|
||||||
<importFeatureDef>org.wso2.carbon.apimgt.core:${carbon.api.mgt.version}</importFeatureDef>
|
<importFeatureDef>org.wso2.carbon.apimgt.core:${carbon.api.mgt.version}</importFeatureDef>
|
||||||
|
<!--<importFeatureDef>org.wso2.carbon.apimgt.keymgt.client:${carbon.api.mgt.version}</importFeatureDef>-->
|
||||||
<importFeatureDef>org.wso2.carbon.device.mgt.extensions:${carbon.device.mgt.version}</importFeatureDef>
|
<importFeatureDef>org.wso2.carbon.device.mgt.extensions:${carbon.device.mgt.version}</importFeatureDef>
|
||||||
<importFeatureDef>org.wso2.carbon.email.sender:${carbon.device.mgt.version}</importFeatureDef>
|
<importFeatureDef>org.wso2.carbon.email.sender:${carbon.device.mgt.version}</importFeatureDef>
|
||||||
</importFeatures>
|
</importFeatures>
|
||||||
|
|||||||
@ -370,7 +370,7 @@ CREATE TABLE IF NOT EXISTS DM_NOTIFICATION (
|
|||||||
OPERATION_ID INTEGER NOT NULL,
|
OPERATION_ID INTEGER NOT NULL,
|
||||||
TENANT_ID INTEGER NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
STATUS VARCHAR(10) NULL,
|
STATUS VARCHAR(10) NULL,
|
||||||
DESCRIPTION VARCHAR(100) NULL,
|
DESCRIPTION VARCHAR(1000) NULL,
|
||||||
PRIMARY KEY (NOTIFICATION_ID),
|
PRIMARY KEY (NOTIFICATION_ID),
|
||||||
CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES
|
CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES
|
||||||
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
|
|||||||
@ -367,7 +367,7 @@ CREATE TABLE DM_NOTIFICATION (
|
|||||||
OPERATION_ID INTEGER NOT NULL,
|
OPERATION_ID INTEGER NOT NULL,
|
||||||
TENANT_ID INTEGER NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
STATUS VARCHAR(10) NULL,
|
STATUS VARCHAR(10) NULL,
|
||||||
DESCRIPTION VARCHAR(100) NULL,
|
DESCRIPTION VARCHAR(1000) NULL,
|
||||||
PRIMARY KEY (NOTIFICATION_ID),
|
PRIMARY KEY (NOTIFICATION_ID),
|
||||||
CONSTRAINT FL_DM_NOTIFICATION FOREIGN KEY (DEVICE_ID) REFERENCES
|
CONSTRAINT FL_DM_NOTIFICATION FOREIGN KEY (DEVICE_ID) REFERENCES
|
||||||
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
@ -435,3 +435,68 @@ CREATE TABLE DM_DEVICE_DETAIL (
|
|||||||
ON DELETE NO ACTION
|
ON DELETE NO ACTION
|
||||||
ON UPDATE NO ACTION
|
ON UPDATE NO ACTION
|
||||||
);
|
);
|
||||||
|
GO
|
||||||
|
|
||||||
|
-- DASHBOARD RELATED VIEWS --
|
||||||
|
|
||||||
|
CREATE VIEW POLICY_COMPLIANCE_INFO AS
|
||||||
|
SELECT TOP 100 PERCENT
|
||||||
|
DEVICE_INFO.DEVICE_ID,
|
||||||
|
DEVICE_INFO.DEVICE_IDENTIFICATION,
|
||||||
|
DEVICE_INFO.PLATFORM,
|
||||||
|
DEVICE_INFO.OWNERSHIP,
|
||||||
|
DEVICE_INFO.CONNECTIVITY_STATUS,
|
||||||
|
ISNULL(DEVICE_WITH_POLICY_INFO.POLICY_ID, -1) AS POLICY_ID,
|
||||||
|
ISNULL(DEVICE_WITH_POLICY_INFO.IS_COMPLIANT, -1) AS
|
||||||
|
IS_COMPLIANT,
|
||||||
|
DEVICE_INFO.TENANT_ID
|
||||||
|
FROM
|
||||||
|
(SELECT
|
||||||
|
DM_DEVICE.ID AS DEVICE_ID,
|
||||||
|
DM_DEVICE.DEVICE_IDENTIFICATION,
|
||||||
|
DM_DEVICE_TYPE.NAME AS PLATFORM,
|
||||||
|
DM_ENROLMENT.OWNERSHIP,
|
||||||
|
DM_ENROLMENT.STATUS AS CONNECTIVITY_STATUS,
|
||||||
|
DM_DEVICE.TENANT_ID
|
||||||
|
FROM DM_DEVICE, DM_DEVICE_TYPE, DM_ENROLMENT
|
||||||
|
WHERE DM_DEVICE.DEVICE_TYPE_ID = DM_DEVICE_TYPE.ID AND DM_DEVICE.ID = DM_ENROLMENT.DEVICE_ID) DEVICE_INFO
|
||||||
|
LEFT JOIN
|
||||||
|
(SELECT
|
||||||
|
DEVICE_ID,
|
||||||
|
POLICY_ID,
|
||||||
|
STATUS AS IS_COMPLIANT
|
||||||
|
FROM
|
||||||
|
DM_POLICY_COMPLIANCE_STATUS) DEVICE_WITH_POLICY_INFO
|
||||||
|
ON DEVICE_INFO.DEVICE_ID = DEVICE_WITH_POLICY_INFO.DEVICE_ID
|
||||||
|
ORDER BY DEVICE_INFO.DEVICE_ID;
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE VIEW FEATURE_NON_COMPLIANCE_INFO AS
|
||||||
|
SELECT TOP 100 PERCENT
|
||||||
|
DM_DEVICE.ID AS DEVICE_ID,
|
||||||
|
DM_DEVICE.DEVICE_IDENTIFICATION,
|
||||||
|
DM_DEVICE_DETAIL.DEVICE_MODEL,
|
||||||
|
DM_DEVICE_DETAIL.VENDOR,
|
||||||
|
DM_DEVICE_DETAIL.OS_VERSION,
|
||||||
|
DM_ENROLMENT.OWNERSHIP,
|
||||||
|
DM_ENROLMENT.OWNER,
|
||||||
|
DM_ENROLMENT.STATUS AS CONNECTIVITY_STATUS,
|
||||||
|
DM_POLICY_COMPLIANCE_STATUS.POLICY_ID,
|
||||||
|
DM_DEVICE_TYPE.NAME
|
||||||
|
AS PLATFORM,
|
||||||
|
DM_POLICY_COMPLIANCE_FEATURES.FEATURE_CODE,
|
||||||
|
DM_POLICY_COMPLIANCE_FEATURES.STATUS AS IS_COMPLAINT,
|
||||||
|
DM_DEVICE.TENANT_ID
|
||||||
|
FROM
|
||||||
|
DM_POLICY_COMPLIANCE_FEATURES, DM_POLICY_COMPLIANCE_STATUS, DM_ENROLMENT, DM_DEVICE, DM_DEVICE_TYPE, DM_DEVICE_DETAIL
|
||||||
|
WHERE
|
||||||
|
DM_POLICY_COMPLIANCE_FEATURES.COMPLIANCE_STATUS_ID = DM_POLICY_COMPLIANCE_STATUS.ID AND
|
||||||
|
DM_POLICY_COMPLIANCE_STATUS.ENROLMENT_ID =
|
||||||
|
DM_ENROLMENT.ID AND
|
||||||
|
DM_POLICY_COMPLIANCE_STATUS.DEVICE_ID = DM_DEVICE.ID AND
|
||||||
|
DM_DEVICE.DEVICE_TYPE_ID = DM_DEVICE_TYPE.ID AND
|
||||||
|
DM_DEVICE.ID = DM_DEVICE_DETAIL.DEVICE_ID
|
||||||
|
ORDER BY TENANT_ID, DEVICE_ID;
|
||||||
|
GO
|
||||||
|
|
||||||
|
-- END OF DASHBOARD RELATED VIEWS --
|
||||||
|
|||||||
@ -428,7 +428,7 @@ CREATE TABLE IF NOT EXISTS DM_NOTIFICATION (
|
|||||||
OPERATION_ID INTEGER NOT NULL,
|
OPERATION_ID INTEGER NOT NULL,
|
||||||
TENANT_ID INTEGER NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
STATUS VARCHAR(10) NULL,
|
STATUS VARCHAR(10) NULL,
|
||||||
DESCRIPTION VARCHAR(100) NULL,
|
DESCRIPTION VARCHAR(1000) NULL,
|
||||||
PRIMARY KEY (NOTIFICATION_ID),
|
PRIMARY KEY (NOTIFICATION_ID),
|
||||||
CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES
|
CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES
|
||||||
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
|
|||||||
@ -3,7 +3,8 @@ CREATE TABLE DM_DEVICE_TYPE (
|
|||||||
NAME VARCHAR2(300) DEFAULT NULL,
|
NAME VARCHAR2(300) DEFAULT NULL,
|
||||||
PROVIDER_TENANT_ID INTEGER DEFAULT 0,
|
PROVIDER_TENANT_ID INTEGER DEFAULT 0,
|
||||||
SHARED_WITH_ALL_TENANTS NUMBER(1) DEFAULT 0 NOT NULL,
|
SHARED_WITH_ALL_TENANTS NUMBER(1) DEFAULT 0 NOT NULL,
|
||||||
CONSTRAINT PK_DM_DEVICE_TYPE PRIMARY KEY (ID)
|
CONSTRAINT PK_DM_DEVICE_TYPE PRIMARY KEY (ID),
|
||||||
|
UNIQUE (NAME)
|
||||||
)
|
)
|
||||||
/
|
/
|
||||||
-- Generate ID using sequence and trigger
|
-- Generate ID using sequence and trigger
|
||||||
@ -44,16 +45,6 @@ WHEN (NEW.ID IS NULL)
|
|||||||
SELECT DM_GROUP_seq.NEXTVAL INTO :NEW.ID FROM DUAL;
|
SELECT DM_GROUP_seq.NEXTVAL INTO :NEW.ID FROM DUAL;
|
||||||
END;
|
END;
|
||||||
/
|
/
|
||||||
-- Generate ID using sequence and trigger
|
|
||||||
CREATE SEQUENCE DM_DEVICE_CERTIFICATE_seq START WITH 1 INCREMENT BY 1 NOCACHE
|
|
||||||
/
|
|
||||||
CREATE OR REPLACE TRIGGER DM_DEVICE_CERTIFICATE_seq_tr
|
|
||||||
BEFORE INSERT ON DM_DEVICE_CERTIFICATE FOR EACH ROW
|
|
||||||
WHEN (NEW.ID IS NULL)
|
|
||||||
BEGIN
|
|
||||||
SELECT DM_DEVICE_CERTIFICATE_seq.NEXTVAL INTO :NEW.ID FROM DUAL;
|
|
||||||
END;
|
|
||||||
/
|
|
||||||
|
|
||||||
CREATE TABLE DM_DEVICE (
|
CREATE TABLE DM_DEVICE (
|
||||||
ID NUMBER(10) NOT NULL,
|
ID NUMBER(10) NOT NULL,
|
||||||
@ -436,7 +427,7 @@ CREATE TABLE DM_DEVICE_POLICY_APPLIED (
|
|||||||
POLICY_ID NUMBER(10) NOT NULL ,
|
POLICY_ID NUMBER(10) NOT NULL ,
|
||||||
POLICY_CONTENT BLOB NULL ,
|
POLICY_CONTENT BLOB NULL ,
|
||||||
TENANT_ID NUMBER(10) NOT NULL,
|
TENANT_ID NUMBER(10) NOT NULL,
|
||||||
APPLIED NUMBER(3) NULL ,
|
APPLIED NUMBER(1) DEFAULT 0,
|
||||||
CREATED_TIME TIMESTAMP(0) NULL ,
|
CREATED_TIME TIMESTAMP(0) NULL ,
|
||||||
UPDATED_TIME TIMESTAMP(0) NULL ,
|
UPDATED_TIME TIMESTAMP(0) NULL ,
|
||||||
APPLIED_TIME TIMESTAMP(0) NULL ,
|
APPLIED_TIME TIMESTAMP(0) NULL ,
|
||||||
@ -706,7 +697,7 @@ CREATE TABLE DM_NOTIFICATION (
|
|||||||
OPERATION_ID NUMBER(10) NOT NULL,
|
OPERATION_ID NUMBER(10) NOT NULL,
|
||||||
TENANT_ID NUMBER(10) NOT NULL,
|
TENANT_ID NUMBER(10) NOT NULL,
|
||||||
STATUS VARCHAR2(10) NULL,
|
STATUS VARCHAR2(10) NULL,
|
||||||
DESCRIPTION VARCHAR2(100) NULL,
|
DESCRIPTION VARCHAR2(1000) NULL,
|
||||||
CONSTRAINT PK_DM_NOTIFICATION PRIMARY KEY (NOTIFICATION_ID),
|
CONSTRAINT PK_DM_NOTIFICATION PRIMARY KEY (NOTIFICATION_ID),
|
||||||
CONSTRAINT FK_DM_DEVICE_NOTIFICATION FOREIGN KEY (DEVICE_ID) REFERENCES
|
CONSTRAINT FK_DM_DEVICE_NOTIFICATION FOREIGN KEY (DEVICE_ID) REFERENCES
|
||||||
DM_DEVICE (ID),
|
DM_DEVICE (ID),
|
||||||
@ -860,8 +851,8 @@ POLICY_ID,
|
|||||||
STATUS AS IS_COMPLIANT
|
STATUS AS IS_COMPLIANT
|
||||||
FROM DM_POLICY_COMPLIANCE_STATUS) DEVICE_WITH_POLICY_INFO
|
FROM DM_POLICY_COMPLIANCE_STATUS) DEVICE_WITH_POLICY_INFO
|
||||||
ON DEVICE_INFO.DEVICE_ID = DEVICE_WITH_POLICY_INFO.DEVICE_ID
|
ON DEVICE_INFO.DEVICE_ID = DEVICE_WITH_POLICY_INFO.DEVICE_ID
|
||||||
ORDER BY DEVICE_INFO.DEVICE_ID;
|
|
||||||
/
|
/
|
||||||
|
|
||||||
CREATE VIEW FEATURE_NON_COMPLIANCE_INFO AS
|
CREATE VIEW FEATURE_NON_COMPLIANCE_INFO AS
|
||||||
SELECT
|
SELECT
|
||||||
DM_DEVICE.ID AS DEVICE_ID,
|
DM_DEVICE.ID AS DEVICE_ID,
|
||||||
@ -885,7 +876,7 @@ DM_POLICY_COMPLIANCE_STATUS.ENROLMENT_ID = DM_ENROLMENT.ID AND
|
|||||||
DM_POLICY_COMPLIANCE_STATUS.DEVICE_ID = DM_DEVICE.ID AND
|
DM_POLICY_COMPLIANCE_STATUS.DEVICE_ID = DM_DEVICE.ID AND
|
||||||
DM_DEVICE.DEVICE_TYPE_ID = DM_DEVICE_TYPE.ID AND
|
DM_DEVICE.DEVICE_TYPE_ID = DM_DEVICE_TYPE.ID AND
|
||||||
DM_DEVICE.ID = DM_DEVICE_DETAIL.DEVICE_ID
|
DM_DEVICE.ID = DM_DEVICE_DETAIL.DEVICE_ID
|
||||||
ORDER BY TENANT_ID, DEVICE_ID;
|
/
|
||||||
|
|
||||||
-- END OF DASHBOARD RELATED VIEWS --
|
-- END OF DASHBOARD RELATED VIEWS --
|
||||||
|
|
||||||
|
|||||||
@ -222,11 +222,11 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_POLICY_APPLIED (
|
|||||||
POLICY_ID INTEGER NOT NULL ,
|
POLICY_ID INTEGER NOT NULL ,
|
||||||
POLICY_CONTENT BYTEA NULL ,
|
POLICY_CONTENT BYTEA NULL ,
|
||||||
TENANT_ID INTEGER NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
APPLIED INTEGER[1] NULL ,
|
APPLIED BOOLEAN NULL ,
|
||||||
CREATED_TIME TIMESTAMP NULL ,
|
CREATED_TIME TIMESTAMP NULL ,
|
||||||
UPDATED_TIME TIMESTAMP NULL ,
|
UPDATED_TIME TIMESTAMP NULL ,
|
||||||
APPLIED_TIME TIMESTAMP NULL ,
|
APPLIED_TIME TIMESTAMP NULL ,
|
||||||
CONSTRAINT FK_DM_POLICY_DEVCIE_APPLIED
|
CONSTRAINT FK_DM_POLICY_DEVICE_APPLIED
|
||||||
FOREIGN KEY (DEVICE_ID )
|
FOREIGN KEY (DEVICE_ID )
|
||||||
REFERENCES DM_DEVICE (ID )
|
REFERENCES DM_DEVICE (ID )
|
||||||
ON DELETE NO ACTION
|
ON DELETE NO ACTION
|
||||||
@ -409,7 +409,7 @@ CREATE TABLE IF NOT EXISTS DM_NOTIFICATION (
|
|||||||
OPERATION_ID INTEGER NOT NULL,
|
OPERATION_ID INTEGER NOT NULL,
|
||||||
TENANT_ID INTEGER NOT NULL,
|
TENANT_ID INTEGER NOT NULL,
|
||||||
STATUS VARCHAR(10) NULL,
|
STATUS VARCHAR(10) NULL,
|
||||||
DESCRIPTION VARCHAR(100) NULL,
|
DESCRIPTION VARCHAR(1000) NULL,
|
||||||
CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES
|
CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES
|
||||||
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
CONSTRAINT fk_dm_operation_notification FOREIGN KEY (OPERATION_ID) REFERENCES
|
CONSTRAINT fk_dm_operation_notification FOREIGN KEY (OPERATION_ID) REFERENCES
|
||||||
|
|||||||
@ -40,6 +40,10 @@
|
|||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.email.sender.core</artifactId>
|
<artifactId>org.wso2.carbon.email.sender.core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.wso2.orbit.org.apache.velocity</groupId>
|
||||||
|
<artifactId>velocity</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@ -94,6 +98,9 @@
|
|||||||
<bundleDef>
|
<bundleDef>
|
||||||
org.wso2.carbon.devicemgt:org.wso2.carbon.email.sender.core:${carbon.device.mgt.version}
|
org.wso2.carbon.devicemgt:org.wso2.carbon.email.sender.core:${carbon.device.mgt.version}
|
||||||
</bundleDef>
|
</bundleDef>
|
||||||
|
<bundleDef>
|
||||||
|
org.wso2.orbit.org.apache.velocity:velocity:${velocity.version}
|
||||||
|
</bundleDef>
|
||||||
</bundles>
|
</bundles>
|
||||||
<importFeatures>
|
<importFeatures>
|
||||||
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
|
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
|
||||||
|
|||||||
@ -49,8 +49,8 @@
|
|||||||
<artifactId>org.wso2.carbon.identity.authenticator.backend.oauth</artifactId>
|
<artifactId>org.wso2.carbon.identity.authenticator.backend.oauth</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.apimgt</groupId>
|
<groupId>org.wso2.carbon.registry</groupId>
|
||||||
<artifactId>org.wso2.carbon.apimgt.keymgt.client</artifactId>
|
<artifactId>org.wso2.carbon.registry.indexing</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
@ -84,13 +84,13 @@
|
|||||||
org.wso2.carbon.devicemgt:org.wso2.carbon.identity.authenticator.backend.oauth:${carbon.device.mgt.version}
|
org.wso2.carbon.devicemgt:org.wso2.carbon.identity.authenticator.backend.oauth:${carbon.device.mgt.version}
|
||||||
</bundleDef>
|
</bundleDef>
|
||||||
</bundles>
|
</bundles>
|
||||||
<importBundles>
|
|
||||||
<importBundleDef>org.wso2.carbon.apimgt:org.wso2.carbon.apimgt.keymgt.client:${carbon.api.mgt.version}</importBundleDef>
|
|
||||||
</importBundles>
|
|
||||||
<importFeatures>
|
<importFeatures>
|
||||||
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
|
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
|
||||||
</importFeatureDef>
|
</importFeatureDef>
|
||||||
</importFeatures>
|
</importFeatures>
|
||||||
|
<importBundles>
|
||||||
|
<importBundleDef>org.wso2.carbon.registry:org.wso2.carbon.registry.indexing:${carbon.registry.version}</importBundleDef>
|
||||||
|
</importBundles>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
|||||||
@ -55,7 +55,11 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.apimgt</groupId>
|
<groupId>org.wso2.carbon.apimgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.apimgt.keymgt</artifactId>
|
<artifactId>org.wso2.carbon.apimgt.keymgt.client</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.wso2.carbon.registry</groupId>
|
||||||
|
<artifactId>org.wso2.carbon.registry.indexing</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
@ -121,7 +125,8 @@
|
|||||||
</bundleDef>
|
</bundleDef>
|
||||||
</bundles>
|
</bundles>
|
||||||
<importBundles>
|
<importBundles>
|
||||||
<importBundleDef>org.wso2.carbon.apimgt:org.wso2.carbon.apimgt.keymgt:${carbon.api.mgt.version}</importBundleDef>
|
<importBundleDef>org.wso2.carbon.apimgt:org.wso2.carbon.apimgt.keymgt.client:${carbon.api.mgt.version}</importBundleDef>
|
||||||
|
<importBundleDef>org.wso2.carbon.registry:org.wso2.carbon.registry.indexing:${carbon.registry.version}</importBundleDef>
|
||||||
</importBundles>
|
</importBundles>
|
||||||
<importFeatures>
|
<importFeatures>
|
||||||
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
|
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
<artifactId>org.wso2.carbon.webapp.authenticator.framework.server.feature</artifactId>
|
<artifactId>org.wso2.carbon.webapp.authenticator.framework.server.feature</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>1.2.2-SNAPSHOT</version>
|
<version>1.2.2-SNAPSHOT</version>
|
||||||
<name>WSO2 Carbon - Device Management Server Feature</name>
|
<name>WSO2 Carbon - Webapp Authenticator Framework Server Feature</name>
|
||||||
<url>http://wso2.org</url>
|
<url>http://wso2.org</url>
|
||||||
<description>This feature contains the core bundles required for Back-end Device Management functionality
|
<description>This feature contains the core bundles required for Back-end Device Management functionality
|
||||||
</description>
|
</description>
|
||||||
@ -44,10 +44,6 @@
|
|||||||
<groupId>org.wso2.carbon.apimgt</groupId>
|
<groupId>org.wso2.carbon.apimgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.apimgt.core</artifactId>
|
<artifactId>org.wso2.carbon.apimgt.core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.wso2.carbon</groupId>
|
|
||||||
<artifactId>org.wso2.carbon.throttle.core</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@ -103,12 +99,7 @@
|
|||||||
</bundles>
|
</bundles>
|
||||||
<importBundles>
|
<importBundles>
|
||||||
<importBundleDef>org.wso2.carbon.apimgt:org.wso2.carbon.apimgt.core:${carbon.api.mgt.version}</importBundleDef>
|
<importBundleDef>org.wso2.carbon.apimgt:org.wso2.carbon.apimgt.core:${carbon.api.mgt.version}</importBundleDef>
|
||||||
<importBundleDef>org.wso2.carbon:org.wso2.carbon.throttle.core:${carbon.throttle.module.version}</importBundleDef>
|
|
||||||
</importBundles>
|
</importBundles>
|
||||||
<importFeatures>
|
|
||||||
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
|
|
||||||
<importFeatureDef>org.wso2.carbon.apimgt.core:${carbon.api.mgt.version}</importFeatureDef>
|
|
||||||
</importFeatures>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
|||||||
131
pom.xml
131
pom.xml
@ -708,11 +708,7 @@
|
|||||||
<artifactId>h2-database-engine</artifactId>
|
<artifactId>h2-database-engine</artifactId>
|
||||||
<version>${orbit.version.h2.engine}</version>
|
<version>${orbit.version.h2.engine}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.wso2.orbit.org.owasp.encoder</groupId>
|
|
||||||
<artifactId>encoder</artifactId>
|
|
||||||
<version>${owasp.encoder.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.axis2.transport</groupId>
|
<groupId>org.apache.axis2.transport</groupId>
|
||||||
<artifactId>axis2-transport-mail</artifactId>
|
<artifactId>axis2-transport-mail</artifactId>
|
||||||
@ -751,12 +747,12 @@
|
|||||||
<!-- End of Orbit dependencies -->
|
<!-- End of Orbit dependencies -->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.ws.commons.axiom</groupId>
|
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
||||||
<artifactId>axiom-api</artifactId>
|
<artifactId>axiom-api</artifactId>
|
||||||
<version>${axiom.version}</version>
|
<version>${axiom.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.ws.commons.axiom</groupId>
|
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
|
||||||
<artifactId>axiom-impl</artifactId>
|
<artifactId>axiom-impl</artifactId>
|
||||||
<version>${axiom.version}</version>
|
<version>${axiom.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -926,6 +922,14 @@
|
|||||||
<artifactId>org.wso2.carbon.apimgt.core</artifactId>
|
<artifactId>org.wso2.carbon.apimgt.core</artifactId>
|
||||||
<version>${carbon.api.mgt.version}</version>
|
<version>${carbon.api.mgt.version}</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.wso2.carbon</groupId>
|
||||||
|
<artifactId>org.wso2.carbon.core</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.wso2.carbon.apimgt</groupId>
|
||||||
|
<artifactId>org.wso2.carbon.apimgt.keymgt.stub</artifactId>
|
||||||
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.wso2.carbon.apimgt</groupId>
|
<groupId>org.wso2.carbon.apimgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.apimgt.usage.publisher</artifactId>
|
<artifactId>org.wso2.carbon.apimgt.usage.publisher</artifactId>
|
||||||
@ -946,6 +950,10 @@
|
|||||||
<groupId>org.wso2.carbon.apimgt</groupId>
|
<groupId>org.wso2.carbon.apimgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.ganalytics.publisher</artifactId>
|
<artifactId>org.wso2.carbon.ganalytics.publisher</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.wso2.carbon.apimgt</groupId>
|
||||||
|
<artifactId>org.wso2.carbon.throttle.core</artifactId>
|
||||||
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- End of API Management dependencies -->
|
<!-- End of API Management dependencies -->
|
||||||
@ -1029,32 +1037,32 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.identity</groupId>
|
<groupId>org.wso2.carbon.identity</groupId>
|
||||||
<artifactId>org.wso2.carbon.identity.base</artifactId>
|
<artifactId>org.wso2.carbon.identity.base</artifactId>
|
||||||
<version>${carbon.identity.version}</version>
|
<version>${carbon.identity.framework.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.identity</groupId>
|
<groupId>org.wso2.carbon.identity</groupId>
|
||||||
<artifactId>org.wso2.carbon.identity.core</artifactId>
|
<artifactId>org.wso2.carbon.identity.core</artifactId>
|
||||||
<version>${carbon.identity.version}</version>
|
<version>${carbon.identity.framework.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.identity</groupId>
|
<groupId>org.wso2.carbon.identity</groupId>
|
||||||
<artifactId>org.wso2.carbon.identity.oauth.stub</artifactId>
|
<artifactId>org.wso2.carbon.identity.oauth.stub</artifactId>
|
||||||
<version>${carbon.identity.version}</version>
|
<version>${identity.inbound.auth.oauth.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.identity</groupId>
|
<groupId>org.wso2.carbon.identity</groupId>
|
||||||
<artifactId>org.wso2.carbon.identity.application.authentication.framework</artifactId>
|
<artifactId>org.wso2.carbon.identity.application.authentication.framework</artifactId>
|
||||||
<version>${carbon.identity.version}</version>
|
<version>${carbon.identity.framework.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.identity</groupId>
|
<groupId>org.wso2.carbon.identity</groupId>
|
||||||
<artifactId>org.wso2.carbon.identity.oauth</artifactId>
|
<artifactId>org.wso2.carbon.identity.oauth</artifactId>
|
||||||
<version>${carbon.identity.version}</version>
|
<version>${identity.inbound.auth.oauth.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.identity</groupId>
|
<groupId>org.wso2.carbon.identity</groupId>
|
||||||
<artifactId>org.wso2.carbon.identity.application.common</artifactId>
|
<artifactId>org.wso2.carbon.identity.application.common</artifactId>
|
||||||
<version>${carbon.identity.version}</version>
|
<version>${carbon.identity.framework.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.identity</groupId>
|
<groupId>org.wso2.carbon.identity</groupId>
|
||||||
@ -1181,7 +1189,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.identity</groupId>
|
<groupId>org.wso2.carbon.identity</groupId>
|
||||||
<artifactId>org.wso2.carbon.identity.application.mgt</artifactId>
|
<artifactId>org.wso2.carbon.identity.application.mgt</artifactId>
|
||||||
<version>${carbon.identity.version}</version>
|
<version>${carbon.identity.framework.version}</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.wso2.carbon.identity</groupId>
|
<groupId>org.wso2.carbon.identity</groupId>
|
||||||
@ -1240,7 +1248,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.identity</groupId>
|
<groupId>org.wso2.carbon.identity</groupId>
|
||||||
<artifactId>org.wso2.carbon.identity.sso.saml</artifactId>
|
<artifactId>org.wso2.carbon.identity.sso.saml</artifactId>
|
||||||
<version>${carbon.identity.version}</version>
|
<version>${identity.inbound.auth.saml.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.googlecode.json-simple.wso2</groupId>
|
<groupId>com.googlecode.json-simple.wso2</groupId>
|
||||||
@ -1271,22 +1279,17 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle.wso2</groupId>
|
<groupId>org.wso2.orbit.org.bouncycastle</groupId>
|
||||||
<artifactId>bcprov-jdk15on</artifactId>
|
<artifactId>bcprov-jdk15on</artifactId>
|
||||||
<version>${bcprov.wso2.version}</version>
|
<version>${bcprov.wso2.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle.wso2</groupId>
|
<groupId>org.wso2.orbit.org.bouncycastle</groupId>
|
||||||
<artifactId>bcpkix-jdk15on</artifactId>
|
<artifactId>bcpkix-jdk15on</artifactId>
|
||||||
<version>${bcpkix.wso2.version}</version>
|
<version>${bcpkix.wso2.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle.wso2</groupId>
|
<groupId>org.wso2.orbit.com.google.code.jscep</groupId>
|
||||||
<artifactId>bcmail-jdk15on</artifactId>
|
|
||||||
<version>${bcmail.wso2.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.google.code.jscep.wso2</groupId>
|
|
||||||
<artifactId>jscep</artifactId>
|
<artifactId>jscep</artifactId>
|
||||||
<version>${jscep.version}</version>
|
<version>${jscep.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -1340,7 +1343,7 @@
|
|||||||
<version>${commons.httpclient.version}</version>
|
<version>${commons.httpclient.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.velocity</groupId>
|
<groupId>org.wso2.orbit.org.apache.velocity</groupId>
|
||||||
<artifactId>velocity</artifactId>
|
<artifactId>velocity</artifactId>
|
||||||
<version>${velocity.version}</version>
|
<version>${velocity.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -1403,6 +1406,12 @@
|
|||||||
<version>${carbon.registry.version}</version>
|
<version>${carbon.registry.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.wso2.carbon.registry</groupId>
|
||||||
|
<artifactId>org.wso2.carbon.registry.common</artifactId>
|
||||||
|
<version>${carbon.registry.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.orbit.org.scannotation</groupId>
|
<groupId>org.wso2.orbit.org.scannotation</groupId>
|
||||||
<artifactId>scannotation</artifactId>
|
<artifactId>scannotation</artifactId>
|
||||||
@ -1447,7 +1456,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.identity</groupId>
|
<groupId>org.wso2.carbon.identity</groupId>
|
||||||
<artifactId>org.wso2.carbon.user.mgt</artifactId>
|
<artifactId>org.wso2.carbon.user.mgt</artifactId>
|
||||||
<version>${carbon.identity.version}</version>
|
<version>${carbon.identity.framework.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@ -1466,19 +1475,16 @@
|
|||||||
<artifactId>swagger-jaxrs</artifactId>
|
<artifactId>swagger-jaxrs</artifactId>
|
||||||
<version>${swagger.version}</version>
|
<version>${swagger.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>javax.servlet</groupId>
|
||||||
<artifactId>servlet-api</artifactId>
|
<artifactId>servlet-api</artifactId>
|
||||||
<version>${servlet-api.version}</version>
|
<version>${servlet-api.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.analytics-common</groupId>
|
<groupId>org.wso2.carbon.analytics-common</groupId>
|
||||||
<artifactId>org.wso2.carbon.event.output.adapter.core</artifactId>
|
<artifactId>org.wso2.carbon.event.output.adapter.core</artifactId>
|
||||||
<version>${carbon.analytics.common.version}</version>
|
<version>${carbon.analytics.common.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm</artifactId>
|
||||||
@ -1495,24 +1501,29 @@
|
|||||||
<version>${carbon.device.mgt.version}</version>
|
<version>${carbon.device.mgt.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>org.wso2.orbit.com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-annotations</artifactId>
|
<artifactId>jackson-annotations</artifactId>
|
||||||
<version>${jackson-annotations.version}</version>
|
<version>${jackson-annotations.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.wso2.orbit.org.owasp.encoder</groupId>
|
||||||
|
<artifactId>encoder</artifactId>
|
||||||
|
<version>${owasp.encoder.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate</groupId>
|
||||||
<artifactId>hibernate-validator</artifactId>
|
<artifactId>hibernate-validator</artifactId>
|
||||||
<version>${hibernate-validator.version}</version>
|
<version>${hibernate-validator.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.apimgt</groupId>
|
<groupId>javax.servlet.jsp</groupId>
|
||||||
<artifactId>org.wso2.carbon.apimgt.keymgt.client</artifactId>
|
<artifactId>javax.servlet.jsp-api</artifactId>
|
||||||
<version>${carbon.api.mgt.version}</version>
|
<version>${servelet.jsp.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>org.wso2.carbon.throttle.core</artifactId>
|
<artifactId>slf4j-simple</artifactId>
|
||||||
<version>${carbon.throttle.module.version}</version>
|
<version>${slf4j.simple.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
@ -1735,8 +1746,9 @@
|
|||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
<servelet.jsp.version>2.2.1</servelet.jsp.version>
|
||||||
<testng.version>6.1.1</testng.version>
|
<testng.version>6.1.1</testng.version>
|
||||||
<carbon.kernel.version>4.4.3</carbon.kernel.version>
|
<carbon.kernel.version>4.4.9</carbon.kernel.version>
|
||||||
<carbon.kernel.version.range>[4.4.0, 5.0.0)</carbon.kernel.version.range>
|
<carbon.kernel.version.range>[4.4.0, 5.0.0)</carbon.kernel.version.range>
|
||||||
<carbon.p2.plugin.version>1.5.4</carbon.p2.plugin.version>
|
<carbon.p2.plugin.version>1.5.4</carbon.p2.plugin.version>
|
||||||
<maven-buildnumber-plugin.version>1.3</maven-buildnumber-plugin.version>
|
<maven-buildnumber-plugin.version>1.3</maven-buildnumber-plugin.version>
|
||||||
@ -1776,21 +1788,23 @@
|
|||||||
<tomcat.jdbc.pooling.version>7.0.34.wso2v2</tomcat.jdbc.pooling.version>
|
<tomcat.jdbc.pooling.version>7.0.34.wso2v2</tomcat.jdbc.pooling.version>
|
||||||
|
|
||||||
<!-- Carbon Deployment -->
|
<!-- Carbon Deployment -->
|
||||||
<carbon.deployment.version>4.6.0</carbon.deployment.version>
|
<carbon.deployment.version>4.7.0</carbon.deployment.version>
|
||||||
|
|
||||||
<!-- Carbon Identity -->
|
<!-- Carbon Identity -->
|
||||||
<carbon.identity.version>5.0.7</carbon.identity.version>
|
<carbon.identity.framework.version>5.2.0</carbon.identity.framework.version>
|
||||||
|
<identity.inbound.auth.oauth.version>5.1.2</identity.inbound.auth.oauth.version>
|
||||||
|
<identity.inbound.auth.saml.version>5.1.1</identity.inbound.auth.saml.version>
|
||||||
|
|
||||||
<!-- Carbon Multi-tenancy -->
|
<!-- Carbon Multi-tenancy -->
|
||||||
<carbon.multitenancy.version>4.5.0</carbon.multitenancy.version>
|
<carbon.multitenancy.version>4.6.0</carbon.multitenancy.version>
|
||||||
|
|
||||||
<!-- Carbon Governance -->
|
<!-- Carbon Governance -->
|
||||||
<carbon.governance.version>4.5.8</carbon.governance.version>
|
<carbon.governance.version>4.6.4</carbon.governance.version>
|
||||||
|
|
||||||
<!-- Axiom -->
|
<!-- Axiom -->
|
||||||
<axiom.version>1.2.11-wso2v11</axiom.version>
|
<axiom.version>1.2.11-wso2v10</axiom.version>
|
||||||
<axiom.osgi.version.range>[1.2.11, 1.3.0)</axiom.osgi.version.range>
|
<axiom.osgi.version.range>[1.2.11, 1.3.0)</axiom.osgi.version.range>
|
||||||
<axiom.wso2.version>1.2.11.wso2v5</axiom.wso2.version>
|
<axiom.wso2.version>1.2.11.wso2v10</axiom.wso2.version>
|
||||||
|
|
||||||
<!-- Carbon Device Management -->
|
<!-- Carbon Device Management -->
|
||||||
<carbon.device.mgt.version>1.2.2-SNAPSHOT</carbon.device.mgt.version>
|
<carbon.device.mgt.version>1.2.2-SNAPSHOT</carbon.device.mgt.version>
|
||||||
@ -1802,15 +1816,15 @@
|
|||||||
<version.commons.lang>2.6.0.wso2v1</version.commons.lang>
|
<version.commons.lang>2.6.0.wso2v1</version.commons.lang>
|
||||||
|
|
||||||
<!-- Carbon API Management -->
|
<!-- Carbon API Management -->
|
||||||
<carbon.api.mgt.version>5.0.5</carbon.api.mgt.version>
|
<carbon.api.mgt.version>6.0.5</carbon.api.mgt.version>
|
||||||
<carbon.api.mgt.version.range>(5.0.0,6.0.0]</carbon.api.mgt.version.range>
|
<carbon.api.mgt.version.range>(5.0.0,7.0.0]</carbon.api.mgt.version.range>
|
||||||
|
|
||||||
<!-- Carbon Analytics Commons -->
|
<!-- Carbon Analytics Commons -->
|
||||||
<carbon.analytics.common.version>5.0.11</carbon.analytics.common.version>
|
<carbon.analytics.common.version>5.1.3</carbon.analytics.common.version>
|
||||||
<carbon.analytics.common.version.range>[5.0.11,6.0.0)</carbon.analytics.common.version.range>
|
<carbon.analytics.common.version.range>[5.1.3,6.0.0)</carbon.analytics.common.version.range>
|
||||||
|
|
||||||
<!-- Carbon Registry -->
|
<!-- Carbon Registry -->
|
||||||
<carbon.registry.version>4.4.8</carbon.registry.version>
|
<carbon.registry.version>4.5.6</carbon.registry.version>
|
||||||
<carbon.registry.imp.pkg.version.range>[4.4.8, 5.0.0)</carbon.registry.imp.pkg.version.range>
|
<carbon.registry.imp.pkg.version.range>[4.4.8, 5.0.0)</carbon.registry.imp.pkg.version.range>
|
||||||
|
|
||||||
<!--CXF properties-->
|
<!--CXF properties-->
|
||||||
@ -1820,14 +1834,12 @@
|
|||||||
<jackson.version>1.9.0</jackson.version>
|
<jackson.version>1.9.0</jackson.version>
|
||||||
|
|
||||||
<!-- BouncyCastle -->
|
<!-- BouncyCastle -->
|
||||||
<bcprov.wso2.version>1.49.wso2v1</bcprov.wso2.version>
|
<bcprov.wso2.version>1.52.0.wso2v1</bcprov.wso2.version>
|
||||||
<bcpkix.wso2.version>1.49.wso2v1</bcpkix.wso2.version>
|
<bcpkix.wso2.version>1.52.0.wso2v2</bcpkix.wso2.version>
|
||||||
<bcprov.ext.wso2.version>1.49.wso2v1</bcprov.ext.wso2.version>
|
<bcprov.wso2.version.range>[1.52.0,1.60.0)</bcprov.wso2.version.range>
|
||||||
<bcprov.wso2.version.range>[1.40.wso2v1, 1.50.0)</bcprov.wso2.version.range>
|
|
||||||
<bcmail.wso2.version>1.49.wso2v1</bcmail.wso2.version>
|
|
||||||
|
|
||||||
<!-- JSCEP -->
|
<!-- JSCEP -->
|
||||||
<jscep.version>2.0.2.wso2v2</jscep.version>
|
<jscep.version>2.3.0.wso2v2</jscep.version>
|
||||||
|
|
||||||
<!-- Nimbus Jose-->
|
<!-- Nimbus Jose-->
|
||||||
<nimbus.orbit.version>2.26.1.wso2v3</nimbus.orbit.version>
|
<nimbus.orbit.version>2.26.1.wso2v3</nimbus.orbit.version>
|
||||||
@ -1856,7 +1868,7 @@
|
|||||||
<httpcore.version>4.3.3.wso2v1</httpcore.version>
|
<httpcore.version>4.3.3.wso2v1</httpcore.version>
|
||||||
<commons.httpclient.version>3.1.0.wso2v2</commons.httpclient.version>
|
<commons.httpclient.version>3.1.0.wso2v2</commons.httpclient.version>
|
||||||
|
|
||||||
<velocity.version>1.7</velocity.version>
|
<velocity.version>1.7.0.wso2v1</velocity.version>
|
||||||
|
|
||||||
<commons-io.version>2.4.0.wso2v1</commons-io.version>
|
<commons-io.version>2.4.0.wso2v1</commons-io.version>
|
||||||
<commons-collections.version>3.2.0.wso2v1</commons-collections.version>
|
<commons-collections.version>3.2.0.wso2v1</commons-collections.version>
|
||||||
@ -1876,19 +1888,26 @@
|
|||||||
|
|
||||||
<!--javax ws rs version-->
|
<!--javax ws rs version-->
|
||||||
<javax.ws.rs.version>2.0.1</javax.ws.rs.version>
|
<javax.ws.rs.version>2.0.1</javax.ws.rs.version>
|
||||||
<swagger.version>1.5.8</swagger.version>
|
<swagger.version>1.5.10</swagger.version>
|
||||||
|
<swagger.annotations.version>1.5.10</swagger.annotations.version>
|
||||||
<servlet-api.version>2.5</servlet-api.version>
|
<servlet-api.version>2.5</servlet-api.version>
|
||||||
|
|
||||||
<!--JWT grant type extension feature-->
|
<!--JWT grant type extension feature-->
|
||||||
<identity.jwt.extension.version>1.0.2</identity.jwt.extension.version>
|
<identity.jwt.extension.version>1.0.2</identity.jwt.extension.version>
|
||||||
<jackson-annotations.version>2.7.4</jackson-annotations.version>
|
<jackson-annotations.version>2.6.1.wso2v1</jackson-annotations.version>
|
||||||
<owasp.encoder.version>1.2.0.wso2v1</owasp.encoder.version>
|
<owasp.encoder.version>1.2.0.wso2v1</owasp.encoder.version>
|
||||||
|
|
||||||
<hibernate-validator.version>5.0.2.Final</hibernate-validator.version>
|
<hibernate-validator.version>5.0.2.Final</hibernate-validator.version>
|
||||||
|
<javax.xml.parsers.import.pkg.version>[0.0.0,1.0.0)</javax.xml.parsers.import.pkg.version>
|
||||||
|
<javax.xml.bind.imp.pkg.version>[0.0.0,1.0.0)</javax.xml.bind.imp.pkg.version>
|
||||||
|
|
||||||
<!-- apache pdfbox version -->
|
<!-- apache pdfbox version -->
|
||||||
<orbit.version.pdfbox>1.8.10.wso2v2</orbit.version.pdfbox>
|
<orbit.version.pdfbox>1.8.10.wso2v2</orbit.version.pdfbox>
|
||||||
<carbon.throttle.module.version>4.2.1</carbon.throttle.module.version>
|
<carbon.throttle.module.version>4.2.1</carbon.throttle.module.version>
|
||||||
|
<javax.xml.soap.imp.pkg.version>[1.0.0, 1.1.0)</javax.xml.soap.imp.pkg.version>
|
||||||
|
|
||||||
|
<!-- apache pdfbox version -->
|
||||||
|
<slf4j.simple.version>1.6.1</slf4j.simple.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user