Package com.gears42.iot.webthing
Interface DatabaseHandlerI
-
- All Known Implementing Classes:
DatabaseHandlerImpl
public interface DatabaseHandlerIInterface to manage database operations of the Framework.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddComplianceConfig(java.lang.String thingId, java.lang.String ruleName, java.lang.String deviceProperty, java.lang.String ruleCondition, int duration, java.lang.String ruleValue, java.lang.String pollingType)Add compliance configuration.voidaddComplianceProperty(java.lang.String thingId, java.lang.String property, java.lang.String value, java.lang.String type)Add compliance property data.voidaddEvent(java.lang.String requestId, java.lang.String data)Add a compliance event.voidaddJobXML(java.lang.String thingId, java.lang.String jobXML)Add JobXML.voidaddOrUpdateCompianceProperty(java.lang.String thingId, java.lang.String property, java.lang.String value, java.lang.String type)Add or update compliance property data.voidaddOrUpdateComplianceConfig(java.lang.String thingId, java.lang.String ruleName, java.lang.String deviceProperty, java.lang.String ruleCondition, int duration, java.lang.String ruleValue, java.lang.String pollingType)Add or update compliance configuration based on existence.voidaddOrUpdateJobXML(java.lang.String thingId, java.lang.String jobXML)Add or update JobXML.booleancleanDB(java.lang.String thingId, java.util.List<java.lang.String> properties)Clean compliance DB data based on intersection of current and old compliance job.voiddeleteCompliance(java.lang.String thingId)Delete compliance for a thing.booleandeleteComplianceConfig(java.lang.String thingId, java.lang.String property)Delete compliance configuration for a property.booleandeleteComplianceProperty(java.lang.String thingId, java.lang.String property)Delete compliance data for a property.voiddeleteEvent(java.lang.String requestId)Delete a compliance event.voiddeleteJobXML(java.lang.String thingId)Delete JobXML.org.json.JSONObjectgetAllConfig()Get compliance configuration for all properties.org.json.JSONObjectgetAllEvents()Get all compliance events.org.json.JSONObjectgetAllPendingEvents()Get all pending compliance events.org.json.JSONArraygetComplianceProperties()Get all compliance properties data.org.json.JSONObjectgetConfigForProperty(java.lang.String thingId, java.lang.String property)Get compliance configuration for a property.java.util.List<java.lang.String>getConfigPropertyNames(java.lang.String thingId, boolean onlyNormalPoll)List of compliance configured properties.java.lang.StringgetJobXML(java.lang.String thingId)Get JobXML.java.util.List<java.lang.String>getThingIDs()List of thingIds on which the compliance is configured.booleanisCompliancePropertyExists(java.lang.String thingId, java.lang.String property)Check if compliance data of a property exists.voidsetCompliance(java.lang.String thingId, java.lang.String property, int isCompliant, long complianceTime)Set compliance status of a property.voidsetNixNotify(java.lang.String requestId, int nixNotified, int notifyCount)Set nix notify status of a property.voidupdateComplianceConfig(java.lang.String thingId, java.lang.String ruleName, java.lang.String deviceProperty, java.lang.String ruleCondition, int duration, java.lang.String ruleValue, java.lang.String pollingType)Update compliance configuration based on existence.voidupdateComplianceProperty(java.lang.String thingId, java.lang.String property, java.lang.String value)Update compliance property data.voidupdateJobXML(java.lang.String thingId, java.lang.String jobXML)Update JobXML.
-
-
-
Method Detail
-
addOrUpdateComplianceConfig
void addOrUpdateComplianceConfig(java.lang.String thingId, java.lang.String ruleName, java.lang.String deviceProperty, java.lang.String ruleCondition, int duration, java.lang.String ruleValue, java.lang.String pollingType)Add or update compliance configuration based on existence.- Parameters:
thingId- Id of the thing.ruleName- Name of the rule.deviceProperty- Compliance configured property.ruleCondition- Condition to decide compliance.duration- Duration till which the property should stay out of compliance to decide it as the later.ruleValue- Threshold value.pollingType- Property polling type.
-
addComplianceConfig
void addComplianceConfig(java.lang.String thingId, java.lang.String ruleName, java.lang.String deviceProperty, java.lang.String ruleCondition, int duration, java.lang.String ruleValue, java.lang.String pollingType)Add compliance configuration.- Parameters:
thingId- Id of the thing.ruleName- Name of the rule.deviceProperty- Compliance configured property.ruleCondition- Condition to decide compliance.duration- Duration till which the property should stay out of compliance to decide it as the later.ruleValue- Threshold value.pollingType- Property polling type.
-
updateComplianceConfig
void updateComplianceConfig(java.lang.String thingId, java.lang.String ruleName, java.lang.String deviceProperty, java.lang.String ruleCondition, int duration, java.lang.String ruleValue, java.lang.String pollingType)Update compliance configuration based on existence.- Parameters:
thingId- Id of the thing.ruleName- Name of the rule.deviceProperty- Compliance configured property.ruleCondition- Condition to decide compliance.duration- Duration till which the property should stay out of compliance to decide it as the later.ruleValue- Threshold value.pollingType- Property polling type.
-
cleanDB
boolean cleanDB(java.lang.String thingId, java.util.List<java.lang.String> properties)Clean compliance DB data based on intersection of current and old compliance job.- Parameters:
thingId- Id of the thing.properties- List of current job properties.- Returns:
- is cleanDB success.
-
getThingIDs
java.util.List<java.lang.String> getThingIDs()
List of thingIds on which the compliance is configured.- Returns:
- List of thingIds.
-
getConfigPropertyNames
java.util.List<java.lang.String> getConfigPropertyNames(java.lang.String thingId, boolean onlyNormalPoll)List of compliance configured properties.- Parameters:
thingId- Id of the thing.onlyNormalPoll- Property polling type.- Returns:
- List of Property names.
-
addOrUpdateCompianceProperty
void addOrUpdateCompianceProperty(java.lang.String thingId, java.lang.String property, java.lang.String value, java.lang.String type)Add or update compliance property data.- Parameters:
thingId- Id of the thing.property- property name.value- Latest value of the property.type- Value type of the property.
-
addComplianceProperty
void addComplianceProperty(java.lang.String thingId, java.lang.String property, java.lang.String value, java.lang.String type)Add compliance property data.- Parameters:
thingId- Id of the thing.property- property name.value- Latest value of the property.type- Value type of the property.
-
updateComplianceProperty
void updateComplianceProperty(java.lang.String thingId, java.lang.String property, java.lang.String value)Update compliance property data.- Parameters:
thingId- Id of the thing.property- property name.value- Latest value of the property.
-
isCompliancePropertyExists
boolean isCompliancePropertyExists(java.lang.String thingId, java.lang.String property)Check if compliance data of a property exists.- Parameters:
thingId- Id of the thing.property- property name.- Returns:
- true if compliance data of a property exists.
-
getComplianceProperties
org.json.JSONArray getComplianceProperties()
Get all compliance properties data.- Returns:
- All compliance properties data.
-
getConfigForProperty
org.json.JSONObject getConfigForProperty(java.lang.String thingId, java.lang.String property)Get compliance configuration for a property.- Parameters:
thingId- Id of the thing.property- property name.- Returns:
- Compliance configuration for a property.
-
getAllConfig
org.json.JSONObject getAllConfig()
Get compliance configuration for all properties.- Returns:
- Compliance configuration for all properties.
-
setCompliance
void setCompliance(java.lang.String thingId, java.lang.String property, int isCompliant, long complianceTime)Set compliance status of a property.- Parameters:
thingId- Id of the thing.property- property name.isCompliant- compliant status.complianceTime- Time of compliance status change.
-
setNixNotify
void setNixNotify(java.lang.String requestId, int nixNotified, int notifyCount)Set nix notify status of a property.- Parameters:
requestId- requestId of event.nixNotified- Nix notified status.notifyCount- notify try count.
-
deleteCompliance
void deleteCompliance(java.lang.String thingId)
Delete compliance for a thing.- Parameters:
thingId- thingId.
-
deleteComplianceConfig
boolean deleteComplianceConfig(java.lang.String thingId, java.lang.String property)Delete compliance configuration for a property.- Parameters:
thingId- thingId.property- compliance property.- Returns:
- true if successful, false otherwise.
-
deleteComplianceProperty
boolean deleteComplianceProperty(java.lang.String thingId, java.lang.String property)Delete compliance data for a property.- Parameters:
thingId- thingId.property- compliance property.- Returns:
- true if successful, false otherwise.
-
addEvent
void addEvent(java.lang.String requestId, java.lang.String data)Add a compliance event.- Parameters:
requestId- Event requestId.data- Event data.
-
deleteEvent
void deleteEvent(java.lang.String requestId)
Delete a compliance event.- Parameters:
requestId- Event requestId.
-
getAllPendingEvents
org.json.JSONObject getAllPendingEvents()
Get all pending compliance events.- Returns:
- Pending events.
-
getAllEvents
org.json.JSONObject getAllEvents()
Get all compliance events.- Returns:
- All compliance events.
-
addOrUpdateJobXML
void addOrUpdateJobXML(java.lang.String thingId, java.lang.String jobXML)Add or update JobXML.- Parameters:
thingId- thingId.jobXML- jobXML.
-
addJobXML
void addJobXML(java.lang.String thingId, java.lang.String jobXML)Add JobXML.- Parameters:
thingId- thingId.jobXML- jobXML.
-
updateJobXML
void updateJobXML(java.lang.String thingId, java.lang.String jobXML)Update JobXML.- Parameters:
thingId- thingId.jobXML- jobXML.
-
getJobXML
java.lang.String getJobXML(java.lang.String thingId)
Get JobXML.- Parameters:
thingId- thingId.- Returns:
- jobXML.
-
deleteJobXML
void deleteJobXML(java.lang.String thingId)
Delete JobXML.- Parameters:
thingId- thingId.
-
-