fixed build failure of siddi extensions

bump-versions-for-development
Amalka Subasinghe 2 years ago
parent ca8680456a
commit ff9cbfc814

@ -20,7 +20,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId> <groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>siddhi-extensions</artifactId> <artifactId>siddhi-extensions</artifactId>
<version>6.0.11-SNAPSHOT</version> <version>6.0.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
@ -30,6 +30,10 @@
<name>WSO2 Siddhi Execution Extension - Device management Core functionality as Siddhi extension</name> <name>WSO2 Siddhi Execution Extension - Device management Core functionality as Siddhi extension</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<properties>
<skipTests>true</skipTests>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>

@ -18,8 +18,6 @@
*/ */
package org.wso2.extension.siddhi.device; package org.wso2.extension.siddhi.device;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.jdbc.pool.PoolProperties; import org.apache.tomcat.jdbc.pool.PoolProperties;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeSuite; import org.testng.annotations.BeforeSuite;
@ -29,6 +27,7 @@ import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory; import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
import org.wso2.carbon.device.mgt.core.dao.GroupManagementDAOFactory; import org.wso2.carbon.device.mgt.core.dao.GroupManagementDAOFactory;
import org.wso2.carbon.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOFactory;
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.operation.mgt.dao.OperationManagementDAOFactory; import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory;
import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil; import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil;
@ -46,7 +45,6 @@ import java.sql.Statement;
public abstract class BaseDeviceManagementTest { public abstract class BaseDeviceManagementTest {
private DataSource dataSource; private DataSource dataSource;
private static final Log log = LogFactory.getLog(BaseDeviceManagementTest.class);
@BeforeSuite @BeforeSuite
public void setupDataSource() throws Exception { public void setupDataSource() throws Exception {
@ -61,6 +59,7 @@ public abstract class BaseDeviceManagementTest {
GroupManagementDAOFactory.init(dataSource); GroupManagementDAOFactory.init(dataSource);
OperationManagementDAOFactory.init(dataSource); OperationManagementDAOFactory.init(dataSource);
NotificationManagementDAOFactory.init(dataSource); NotificationManagementDAOFactory.init(dataSource);
MetadataManagementDAOFactory.init(dataSource);
} }
@BeforeClass @BeforeClass

@ -61,10 +61,10 @@
<!-- <!--
<ServerURL>https://${carbon.local.ip}:${carbon.management.port}${carbon.context}/services/</ServerURL> <ServerURL>https://${carbon.local.ip}:${carbon.management.port}${carbon.context}/services/</ServerURL>
--> -->
<!-- <!--
The URL of the index page. This is where the user will be redirected after signing in to the The URL of the index page. This is where the user will be redirected after signing in to the
carbon server. carbon server.
--> -->
<!-- IndexPageURL>/carbon/admin/index.jsp</IndexPageURL--> <!-- IndexPageURL>/carbon/admin/index.jsp</IndexPageURL-->
<!-- <!--
@ -143,12 +143,12 @@
<KDCServerPort>8000</KDCServerPort> <KDCServerPort>8000</KDCServerPort>
</EmbeddedLDAP> </EmbeddedLDAP>
<!-- <!--
Override datasources JNDIproviderPort defined in bps.xml and datasources.properties files Override datasources JNDIproviderPort defined in bps.xml and datasources.properties files
--> -->
<!--<JNDIProviderPort>2199</JNDIProviderPort>--> <!--<JNDIProviderPort>2199</JNDIProviderPort>-->
<!--Override receive port of thrift based entitlement service.--> <!--Override receive port of thrift based entitlement service.-->
<ThriftEntitlementReceivePort>10500</ThriftEntitlementReceivePort> <ThriftEntitlementReceivePort>10500</ThriftEntitlementReceivePort>
</Ports> </Ports>
@ -317,9 +317,9 @@
<!-- If this parameter is set, the ?wsdl on an admin service will not give the admin service wsdl. --> <!-- If this parameter is set, the ?wsdl on an admin service will not give the admin service wsdl. -->
<HideAdminServiceWSDLs>true</HideAdminServiceWSDLs> <HideAdminServiceWSDLs>true</HideAdminServiceWSDLs>
<!--WARNING-Use With Care! Uncommenting bellow parameter would expose all AdminServices in HTTP transport. <!--WARNING-Use With Care! Uncommenting bellow parameter would expose all AdminServices in HTTP transport.
With HTTP transport your credentials and data routed in public channels are vulnerable for sniffing attacks. With HTTP transport your credentials and data routed in public channels are vulnerable for sniffing attacks.
Use bellow parameter ONLY if your communication channels are confirmed to be secured by other means --> Use bellow parameter ONLY if your communication channels are confirmed to be secured by other means -->
<!--HttpAdminServices>*</HttpAdminServices--> <!--HttpAdminServices>*</HttpAdminServices-->
</Axis2Config> </Axis2Config>
@ -390,21 +390,21 @@
exceptions at runtime. exceptions at runtime.
--> -->
<!-- <Credential> --> <!-- <Credential> -->
<!-- <!--
the pattern that would match a subset of URLs for which this authenticator the pattern that would match a subset of URLs for which this authenticator
would be used would be used
--> -->
<!-- <Pattern>regularExpression</Pattern> --> <!-- <Pattern>regularExpression</Pattern> -->
<!-- <!--
the type of this authenticator. Allowed values are: the type of this authenticator. Allowed values are:
1. server 1. server
2. proxy 2. proxy
--> -->
<!-- <Type>proxy</Type> --> <!-- <Type>proxy</Type> -->
<!-- the username used to log in to server/proxy --> <!-- the username used to log in to server/proxy -->
<!-- <Username>username</Username> --> <!-- <Username>username</Username> -->
<!-- the password used to log in to server/proxy --> <!-- the password used to log in to server/proxy -->
<!-- <Password>password</Password> --> <!-- <Password>password</Password> -->
<!-- </Credential> --> <!-- </Credential> -->
</NetworkAuthenticatorConfig> </NetworkAuthenticatorConfig>
@ -419,14 +419,14 @@
--> -->
<TomcatRealm>UserManager</TomcatRealm> <TomcatRealm>UserManager</TomcatRealm>
<!--Option to disable storing of tokens issued by STS--> <!--Option to disable storing of tokens issued by STS-->
<DisableTokenStore>false</DisableTokenStore> <DisableTokenStore>false</DisableTokenStore>
<!-- <!--
Security token store class name. If this is not set, default class will be Security token store class name. If this is not set, default class will be
org.wso2.carbon.security.util.SecurityTokenStore org.wso2.carbon.security.util.SecurityTokenStore
--> -->
<!--TokenStoreClassName>org.wso2.carbon.identity.sts.store.DBTokenStore</TokenStoreClassName--> <!--TokenStoreClassName>org.wso2.carbon.identity.sts.store.DBTokenStore</TokenStoreClassName-->
</Security> </Security>
<!-- <!--
@ -627,30 +627,30 @@
Default Feature Repository of WSO2 Carbon. Default Feature Repository of WSO2 Carbon.
--> -->
<FeatureRepository> <FeatureRepository>
<RepositoryName>default repository</RepositoryName> <RepositoryName>default repository</RepositoryName>
<RepositoryURL>${p2.repo.url}</RepositoryURL> <RepositoryURL>${p2.repo.url}</RepositoryURL>
</FeatureRepository> </FeatureRepository>
<!-- <!--
Configure API Management Configure API Management
--> -->
<APIManagement> <APIManagement>
<!--Uses the embedded API Manager by default. If you want to use an external <!--Uses the embedded API Manager by default. If you want to use an external
API Manager instance to manage APIs, configure below externalAPIManager--> API Manager instance to manage APIs, configure below externalAPIManager-->
<Enabled>true</Enabled> <Enabled>true</Enabled>
<!--Uncomment and configure API Gateway and <!--Uncomment and configure API Gateway and
Publisher URLs to use external API Manager instance--> Publisher URLs to use external API Manager instance-->
<!--ExternalAPIManager> <!--ExternalAPIManager>
<APIGatewayURL>http://localhost:8281</APIGatewayURL> <APIGatewayURL>http://localhost:8281</APIGatewayURL>
<APIPublisherURL>http://localhost:8281/publisher</APIPublisherURL> <APIPublisherURL>http://localhost:8281/publisher</APIPublisherURL>
</ExternalAPIManager--> </ExternalAPIManager-->
<LoadAPIContextsInServerStartup>true</LoadAPIContextsInServerStartup> <LoadAPIContextsInServerStartup>true</LoadAPIContextsInServerStartup>
</APIManagement> </APIManagement>
</Server> </Server>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<!-- <!--
~ Copyright 2005-2017 WSO2 Inc. (http://wso2.com) ~ Copyright 2017 WSO2 Inc. (http://wso2.com)
~ ~
~ Licensed under the Apache License, Version 2.0 (the "License"); ~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License. ~ you may not use this file except in compliance with the License.
@ -37,62 +37,6 @@
<minIdle>5</minIdle> <minIdle>5</minIdle>
</dbConfig> </dbConfig>
<!--<handler class="org.wso2.carbon.registry.extensions.handlers.SynapseRepositoryHandler">
<filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
<property name="mediaType">application/vnd.apache.synapse</property>
</filter>
</handler>
<handler class="org.wso2.carbon.registry.extensions.handlers.SynapseRepositoryHandler">
<filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
<property name="mediaType">application/vnd.apache.esb</property>
</filter>
</handler>
<handler class="org.wso2.carbon.registry.extensions.handlers.Axis2RepositoryHandler">
<filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
<property name="mediaType">application/vnd.apache.axis2</property>
</filter>
</handler>
<handler class="org.wso2.carbon.registry.extensions.handlers.Axis2RepositoryHandler">
<filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
<property name="mediaType">application/vnd.apache.wsas</property>
</filter>
</handler>
<handler class="org.wso2.carbon.registry.extensions.handlers.WSDLMediaTypeHandler">
<filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
<property name="mediaType">application/wsdl+xml</property>
</filter>
</handler>
<handler class="org.wso2.carbon.registry.extensions.handlers.XSDMediaTypeHandler">
<filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
<property name="mediaType">application/x-xsd+xml</property>
</filter>
</handler> -->
<!--remoteInstance url="https://localhost:9443/registry">
<id>instanceid</id>
<username>username</username>
<password>password</password>
</remoteInstance-->
<!--remoteInstance url="https://localhost:9443/registry">
<id>instanceid</id>
<dbConfig>wso2registry</dbConfig>
<readOnly>false</readOnly>
<enableCache>true</enableCache>
<registryRoot>/</registryRoot>
</remoteInstance-->
<!--mount path="/_system/config" overwrite="true|false|virtual">
<instanceId>instanceid</instanceId>
<targetPath>/_system/nodes</targetPath>
</mount-->
<versionResourcesOnChange>false</versionResourcesOnChange> <versionResourcesOnChange>false</versionResourcesOnChange>
<!-- NOTE: You can edit the options under "StaticConfiguration" only before the <!-- NOTE: You can edit the options under "StaticConfiguration" only before the

@ -8,11 +8,22 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE (
PRIMARY KEY (ID) PRIMARY KEY (ID)
); );
CREATE TABLE IF NOT EXISTS DM_DEVICE_CERTIFICATE (
ID INTEGER auto_increment NOT NULL,
SERIAL_NUMBER VARCHAR(500) DEFAULT NULL,
CERTIFICATE BLOB DEFAULT NULL,
TENANT_ID INTEGER DEFAULT 0,
USERNAME VARCHAR(500) DEFAULT NULL,
PRIMARY KEY (ID)
);
CREATE TABLE IF NOT EXISTS DM_GROUP ( CREATE TABLE IF NOT EXISTS DM_GROUP (
ID INTEGER AUTO_INCREMENT NOT NULL, ID INTEGER AUTO_INCREMENT NOT NULL,
GROUP_NAME VARCHAR(100) DEFAULT NULL, GROUP_NAME VARCHAR(100) DEFAULT NULL,
STATUS VARCHAR(50) DEFAULT NULL,
DESCRIPTION TEXT DEFAULT NULL, DESCRIPTION TEXT DEFAULT NULL,
OWNER VARCHAR(45) DEFAULT NULL, OWNER VARCHAR(255) DEFAULT NULL,
PARENT_PATH VARCHAR(255) DEFAULT NULL,
TENANT_ID INTEGER DEFAULT 0, TENANT_ID INTEGER DEFAULT 0,
PRIMARY KEY (ID) PRIMARY KEY (ID)
); );
@ -41,6 +52,17 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE (
CONSTRAINT uk_DM_DEVICE UNIQUE (NAME, DEVICE_TYPE_ID, DEVICE_IDENTIFICATION, TENANT_ID) CONSTRAINT uk_DM_DEVICE UNIQUE (NAME, DEVICE_TYPE_ID, DEVICE_IDENTIFICATION, TENANT_ID)
); );
CREATE TABLE IF NOT EXISTS DM_BILLING (
INVOICE_ID INTEGER auto_increment NOT NULL,
TENANT_ID INTEGER default 0,
DEVICE_ID INT default NULL,
BILLING_START TIMESTAMP not null,
BILLING_END TIMESTAMP not null,
PRIMARY KEY (INVOICE_ID),
CONSTRAINT FK_DM_BILLING_DM_DEVICE
FOREIGN KEY (DEVICE_ID) REFERENCES DM_DEVICE (ID)
);
CREATE TABLE IF NOT EXISTS DM_DEVICE_PROPERTIES ( CREATE TABLE IF NOT EXISTS DM_DEVICE_PROPERTIES (
DEVICE_TYPE_NAME VARCHAR(300) NOT NULL, DEVICE_TYPE_NAME VARCHAR(300) NOT NULL,
DEVICE_IDENTIFICATION VARCHAR(300) NOT NULL, DEVICE_IDENTIFICATION VARCHAR(300) NOT NULL,
@ -50,6 +72,14 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_PROPERTIES (
PRIMARY KEY (DEVICE_TYPE_NAME, DEVICE_IDENTIFICATION, PROPERTY_NAME, TENANT_ID) PRIMARY KEY (DEVICE_TYPE_NAME, DEVICE_IDENTIFICATION, PROPERTY_NAME, TENANT_ID)
); );
CREATE TABLE IF NOT EXISTS GROUP_PROPERTIES (
GROUP_ID INTEGER NOT NULL,
PROPERTY_NAME VARCHAR(100) DEFAULT 0,
PROPERTY_VALUE VARCHAR(100) DEFAULT NULL,
TENANT_ID VARCHAR(100),
PRIMARY KEY (GROUP_ID, PROPERTY_NAME, TENANT_ID)
);
CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_MAP ( CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_MAP (
ID INTEGER AUTO_INCREMENT NOT NULL, ID INTEGER AUTO_INCREMENT NOT NULL,
DEVICE_ID INTEGER DEFAULT NULL, DEVICE_ID INTEGER DEFAULT NULL,
@ -65,62 +95,44 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_MAP (
CREATE TABLE IF NOT EXISTS DM_OPERATION ( CREATE TABLE IF NOT EXISTS DM_OPERATION (
ID INTEGER AUTO_INCREMENT NOT NULL, ID INTEGER AUTO_INCREMENT NOT NULL,
TYPE VARCHAR(50) NOT NULL, TYPE VARCHAR(50) NOT NULL,
CREATED_TIMESTAMP TIMESTAMP NOT NULL, CREATED_TIMESTAMP BIGINT NOT NULL,
RECEIVED_TIMESTAMP TIMESTAMP NULL, RECEIVED_TIMESTAMP BIGINT NULL,
OPERATION_CODE VARCHAR(1000) NOT NULL, OPERATION_CODE VARCHAR(1000) NOT NULL,
PRIMARY KEY (ID) INITIATED_BY VARCHAR(100) NULL,
);
CREATE TABLE IF NOT EXISTS DM_CONFIG_OPERATION (
OPERATION_ID INTEGER NOT NULL,
OPERATION_CONFIG BLOB DEFAULT NULL,
ENABLED BOOLEAN NOT NULL DEFAULT FALSE,
PRIMARY KEY (OPERATION_ID),
CONSTRAINT fk_dm_operation_config FOREIGN KEY (OPERATION_ID) REFERENCES
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE TABLE IF NOT EXISTS DM_COMMAND_OPERATION (
OPERATION_ID INTEGER NOT NULL,
ENABLED BOOLEAN NOT NULL DEFAULT FALSE,
PRIMARY KEY (OPERATION_ID),
CONSTRAINT fk_dm_operation_command FOREIGN KEY (OPERATION_ID) REFERENCES
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE TABLE IF NOT EXISTS DM_POLICY_OPERATION (
OPERATION_ID INTEGER NOT NULL,
ENABLED INTEGER NOT NULL DEFAULT 0,
OPERATION_DETAILS BLOB DEFAULT NULL,
PRIMARY KEY (OPERATION_ID),
CONSTRAINT fk_dm_operation_policy FOREIGN KEY (OPERATION_ID) REFERENCES
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE TABLE IF NOT EXISTS DM_PROFILE_OPERATION (
OPERATION_ID INTEGER NOT NULL,
ENABLED INTEGER NOT NULL DEFAULT 0,
OPERATION_DETAILS BLOB DEFAULT NULL, OPERATION_DETAILS BLOB DEFAULT NULL,
PRIMARY KEY (OPERATION_ID), ENABLED BOOLEAN NOT NULL DEFAULT FALSE,
CONSTRAINT fk_dm_operation_profile FOREIGN KEY (OPERATION_ID) REFERENCES PRIMARY KEY (ID)
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
); );
CREATE TABLE IF NOT EXISTS DM_ENROLMENT ( CREATE TABLE IF NOT EXISTS DM_ENROLMENT (
ID INTEGER AUTO_INCREMENT NOT NULL, ID INTEGER AUTO_INCREMENT NOT NULL,
DEVICE_ID INTEGER NOT NULL, DEVICE_ID INTEGER NOT NULL,
OWNER VARCHAR(50) NOT NULL, OWNER VARCHAR(255) NOT NULL,
OWNERSHIP VARCHAR(45) DEFAULT NULL, OWNERSHIP VARCHAR(45) DEFAULT NULL,
STATUS VARCHAR(50) NULL, STATUS VARCHAR(50) NULL,
IS_TRANSFERRED BOOLEAN NOT NULL DEFAULT FALSE,
DATE_OF_ENROLMENT TIMESTAMP DEFAULT NULL, DATE_OF_ENROLMENT TIMESTAMP DEFAULT NULL,
DATE_OF_LAST_UPDATE TIMESTAMP DEFAULT NULL, DATE_OF_LAST_UPDATE TIMESTAMP DEFAULT NULL,
TENANT_ID INT NOT NULL, TENANT_ID INT NOT NULL,
LAST_BILLED_DATE BIGINT DEFAULT 0,
PRIMARY KEY (ID), PRIMARY KEY (ID),
CONSTRAINT fk_dm_device_enrolment FOREIGN KEY (DEVICE_ID) REFERENCES CONSTRAINT fk_dm_device_enrolment 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 uk_dm_device_enrolment UNIQUE (DEVICE_ID, OWNER, OWNERSHIP, TENANT_ID) CONSTRAINT uk_dm_device_enrolment UNIQUE (DEVICE_ID, OWNER, OWNERSHIP, TENANT_ID)
); );
CREATE TABLE IF NOT EXISTS DM_DEVICE_STATUS (
ID INTEGER AUTO_INCREMENT NOT NULL,
ENROLMENT_ID INTEGER NOT NULL,
DEVICE_ID INTEGER NOT NULL,
STATUS VARCHAR(50) DEFAULT NULL,
UPDATE_TIME TIMESTAMP DEFAULT NULL,
CHANGED_BY VARCHAR(255) NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT fk_dm_device_status_device FOREIGN KEY (DEVICE_ID) REFERENCES
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT fk_dm_device_status_enrolment FOREIGN KEY (ENROLMENT_ID) REFERENCES
DM_ENROLMENT (ID) ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE TABLE IF NOT EXISTS DM_ENROLMENT_OP_MAPPING ( CREATE TABLE IF NOT EXISTS DM_ENROLMENT_OP_MAPPING (
ID INTEGER AUTO_INCREMENT NOT NULL, ID INTEGER AUTO_INCREMENT NOT NULL,
ENROLMENT_ID INTEGER NOT NULL, ENROLMENT_ID INTEGER NOT NULL,
@ -129,6 +141,13 @@ CREATE TABLE IF NOT EXISTS DM_ENROLMENT_OP_MAPPING (
PUSH_NOTIFICATION_STATUS VARCHAR(50) NULL, PUSH_NOTIFICATION_STATUS VARCHAR(50) NULL,
CREATED_TIMESTAMP INT NOT NULL, CREATED_TIMESTAMP INT NOT NULL,
UPDATED_TIMESTAMP INT NOT NULL, UPDATED_TIMESTAMP INT NOT NULL,
OPERATION_CODE VARCHAR(50) NOT NULL,
INITIATED_BY VARCHAR(100) NULL,
TYPE VARCHAR(20) NOT NULL,
DEVICE_ID INTEGER DEFAULT NULL,
DEVICE_TYPE VARCHAR(300) NOT NULL,
DEVICE_IDENTIFICATION VARCHAR(300) DEFAULT NULL,
TENANT_ID INTEGER DEFAULT 0,
PRIMARY KEY (ID), PRIMARY KEY (ID),
CONSTRAINT fk_dm_device_operation_mapping_device FOREIGN KEY (ENROLMENT_ID) REFERENCES CONSTRAINT fk_dm_device_operation_mapping_device FOREIGN KEY (ENROLMENT_ID) REFERENCES
DM_ENROLMENT (ID) ON DELETE NO ACTION ON UPDATE NO ACTION, DM_ENROLMENT (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
@ -141,7 +160,8 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_OPERATION_RESPONSE (
ENROLMENT_ID INTEGER NOT NULL, ENROLMENT_ID INTEGER NOT NULL,
OPERATION_ID INTEGER NOT NULL, OPERATION_ID INTEGER NOT NULL,
EN_OP_MAP_ID INTEGER NOT NULL, EN_OP_MAP_ID INTEGER NOT NULL,
OPERATION_RESPONSE LONGBLOB DEFAULT NULL, OPERATION_RESPONSE VARCHAR(1024) DEFAULT NULL ,
IS_LARGE_RESPONSE BOOLEAN NOT NULL DEFAULT FALSE,
RECEIVED_TIMESTAMP TIMESTAMP NULL, RECEIVED_TIMESTAMP TIMESTAMP NULL,
PRIMARY KEY (ID), PRIMARY KEY (ID),
CONSTRAINT fk_dm_device_operation_response_enrollment FOREIGN KEY (ENROLMENT_ID) REFERENCES CONSTRAINT fk_dm_device_operation_response_enrollment FOREIGN KEY (ENROLMENT_ID) REFERENCES
@ -152,6 +172,21 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_OPERATION_RESPONSE (
DM_ENROLMENT_OP_MAPPING (ID) ON DELETE NO ACTION ON UPDATE NO ACTION DM_ENROLMENT_OP_MAPPING (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
); );
CREATE TABLE DM_DEVICE_OPERATION_RESPONSE_LARGE (
ID INTEGER NOT NULL,
OPERATION_RESPONSE LONGBLOB DEFAULT NULL,
OPERATION_ID INTEGER NOT NULL,
EN_OP_MAP_ID INTEGER NOT NULL,
RECEIVED_TIMESTAMP TIMESTAMP NULL,
DEVICE_IDENTIFICATION VARCHAR(300) DEFAULT NULL,
CONSTRAINT fk_dm_device_operation_response_large_mapping FOREIGN KEY (ID)
REFERENCES DM_DEVICE_OPERATION_RESPONSE (ID)
ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT fk_dm_en_op_map_response_large FOREIGN KEY (EN_OP_MAP_ID)
REFERENCES DM_ENROLMENT_OP_MAPPING (ID)
ON DELETE NO ACTION ON UPDATE NO ACTION
);
-- POLICY RELATED TABLES -- -- POLICY RELATED TABLES --
CREATE TABLE IF NOT EXISTS DM_PROFILE ( CREATE TABLE IF NOT EXISTS DM_PROFILE (
@ -168,6 +203,7 @@ CREATE TABLE IF NOT EXISTS DM_POLICY (
ID INT(11) NOT NULL AUTO_INCREMENT , ID INT(11) NOT NULL AUTO_INCREMENT ,
NAME VARCHAR(45) DEFAULT NULL , NAME VARCHAR(45) DEFAULT NULL ,
DESCRIPTION VARCHAR(1000) NULL, DESCRIPTION VARCHAR(1000) NULL,
PAYLOAD_VERSION VARCHAR (45) NULL,
TENANT_ID INT(11) NOT NULL , TENANT_ID INT(11) NOT NULL ,
PROFILE_ID INT(11) NOT NULL , PROFILE_ID INT(11) NOT NULL ,
OWNERSHIP_TYPE VARCHAR(45) NULL, OWNERSHIP_TYPE VARCHAR(45) NULL,
@ -175,6 +211,7 @@ CREATE TABLE IF NOT EXISTS DM_POLICY (
PRIORITY INT NOT NULL, PRIORITY INT NOT NULL,
ACTIVE INT(2) NOT NULL, ACTIVE INT(2) NOT NULL,
UPDATED INT(1) NULL, UPDATED INT(1) NULL,
POLICY_TYPE VARCHAR(45) NULL,
PRIMARY KEY (ID) , PRIMARY KEY (ID) ,
CONSTRAINT FK_DM_PROFILE_DM_POLICY CONSTRAINT FK_DM_PROFILE_DM_POLICY
FOREIGN KEY (PROFILE_ID ) FOREIGN KEY (PROFILE_ID )
@ -229,6 +266,21 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE_FEATURES (
ON UPDATE NO ACTION ON UPDATE NO ACTION
); );
CREATE TABLE IF NOT EXISTS DM_POLICY_CORRECTIVE_ACTION (
ID INT(11) NOT NULL AUTO_INCREMENT,
ACTION_TYPE VARCHAR(45) NOT NULL,
CORRECTIVE_POLICY_ID INT(11) DEFAULT NULL,
POLICY_ID INT(11) NOT NULL,
FEATURE_ID INT(11) DEFAULT NULL,
IS_REACTIVE BOOLEAN NOT NULL DEFAULT FALSE,
PRIMARY KEY (ID),
CONSTRAINT FK_DM_POLICY_DM_POLICY_CORRECTIVE_ACTION
FOREIGN KEY (POLICY_ID)
REFERENCES DM_POLICY (ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
CREATE TABLE IF NOT EXISTS DM_ROLE_POLICY ( CREATE TABLE IF NOT EXISTS DM_ROLE_POLICY (
ID INT(11) NOT NULL AUTO_INCREMENT , ID INT(11) NOT NULL AUTO_INCREMENT ,
ROLE_NAME VARCHAR(45) NOT NULL , ROLE_NAME VARCHAR(45) NOT NULL ,
@ -301,7 +353,7 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_CRITERIA_PROPERTIES (
POLICY_CRITERION_ID INT NOT NULL, POLICY_CRITERION_ID INT NOT NULL,
PROP_KEY VARCHAR(45) NULL, PROP_KEY VARCHAR(45) NULL,
PROP_VALUE VARCHAR(100) NULL, PROP_VALUE VARCHAR(100) NULL,
CONTENT BLOB NULL COMMENT 'This is used to ', CONTENT BLOB NULL,
PRIMARY KEY (ID), PRIMARY KEY (ID),
CONSTRAINT FK_POLICY_CRITERIA_PROPERTIES CONSTRAINT FK_POLICY_CRITERIA_PROPERTIES
FOREIGN KEY (POLICY_CRITERION_ID) FOREIGN KEY (POLICY_CRITERION_ID)
@ -359,20 +411,20 @@ CREATE TABLE IF NOT EXISTS DM_APPLICATION (
APP_PROPERTIES BLOB NULL, APP_PROPERTIES BLOB NULL,
MEMORY_USAGE INTEGER(10) NULL, MEMORY_USAGE INTEGER(10) NULL,
IS_ACTIVE BOOLEAN NOT NULL DEFAULT FALSE, IS_ACTIVE BOOLEAN NOT NULL DEFAULT FALSE,
TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (ID)
);
CREATE TABLE IF NOT EXISTS DM_DEVICE_APPLICATION_MAPPING (
ID INTEGER AUTO_INCREMENT NOT NULL,
DEVICE_ID INTEGER NOT NULL, DEVICE_ID INTEGER NOT NULL,
APPLICATION_ID INTEGER NOT NULL, ENROLMENT_ID INTEGER NOT NULL,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (ID), PRIMARY KEY (ID),
CONSTRAINT fk_dm_device FOREIGN KEY (DEVICE_ID) REFERENCES CONSTRAINT fk_dm_device
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION, FOREIGN KEY (DEVICE_ID)
CONSTRAINT fk_dm_application FOREIGN KEY (APPLICATION_ID) REFERENCES REFERENCES DM_DEVICE (ID)
DM_APPLICATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT fk_dm_enrolement
FOREIGN KEY (ENROLMENT_ID)
REFERENCES DM_ENROLMENT (ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION
); );
-- POLICY RELATED TABLES FINISHED -- -- POLICY RELATED TABLES FINISHED --
@ -381,34 +433,42 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_APPLICATION_MAPPING (
CREATE TABLE IF NOT EXISTS DM_NOTIFICATION ( CREATE TABLE IF NOT EXISTS DM_NOTIFICATION (
NOTIFICATION_ID INTEGER AUTO_INCREMENT NOT NULL, NOTIFICATION_ID INTEGER AUTO_INCREMENT NOT NULL,
DEVICE_ID INTEGER NOT NULL, DEVICE_ID INTEGER NOT NULL,
OPERATION_ID INTEGER NOT NULL, OPERATION_ID INTEGER NULL,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
STATUS VARCHAR(10) NULL, STATUS VARCHAR(10) NULL,
DESCRIPTION VARCHAR(1000) NULL, DESCRIPTION VARCHAR(1000) NULL,
LAST_UPDATED_TIMESTAMP TIMESTAMP NOT 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
CONSTRAINT fk_dm_operation_notification FOREIGN KEY (OPERATION_ID) REFERENCES
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
); );
-- NOTIFICATION TABLE END -- -- NOTIFICATION TABLE END --
CREATE TABLE IF NOT EXISTS DM_DEVICE_INFO ( CREATE TABLE IF NOT EXISTS DM_DEVICE_INFO (
ID INTEGER AUTO_INCREMENT NOT NULL, ID INTEGER AUTO_INCREMENT NOT NULL,
DEVICE_ID INT NULL, DEVICE_ID INT NULL,
ENROLMENT_ID INT NOT NULL,
KEY_FIELD VARCHAR(45) NULL, KEY_FIELD VARCHAR(45) NULL,
VALUE_FIELD VARCHAR(100) NULL, VALUE_FIELD VARCHAR(1500) NULL,
PRIMARY KEY (ID), PRIMARY KEY (ID),
CONSTRAINT DM_DEVICE_INFO_DEVICE CONSTRAINT DM_DEVICE_INFO_DEVICE
FOREIGN KEY (DEVICE_ID) FOREIGN KEY (DEVICE_ID)
REFERENCES DM_DEVICE (ID) REFERENCES DM_DEVICE (ID)
ON DELETE NO ACTION ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT DM_DEVICE_INFO_DEVICE_ENROLLMENT
FOREIGN KEY (ENROLMENT_ID)
REFERENCES DM_ENROLMENT (ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION ON UPDATE NO ACTION
); );
CREATE INDEX IDX_DM_DEVICE_INFO_DID_EID_KFIELD ON DM_DEVICE_INFO(DEVICE_ID, ENROLMENT_ID, KEY_FIELD);
CREATE TABLE IF NOT EXISTS DM_DEVICE_LOCATION ( CREATE TABLE IF NOT EXISTS DM_DEVICE_LOCATION (
ID INTEGER AUTO_INCREMENT NOT NULL, ID INTEGER AUTO_INCREMENT NOT NULL,
DEVICE_ID INT NULL, DEVICE_ID INT NULL,
ENROLMENT_ID INT NOT NULL,
LATITUDE DOUBLE NULL, LATITUDE DOUBLE NULL,
LONGITUDE DOUBLE NULL, LONGITUDE DOUBLE NULL,
STREET1 VARCHAR(255) NULL, STREET1 VARCHAR(255) NULL,
@ -417,18 +477,30 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_LOCATION (
ZIP VARCHAR(10) NULL, ZIP VARCHAR(10) NULL,
STATE VARCHAR(45) NULL, STATE VARCHAR(45) NULL,
COUNTRY VARCHAR(45) NULL, COUNTRY VARCHAR(45) NULL,
GEO_HASH VARCHAR(45) NULL,
UPDATE_TIMESTAMP BIGINT(15) NOT NULL, UPDATE_TIMESTAMP BIGINT(15) NOT NULL,
ALTITUDE DOUBLE NULL,
SPEED FLOAT NULL,
BEARING FLOAT NULL,
DISTANCE DOUBLE NULL,
PRIMARY KEY (ID), PRIMARY KEY (ID),
CONSTRAINT DM_DEVICE_LOCATION_DEVICE CONSTRAINT DM_DEVICE_LOCATION_DEVICE
FOREIGN KEY (DEVICE_ID) FOREIGN KEY (DEVICE_ID)
REFERENCES DM_DEVICE (ID) REFERENCES DM_DEVICE (ID)
ON DELETE NO ACTION ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT DM_DEVICE_LOCATION_DM_ENROLLMENT
FOREIGN KEY (ENROLMENT_ID)
REFERENCES DM_ENROLMENT (ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION ON UPDATE NO ACTION
); );
CREATE INDEX DM_DEVICE_LOCATION_GEO_hashx ON DM_DEVICE_LOCATION(GEO_HASH ASC);
CREATE TABLE IF NOT EXISTS DM_DEVICE_DETAIL ( CREATE TABLE IF NOT EXISTS DM_DEVICE_DETAIL (
ID INT NOT NULL AUTO_INCREMENT, ID INT NOT NULL AUTO_INCREMENT,
DEVICE_ID INT NOT NULL, DEVICE_ID INT NOT NULL,
ENROLMENT_ID INT NOT NULL,
DEVICE_MODEL VARCHAR(45) NULL, DEVICE_MODEL VARCHAR(45) NULL,
VENDOR VARCHAR(45) NULL, VENDOR VARCHAR(45) NULL,
OS_VERSION VARCHAR(45) NULL, OS_VERSION VARCHAR(45) NULL,
@ -450,9 +522,35 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_DETAIL (
FOREIGN KEY (DEVICE_ID) FOREIGN KEY (DEVICE_ID)
REFERENCES DM_DEVICE (ID) REFERENCES DM_DEVICE (ID)
ON DELETE NO ACTION ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT FK_DM_ENROLMENT_DEVICE_DETAILS
FOREIGN KEY (ENROLMENT_ID)
REFERENCES DM_ENROLMENT (ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION ON UPDATE NO ACTION
); );
CREATE INDEX IDX_DM_DEVICE_DETAIL_DID_EID ON DM_DEVICE_DETAIL(DEVICE_ID, ENROLMENT_ID);
CREATE TABLE IF NOT EXISTS DM_DEVICE_HISTORY_LAST_SEVEN_DAYS
(
ID INTEGER AUTO_INCREMENT NOT NULL,
DEVICE_ID INT NOT NULL,
DEVICE_ID_NAME VARCHAR(255) NOT NULL,
TENANT_ID INT NOT NULL,
DEVICE_TYPE_NAME VARCHAR(45) NOT NULL,
LATITUDE DOUBLE NULL,
LONGITUDE DOUBLE NULL,
SPEED FLOAT NULL,
HEADING FLOAT NULL,
TIMESTAMP BIGINT(15) NOT NULL,
GEO_HASH VARCHAR(45) NULL,
DEVICE_OWNER VARCHAR(45) NULL,
DEVICE_ALTITUDE DOUBLE NULL,
DISTANCE DOUBLE NULL,
PRIMARY KEY (ID)
);
-- POLICY AND DEVICE GROUP MAPPING -- -- POLICY AND DEVICE GROUP MAPPING --
CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_POLICY ( CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_POLICY (
ID INT NOT NULL AUTO_INCREMENT, ID INT NOT NULL AUTO_INCREMENT,
@ -473,6 +571,52 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_POLICY (
); );
-- END OF POLICY AND DEVICE GROUP MAPPING -- -- END OF POLICY AND DEVICE GROUP MAPPING --
CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE_PLATFORM (
ID INT NOT NULL AUTO_INCREMENT,
DEVICE_TYPE_ID INT NULL DEFAULT 0,
VERSION_NAME VARCHAR(100) NULL,
VERSION_STATUS VARCHAR(100) NULL DEFAULT 'ACTIVE',
PRIMARY KEY (ID),
CONSTRAINT DM_DEVICE_TYPE_DM_DEVICE_TYPE_PLATFORM_MAPPING
FOREIGN KEY (DEVICE_TYPE_ID)
REFERENCES DM_DEVICE_TYPE (ID) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT device_type_version_uk
UNIQUE (
DEVICE_TYPE_ID,
VERSION_NAME
)
);
-- METADATA TABLE --
CREATE TABLE IF NOT EXISTS DM_METADATA (
METADATA_ID INT AUTO_INCREMENT NOT NULL,
DATA_TYPE VARCHAR(16) NOT NULL,
METADATA_KEY VARCHAR(128) NOT NULL,
METADATA_VALUE VARCHAR(8000) NOT NULL,
TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (METADATA_ID),
CONSTRAINT METADATA_KEY_TENANT_ID UNIQUE (METADATA_KEY, TENANT_ID)
);
-- END OF METADATA TABLE --
-- DM_OTP_DATA TABLE --
CREATE TABLE IF NOT EXISTS DM_OTP_DATA (
ID INT AUTO_INCREMENT NOT NULL,
OTP_TOKEN VARCHAR(100) NOT NULL,
TENANT_ID INT NOT NULL,
USERNAME VARCHAR(500) DEFAULT NOT NULL,
EMAIL VARCHAR(100) NOT NULL,
EMAIL_TYPE VARCHAR(20) NOT NULL,
META_INFO VARCHAR(20000) NOT NULL,
CREATED_AT TIMESTAMP NOT NULL,
EXPIRY_TIME INT NOT NULL DEFAULT 3600,
IS_EXPIRED BOOLEAN DEFAULT false,
PRIMARY KEY (ID),
CONSTRAINT email_type_uk UNIQUE (EMAIL, EMAIL_TYPE)
);
-- END OF DM_OTP_DATA TABLE --
-- DASHBOARD RELATED VIEWS -- -- DASHBOARD RELATED VIEWS --
CREATE VIEW POLICY_COMPLIANCE_INFO AS CREATE VIEW POLICY_COMPLIANCE_INFO AS
SELECT SELECT
@ -529,3 +673,107 @@ DM_DEVICE.ID = DM_DEVICE_DETAIL.DEVICE_ID
ORDER BY TENANT_ID, DEVICE_ID; ORDER BY TENANT_ID, DEVICE_ID;
-- END OF DASHBOARD RELATED VIEWS -- -- END OF DASHBOARD RELATED VIEWS --
-- DM_GEOFENCE TABLE--
CREATE TABLE IF NOT EXISTS DM_GEOFENCE (
ID INT NOT NULL AUTO_INCREMENT,
FENCE_NAME VARCHAR(255) NOT NULL,
DESCRIPTION TEXT DEFAULT NULL,
LATITUDE DOUBLE DEFAULT NULL,
LONGITUDE DOUBLE DEFAULT NULL,
RADIUS DOUBLE DEFAULT NULL,
GEO_JSON TEXT DEFAULT NULL,
FENCE_SHAPE VARCHAR(100) DEFAULT NULL,
CREATED_TIMESTAMP TIMESTAMP NOT NULL,
OWNER VARCHAR(255) NOT NULL,
TENANT_ID INTEGER DEFAULT 0,
PRIMARY KEY (ID)
);
-- END OF DM_GEOFENCE TABLE--
-- DM_GEOFENCE_GROUP_MAPPING TABLE--
CREATE TABLE IF NOT EXISTS DM_GEOFENCE_GROUP_MAPPING (
ID INT NOT NULL AUTO_INCREMENT,
FENCE_ID INT NOT NULL,
GROUP_ID INT NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT fk_dm_geofence_group_mapping_geofence FOREIGN KEY (FENCE_ID) REFERENCES
DM_GEOFENCE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT fk_dm_geofence_group_mapping_group FOREIGN KEY (GROUP_ID) REFERENCES
DM_GROUP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
-- END OF DM_GEOFENCE_GROUP_MAPPING TABLE--
-- DM_DEVICE_EVENT TABLE --
CREATE TABLE IF NOT EXISTS DM_DEVICE_EVENT (
ID INT NOT NULL AUTO_INCREMENT,
EVENT_SOURCE VARCHAR(100) NOT NULL,
EVENT_LOGIC VARCHAR(100) NOT NULL,
ACTIONS TEXT DEFAULT NULL,
CREATED_TIMESTAMP TIMESTAMP NOT NULL,
TENANT_ID INTEGER DEFAULT 0,
PRIMARY KEY (ID)
);
-- END OF DM_DEVICE_EVENT TABLE --
-- DM_DEVICE_EVENT_GROUP_MAPPING TABLE--
CREATE TABLE IF NOT EXISTS DM_DEVICE_EVENT_GROUP_MAPPING (
ID INT NOT NULL AUTO_INCREMENT,
EVENT_ID INT NOT NULL,
GROUP_ID INT NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT fk_dm_event_group_mapping_event FOREIGN KEY (EVENT_ID) REFERENCES
DM_DEVICE_EVENT (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT fk_dm_event_group_mapping_group FOREIGN KEY (GROUP_ID) REFERENCES
DM_GROUP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
-- END OF DM_DEVICE_EVENT_GROUP_MAPPING TABLE--
-- DM_GEOFENCE_GROUP_MAPPING TABLE--
CREATE TABLE IF NOT EXISTS DM_GEOFENCE_EVENT_MAPPING (
ID INT NOT NULL AUTO_INCREMENT,
FENCE_ID INT NOT NULL,
EVENT_ID INT NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT fk_dm_geofence_event_mapping_geofence FOREIGN KEY (FENCE_ID) REFERENCES
DM_GEOFENCE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT fk_dm_geofence_event_mapping_event FOREIGN KEY (EVENT_ID) REFERENCES
DM_DEVICE_EVENT (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
-- END OF DM_GEOFENCE_GROUP_MAPPING TABLE--
-- DM_EXT_GROUP_MAPPING TABLE--
CREATE TABLE IF NOT EXISTS DM_EXT_GROUP_MAPPING (
ID INT NOT NULL AUTO_INCREMENT,
TRACCAR_GROUP_ID INT DEFAULT 0,
GROUP_ID INT NOT NULL,
TENANT_ID INT NOT NULL,
STATUS INT DEFAULT 0,
PRIMARY KEY (ID)
);
-- END OF DM_EXT_GROUP_MAPPING TABLE--
-- END OF DM_EXT_DEVICE_MAPPING TABLE--
CREATE TABLE IF NOT EXISTS DM_EXT_DEVICE_MAPPING (
ID INT NOT NULL AUTO_INCREMENT,
TRACCAR_DEVICE_ID INT DEFAULT 0,
DEVICE_ID INT NOT NULL,
TENANT_ID INT NOT NULL,
STATUS INT DEFAULT 0,
PRIMARY KEY (ID)
);
-- END OF DM_EXT_DEVICE_MAPPING TABLE--
-- END OF DM_EXT_PERMISSION_MAPPING TABLE--
CREATE TABLE IF NOT EXISTS DM_EXT_PERMISSION_MAPPING (
TRACCAR_DEVICE_ID INT DEFAULT 0,
TRACCAR_USER_ID INT DEFAULT 0
);
-- END OF DM_EXT_PERMISSION_MAPPING TABLE--

@ -1,5 +1,5 @@
<!-- <!--
~ Copyright (c) 2005-2011, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. ~ Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ ~
~ WSO2 Inc. licenses this file to you under the Apache License, ~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except ~ Version 2.0 (the "License"); you may not use this file except
@ -16,75 +16,55 @@
~ under the License. ~ under the License.
--> -->
<UserManager> <UserManager>
<Realm> <Realm>
<Configuration> <Configuration>
<AddAdmin>true</AddAdmin> <AddAdmin>true</AddAdmin>
<AdminRole>admin</AdminRole> <AdminRole>admin</AdminRole>
<AdminUser> <AdminUser>
<UserName>admin</UserName> <UserName>admin</UserName>
<Password>admin</Password> <Password>admin</Password>
</AdminUser> </AdminUser>
<EveryOneRoleName>everyone</EveryOneRoleName> <EveryOneRoleName>everyone</EveryOneRoleName>
<ReadOnly>false</ReadOnly> <ReadOnly>false</ReadOnly>
<MaxUserNameListLength>500</MaxUserNameListLength> <MaxUserNameListLength>500</MaxUserNameListLength>
<Property name="url">jdbc:h2:target/databasetest/CARBON_TEST</Property> <Property name="url">jdbc:h2:./target/databasetest/CARBON_TEST</Property>
<Property name="driverName">org.h2.Driver</Property> <Property name="driverName">org.h2.Driver</Property>
<Property name="maxActive">50</Property> <Property name="maxActive">50</Property>
<Property name="maxWait">60000</Property> <Property name="maxWait">60000</Property>
<Property name="minIdle">5</Property> <Property name="minIdle">5</Property>
</Configuration> </Configuration>
<UserStoreManager <UserStoreManager class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager"> <Property name="TenantManager">org.wso2.carbon.user.core.tenant.JDBCTenantManager</Property>
<Property name="PasswordJavaRegEx">[\S]{5,30}$</Property> <Property name="ReadOnly">false</Property>
<Property name="PasswordJavaScriptRegEx">[\\S]{5,30}</Property> <Property name="MaxUserNameListLength">100</Property>
<Property name="SelectUserSQL">SELECT * FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property> <Property name="IsEmailUserName">false</Property>
<!--<Property name="GetRoleListSQL">SELECT UM_ROLE_NAME FROM UM_ROLE WHERE UM_TENANT_ID=?</Property>--> <Property name="DomainCalculation">default</Property>
<!--<Property name="UserFilterSQL">SELECT UM_USER_NAME FROM UM_USER WHERE UM_USER_NAME LIKE ? AND UM_TENANT_ID=? ORDER BY UM_USER_NAME</Property>-->
<!--<Property name="UserRoleSQL">SELECT UM_ROLE_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_USER.UM_USER_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>-->
<!--<Property name="IsRoleExistingSQL">SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?</Property>-->
<!--<Property name="IsUserExistingSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>-->
<!--<Property name="GetUserListOfRoleSQL">SELECT UM_USER_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_ROLE.UM_ROLE_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>-->
<!--<Property name="GetUserPropertyForProfileSQL">SELECT UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>-->
<!--<Property name="GetUserPropertiesForProfileSQL">SELECT UM_ATTR_NAME, UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>-->
<!--<Property name="GetProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_TENANT_ID=?</Property>-->
<!--<Property name="GetUserProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>-->
<!--<Property name="GetUsersWithDefaultPasswordsSQL">SELECT UM_USER_NAME FROM UM_USER WHERE WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>-->
<!--<Property name="UserNameUniqueAcrossTenantsSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>-->
<!--<Property name="GetUserIDFromUserNameSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>-->
<!--<Property name="GetUserNameFromTenantIDSQL">SELECT UM_USER_NAME FROM UM_USER WHERE UM_TENANT_ID=?</Property>-->
<!--<Property name="GetTenantIDFromUserNameSQL">SELECT UM_TENANT_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>-->
<Property name="PasswordDigest">SHA-256</Property> <Property name="PasswordDigest">SHA-256</Property>
<Property name="StoreSaltedPassword">true</Property> <Property name="StoreSaltedPassword">true</Property>
<Property name="ReadGroups">true</Property>
<Property name="WriteGroups">true</Property>
<Property name="UserNameUniqueAcrossTenants">false</Property> <Property name="UserNameUniqueAcrossTenants">false</Property>
<Property name="IsEmailUserName">false</Property> <Property name="PasswordJavaRegEx">^[\S]{5,30}$</Property>
<Property name="SuperDomain">wso2.com</Property> <Property name="PasswordJavaRegExViolationErrorMsg">Password length should be between 5 to 30 characters
<Property name="IsUsersOfRoleListing">true</Property> </Property>
<Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
<Property name="UsernameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
<Property name="UsernameJavaScriptRegEx">^[\S]{3,30}$</Property>
<Property name="RolenameJavaRegEx">^[^~!#$;%^*+={}\\|\\\\&lt;&gt;,\'\"]{3,30}$</Property>
<Property name="RolenameJavaScriptRegEx">^[\S]{3,30}$</Property>
<Property name="UserRolesCacheEnabled">true</Property>
<Property name="MaxRoleNameListLength">100</Property>
<Property name="MaxUserNameListLength">100</Property> <Property name="MaxUserNameListLength">100</Property>
<!-- writing sqls follow--> <Property name="SharedGroupEnabled">false</Property>
<!--<Property name="AddUserSQL">INSERT INTO UM_USER (UM_USER_NAME, UM_USER_PASSWORD, UM_SALT_VALUE, UM_REQUIRE_CHANGE, UM_CHANGED_TIME, UM_TENANT_ID) VALUES (?, ?, ?, ?, ?, ?)</Property>--> <Property name="SCIMEnabled">false</Property>
<Property name="AddRoleSQL">INSERT INTO UM_ROLE (UM_ROLE_NAME, UM_TENANT_ID) VALUES (?, ?)</Property> <Property name="CaseSensitiveUsername">true</Property>
<!--<Property name="AddUserToRoleSQL">INSERT INTO UM_USER_ROLE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?), ?)</Property>--> <Property name="MultiAttributeSeparator">,</Property>
<!--<Property name="AddUserToRoleSQL-mssql">INSERT INTO UM_USER_ROLE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(?)</Property>--> <Property name="BulkImportSupported">true</Property>
<!--<Property name="RemoveUserFromRoleSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>--> </UserStoreManager>
<!--<Property name="AddRoleToUserSQL">INSERT INTO UM_USER_ROLE (UM_ROLE_ID, UM_USER_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?)</Property>-->
<!--<Property name="AddRoleToUserSQL-mssql">INSERT INTO UM_USER_ROLE (UM_ROLE_ID, UM_USER_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), (?)</Property>-->
<!--<Property name="RemoveRoleFromUserSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>-->
<!--<Property name="DeleteRoleSQL">DELETE FROM UM_ROLE WHERE UM_ROLE_NAME = ? AND UM_TENANT_ID=?</Property>-->
<!--<Property name="OnDeleteRoleRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>-->
<!--<Property name="OnDeleteUserRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>-->
<!--<Property name="OnDeleteUserRemoveUserAttributeSQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>-->
<!--<Property name="DeleteUserSQL">DELETE FROM UM_USER WHERE UM_USER_NAME = ? AND UM_TENANT_ID=?</Property>-->
<!--<Property name="UpdateUserPasswordSQL">UPDATE UM_USER SET UM_USER_PASSWORD= ?, UM_SALT_VALUE=?, UM_REQUIRE_CHANGE=?, UM_CHANGED_TIME=? WHERE UM_USER_NAME= ? AND UM_TENANT_ID=?</Property>-->
<!--<Property name="AddUserPropertySQL">INSERT INTO UM_USER_ATTRIBUTE (UM_USER_ID, UM_ATTR_NAME, UM_ATTR_VALUE, UM_PROFILE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?, ?, ?, ?)</Property>-->
<!--<Property name="AddUserPropertySQL-mssql">INSERT INTO UM_USER_ATTRIBUTE (UM_USER_ID, UM_ATTR_NAME, UM_ATTR_VALUE, UM_PROFILE_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), (?), (?), (?), (?)</Property>-->
<!--<Property name="UpdateUserPropertySQL">UPDATE UM_USER_ATTRIBUTE SET UM_ATTR_VALUE=? WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>-->
<!--<Property name="DeleteUserPropertySQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>-->
<Property name="TenantManager">org.wso2.carbon.user.core.tenant.JDBCTenantManager</Property>
</UserStoreManager>
<AuthorizationManager <AuthorizationManager
class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager"> class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager">
<Property name="AuthorizationCacheEnabled">true</Property> <Property name="AuthorizationCacheEnabled">true</Property>
</AuthorizationManager> </AuthorizationManager>
</Realm> </Realm>
<SystemPermission> <SystemPermission>
<Permission>login</Permission> <Permission>login</Permission>
@ -98,4 +78,3 @@
<Permission>delegate-identity</Permission> <Permission>delegate-identity</Permission>
</SystemPermission> </SystemPermission>
</UserManager> </UserManager>

@ -20,7 +20,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId> <groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>siddhi-extensions</artifactId> <artifactId>siddhi-extensions</artifactId>
<version>6.0.11-SNAPSHOT</version> <version>6.0.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId> <groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId> <artifactId>extensions</artifactId>
<version>6.0.11-SNAPSHOT</version> <version>6.0.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -20,7 +20,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId> <groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId> <artifactId>extensions-feature</artifactId>
<version>6.0.11-SNAPSHOT</version> <version>6.0.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -20,13 +20,12 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId> <groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId> <artifactId>extensions-feature</artifactId>
<version>6.0.11-SNAPSHOT</version> <version>6.0.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>org.wso2.extension.siddhi.execution.json.feature</artifactId> <artifactId>org.wso2.extension.siddhi.execution.json.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>4.1.21-SNAPSHOT</version>
<name>WSO2 Siddhi Execution Extension - Json Feature</name> <name>WSO2 Siddhi Execution Extension - Json Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains Siddhi extension feature for changing a json string to individual properties.</description> <description>This feature contains Siddhi extension feature for changing a json string to individual properties.</description>

@ -37,12 +37,9 @@
<modules> <modules>
<module>components/extensions</module> <module>components/extensions</module>
<module>components/mobile-plugins</module> <module>components/mobile-plugins</module>
<!--<module>components/device-types</module>-->
<!--<module>components/analytics</module>-->
<!--<module>components/test-coverage</module>--> <!--<module>components/test-coverage</module>-->
<!--<module>features/analytics-feature</module>--> <!--<module>features/analytics-feature</module>-->
<module>features/mobile-plugins-feature</module> <module>features/mobile-plugins-feature</module>
<!--<module>features/device-types-feature</module>-->
<module>features/extensions-feature</module> <module>features/extensions-feature</module>
</modules> </modules>

Loading…
Cancel
Save