replace remained tenantDao usages to tenantService
This commit is contained in:
parent
d9dbd27364
commit
a39b56c93c
@ -32,7 +32,7 @@ import org.thingsboard.server.dao.alarm.AlarmDao;
|
||||
import org.thingsboard.server.dao.alarm.AlarmService;
|
||||
import org.thingsboard.server.dao.relation.RelationService;
|
||||
import org.thingsboard.server.dao.tenant.TbTenantProfileCache;
|
||||
import org.thingsboard.server.dao.tenant.TenantDao;
|
||||
import org.thingsboard.server.dao.tenant.TenantService;
|
||||
import org.thingsboard.server.queue.discovery.PartitionService;
|
||||
import org.thingsboard.server.queue.util.TbCoreComponent;
|
||||
import org.thingsboard.server.service.action.EntityActionService;
|
||||
@ -50,7 +50,7 @@ public class AlarmsCleanUpService {
|
||||
@Value("${sql.ttl.alarms.removal_batch_size}")
|
||||
private Integer removalBatchSize;
|
||||
|
||||
private final TenantDao tenantDao;
|
||||
private final TenantService tenantService;
|
||||
private final AlarmDao alarmDao;
|
||||
private final AlarmService alarmService;
|
||||
private final RelationService relationService;
|
||||
@ -64,7 +64,7 @@ public class AlarmsCleanUpService {
|
||||
PageLink removalBatchRequest = new PageLink(removalBatchSize, 0 );
|
||||
PageData<TenantId> tenantsIds;
|
||||
do {
|
||||
tenantsIds = tenantDao.findTenantsIds(tenantsBatchRequest);
|
||||
tenantsIds = tenantService.findTenantsIds(tenantsBatchRequest);
|
||||
for (TenantId tenantId : tenantsIds.getData()) {
|
||||
if (!partitionService.resolve(ServiceType.TB_CORE, tenantId, tenantId).isMyPartition()) {
|
||||
continue;
|
||||
|
||||
@ -27,7 +27,7 @@ import org.thingsboard.server.common.data.tenant.profile.DefaultTenantProfileCon
|
||||
import org.thingsboard.server.common.msg.queue.ServiceType;
|
||||
import org.thingsboard.server.dao.rpc.RpcDao;
|
||||
import org.thingsboard.server.dao.tenant.TbTenantProfileCache;
|
||||
import org.thingsboard.server.dao.tenant.TenantDao;
|
||||
import org.thingsboard.server.dao.tenant.TenantService;
|
||||
import org.thingsboard.server.queue.discovery.PartitionService;
|
||||
import org.thingsboard.server.queue.util.TbCoreComponent;
|
||||
|
||||
@ -43,7 +43,7 @@ public class RpcCleanUpService {
|
||||
@Value("${sql.ttl.rpc.enabled}")
|
||||
private boolean ttlTaskExecutionEnabled;
|
||||
|
||||
private final TenantDao tenantDao;
|
||||
private final TenantService tenantService;
|
||||
private final PartitionService partitionService;
|
||||
private final TbTenantProfileCache tenantProfileCache;
|
||||
private final RpcDao rpcDao;
|
||||
@ -54,7 +54,7 @@ public class RpcCleanUpService {
|
||||
PageLink tenantsBatchRequest = new PageLink(10_000, 0);
|
||||
PageData<TenantId> tenantsIds;
|
||||
do {
|
||||
tenantsIds = tenantDao.findTenantsIds(tenantsBatchRequest);
|
||||
tenantsIds = tenantService.findTenantsIds(tenantsBatchRequest);
|
||||
for (TenantId tenantId : tenantsIds.getData()) {
|
||||
if (!partitionService.resolve(ServiceType.TB_CORE, tenantId, tenantId).isMyPartition()) {
|
||||
continue;
|
||||
|
||||
@ -39,4 +39,6 @@ public interface TenantService {
|
||||
PageData<TenantInfo> findTenantInfos(PageLink pageLink);
|
||||
|
||||
void deleteTenants();
|
||||
|
||||
PageData<TenantId> findTenantsIds(PageLink pageLink);
|
||||
}
|
||||
|
||||
@ -191,6 +191,13 @@ public class TenantServiceImpl extends AbstractEntityService implements TenantSe
|
||||
tenantsRemover.removeEntities(new TenantId(EntityId.NULL_UUID), DEFAULT_TENANT_REGION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageData<TenantId> findTenantsIds(PageLink pageLink) {
|
||||
log.trace("Executing deleteTenants");
|
||||
Validator.validatePageLink(pageLink);
|
||||
return tenantDao.findTenantsIds(pageLink);
|
||||
}
|
||||
|
||||
private DataValidator<Tenant> tenantValidator =
|
||||
new DataValidator<Tenant>() {
|
||||
@Override
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user