Commit f3a5cb316242634a019f2bdab54cd6f2b4b4d464

Authored by Andrii Shvaika
1 parent 059383a2

AlarmRules

  1 +/**
  2 + * Copyright © 2016-2020 The Thingsboard Authors
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License");
  5 + * you may not use this file except in compliance with the License.
  6 + * You may obtain a copy of the License at
  7 + *
  8 + * http://www.apache.org/licenses/LICENSE-2.0
  9 + *
  10 + * Unless required by applicable law or agreed to in writing, software
  11 + * distributed under the License is distributed on an "AS IS" BASIS,
  12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + * See the License for the specific language governing permissions and
  14 + * limitations under the License.
  15 + */
  16 +package org.thingsboard.server.common.data.device.profile;
  17 +
  18 +import org.thingsboard.server.common.data.query.KeyFilter;
  19 +
  20 +import java.util.List;
  21 +import java.util.concurrent.TimeUnit;
  22 +
  23 +public class AlarmCondition {
  24 +
  25 + private List<KeyFilter> condition;
  26 + private TimeUnit durationUnit;
  27 + private long durationValue;
  28 +
  29 +}
... ...
  1 +/**
  2 + * Copyright © 2016-2020 The Thingsboard Authors
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License");
  5 + * you may not use this file except in compliance with the License.
  6 + * You may obtain a copy of the License at
  7 + *
  8 + * http://www.apache.org/licenses/LICENSE-2.0
  9 + *
  10 + * Unless required by applicable law or agreed to in writing, software
  11 + * distributed under the License is distributed on an "AS IS" BASIS,
  12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + * See the License for the specific language governing permissions and
  14 + * limitations under the License.
  15 + */
  16 +package org.thingsboard.server.common.data.device.profile;
  17 +
  18 +public class AlarmRule {
  19 +
  20 + private AlarmCondition condition;
  21 + // Advanced
  22 + private String alarmDetails;
  23 +
  24 +}
... ...
  1 +/**
  2 + * Copyright © 2016-2020 The Thingsboard Authors
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License");
  5 + * you may not use this file except in compliance with the License.
  6 + * You may obtain a copy of the License at
  7 + *
  8 + * http://www.apache.org/licenses/LICENSE-2.0
  9 + *
  10 + * Unless required by applicable law or agreed to in writing, software
  11 + * distributed under the License is distributed on an "AS IS" BASIS,
  12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + * See the License for the specific language governing permissions and
  14 + * limitations under the License.
  15 + */
  16 +package org.thingsboard.server.common.data.device.profile;
  17 +
  18 +import lombok.Data;
  19 +import org.thingsboard.server.common.data.alarm.AlarmSeverity;
  20 +
  21 +import java.util.List;
  22 +import java.util.Map;
  23 +
  24 +@Data
  25 +public class DeviceProfileAlarm {
  26 +
  27 + private String id;
  28 + private String alarmType;
  29 +
  30 + private Map<AlarmSeverity, AlarmRule> createRules;
  31 + private AlarmRule clearRule;
  32 +
  33 + // Hidden in advanced settings
  34 + private boolean propagate;
  35 + private List<String> propagateRelationTypes;
  36 +
  37 +}
... ...
... ... @@ -17,10 +17,13 @@ package org.thingsboard.server.common.data.device.profile;
17 17
18 18 import lombok.Data;
19 19
  20 +import java.util.List;
  21 +
20 22 @Data
21 23 public class DeviceProfileData {
22 24
23 25 private DeviceProfileConfiguration configuration;
24 26 private DeviceProfileTransportConfiguration transportConfiguration;
  27 + private List<DeviceProfileAlarm> alarms;
25 28
26 29 }
... ...