refactoring
This commit is contained in:
parent
d25f271d89
commit
e59c4a950c
@ -94,7 +94,6 @@ import org.thingsboard.server.service.queue.processing.IdMsgPair;
|
|||||||
import org.thingsboard.server.service.resource.TbImageService;
|
import org.thingsboard.server.service.resource.TbImageService;
|
||||||
import org.thingsboard.server.service.rpc.TbCoreDeviceRpcService;
|
import org.thingsboard.server.service.rpc.TbCoreDeviceRpcService;
|
||||||
import org.thingsboard.server.service.security.auth.jwt.settings.JwtSettingsService;
|
import org.thingsboard.server.service.security.auth.jwt.settings.JwtSettingsService;
|
||||||
import org.thingsboard.server.service.security.model.token.JwtTokenFactory;
|
|
||||||
import org.thingsboard.server.service.state.DeviceStateService;
|
import org.thingsboard.server.service.state.DeviceStateService;
|
||||||
import org.thingsboard.server.service.subscription.SubscriptionManagerService;
|
import org.thingsboard.server.service.subscription.SubscriptionManagerService;
|
||||||
import org.thingsboard.server.service.subscription.TbLocalSubscriptionService;
|
import org.thingsboard.server.service.subscription.TbLocalSubscriptionService;
|
||||||
@ -173,12 +172,11 @@ public class DefaultTbCoreConsumerService extends AbstractConsumerService<ToCore
|
|||||||
PartitionService partitionService,
|
PartitionService partitionService,
|
||||||
ApplicationEventPublisher eventPublisher,
|
ApplicationEventPublisher eventPublisher,
|
||||||
JwtSettingsService jwtSettingsService,
|
JwtSettingsService jwtSettingsService,
|
||||||
JwtTokenFactory jwtTokenFactory,
|
|
||||||
NotificationSchedulerService notificationSchedulerService,
|
NotificationSchedulerService notificationSchedulerService,
|
||||||
NotificationRuleProcessor notificationRuleProcessor,
|
NotificationRuleProcessor notificationRuleProcessor,
|
||||||
TbImageService imageService) {
|
TbImageService imageService) {
|
||||||
super(actorContext, tenantProfileCache, deviceProfileCache, assetProfileCache, apiUsageStateService, partitionService,
|
super(actorContext, tenantProfileCache, deviceProfileCache, assetProfileCache, apiUsageStateService, partitionService,
|
||||||
eventPublisher, tbCoreQueueFactory.createToCoreNotificationsMsgConsumer(), jwtSettingsService, jwtTokenFactory);
|
eventPublisher, tbCoreQueueFactory.createToCoreNotificationsMsgConsumer(), jwtSettingsService);
|
||||||
this.mainConsumer = tbCoreQueueFactory.createToCoreMsgConsumer();
|
this.mainConsumer = tbCoreQueueFactory.createToCoreMsgConsumer();
|
||||||
this.usageStatsConsumer = tbCoreQueueFactory.createToUsageStatsServiceMsgConsumer();
|
this.usageStatsConsumer = tbCoreQueueFactory.createToUsageStatsServiceMsgConsumer();
|
||||||
this.firmwareStatesConsumer = tbCoreQueueFactory.createToOtaPackageStateServiceMsgConsumer();
|
this.firmwareStatesConsumer = tbCoreQueueFactory.createToOtaPackageStateServiceMsgConsumer();
|
||||||
|
|||||||
@ -56,7 +56,6 @@ import org.thingsboard.server.service.rpc.TbRuleEngineDeviceRpcService;
|
|||||||
import org.thingsboard.server.service.security.auth.jwt.settings.JwtSettingsService;
|
import org.thingsboard.server.service.security.auth.jwt.settings.JwtSettingsService;
|
||||||
|
|
||||||
import jakarta.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
import org.thingsboard.server.service.security.model.token.JwtTokenFactory;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -88,10 +87,9 @@ public class DefaultTbRuleEngineConsumerService extends AbstractConsumerService<
|
|||||||
TbApiUsageStateService apiUsageStateService,
|
TbApiUsageStateService apiUsageStateService,
|
||||||
PartitionService partitionService,
|
PartitionService partitionService,
|
||||||
ApplicationEventPublisher eventPublisher,
|
ApplicationEventPublisher eventPublisher,
|
||||||
JwtSettingsService jwtSettingsService,
|
JwtSettingsService jwtSettingsService) {
|
||||||
JwtTokenFactory jwtTokenFactory) {
|
|
||||||
super(actorContext, tenantProfileCache, deviceProfileCache, assetProfileCache, apiUsageStateService, partitionService,
|
super(actorContext, tenantProfileCache, deviceProfileCache, assetProfileCache, apiUsageStateService, partitionService,
|
||||||
eventPublisher, tbRuleEngineQueueFactory.createToRuleEngineNotificationsMsgConsumer(), jwtSettingsService, jwtTokenFactory);
|
eventPublisher, tbRuleEngineQueueFactory.createToRuleEngineNotificationsMsgConsumer(), jwtSettingsService);
|
||||||
this.ctx = ctx;
|
this.ctx = ctx;
|
||||||
this.tbDeviceRpcService = tbDeviceRpcService;
|
this.tbDeviceRpcService = tbDeviceRpcService;
|
||||||
this.queueService = queueService;
|
this.queueService = queueService;
|
||||||
|
|||||||
@ -77,7 +77,6 @@ public abstract class AbstractConsumerService<N extends com.google.protobuf.Gene
|
|||||||
|
|
||||||
protected final TbQueueConsumer<TbProtoQueueMsg<N>> nfConsumer;
|
protected final TbQueueConsumer<TbProtoQueueMsg<N>> nfConsumer;
|
||||||
protected final JwtSettingsService jwtSettingsService;
|
protected final JwtSettingsService jwtSettingsService;
|
||||||
protected final JwtTokenFactory jwtTokenFactory;
|
|
||||||
|
|
||||||
public void init(String nfConsumerThreadName) {
|
public void init(String nfConsumerThreadName) {
|
||||||
this.notificationsConsumerExecutor = Executors.newSingleThreadExecutor(ThingsBoardThreadFactory.forName(nfConsumerThreadName));
|
this.notificationsConsumerExecutor = Executors.newSingleThreadExecutor(ThingsBoardThreadFactory.forName(nfConsumerThreadName));
|
||||||
@ -166,7 +165,6 @@ public abstract class AbstractConsumerService<N extends com.google.protobuf.Gene
|
|||||||
} else if (EntityType.TENANT.equals(componentLifecycleMsg.getEntityId().getEntityType())) {
|
} else if (EntityType.TENANT.equals(componentLifecycleMsg.getEntityId().getEntityType())) {
|
||||||
if (TenantId.SYS_TENANT_ID.equals(tenantId)) {
|
if (TenantId.SYS_TENANT_ID.equals(tenantId)) {
|
||||||
jwtSettingsService.reloadJwtSettings();
|
jwtSettingsService.reloadJwtSettings();
|
||||||
jwtTokenFactory.reload();
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
tenantProfileCache.evict(tenantId);
|
tenantProfileCache.evict(tenantId);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user