use of org.thingsboard.server.dao.exception.DatabaseException in project thingsboard by thingsboard.
the class BaseRuleService method updateLifeCycleState.
private void updateLifeCycleState(RuleId ruleId, ComponentLifecycleState state) {
Validator.validateId(ruleId, "Incorrect rule id for state change request.");
RuleMetaData rule = ruleDao.findById(ruleId);
if (rule != null) {
rule.setState(state);
validateRuleAndPluginState(rule);
ruleDao.save(rule);
} else {
throw new DatabaseException("Plugin not found!");
}
}
use of org.thingsboard.server.dao.exception.DatabaseException in project thingsboard by thingsboard.
the class BasePluginService method updateLifeCycleState.
private void updateLifeCycleState(PluginId pluginId, ComponentLifecycleState state) {
Validator.validateId(pluginId, "Incorrect plugin id for state change request.");
PluginMetaData plugin = pluginDao.findById(pluginId);
if (plugin != null) {
plugin.setState(state);
pluginDao.save(plugin);
} else {
throw new DatabaseException("Plugin not found!");
}
}
Aggregations