Search in sources :

Example 21 with DeviceProfileAlarm

use of org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm in project thingsboard by thingsboard.

the class TbDeviceProfileNodeTest method testCurrentDeviceAttributeForUseDefaultRepeatingWhenDynamicDurationValueIsNull.

@Test
public void testCurrentDeviceAttributeForUseDefaultRepeatingWhenDynamicDurationValueIsNull() throws Exception {
    init();
    DeviceProfile deviceProfile = new DeviceProfile();
    deviceProfile.setId(deviceProfileId);
    DeviceProfileData deviceProfileData = new DeviceProfileData();
    Device device = new Device();
    device.setId(deviceId);
    device.setCustomerId(customerId);
    AttributeKvCompositeKey compositeKey = new AttributeKvCompositeKey(EntityType.TENANT, deviceId.getId(), "SERVER_SCOPE", "greaterAttribute");
    AttributeKvEntity attributeKvEntity = new AttributeKvEntity();
    attributeKvEntity.setId(compositeKey);
    attributeKvEntity.setLongValue(30L);
    attributeKvEntity.setLastUpdateTs(0L);
    AttributeKvEntry entry = attributeKvEntity.toData();
    ListenableFuture<List<AttributeKvEntry>> listListenableFuture = Futures.immediateFuture(Collections.singletonList(entry));
    AlarmConditionFilter highTempFilter = new AlarmConditionFilter();
    highTempFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "temperature"));
    highTempFilter.setValueType(EntityKeyValueType.NUMERIC);
    NumericFilterPredicate highTemperaturePredicate = new NumericFilterPredicate();
    highTemperaturePredicate.setOperation(NumericFilterPredicate.NumericOperation.GREATER);
    highTemperaturePredicate.setValue(new FilterPredicateValue<>(0.0, null, new DynamicValue<>(DynamicValueSourceType.CURRENT_DEVICE, "greaterAttribute")));
    highTempFilter.setPredicate(highTemperaturePredicate);
    AlarmCondition alarmCondition = new AlarmCondition();
    alarmCondition.setCondition(Collections.singletonList(highTempFilter));
    RepeatingAlarmConditionSpec repeating = new RepeatingAlarmConditionSpec();
    repeating.setPredicate(new FilterPredicateValue<>(0, null, new DynamicValue<>(DynamicValueSourceType.CURRENT_DEVICE, "alarm_rule", false)));
    alarmCondition.setSpec(repeating);
    AlarmRule alarmRule = new AlarmRule();
    alarmRule.setCondition(alarmCondition);
    DeviceProfileAlarm dpa = new DeviceProfileAlarm();
    dpa.setId("highTemperatureAlarmID");
    dpa.setAlarmType("highTemperatureAlarm");
    dpa.setCreateRules(new TreeMap<>(Collections.singletonMap(AlarmSeverity.CRITICAL, alarmRule)));
    deviceProfileData.setAlarms(Collections.singletonList(dpa));
    deviceProfile.setProfileData(deviceProfileData);
    Mockito.when(cache.get(tenantId, deviceId)).thenReturn(deviceProfile);
    Mockito.when(timeseriesService.findLatest(tenantId, deviceId, Collections.singleton("temperature"))).thenReturn(Futures.immediateFuture(Collections.emptyList()));
    Mockito.when(alarmService.findLatestByOriginatorAndType(tenantId, deviceId, "highTemperatureAlarm")).thenReturn(Futures.immediateFuture(null));
    Mockito.when(alarmService.createOrUpdateAlarm(Mockito.any())).thenAnswer(AdditionalAnswers.returnsFirstArg());
    Mockito.when(ctx.getAttributesService()).thenReturn(attributesService);
    Mockito.when(attributesService.find(eq(tenantId), eq(deviceId), Mockito.anyString(), Mockito.anySet())).thenReturn(listListenableFuture);
    TbMsg theMsg = TbMsg.newMsg("ALARM", deviceId, new TbMsgMetaData(), "");
    Mockito.when(ctx.newMsg(Mockito.anyString(), Mockito.anyString(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.anyString())).thenReturn(theMsg);
    ObjectNode data = mapper.createObjectNode();
    data.put("temperature", 35);
    TbMsg msg = TbMsg.newMsg(SessionMsgType.POST_TELEMETRY_REQUEST.name(), deviceId, new TbMsgMetaData(), TbMsgDataType.JSON, mapper.writeValueAsString(data), null, null);
    node.onMsg(ctx, msg);
    verify(ctx).tellSuccess(msg);
    verify(ctx).enqueueForTellNext(theMsg, "Alarm Created");
    verify(ctx, Mockito.never()).tellFailure(Mockito.any(), Mockito.any());
}
Also used : AttributeKvEntry(org.thingsboard.server.common.data.kv.AttributeKvEntry) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) AttributeKvEntity(org.thingsboard.server.dao.model.sql.AttributeKvEntity) NumericFilterPredicate(org.thingsboard.server.common.data.query.NumericFilterPredicate) Device(org.thingsboard.server.common.data.Device) AlarmRule(org.thingsboard.server.common.data.device.profile.AlarmRule) TbMsgMetaData(org.thingsboard.server.common.msg.TbMsgMetaData) AlarmConditionFilter(org.thingsboard.server.common.data.device.profile.AlarmConditionFilter) DeviceProfile(org.thingsboard.server.common.data.DeviceProfile) AlarmCondition(org.thingsboard.server.common.data.device.profile.AlarmCondition) DeviceProfileAlarm(org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm) List(java.util.List) RepeatingAlarmConditionSpec(org.thingsboard.server.common.data.device.profile.RepeatingAlarmConditionSpec) DeviceProfileData(org.thingsboard.server.common.data.device.profile.DeviceProfileData) AlarmConditionFilterKey(org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey) AttributeKvCompositeKey(org.thingsboard.server.dao.model.sql.AttributeKvCompositeKey) DynamicValue(org.thingsboard.server.common.data.query.DynamicValue) TbMsg(org.thingsboard.server.common.msg.TbMsg) Test(org.junit.Test)

Example 22 with DeviceProfileAlarm

use of org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm in project thingsboard by thingsboard.

the class AlarmState method updateState.

public void updateState(DeviceProfileAlarm alarm, PersistedAlarmState alarmState) {
    this.alarmDefinition = alarm;
    this.createRulesSortedBySeverityDesc = new ArrayList<>();
    alarmDefinition.getCreateRules().forEach((severity, rule) -> {
        PersistedAlarmRuleState ruleState = null;
        if (alarmState != null) {
            ruleState = alarmState.getCreateRuleStates().get(severity);
            if (ruleState == null) {
                ruleState = new PersistedAlarmRuleState();
                alarmState.getCreateRuleStates().put(severity, ruleState);
            }
        }
        createRulesSortedBySeverityDesc.add(new AlarmRuleState(severity, rule, deviceProfile.getCreateAlarmKeys(alarm.getId(), severity), ruleState, dynamicPredicateValueCtx));
    });
    createRulesSortedBySeverityDesc.sort(Comparator.comparingInt(state -> state.getSeverity().ordinal()));
    PersistedAlarmRuleState ruleState = alarmState == null ? null : alarmState.getClearRuleState();
    if (alarmDefinition.getClearRule() != null) {
        clearState = new AlarmRuleState(null, alarmDefinition.getClearRule(), deviceProfile.getClearAlarmKeys(alarm.getId()), ruleState, dynamicPredicateValueCtx);
    }
}
Also used : AlarmSeverity(org.thingsboard.server.common.data.alarm.AlarmSeverity) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) TbMsg(org.thingsboard.server.common.msg.TbMsg) BiFunction(java.util.function.BiFunction) JacksonUtil(org.thingsboard.common.util.JacksonUtil) DonAsynchron(org.thingsboard.common.util.DonAsynchron) TbAlarmResult(org.thingsboard.rule.engine.action.TbAlarmResult) AlarmConditionKeyType(org.thingsboard.server.common.data.device.profile.AlarmConditionKeyType) TbContext(org.thingsboard.rule.engine.api.TbContext) StringUtils(org.apache.commons.lang3.StringUtils) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) TbMsgMetaData(org.thingsboard.server.common.msg.TbMsgMetaData) ArrayList(java.util.ArrayList) DeviceProfileAlarm(org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm) EntityId(org.thingsboard.server.common.data.id.EntityId) JsonNode(com.fasterxml.jackson.databind.JsonNode) AlarmStatus(org.thingsboard.server.common.data.alarm.AlarmStatus) PersistedAlarmRuleState(org.thingsboard.rule.engine.profile.state.PersistedAlarmRuleState) DashboardId(org.thingsboard.server.common.data.id.DashboardId) DataConstants(org.thingsboard.server.common.data.DataConstants) PersistedAlarmState(org.thingsboard.rule.engine.profile.state.PersistedAlarmState) AlarmOperationResult(org.thingsboard.server.dao.alarm.AlarmOperationResult) Alarm(org.thingsboard.server.common.data.alarm.Alarm) ExecutionException(java.util.concurrent.ExecutionException) Slf4j(lombok.extern.slf4j.Slf4j) ServiceQueue(org.thingsboard.server.common.msg.queue.ServiceQueue) List(java.util.List) Data(lombok.Data) AlarmConditionSpecType(org.thingsboard.server.common.data.device.profile.AlarmConditionSpecType) Comparator(java.util.Comparator) PersistedAlarmRuleState(org.thingsboard.rule.engine.profile.state.PersistedAlarmRuleState) PersistedAlarmRuleState(org.thingsboard.rule.engine.profile.state.PersistedAlarmRuleState)

Example 23 with DeviceProfileAlarm

use of org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm in project thingsboard by thingsboard.

the class ProfileState method updateDeviceProfile.

void updateDeviceProfile(DeviceProfile deviceProfile) {
    this.deviceProfile = deviceProfile;
    alarmSettings.clear();
    alarmCreateKeys.clear();
    alarmClearKeys.clear();
    entityKeys.clear();
    if (deviceProfile.getProfileData().getAlarms() != null) {
        alarmSettings.addAll(deviceProfile.getProfileData().getAlarms());
        for (DeviceProfileAlarm alarm : deviceProfile.getProfileData().getAlarms()) {
            Map<AlarmSeverity, Set<AlarmConditionFilterKey>> createAlarmKeys = alarmCreateKeys.computeIfAbsent(alarm.getId(), id -> new HashMap<>());
            alarm.getCreateRules().forEach(((severity, alarmRule) -> {
                var ruleKeys = createAlarmKeys.computeIfAbsent(severity, id -> new HashSet<>());
                for (var keyFilter : alarmRule.getCondition().getCondition()) {
                    entityKeys.add(keyFilter.getKey());
                    ruleKeys.add(keyFilter.getKey());
                    addDynamicValuesRecursively(keyFilter.getPredicate(), entityKeys, ruleKeys);
                }
                addEntityKeysFromAlarmConditionSpec(alarmRule);
            }));
            if (alarm.getClearRule() != null) {
                var clearAlarmKeys = alarmClearKeys.computeIfAbsent(alarm.getId(), id -> new HashSet<>());
                for (var keyFilter : alarm.getClearRule().getCondition().getCondition()) {
                    entityKeys.add(keyFilter.getKey());
                    clearAlarmKeys.add(keyFilter.getKey());
                    addDynamicValuesRecursively(keyFilter.getPredicate(), entityKeys, clearAlarmKeys);
                }
                addEntityKeysFromAlarmConditionSpec(alarm.getClearRule());
            }
        }
    }
}
Also used : AlarmSeverity(org.thingsboard.server.common.data.alarm.AlarmSeverity) DynamicValue(org.thingsboard.server.common.data.query.DynamicValue) Getter(lombok.Getter) AlarmRule(org.thingsboard.server.common.data.device.profile.AlarmRule) AlarmConditionKeyType(org.thingsboard.server.common.data.device.profile.AlarmConditionKeyType) DeviceProfileId(org.thingsboard.server.common.data.id.DeviceProfileId) HashMap(java.util.HashMap) DynamicValueSourceType(org.thingsboard.server.common.data.query.DynamicValueSourceType) HashSet(java.util.HashSet) AccessLevel(lombok.AccessLevel) KeyFilterPredicate(org.thingsboard.server.common.data.query.KeyFilterPredicate) AlarmConditionFilterKey(org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey) DeviceProfileAlarm(org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm) Map(java.util.Map) DurationAlarmConditionSpec(org.thingsboard.server.common.data.device.profile.DurationAlarmConditionSpec) AlarmConditionSpec(org.thingsboard.server.common.data.device.profile.AlarmConditionSpec) ComplexFilterPredicate(org.thingsboard.server.common.data.query.ComplexFilterPredicate) DeviceProfile(org.thingsboard.server.common.data.DeviceProfile) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) List(java.util.List) RepeatingAlarmConditionSpec(org.thingsboard.server.common.data.device.profile.RepeatingAlarmConditionSpec) SimpleKeyFilterPredicate(org.thingsboard.server.common.data.query.SimpleKeyFilterPredicate) AlarmConditionSpecType(org.thingsboard.server.common.data.device.profile.AlarmConditionSpecType) Collections(java.util.Collections) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) AlarmSeverity(org.thingsboard.server.common.data.alarm.AlarmSeverity) HashSet(java.util.HashSet) Set(java.util.Set) DeviceProfileAlarm(org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm) HashSet(java.util.HashSet)

Example 24 with DeviceProfileAlarm

use of org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm in project thingsboard by thingsboard.

the class DeviceState method processAlarmAckNotification.

private void processAlarmAckNotification(TbContext ctx, TbMsg msg) {
    Alarm alarmNf = JacksonUtil.fromString(msg.getData(), Alarm.class);
    for (DeviceProfileAlarm alarm : deviceProfile.getAlarmSettings()) {
        AlarmState alarmState = alarmStates.computeIfAbsent(alarm.getId(), a -> new AlarmState(this.deviceProfile, deviceId, alarm, getOrInitPersistedAlarmState(alarm), dynamicPredicateValueCtx));
        alarmState.processAckAlarm(alarmNf);
    }
    ctx.tellSuccess(msg);
}
Also used : PersistedAlarmState(org.thingsboard.rule.engine.profile.state.PersistedAlarmState) DeviceProfileAlarm(org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm) Alarm(org.thingsboard.server.common.data.alarm.Alarm) DeviceProfileAlarm(org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm)

Example 25 with DeviceProfileAlarm

use of org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm in project thingsboard by thingsboard.

the class DeviceProfileDataValidator method validateDataImpl.

@Override
protected void validateDataImpl(TenantId tenantId, DeviceProfile deviceProfile) {
    if (org.thingsboard.server.common.data.StringUtils.isEmpty(deviceProfile.getName())) {
        throw new DataValidationException("Device profile name should be specified!");
    }
    if (deviceProfile.getType() == null) {
        throw new DataValidationException("Device profile type should be specified!");
    }
    if (deviceProfile.getTransportType() == null) {
        throw new DataValidationException("Device profile transport type should be specified!");
    }
    if (deviceProfile.getTenantId() == null) {
        throw new DataValidationException("Device profile should be assigned to tenant!");
    } else {
        Tenant tenant = tenantDao.findById(deviceProfile.getTenantId(), deviceProfile.getTenantId().getId());
        if (tenant == null) {
            throw new DataValidationException("Device profile is referencing to non-existent tenant!");
        }
    }
    if (deviceProfile.isDefault()) {
        DeviceProfile defaultDeviceProfile = deviceProfileService.findDefaultDeviceProfile(tenantId);
        if (defaultDeviceProfile != null && !defaultDeviceProfile.getId().equals(deviceProfile.getId())) {
            throw new DataValidationException("Another default device profile is present in scope of current tenant!");
        }
    }
    if (!org.thingsboard.server.common.data.StringUtils.isEmpty(deviceProfile.getDefaultQueueName()) && queueService != null) {
        if (!queueService.getQueuesByServiceType(ServiceType.TB_RULE_ENGINE).contains(deviceProfile.getDefaultQueueName())) {
            throw new DataValidationException("Device profile is referencing to non-existent queue!");
        }
    }
    if (deviceProfile.getProvisionType() == null) {
        deviceProfile.setProvisionType(DeviceProfileProvisionType.DISABLED);
    }
    DeviceProfileTransportConfiguration transportConfiguration = deviceProfile.getProfileData().getTransportConfiguration();
    transportConfiguration.validate();
    if (transportConfiguration instanceof MqttDeviceProfileTransportConfiguration) {
        MqttDeviceProfileTransportConfiguration mqttTransportConfiguration = (MqttDeviceProfileTransportConfiguration) transportConfiguration;
        if (mqttTransportConfiguration.getTransportPayloadTypeConfiguration() instanceof ProtoTransportPayloadConfiguration) {
            ProtoTransportPayloadConfiguration protoTransportPayloadConfiguration = (ProtoTransportPayloadConfiguration) mqttTransportConfiguration.getTransportPayloadTypeConfiguration();
            validateProtoSchemas(protoTransportPayloadConfiguration);
            validateTelemetryDynamicMessageFields(protoTransportPayloadConfiguration);
            validateRpcRequestDynamicMessageFields(protoTransportPayloadConfiguration);
        }
    } else if (transportConfiguration instanceof CoapDeviceProfileTransportConfiguration) {
        CoapDeviceProfileTransportConfiguration coapDeviceProfileTransportConfiguration = (CoapDeviceProfileTransportConfiguration) transportConfiguration;
        CoapDeviceTypeConfiguration coapDeviceTypeConfiguration = coapDeviceProfileTransportConfiguration.getCoapDeviceTypeConfiguration();
        if (coapDeviceTypeConfiguration instanceof DefaultCoapDeviceTypeConfiguration) {
            DefaultCoapDeviceTypeConfiguration defaultCoapDeviceTypeConfiguration = (DefaultCoapDeviceTypeConfiguration) coapDeviceTypeConfiguration;
            TransportPayloadTypeConfiguration transportPayloadTypeConfiguration = defaultCoapDeviceTypeConfiguration.getTransportPayloadTypeConfiguration();
            if (transportPayloadTypeConfiguration instanceof ProtoTransportPayloadConfiguration) {
                ProtoTransportPayloadConfiguration protoTransportPayloadConfiguration = (ProtoTransportPayloadConfiguration) transportPayloadTypeConfiguration;
                validateProtoSchemas(protoTransportPayloadConfiguration);
                validateTelemetryDynamicMessageFields(protoTransportPayloadConfiguration);
                validateRpcRequestDynamicMessageFields(protoTransportPayloadConfiguration);
            }
        }
    } else if (transportConfiguration instanceof Lwm2mDeviceProfileTransportConfiguration) {
        List<LwM2MBootstrapServerCredential> lwM2MBootstrapServersConfigurations = ((Lwm2mDeviceProfileTransportConfiguration) transportConfiguration).getBootstrap();
        if (lwM2MBootstrapServersConfigurations != null) {
            validateLwm2mServersConfigOfBootstrapForClient(lwM2MBootstrapServersConfigurations, ((Lwm2mDeviceProfileTransportConfiguration) transportConfiguration).isBootstrapServerUpdateEnable());
            for (LwM2MBootstrapServerCredential bootstrapServerCredential : lwM2MBootstrapServersConfigurations) {
                validateLwm2mServersCredentialOfBootstrapForClient(bootstrapServerCredential);
            }
        }
    }
    List<DeviceProfileAlarm> profileAlarms = deviceProfile.getProfileData().getAlarms();
    if (!CollectionUtils.isEmpty(profileAlarms)) {
        Set<String> alarmTypes = new HashSet<>();
        for (DeviceProfileAlarm alarm : profileAlarms) {
            String alarmType = alarm.getAlarmType();
            if (StringUtils.isEmpty(alarmType)) {
                throw new DataValidationException("Alarm rule type should be specified!");
            }
            if (!alarmTypes.add(alarmType)) {
                throw new DataValidationException(String.format("Can't create device profile with the same alarm rule types: \"%s\"!", alarmType));
            }
        }
    }
    if (deviceProfile.getDefaultRuleChainId() != null) {
        RuleChain ruleChain = ruleChainService.findRuleChainById(tenantId, deviceProfile.getDefaultRuleChainId());
        if (ruleChain == null) {
            throw new DataValidationException("Can't assign non-existent rule chain!");
        }
    }
    if (deviceProfile.getDefaultDashboardId() != null) {
        DashboardInfo dashboard = dashboardService.findDashboardInfoById(tenantId, deviceProfile.getDefaultDashboardId());
        if (dashboard == null) {
            throw new DataValidationException("Can't assign non-existent dashboard!");
        }
    }
    if (deviceProfile.getFirmwareId() != null) {
        OtaPackage firmware = otaPackageService.findOtaPackageById(tenantId, deviceProfile.getFirmwareId());
        if (firmware == null) {
            throw new DataValidationException("Can't assign non-existent firmware!");
        }
        if (!firmware.getType().equals(OtaPackageType.FIRMWARE)) {
            throw new DataValidationException("Can't assign firmware with type: " + firmware.getType());
        }
        if (firmware.getData() == null && !firmware.hasUrl()) {
            throw new DataValidationException("Can't assign firmware with empty data!");
        }
        if (!firmware.getDeviceProfileId().equals(deviceProfile.getId())) {
            throw new DataValidationException("Can't assign firmware with different deviceProfile!");
        }
    }
    if (deviceProfile.getSoftwareId() != null) {
        OtaPackage software = otaPackageService.findOtaPackageById(tenantId, deviceProfile.getSoftwareId());
        if (software == null) {
            throw new DataValidationException("Can't assign non-existent software!");
        }
        if (!software.getType().equals(OtaPackageType.SOFTWARE)) {
            throw new DataValidationException("Can't assign software with type: " + software.getType());
        }
        if (software.getData() == null && !software.hasUrl()) {
            throw new DataValidationException("Can't assign software with empty data!");
        }
        if (!software.getDeviceProfileId().equals(deviceProfile.getId())) {
            throw new DataValidationException("Can't assign firmware with different deviceProfile!");
        }
    }
}
Also used : DataValidationException(org.thingsboard.server.dao.exception.DataValidationException) DefaultCoapDeviceTypeConfiguration(org.thingsboard.server.common.data.device.profile.DefaultCoapDeviceTypeConfiguration) Lwm2mDeviceProfileTransportConfiguration(org.thingsboard.server.common.data.device.profile.Lwm2mDeviceProfileTransportConfiguration) CoapDeviceProfileTransportConfiguration(org.thingsboard.server.common.data.device.profile.CoapDeviceProfileTransportConfiguration) DashboardInfo(org.thingsboard.server.common.data.DashboardInfo) DeviceProfile(org.thingsboard.server.common.data.DeviceProfile) Tenant(org.thingsboard.server.common.data.Tenant) MqttDeviceProfileTransportConfiguration(org.thingsboard.server.common.data.device.profile.MqttDeviceProfileTransportConfiguration) CoapDeviceProfileTransportConfiguration(org.thingsboard.server.common.data.device.profile.CoapDeviceProfileTransportConfiguration) MqttDeviceProfileTransportConfiguration(org.thingsboard.server.common.data.device.profile.MqttDeviceProfileTransportConfiguration) Lwm2mDeviceProfileTransportConfiguration(org.thingsboard.server.common.data.device.profile.Lwm2mDeviceProfileTransportConfiguration) DeviceProfileTransportConfiguration(org.thingsboard.server.common.data.device.profile.DeviceProfileTransportConfiguration) AbstractLwM2MBootstrapServerCredential(org.thingsboard.server.common.data.device.profile.lwm2m.bootstrap.AbstractLwM2MBootstrapServerCredential) RPKLwM2MBootstrapServerCredential(org.thingsboard.server.common.data.device.profile.lwm2m.bootstrap.RPKLwM2MBootstrapServerCredential) LwM2MBootstrapServerCredential(org.thingsboard.server.common.data.device.profile.lwm2m.bootstrap.LwM2MBootstrapServerCredential) X509LwM2MBootstrapServerCredential(org.thingsboard.server.common.data.device.profile.lwm2m.bootstrap.X509LwM2MBootstrapServerCredential) RuleChain(org.thingsboard.server.common.data.rule.RuleChain) ProtoTransportPayloadConfiguration(org.thingsboard.server.common.data.device.profile.ProtoTransportPayloadConfiguration) OtaPackage(org.thingsboard.server.common.data.OtaPackage) DeviceProfileAlarm(org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm) TransportPayloadTypeConfiguration(org.thingsboard.server.common.data.device.profile.TransportPayloadTypeConfiguration) DefaultCoapDeviceTypeConfiguration(org.thingsboard.server.common.data.device.profile.DefaultCoapDeviceTypeConfiguration) CoapDeviceTypeConfiguration(org.thingsboard.server.common.data.device.profile.CoapDeviceTypeConfiguration) HashSet(java.util.HashSet)

Aggregations

DeviceProfileAlarm (org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm)25 AlarmConditionFilterKey (org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey)18 DeviceProfile (org.thingsboard.server.common.data.DeviceProfile)17 AlarmRule (org.thingsboard.server.common.data.device.profile.AlarmRule)17 AlarmCondition (org.thingsboard.server.common.data.device.profile.AlarmCondition)16 AlarmConditionFilter (org.thingsboard.server.common.data.device.profile.AlarmConditionFilter)16 DeviceProfileData (org.thingsboard.server.common.data.device.profile.DeviceProfileData)16 NumericFilterPredicate (org.thingsboard.server.common.data.query.NumericFilterPredicate)16 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)15 List (java.util.List)15 AttributeKvEntry (org.thingsboard.server.common.data.kv.AttributeKvEntry)15 TbMsg (org.thingsboard.server.common.msg.TbMsg)15 TbMsgMetaData (org.thingsboard.server.common.msg.TbMsgMetaData)15 Test (org.junit.Test)14 DynamicValue (org.thingsboard.server.common.data.query.DynamicValue)14 AttributeKvCompositeKey (org.thingsboard.server.dao.model.sql.AttributeKvCompositeKey)13 AttributeKvEntity (org.thingsboard.server.dao.model.sql.AttributeKvEntity)13 Device (org.thingsboard.server.common.data.Device)9 Optional (java.util.Optional)7 PersistedAlarmState (org.thingsboard.rule.engine.profile.state.PersistedAlarmState)7