Browse Source
Merge pull request #7550 from ShvaykaD/feature/check_tenant_entity_for_nodes
Fix compilation error in alarm service for issue #7393
pull/7569/head
Andrew Shvayka
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with
18 additions and
9 deletions
-
application/src/main/java/org/thingsboard/server/actors/ruleChain/DefaultTbContext.java
-
application/src/main/java/org/thingsboard/server/service/apiusage/TbApiUsageStateService.java
-
application/src/main/java/org/thingsboard/server/service/rpc/DefaultTbRuleEngineRpcService.java
-
application/src/main/java/org/thingsboard/server/service/telemetry/DefaultAlarmSubscriptionService.java
-
common/dao-api/src/main/java/org/thingsboard/server/dao/alarm/AlarmService.java
-
dao/src/main/java/org/thingsboard/server/dao/alarm/BaseAlarmService.java
-
rule-engine/rule-engine-api/src/main/java/org/thingsboard/rule/engine/api/RuleEngineRpcService.java
|
|
|
@ -5,7 +5,7 @@ |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* You may obtain a copy of the License at |
|
|
|
* |
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
* |
|
|
|
* Unless required by applicable law or agreed to in writing, software |
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
|
|
|
|
|
|
|
@ -17,7 +17,6 @@ package org.thingsboard.server.service.apiusage; |
|
|
|
|
|
|
|
import org.springframework.context.ApplicationListener; |
|
|
|
import org.thingsboard.rule.engine.api.RuleEngineApiUsageStateService; |
|
|
|
import org.thingsboard.server.common.data.ApiUsageState; |
|
|
|
import org.thingsboard.server.common.data.id.CustomerId; |
|
|
|
import org.thingsboard.server.common.data.id.TenantId; |
|
|
|
import org.thingsboard.server.common.data.id.TenantProfileId; |
|
|
|
@ -31,8 +30,6 @@ public interface TbApiUsageStateService extends TbApiUsageStateClient, RuleEngin |
|
|
|
|
|
|
|
void process(TbProtoQueueMsg<ToUsageStatsServiceMsg> msg, TbCallback callback); |
|
|
|
|
|
|
|
ApiUsageState getApiUsageState(TenantId tenantId); |
|
|
|
|
|
|
|
void onTenantProfileUpdate(TenantProfileId tenantProfileId); |
|
|
|
|
|
|
|
void onTenantUpdate(TenantId tenantId); |
|
|
|
|
|
|
|
@ -15,7 +15,6 @@ |
|
|
|
*/ |
|
|
|
package org.thingsboard.server.service.rpc; |
|
|
|
|
|
|
|
import com.google.common.util.concurrent.ListenableFuture; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -67,7 +66,8 @@ public class DefaultTbRuleEngineRpcService implements TbRuleEngineDeviceRpcServi |
|
|
|
|
|
|
|
public DefaultTbRuleEngineRpcService(PartitionService partitionService, |
|
|
|
TbClusterService clusterService, |
|
|
|
TbServiceInfoProvider serviceInfoProvider, RpcService rpcService) { |
|
|
|
TbServiceInfoProvider serviceInfoProvider, |
|
|
|
RpcService rpcService) { |
|
|
|
this.partitionService = partitionService; |
|
|
|
this.clusterService = clusterService; |
|
|
|
this.serviceInfoProvider = serviceInfoProvider; |
|
|
|
|
|
|
|
@ -129,6 +129,11 @@ public class DefaultAlarmSubscriptionService extends AbstractSubscriptionService |
|
|
|
return alarmService.findAlarmByIdAsync(tenantId, alarmId); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Alarm findAlarmById(TenantId tenantId, AlarmId alarmId) { |
|
|
|
return alarmService.findAlarmById(tenantId, alarmId); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ListenableFuture<AlarmInfo> findAlarmInfoByIdAsync(TenantId tenantId, AlarmId alarmId) { |
|
|
|
return alarmService.findAlarmInfoByIdAsync(tenantId, alarmId); |
|
|
|
|
|
|
|
@ -48,6 +48,8 @@ public interface AlarmService { |
|
|
|
|
|
|
|
ListenableFuture<AlarmOperationResult> clearAlarm(TenantId tenantId, AlarmId alarmId, JsonNode details, long clearTs); |
|
|
|
|
|
|
|
Alarm findAlarmById(TenantId tenantId, AlarmId alarmId); |
|
|
|
|
|
|
|
ListenableFuture<Alarm> findAlarmByIdAsync(TenantId tenantId, AlarmId alarmId); |
|
|
|
|
|
|
|
ListenableFuture<AlarmInfo> findAlarmInfoByIdAsync(TenantId tenantId, AlarmId alarmId); |
|
|
|
|
|
|
|
@ -262,9 +262,16 @@ public class BaseAlarmService extends AbstractEntityService implements AlarmServ |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ListenableFuture<Alarm> findAlarmByIdAsync(TenantId tenantId, AlarmId alarmId) { |
|
|
|
public Alarm findAlarmById(TenantId tenantId, AlarmId alarmId) { |
|
|
|
log.trace("Executing findAlarmById [{}]", alarmId); |
|
|
|
validateId(alarmId, "Incorrect alarmId " + alarmId); |
|
|
|
return alarmDao.findAlarmById(tenantId, alarmId.getId()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ListenableFuture<Alarm> findAlarmByIdAsync(TenantId tenantId, AlarmId alarmId) { |
|
|
|
log.trace("Executing findAlarmByIdAsync [{}]", alarmId); |
|
|
|
validateId(alarmId, "Incorrect alarmId " + alarmId); |
|
|
|
return alarmDao.findAlarmByIdAsync(tenantId, alarmId.getId()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -15,8 +15,6 @@ |
|
|
|
*/ |
|
|
|
package org.thingsboard.rule.engine.api; |
|
|
|
|
|
|
|
import com.google.common.util.concurrent.ListenableFuture; |
|
|
|
import org.thingsboard.server.common.data.id.DeviceId; |
|
|
|
import org.thingsboard.server.common.data.id.RpcId; |
|
|
|
import org.thingsboard.server.common.data.id.TenantId; |
|
|
|
import org.thingsboard.server.common.data.rpc.Rpc; |
|
|
|
|