use of org.thingsboard.server.common.data.page.PageDataIterable in project thingsboard by thingsboard.
the class AppActor method preStart.
@Override
public void preStart() {
logger.info("Starting main system actor.");
try {
ruleManager.init(this.context());
pluginManager.init(this.context());
if (systemContext.isTenantComponentsInitEnabled()) {
PageDataIterable<Tenant> tenantIterator = new PageDataIterable<>(tenantService::findTenants, ENTITY_PACK_LIMIT);
for (Tenant tenant : tenantIterator) {
logger.debug("[{}] Creating tenant actor", tenant.getId());
getOrCreateTenantActor(tenant.getId());
logger.debug("Tenant actor created.");
}
}
logger.info("Main system actor started.");
} catch (Exception e) {
logger.error(e, "Unknown failure");
}
}
use of org.thingsboard.server.common.data.page.PageDataIterable in project thingsboard by thingsboard.
the class RuleManager method doInit.
private void doInit(ActorContext context) {
PageDataIterable<RuleMetaData> ruleIterator = new PageDataIterable<>(getFetchRulesFunction(), ContextAwareActor.ENTITY_PACK_LIMIT);
ruleMap = new HashMap<>();
for (RuleMetaData rule : ruleIterator) {
log.debug("[{}] Creating rule actor {}", rule.getId(), rule);
ActorRef ref = getOrCreateRuleActor(context, rule.getId());
ruleMap.put(rule, RuleActorMetaData.systemRule(rule.getId(), rule.getWeight(), ref));
log.debug("[{}] Rule actor created.", rule.getId());
}
refreshRuleChain();
}
use of org.thingsboard.server.common.data.page.PageDataIterable in project thingsboard by thingsboard.
the class PluginManager method init.
public void init(ActorContext context) {
PageDataIterable<PluginMetaData> pluginIterator = new PageDataIterable<>(getFetchPluginsFunction(), ContextAwareActor.ENTITY_PACK_LIMIT);
for (PluginMetaData plugin : pluginIterator) {
log.debug("[{}] Creating plugin actor", plugin.getId());
getOrCreatePluginActor(context, plugin.getId());
log.debug("Plugin actor created.");
}
}
Aggregations