diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/DeviceTypeDeployer.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/DeviceTypeDeployer.java index 2ace9f4970..5bfe3e5f9c 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/DeviceTypeDeployer.java +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/DeviceTypeDeployer.java @@ -31,7 +31,7 @@ import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.DeviceManagementConfiguration; import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.exception.DeviceTypeConfigurationException; -import org.wso2.carbon.device.mgt.extensions.push.notification.provider.internal.DeviceTypeManagementDataHolder; +import org.wso2.carbon.device.mgt.extensions.device.type.deployer.internal.DeviceTypeManagementDataHolder; import org.wso2.carbon.device.mgt.extensions.device.type.deployer.template.DeviceTypeConfigIdentifier; import org.wso2.carbon.device.mgt.extensions.device.type.deployer.template.DeviceTypeManagerService; import org.wso2.carbon.device.mgt.extensions.device.type.deployer.util.DeviceTypeConfigUtil; @@ -125,7 +125,7 @@ public class DeviceTypeDeployer extends AbstractDeployer { private void unregisterDeviceType(String filePath) { if (log.isDebugEnabled()) { - log.debug("De-activating Virtual Firealarm Device Management Service Component"); + log.debug("De-activating Device Management Service."); } try { if (this.deviceTypeServiceRegistrations.get(filePath) != null) { diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/Attribute.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/Attribute.java new file mode 100644 index 0000000000..d57ea91fee --- /dev/null +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/Attribute.java @@ -0,0 +1,59 @@ + +package org.wso2.carbon.device.mgt.extensions.device.type.deployer.config; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; + + +/** + *
Java class for Attribute complex type. + * + *
The following schema fragment specifies the expected content contained within this class. + * + *
+ * <complexType name="Attribute"> + * <simpleContent> + * <extension base="<http://www.w3.org/2001/XMLSchema>string"> + * <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" /> + * </extension> + * </simpleContent> + * </complexType> + *+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +public class Attribute { + + @XmlValue + protected String value; + + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + +} diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/Attributes.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/Attributes.java new file mode 100644 index 0000000000..561f9c1d3d --- /dev/null +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/Attributes.java @@ -0,0 +1,69 @@ + +package org.wso2.carbon.device.mgt.extensions.device.type.deployer.config; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *
Java class for Attributes complex type. + * + *
The following schema fragment specifies the expected content contained within this class. + * + *
+ * <complexType name="Attributes"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="Attribute" type="{}Attribute" maxOccurs="unbounded" minOccurs="0"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + *+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Attributes", propOrder = { + "attribute" +}) +public class Attributes { + + @XmlElement(name = "Attribute") + protected List
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a set
method for the attribute property.
+ *
+ *
+ * For example, to add a new item, do as follows: + *
+ * getAttribute().add(newItem); + *+ * + * + *
+ * Objects of the following type(s) are allowed in the list
+ * {@link Attribute }
+ *
+ *
+ */
+ public List Java class for DataSourceConfiguration complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * Java class for DeviceDefinition complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * Java class for DeviceManagementConfiguration complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * Java class for Feature complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * Java class for Features complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a
+ * For example, to add a new item, do as follows:
+ *
+ * Objects of the following type(s) are allowed in the list
+ * {@link Feature }
+ *
+ *
+ */
+ public List Java class for JndiLookupDefinition complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * Java class for License complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * Java class for ManagementRepository complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * Java class for Properties complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a
+ * For example, to add a new item, do as follows:
+ *
+ * Objects of the following type(s) are allowed in the list
+ * {@link Property }
+ *
+ *
+ */
+ public List Java class for Property complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * Java class for ProvisioningConfig complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * Java class for PushNotificationConfiguration complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ * <complexType name="DataSourceConfiguration">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="JndiLookupDefinition" type="{}JndiLookupDefinition"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "DataSourceConfiguration", propOrder = {
+ "jndiLookupDefinition"
+})
+public class DataSourceConfiguration {
+
+ @XmlElement(name = "JndiLookupDefinition", required = true)
+ protected JndiLookupDefinition jndiLookupDefinition;
+
+ /**
+ * Gets the value of the jndiLookupDefinition property.
+ *
+ * @return
+ * possible object is
+ * {@link JndiLookupDefinition }
+ *
+ */
+ public JndiLookupDefinition getJndiLookupDefinition() {
+ return jndiLookupDefinition;
+ }
+
+ /**
+ * Sets the value of the jndiLookupDefinition property.
+ *
+ * @param value
+ * allowed object is
+ * {@link JndiLookupDefinition }
+ *
+ */
+ public void setJndiLookupDefinition(JndiLookupDefinition value) {
+ this.jndiLookupDefinition = value;
+ }
+
+}
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/DeviceDefinition.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/DeviceDefinition.java
new file mode 100644
index 0000000000..f66921f329
--- /dev/null
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/DeviceDefinition.java
@@ -0,0 +1,174 @@
+
+package org.wso2.carbon.device.mgt.extensions.device.type.deployer.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
+ * <complexType name="DeviceDefinition">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="TableName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="PrimaryKey" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="Attributes" type="{}Attributes"/>
+ * <element name="License" type="{}License"/>
+ * <element name="Features" type="{}Features"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "DeviceDefinition", propOrder = {
+ "tableName",
+ "primaryKey",
+ "attributes",
+ "license",
+ "features"
+})
+public class DeviceDefinition {
+
+ @XmlElement(name = "TableName", required = true)
+ protected String tableName;
+ @XmlElement(name = "PrimaryKey", required = true)
+ protected String primaryKey;
+ @XmlElement(name = "Attributes", required = true)
+ protected Attributes attributes;
+ @XmlElement(name = "License", required = true)
+ protected License license;
+ @XmlElement(name = "Features", required = true)
+ protected Features features;
+
+ /**
+ * Gets the value of the tableName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTableName() {
+ return tableName;
+ }
+
+ /**
+ * Sets the value of the tableName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTableName(String value) {
+ this.tableName = value;
+ }
+
+ /**
+ * Gets the value of the primaryKey property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getPrimaryKey() {
+ return primaryKey;
+ }
+
+ /**
+ * Sets the value of the primaryKey property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setPrimaryKey(String value) {
+ this.primaryKey = value;
+ }
+
+ /**
+ * Gets the value of the attributes property.
+ *
+ * @return
+ * possible object is
+ * {@link Attributes }
+ *
+ */
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ /**
+ * Sets the value of the attributes property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Attributes }
+ *
+ */
+ public void setAttributes(Attributes value) {
+ this.attributes = value;
+ }
+
+ /**
+ * Gets the value of the license property.
+ *
+ * @return
+ * possible object is
+ * {@link License }
+ *
+ */
+ public License getLicense() {
+ return license;
+ }
+
+ /**
+ * Sets the value of the license property.
+ *
+ * @param value
+ * allowed object is
+ * {@link License }
+ *
+ */
+ public void setLicense(License value) {
+ this.license = value;
+ }
+
+ /**
+ * Gets the value of the features property.
+ *
+ * @return
+ * possible object is
+ * {@link Features }
+ *
+ */
+ public Features getFeatures() {
+ return features;
+ }
+
+ /**
+ * Sets the value of the features property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Features }
+ *
+ */
+ public void setFeatures(Features value) {
+ this.features = value;
+ }
+
+}
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/DeviceManagementConfigRepository.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/DeviceManagementConfigRepository.java
deleted file mode 100644
index faafcfb02e..0000000000
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/DeviceManagementConfigRepository.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2014, 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.device.mgt.extensions.device.type.deployer.config;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Class for holding management repository data.
- */
-@XmlRootElement(name = "ManagementRepository")
-public class DeviceManagementConfigRepository {
-
- private DataSourceConfig dataSourceConfig;
- private ProvisioningConfig provisioningConfig;
-
- @XmlElement(name = "DataSourceConfiguration", required = true)
- public DataSourceConfig getDataSourceConfig() {
- return dataSourceConfig;
- }
-
- public void setDataSourceConfig(DataSourceConfig dataSourceConfig) {
- this.dataSourceConfig = dataSourceConfig;
- }
-
- @XmlElement(name = "ProvisioningConfig", required = true)
- public ProvisioningConfig getProvisioningConfig() {
- return provisioningConfig;
- }
-
- public void setProvisioningConfig(
- ProvisioningConfig provisioningConfig) {
- this.provisioningConfig = provisioningConfig;
- }
-}
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/DeviceManagementConfiguration.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/DeviceManagementConfiguration.java
index 6f43af0ee5..91bced5368 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/DeviceManagementConfiguration.java
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/DeviceManagementConfiguration.java
@@ -1,65 +1,120 @@
-/*
- * Copyright (c) 2016, 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.device.mgt.extensions.device.type.deployer.config;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+package org.wso2.carbon.device.mgt.extensions.device.type.deployer.config;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ *
+ * <complexType name="DeviceManagementConfiguration">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Device" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="ManagementRepository" type="{}ManagementRepository"/>
+ * <element name="PushNotificationConfiguration" type="{}PushNotificationConfiguration"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+//@XmlAccessorType(XmlAccessType.FIELD)
+//@XmlType(name = "DeviceManagementConfiguration", propOrder = {
+// "deviceType",
+// "managementRepository",
+// "pushNotificationConfiguration"
+//})
@XmlRootElement(name = "DeviceManagementConfiguration")
public class DeviceManagementConfiguration {
- private DeviceManagementConfigRepository deviceManagementConfigRepository;
- private PushNotificationConfig pushNotificationConfig;
- private String deviceType;
-
- private static final Log log = LogFactory.getLog(DeviceManagementConfiguration.class);
-
- private DeviceManagementConfiguration() {
- }
+ @XmlElement(name = "DeviceType", required = true)
+ protected String deviceType;
+ @XmlElement(name = "ManagementRepository", required = true)
+ protected ManagementRepository managementRepository;
+ @XmlElement(name = "PushNotificationConfiguration", required = true)
+ protected PushNotificationConfiguration pushNotificationConfiguration;
- @XmlElement(name = "DeviceType", required = false)
+ /**
+ * Gets the value of the device property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
public String getDeviceType() {
return deviceType;
}
- public void setDeviceType(String deviceType) {
- this.deviceType = deviceType;
+ /**
+ * Sets the value of the device property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDeviceType(String value) {
+ this.deviceType = value;
}
- @XmlElement(name = "ManagementRepository", required = true)
- public DeviceManagementConfigRepository getDeviceManagementConfigRepository() {
- return deviceManagementConfigRepository;
+ /**
+ * Gets the value of the managementRepository property.
+ *
+ * @return
+ * possible object is
+ * {@link ManagementRepository }
+ *
+ */
+ public ManagementRepository getManagementRepository() {
+ return managementRepository;
}
- public void setDeviceManagementConfigRepository(DeviceManagementConfigRepository deviceManagementConfigRepository) {
- this.deviceManagementConfigRepository = deviceManagementConfigRepository;
+ /**
+ * Sets the value of the managementRepository property.
+ *
+ * @param value
+ * allowed object is
+ * {@link ManagementRepository }
+ *
+ */
+ public void setManagementRepository(ManagementRepository value) {
+ this.managementRepository = value;
}
- @XmlElement(name = "PushNotificationConfiguration", required = false)
- public PushNotificationConfig getPushNotificationConfig() {
- return pushNotificationConfig;
+ /**
+ * Gets the value of the pushNotificationConfiguration property.
+ *
+ * @return
+ * possible object is
+ * {@link PushNotificationConfiguration }
+ *
+ */
+ public PushNotificationConfiguration getPushNotificationConfiguration() {
+ return pushNotificationConfiguration;
}
- public void setPushNotificationConfig(PushNotificationConfig pushNotificationConfig) {
- this.pushNotificationConfig = pushNotificationConfig;
+ /**
+ * Sets the value of the pushNotificationConfiguration property.
+ *
+ * @param value
+ * allowed object is
+ * {@link PushNotificationConfiguration }
+ *
+ */
+ public void setPushNotificationConfiguration(PushNotificationConfiguration value) {
+ this.pushNotificationConfiguration = value;
}
+
}
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/Feature.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/Feature.java
new file mode 100644
index 0000000000..4af7952548
--- /dev/null
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/Feature.java
@@ -0,0 +1,118 @@
+
+package org.wso2.carbon.device.mgt.extensions.device.type.deployer.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
+ * <complexType name="Feature">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Code" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="Description" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Feature", propOrder = {
+ "code",
+ "name",
+ "description"
+})
+public class Feature {
+
+ @XmlElement(name = "Code", required = true)
+ protected String code;
+ @XmlElement(name = "Name", required = true)
+ protected String name;
+ @XmlElement(name = "Description", required = true)
+ protected String description;
+
+ /**
+ * Gets the value of the code property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCode() {
+ return code;
+ }
+
+ /**
+ * Sets the value of the code property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCode(String value) {
+ this.code = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the description property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Sets the value of the description property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDescription(String value) {
+ this.description = value;
+ }
+
+}
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/Features.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/Features.java
new file mode 100644
index 0000000000..e105609347
--- /dev/null
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/Features.java
@@ -0,0 +1,97 @@
+
+package org.wso2.carbon.device.mgt.extensions.device.type.deployer.config;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
+ * <complexType name="Features">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Feature" type="{}Feature" maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="generate" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Features", propOrder = {
+ "feature"
+})
+public class Features {
+
+ @XmlElement(name = "Feature")
+ protected Listset
method for the feature property.
+ *
+ *
+ * getFeature().add(newItem);
+ *
+ *
+ *
+ *
+ * <complexType name="JndiLookupDefinition">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "JndiLookupDefinition", propOrder = {
+ "name"
+})
+public class JndiLookupDefinition {
+
+ @XmlElement(name = "Name", required = true)
+ protected String name;
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+}
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/License.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/License.java
new file mode 100644
index 0000000000..db88c3a656
--- /dev/null
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/License.java
@@ -0,0 +1,118 @@
+
+package org.wso2.carbon.device.mgt.extensions.device.type.deployer.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
+ * <complexType name="License">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Language" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="Version" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="Text" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "License", propOrder = {
+ "language",
+ "version",
+ "text"
+})
+public class License {
+
+ @XmlElement(name = "Language", required = true)
+ protected String language;
+ @XmlElement(name = "Version", required = true)
+ protected String version;
+ @XmlElement(name = "Text", required = true)
+ protected String text;
+
+ /**
+ * Gets the value of the language property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getLanguage() {
+ return language;
+ }
+
+ /**
+ * Sets the value of the language property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setLanguage(String value) {
+ this.language = value;
+ }
+
+ /**
+ * Gets the value of the version property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * Sets the value of the version property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setVersion(String value) {
+ this.version = value;
+ }
+
+ /**
+ * Gets the value of the text property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * Sets the value of the text property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setText(String value) {
+ this.text = value;
+ }
+
+}
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/ManagementRepository.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/ManagementRepository.java
new file mode 100644
index 0000000000..da2bdfede8
--- /dev/null
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/ManagementRepository.java
@@ -0,0 +1,118 @@
+
+package org.wso2.carbon.device.mgt.extensions.device.type.deployer.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
+ * <complexType name="ManagementRepository">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="DataSourceConfiguration" type="{}DataSourceConfiguration"/>
+ * <element name="DeviceDefinition" type="{}DeviceDefinition"/>
+ * <element name="ProvisioningConfig" type="{}ProvisioningConfig"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ManagementRepository", propOrder = {
+ "dataSourceConfiguration",
+ "deviceDefinition",
+ "provisioningConfig"
+})
+public class ManagementRepository {
+
+ @XmlElement(name = "DataSourceConfiguration", required = true)
+ protected DataSourceConfiguration dataSourceConfiguration;
+ @XmlElement(name = "DeviceDefinition", required = true)
+ protected DeviceDefinition deviceDefinition;
+ @XmlElement(name = "ProvisioningConfig", required = true)
+ protected ProvisioningConfig provisioningConfig;
+
+ /**
+ * Gets the value of the dataSourceConfiguration property.
+ *
+ * @return
+ * possible object is
+ * {@link DataSourceConfiguration }
+ *
+ */
+ public DataSourceConfiguration getDataSourceConfiguration() {
+ return dataSourceConfiguration;
+ }
+
+ /**
+ * Sets the value of the dataSourceConfiguration property.
+ *
+ * @param value
+ * allowed object is
+ * {@link DataSourceConfiguration }
+ *
+ */
+ public void setDataSourceConfiguration(DataSourceConfiguration value) {
+ this.dataSourceConfiguration = value;
+ }
+
+ /**
+ * Gets the value of the deviceDefinition property.
+ *
+ * @return
+ * possible object is
+ * {@link DeviceDefinition }
+ *
+ */
+ public DeviceDefinition getDeviceDefinition() {
+ return deviceDefinition;
+ }
+
+ /**
+ * Sets the value of the deviceDefinition property.
+ *
+ * @param value
+ * allowed object is
+ * {@link DeviceDefinition }
+ *
+ */
+ public void setDeviceDefinition(DeviceDefinition value) {
+ this.deviceDefinition = value;
+ }
+
+ /**
+ * Gets the value of the provisioningConfig property.
+ *
+ * @return
+ * possible object is
+ * {@link ProvisioningConfig }
+ *
+ */
+ public ProvisioningConfig getProvisioningConfig() {
+ return provisioningConfig;
+ }
+
+ /**
+ * Sets the value of the provisioningConfig property.
+ *
+ * @param value
+ * allowed object is
+ * {@link ProvisioningConfig }
+ *
+ */
+ public void setProvisioningConfig(ProvisioningConfig value) {
+ this.provisioningConfig = value;
+ }
+
+}
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/Properties.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/Properties.java
new file mode 100644
index 0000000000..621f19b48c
--- /dev/null
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/Properties.java
@@ -0,0 +1,69 @@
+
+package org.wso2.carbon.device.mgt.extensions.device.type.deployer.config;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
+ * <complexType name="Properties">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Property" type="{}Property" maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Properties", propOrder = {
+ "property"
+})
+public class Properties {
+
+ @XmlElement(name = "Property")
+ protected Listset
method for the property property.
+ *
+ *
+ * getProperty().add(newItem);
+ *
+ *
+ *
+ *
+ * <complexType name="Property">
+ * <simpleContent>
+ * <extension base="<http://www.w3.org/2001/XMLSchema>string">
+ * <attribute name="Name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </extension>
+ * </simpleContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Property", propOrder = {
+ "value"
+})
+public class Property {
+
+ @XmlValue
+ protected String value;
+ @XmlAttribute(name = "Name")
+ protected String name;
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+}
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/ProvisioningConfig.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/ProvisioningConfig.java
index 4ebf232a44..6abb4c79c6 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/ProvisioningConfig.java
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/ProvisioningConfig.java
@@ -1,39 +1,62 @@
-/*
- * Copyright (c) 2014, 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.device.mgt.extensions.device.type.deployer.config;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
/**
- * Class for holding device type configuration and parsing with JAXB.
+ *
+ * <complexType name="ProvisioningConfig">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="SharedWithAllTenants" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
*/
-@XmlRootElement(name = "ProvisioningConfig")
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ProvisioningConfig", propOrder = {
+ "sharedWithAllTenants"
+})
public class ProvisioningConfig {
- private boolean sharedWithAllTenants;
+ @XmlElement(name = "SharedWithAllTenants", required = true)
+ protected boolean sharedWithAllTenants;
+
+ /**
+ * Gets the value of the sharedWithAllTenants property.
+ *
+ * @return
+ * possible object is
+ * {@link boolean }
+ *
+ */
+ public boolean isSharedWithAllTenants() {
+ return sharedWithAllTenants;
+ }
- @XmlElement(name = "SharedWithAllTenants", required = true)
- public boolean isSharedWithAllTenants() {
- return sharedWithAllTenants;
- }
+ /**
+ * Sets the value of the sharedWithAllTenants property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSharedWithAllTenants(boolean value) {
+ this.sharedWithAllTenants = value;
+ }
- public void setSharedWithAllTenants(boolean sharedWithAllTenants) {
- this.sharedWithAllTenants = sharedWithAllTenants;
- }
-}
\ No newline at end of file
+}
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/PushNotificationConfig.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/PushNotificationConfig.java
deleted file mode 100644
index 94955ff25f..0000000000
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/PushNotificationConfig.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2016, 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.device.mgt.extensions.device.type.deployer.config;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlValue;
-import java.util.List;
-
-@XmlRootElement(name = "PushNotificationConfiguration")
-public class PushNotificationConfig {
-
- private String pushNotificationProvider;
- private List
+ * <complexType name="PushNotificationConfiguration">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="PushNotificationProvider" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="FileBasedProperties" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="Properties" type="{}Properties"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "PushNotificationConfiguration", propOrder = {
+ "pushNotificationProvider",
+ "fileBasedProperties",
+ "properties"
+})
+public class PushNotificationConfiguration {
+
+ @XmlElement(name = "PushNotificationProvider", required = true)
+ protected String pushNotificationProvider;
+ @XmlElement(name = "FileBasedProperties", required = true)
+ protected boolean fileBasedProperties;
+ @XmlElement(name = "Properties", required = true)
+ protected Properties properties;
+
+ /**
+ * Gets the value of the pushNotificationProvider property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getPushNotificationProvider() {
+ return pushNotificationProvider;
+ }
+
+ /**
+ * Sets the value of the pushNotificationProvider property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setPushNotificationProvider(String value) {
+ this.pushNotificationProvider = value;
+ }
+
+ /**
+ * Gets the value of the fileBasedProperties property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public boolean isFileBasedProperties() {
+ return fileBasedProperties;
+ }
+
+ /**
+ * Sets the value of the fileBasedProperties property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setFileBasedProperties(boolean value) {
+ this.fileBasedProperties = value;
+ }
+
+ /**
+ * Gets the value of the properties property.
+ *
+ * @return
+ * possible object is
+ * {@link Properties }
+ *
+ */
+ public Properties getProperties() {
+ return properties;
+ }
+
+ /**
+ * Sets the value of the properties property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Properties }
+ *
+ */
+ public void setProperties(Properties value) {
+ this.properties = value;
+ }
+
+}
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/FeaturesConfig.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/exception/DeviceTypeDeployerFileException.java
similarity index 50%
rename from components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/FeaturesConfig.java
rename to components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/exception/DeviceTypeDeployerFileException.java
index b7baf06489..1d30952a9f 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/config/FeaturesConfig.java
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/exception/DeviceTypeDeployerFileException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ * 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
@@ -15,26 +15,29 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.wso2.carbon.device.mgt.extensions.device.type.deployer.config;
+package org.wso2.carbon.device.mgt.extensions.device.type.deployer.exception;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-/**
- * Class for holding device type configuration and parsing with JAXB.
- */
-@XmlRootElement(name = "FeaturesConfig")
-public class FeaturesConfig {
+public class DeviceTypeDeployerFileException extends RuntimeException {
+
+ public DeviceTypeDeployerFileException(String msg, Exception nestedEx) {
+ super(msg, nestedEx);
+ }
- private JNDILookupDefinition jndiLookupDefinition;
+ public DeviceTypeDeployerFileException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public DeviceTypeDeployerFileException(String msg) {
+ super(msg);
+ }
- @XmlElement(name = "JndiLookupDefinition", required = true)
- public JNDILookupDefinition getJndiLookupDefinition() {
- return jndiLookupDefinition;
+ public DeviceTypeDeployerFileException() {
+ super();
}
- public void setJndiLookupDefinition(JNDILookupDefinition jndiLookupDefinition) {
- this.jndiLookupDefinition = jndiLookupDefinition;
+ public DeviceTypeDeployerFileException(Throwable cause) {
+ super(cause);
}
-}
\ No newline at end of file
+}
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/template/DeviceTypeManager.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/template/DeviceTypeManager.java
index df81c24577..d635e9192c 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/template/DeviceTypeManager.java
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/template/DeviceTypeManager.java
@@ -15,10 +15,16 @@ import org.wso2.carbon.device.mgt.common.license.mgt.License;
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager;
import org.wso2.carbon.device.mgt.extensions.device.type.deployer.DeviceTypePluginConstants;
+import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.DeviceDefinition;
import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.DeviceManagementConfiguration;
+import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.Feature;
+import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.Features;
+import org.wso2.carbon.device.mgt.extensions.device.type.deployer.exception.DeviceTypeDeployerFileException;
import org.wso2.carbon.device.mgt.extensions.device.type.deployer.exception.DeviceTypeMgtPluginException;
+import org.wso2.carbon.device.mgt.extensions.device.type.deployer.template.dao.DeviceDAODefinition;
import org.wso2.carbon.device.mgt.extensions.device.type.deployer.template.dao.DeviceTypePluginDAOManager;
import org.wso2.carbon.device.mgt.extensions.device.type.deployer.template.feature.AnnotationBasedFeatureManager;
+import org.wso2.carbon.device.mgt.extensions.device.type.deployer.template.feature.ConfigurationBasedFeatureManager;
import org.wso2.carbon.device.mgt.extensions.device.type.deployer.template.util.DeviceTypeUtils;
import org.wso2.carbon.device.mgt.extensions.license.mgt.registry.RegistryBasedLicenseManager;
import org.wso2.carbon.registry.api.RegistryException;
@@ -39,14 +45,14 @@ public class DeviceTypeManager implements DeviceManager {
private String deviceType;
private DeviceTypePluginDAOManager deviceTypePluginDAOManager;
private LicenseManager licenseManager;
+ private boolean propertiesExist;
private FeatureManager featureManager;
public DeviceTypeManager(DeviceTypeConfigIdentifier deviceTypeConfigIdentifier,
DeviceManagementConfiguration deviceManagementConfiguration) {
- deviceTypePluginDAOManager = new DeviceTypePluginDAOManager(deviceManagementConfiguration);
+
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
- boolean isSharedWithAllTenants =
- deviceManagementConfiguration.getDeviceManagementConfigRepository().getProvisioningConfig()
+ boolean isSharedWithAllTenants = deviceManagementConfiguration.getManagementRepository().getProvisioningConfig()
.isSharedWithAllTenants();
DeviceTypeIdentifier deviceTypeIdentifier;
deviceType = deviceTypeConfigIdentifier.getDeviceType();
@@ -56,21 +62,54 @@ public class DeviceTypeManager implements DeviceManager {
deviceTypeIdentifier = new DeviceTypeIdentifier(deviceType, tenantId);
}
- featureManager = new AnnotationBasedFeatureManager(deviceTypeIdentifier);
+ DeviceDefinition deviceDefinition = deviceManagementConfiguration.getManagementRepository().getDeviceDefinition();
+ if (deviceDefinition != null) {
+ //generate features.
+ Features featuresList = deviceManagementConfiguration.getManagementRepository().getDeviceDefinition().getFeatures();
+ if (featuresList != null) {
+ if (featuresList.isGenerate()) {
+ featureManager = new AnnotationBasedFeatureManager(deviceTypeIdentifier);
+ } else {
+ ListFEATURE_CODE_1
+ FEATURE_CODE_2
+ FEATURE_CODE_1
- FEATURE_CODE_2
-