diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/FeatureDAO.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/FeatureDAO.java index 489e22f2388..08cd091c9d3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/FeatureDAO.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/FeatureDAO.java @@ -32,7 +32,7 @@ public interface FeatureDAO { * @return The status of the operation. If the delete was successful or not. * @throws MobileDeviceManagementDAOException */ - boolean deleteDevice(String featureCode) throws MobileDeviceManagementDAOException; + boolean deleteFeature(String featureCode) throws MobileDeviceManagementDAOException; /** * Retrieve a given feature from plugin database. diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/FeaturePropertyDAO.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/FeaturePropertyDAO.java new file mode 100644 index 00000000000..aacfac3eaa3 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/FeaturePropertyDAO.java @@ -0,0 +1,50 @@ +package org.wso2.carbon.device.mgt.mobile.dao; + +import org.wso2.carbon.device.mgt.mobile.dto.FeatureProperty; + +/** + * This class represents the key operations associated with persisting feature property related + * information. + */ +public interface FeaturePropertyDAO { + /** + * Add a new feature property to plugin feature property table. + * @param featureProperty Feature property object that holds data related to the feature property to be inserted. + * @return The status of the operation. If the insert was successful or not. + * @throws MobileDeviceManagementDAOException + */ + boolean addFeatureProperty(FeatureProperty featureProperty) throws MobileDeviceManagementDAOException; + + /** + * Update a feature property in the feature property table. + * @param featureProperty Feature property object that holds data has to be updated. + * @return The status of the operation. If the update was successful or not. + * @throws MobileDeviceManagementDAOException + */ + boolean updateFeatureProperty(FeatureProperty featureProperty) throws MobileDeviceManagementDAOException; + + /** + * Delete a given feature property from plugin database. + * @param propertyId Id of the feature property to be deleted. + * @return The status of the operation. If the delete was successful or not. + * @throws MobileDeviceManagementDAOException + */ + boolean deleteDeviceProperty(String propertyId) throws MobileDeviceManagementDAOException; + + /** + * Retrieve a given feature property from plugin database. + * @param propertyId Id of the feature property to be retrieved. + * @return Feature property object that holds data of the feature property represented by propertyId. + * @throws MobileDeviceManagementDAOException + */ + FeatureProperty getFeatureProperty(String propertyId) throws MobileDeviceManagementDAOException; + + /** + * Retrieve a list of feature property corresponds to a feature code . + * @param featureCode feature code of the feature property to be retrieved. + * @return Feature property object that holds data of the feature property represented by propertyId. + * @throws MobileDeviceManagementDAOException + */ + FeatureProperty[] getFeaturePropertyOfFeature(String featureCode) throws MobileDeviceManagementDAOException; + +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/impl/FeatureDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/impl/FeatureDAOImpl.java index 60bf32fdc06..301828a1203 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/impl/FeatureDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/impl/FeatureDAOImpl.java @@ -87,7 +87,7 @@ public class FeatureDAOImpl implements FeatureDAO { } @Override - public boolean deleteDevice(String featureCode) + public boolean deleteFeature(String featureCode) throws MobileDeviceManagementDAOException { boolean status = false; Connection conn = null; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dto/FeatureProperty.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dto/FeatureProperty.java new file mode 100644 index 00000000000..f1cdf154ef1 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dto/FeatureProperty.java @@ -0,0 +1,36 @@ +package org.wso2.carbon.device.mgt.mobile.dto; + + +/** + * DTO of feature property. Represents a property of a feature. + */ +public class FeatureProperty { + int propertyId; + String property; + String featureCode; + + public String getFeatureCode() { + return featureCode; + } + + public void setFeatureCode(String featureCode) { + this.featureCode = featureCode; + } + + public int getPropertyId() { + return propertyId; + } + + public void setPropertyId(int propertyId) { + this.propertyId = propertyId; + } + + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + +}