Showing
12 changed files
with
39 additions
and
61 deletions
... | ... | @@ -31,17 +31,9 @@ import org.thingsboard.server.common.data.id.CustomerId; |
31 | 31 | import org.thingsboard.server.common.data.id.DeviceProfileId; |
32 | 32 | import org.thingsboard.server.common.data.id.EntityId; |
33 | 33 | import org.thingsboard.server.common.data.id.TenantId; |
34 | -import org.thingsboard.server.common.data.kv.AttributeKvEntry; | |
35 | -import org.thingsboard.server.common.data.kv.BaseAttributeKvEntry; | |
36 | -import org.thingsboard.server.common.data.kv.BooleanDataEntry; | |
37 | -import org.thingsboard.server.common.data.kv.DeleteTsKvQuery; | |
38 | -import org.thingsboard.server.common.data.kv.DoubleDataEntry; | |
39 | -import org.thingsboard.server.common.data.kv.LongDataEntry; | |
40 | -import org.thingsboard.server.common.data.kv.StringDataEntry; | |
41 | -import org.thingsboard.server.common.data.kv.TsKvEntry; | |
42 | -import org.thingsboard.server.common.data.kv.TsKvLatestRemovingResult; | |
34 | +import org.thingsboard.server.common.data.kv.*; | |
43 | 35 | import org.thingsboard.server.common.data.yunteng.dto.TkEventKvEntry; |
44 | -import org.thingsboard.server.common.data.yunteng.enums.TkEventType; | |
36 | +import org.thingsboard.server.common.data.yunteng.enums.DeviceEventTypeEnum; | |
45 | 37 | import org.thingsboard.server.common.msg.queue.ServiceType; |
46 | 38 | import org.thingsboard.server.common.msg.queue.TbCallback; |
47 | 39 | import org.thingsboard.server.common.msg.queue.TopicPartitionInfo; |
... | ... | @@ -58,15 +50,7 @@ import org.thingsboard.server.service.subscription.TbSubscriptionUtils; |
58 | 50 | import javax.annotation.Nullable; |
59 | 51 | import javax.annotation.PostConstruct; |
60 | 52 | import javax.annotation.PreDestroy; |
61 | -import java.util.ArrayList; | |
62 | -import java.util.Collection; | |
63 | -import java.util.Collections; | |
64 | -import java.util.Comparator; | |
65 | -import java.util.HashMap; | |
66 | -import java.util.List; | |
67 | -import java.util.Map; | |
68 | -import java.util.Objects; | |
69 | -import java.util.Optional; | |
53 | +import java.util.*; | |
70 | 54 | import java.util.concurrent.ExecutorService; |
71 | 55 | import java.util.concurrent.Executors; |
72 | 56 | |
... | ... | @@ -252,12 +236,12 @@ public class DefaultTelemetrySubscriptionService extends AbstractSubscriptionSer |
252 | 236 | |
253 | 237 | //Thingskit function |
254 | 238 | @Override |
255 | - public void saveAndNotify(TenantId tenantId, DeviceProfileId profileId, EntityId entityId, String eventId, TkEventType eventType, List<TkEventKvEntry> attributes, FutureCallback<Void> callback) { | |
239 | + public void saveAndNotify(TenantId tenantId, DeviceProfileId profileId, EntityId entityId, String eventId, DeviceEventTypeEnum eventType, List<TkEventKvEntry> attributes, FutureCallback<Void> callback) { | |
256 | 240 | checkInternalEntity(entityId); |
257 | 241 | saveAndNotifyInternal(tenantId,profileId, entityId, eventId,eventType, attributes, callback); |
258 | 242 | } |
259 | 243 | @Override |
260 | - public void saveAndNotifyInternal(TenantId tenantId,DeviceProfileId profileId, EntityId entityId,String eventId, TkEventType eventType, List<TkEventKvEntry> attributes, FutureCallback<Void> callback) { | |
244 | + public void saveAndNotifyInternal(TenantId tenantId,DeviceProfileId profileId, EntityId entityId,String eventId, DeviceEventTypeEnum eventType, List<TkEventKvEntry> attributes, FutureCallback<Void> callback) { | |
261 | 245 | ListenableFuture<List<Void>> saveFuture = eventsService.save(tenantId,profileId, entityId,eventId,eventType, attributes); |
262 | 246 | addVoidCallback(saveFuture, callback); |
263 | 247 | // addWsCallback(saveFuture, success -> onAttributesUpdate(tenantId, entityId, scope, attributes, notifyDevice)); | ... | ... |
... | ... | @@ -23,7 +23,7 @@ import org.thingsboard.server.common.data.id.TenantId; |
23 | 23 | import org.thingsboard.server.common.data.kv.AttributeKvEntry; |
24 | 24 | import org.thingsboard.server.common.data.kv.TsKvEntry; |
25 | 25 | import org.thingsboard.server.common.data.yunteng.dto.TkEventKvEntry; |
26 | -import org.thingsboard.server.common.data.yunteng.enums.TkEventType; | |
26 | +import org.thingsboard.server.common.data.yunteng.enums.DeviceEventTypeEnum; | |
27 | 27 | |
28 | 28 | import java.util.List; |
29 | 29 | |
... | ... | @@ -39,7 +39,7 @@ public interface InternalTelemetryService extends RuleEngineTelemetryService { |
39 | 39 | void saveAndNotifyInternal(TenantId tenantId, EntityId entityId, String scope, List<AttributeKvEntry> attributes, boolean notifyDevice, FutureCallback<Void> callback); |
40 | 40 | |
41 | 41 | //Thingskit function |
42 | - void saveAndNotifyInternal(TenantId tenantId, DeviceProfileId profileId, EntityId entityId, String eventId, TkEventType eventType, List<TkEventKvEntry> attributes, FutureCallback<Void> callback); | |
42 | + void saveAndNotifyInternal(TenantId tenantId, DeviceProfileId profileId, EntityId entityId, String eventId, DeviceEventTypeEnum eventType, List<TkEventKvEntry> attributes, FutureCallback<Void> callback); | |
43 | 43 | |
44 | 44 | void saveLatestAndNotifyInternal(TenantId tenantId, EntityId entityId, List<TsKvEntry> ts, FutureCallback<Void> callback); |
45 | 45 | ... | ... |
... | ... | @@ -21,7 +21,7 @@ import org.thingsboard.server.common.data.id.DeviceProfileId; |
21 | 21 | import org.thingsboard.server.common.data.id.EntityId; |
22 | 22 | import org.thingsboard.server.common.data.id.TenantId; |
23 | 23 | import org.thingsboard.server.common.data.yunteng.dto.TkEventKvEntry; |
24 | -import org.thingsboard.server.common.data.yunteng.enums.TkEventType; | |
24 | +import org.thingsboard.server.common.data.yunteng.enums.DeviceEventTypeEnum; | |
25 | 25 | |
26 | 26 | import java.util.Collection; |
27 | 27 | import java.util.List; |
... | ... | @@ -36,11 +36,11 @@ public interface TkEventsService { |
36 | 36 | |
37 | 37 | ListenableFuture<List<TkEventKvEntry>> find(TenantId tenantId, EntityId entityId, String scope, Collection<String> eventKeys); |
38 | 38 | |
39 | - ListenableFuture<List<TkEventKvEntry>> findAll(TenantId tenantId, EntityId entityId,String eventId, TkEventType eventType); | |
39 | + ListenableFuture<List<TkEventKvEntry>> findAll(TenantId tenantId, EntityId entityId,String eventId, DeviceEventTypeEnum eventType); | |
40 | 40 | |
41 | - ListenableFuture<List<Void>> save(TenantId tenantId, DeviceProfileId profileId,EntityId entityId, String eventId, TkEventType eventType, List<TkEventKvEntry> attributes); | |
41 | + ListenableFuture<List<Void>> save(TenantId tenantId, DeviceProfileId profileId,EntityId entityId, String eventId, DeviceEventTypeEnum eventType, List<TkEventKvEntry> attributes); | |
42 | 42 | |
43 | - ListenableFuture<List<Void>> removeAll(TenantId tenantId, EntityId entityId, String eventId, TkEventType eventType, List<String> eventKeys); | |
43 | + ListenableFuture<List<Void>> removeAll(TenantId tenantId, EntityId entityId, String eventId, DeviceEventTypeEnum eventType, List<String> eventKeys); | |
44 | 44 | |
45 | 45 | List<String> findAllKeysByDeviceProfileId(TenantId tenantId, DeviceProfileId deviceProfileId); |
46 | 46 | ... | ... |
... | ... | @@ -24,7 +24,7 @@ import org.thingsboard.server.common.data.id.DeviceProfileId; |
24 | 24 | import org.thingsboard.server.common.data.id.EntityId; |
25 | 25 | import org.thingsboard.server.common.data.id.TenantId; |
26 | 26 | import org.thingsboard.server.common.data.yunteng.dto.TkEventKvEntry; |
27 | -import org.thingsboard.server.common.data.yunteng.enums.TkEventType; | |
27 | +import org.thingsboard.server.common.data.yunteng.enums.DeviceEventTypeEnum; | |
28 | 28 | import org.thingsboard.server.dao.service.Validator; |
29 | 29 | import org.thingsboard.server.dao.yunteng.event.TkEventsService; |
30 | 30 | |
... | ... | @@ -63,7 +63,7 @@ public class BaseEventsService implements TkEventsService { |
63 | 63 | } |
64 | 64 | |
65 | 65 | @Override |
66 | - public ListenableFuture<List<TkEventKvEntry>> findAll(TenantId tenantId, EntityId entityId,String eventId, TkEventType eventType) { | |
66 | + public ListenableFuture<List<TkEventKvEntry>> findAll(TenantId tenantId, EntityId entityId,String eventId, DeviceEventTypeEnum eventType) { | |
67 | 67 | validate(entityId,eventId); |
68 | 68 | return eventsDao.findAll(tenantId, entityId, eventType); |
69 | 69 | } |
... | ... | @@ -79,7 +79,7 @@ public class BaseEventsService implements TkEventsService { |
79 | 79 | } |
80 | 80 | |
81 | 81 | @Override |
82 | - public ListenableFuture<List<Void>> save(TenantId tenantId,DeviceProfileId profileId, EntityId entityId, String eventId, TkEventType eventType, List<TkEventKvEntry> attributes) { | |
82 | + public ListenableFuture<List<Void>> save(TenantId tenantId,DeviceProfileId profileId, EntityId entityId, String eventId, DeviceEventTypeEnum eventType, List<TkEventKvEntry> attributes) { | |
83 | 83 | validate(entityId, eventId,eventType); |
84 | 84 | attributes.forEach(attribute -> validate(attribute)); |
85 | 85 | |
... | ... | @@ -88,7 +88,7 @@ public class BaseEventsService implements TkEventsService { |
88 | 88 | } |
89 | 89 | |
90 | 90 | @Override |
91 | - public ListenableFuture<List<Void>> removeAll(TenantId tenantId, EntityId entityId, String eventId, TkEventType eventType, List<String> eventKeys) { | |
91 | + public ListenableFuture<List<Void>> removeAll(TenantId tenantId, EntityId entityId, String eventId, DeviceEventTypeEnum eventType, List<String> eventKeys) { | |
92 | 92 | validate(entityId, eventId); |
93 | 93 | return eventsDao.removeAll(tenantId, entityId, eventId,eventType, eventKeys); |
94 | 94 | } | ... | ... |
... | ... | @@ -16,9 +16,8 @@ |
16 | 16 | package org.thingsboard.server.dao.yunteng.jpa.dao.event; |
17 | 17 | |
18 | 18 | import org.thingsboard.server.common.data.id.EntityId; |
19 | -import org.thingsboard.server.common.data.kv.AttributeKvEntry; | |
20 | 19 | import org.thingsboard.server.common.data.yunteng.dto.TkEventKvEntry; |
21 | -import org.thingsboard.server.common.data.yunteng.enums.TkEventType; | |
20 | +import org.thingsboard.server.common.data.yunteng.enums.DeviceEventTypeEnum; | |
22 | 21 | import org.thingsboard.server.dao.exception.IncorrectParameterException; |
23 | 22 | import org.thingsboard.server.dao.service.Validator; |
24 | 23 | |
... | ... | @@ -29,7 +28,7 @@ public class EventUtils { |
29 | 28 | } |
30 | 29 | |
31 | 30 | |
32 | - public static void validate(EntityId id, String eventIdentifier, TkEventType eventType) { | |
31 | + public static void validate(EntityId id, String eventIdentifier, DeviceEventTypeEnum eventType) { | |
33 | 32 | Validator.validateId(id.getId(), "Incorrect id " + id); |
34 | 33 | Validator.validateString(eventIdentifier, "Incorrect scope " + eventIdentifier); |
35 | 34 | if(eventType == null){ | ... | ... |
... | ... | @@ -21,7 +21,7 @@ import org.thingsboard.server.common.data.id.DeviceProfileId; |
21 | 21 | import org.thingsboard.server.common.data.id.EntityId; |
22 | 22 | import org.thingsboard.server.common.data.id.TenantId; |
23 | 23 | import org.thingsboard.server.common.data.yunteng.dto.TkEventKvEntry; |
24 | -import org.thingsboard.server.common.data.yunteng.enums.TkEventType; | |
24 | +import org.thingsboard.server.common.data.yunteng.enums.DeviceEventTypeEnum; | |
25 | 25 | |
26 | 26 | import java.util.Collection; |
27 | 27 | import java.util.List; |
... | ... | @@ -32,15 +32,15 @@ import java.util.Optional; |
32 | 32 | */ |
33 | 33 | public interface EventsDao { |
34 | 34 | |
35 | - ListenableFuture<Optional<TkEventKvEntry>> find(TenantId tenantId, EntityId entityId, TkEventType attributeType, String attributeKey); | |
35 | + ListenableFuture<Optional<TkEventKvEntry>> find(TenantId tenantId, EntityId entityId, DeviceEventTypeEnum attributeType, String attributeKey); | |
36 | 36 | |
37 | - ListenableFuture<List<TkEventKvEntry>> find(TenantId tenantId, EntityId entityId, TkEventType attributeType, Collection<String> attributeKey); | |
37 | + ListenableFuture<List<TkEventKvEntry>> find(TenantId tenantId, EntityId entityId, DeviceEventTypeEnum attributeType, Collection<String> attributeKey); | |
38 | 38 | |
39 | - ListenableFuture<List<TkEventKvEntry>> findAll(TenantId tenantId, EntityId entityId, TkEventType attributeType); | |
39 | + ListenableFuture<List<TkEventKvEntry>> findAll(TenantId tenantId, EntityId entityId, DeviceEventTypeEnum attributeType); | |
40 | 40 | |
41 | - ListenableFuture<Void> save(TenantId tenantId, DeviceProfileId profileId,EntityId entityId, TkEventType attributeType,String eventIdentifier, TkEventKvEntry attribute); | |
41 | + ListenableFuture<Void> save(TenantId tenantId, DeviceProfileId profileId,EntityId entityId, DeviceEventTypeEnum attributeType,String eventIdentifier, TkEventKvEntry attribute); | |
42 | 42 | |
43 | - ListenableFuture<List<Void>> removeAll(TenantId tenantId, EntityId entityId, String eventId,TkEventType eventType,List<String> keys); | |
43 | + ListenableFuture<List<Void>> removeAll(TenantId tenantId, EntityId entityId, String eventId,DeviceEventTypeEnum eventType,List<String> keys); | |
44 | 44 | |
45 | 45 | List<String> findAllKeysByDeviceProfileId(TenantId tenantId, DeviceProfileId deviceProfileId); |
46 | 46 | ... | ... |
... | ... | @@ -18,7 +18,7 @@ package org.thingsboard.server.dao.yunteng.jpa.entity.events; |
18 | 18 | import lombok.AllArgsConstructor; |
19 | 19 | import lombok.Data; |
20 | 20 | import lombok.NoArgsConstructor; |
21 | -import org.thingsboard.server.common.data.yunteng.enums.TkEventType; | |
21 | +import org.thingsboard.server.common.data.yunteng.enums.DeviceEventTypeEnum; | |
22 | 22 | |
23 | 23 | import javax.persistence.Column; |
24 | 24 | import javax.persistence.Embeddable; |
... | ... | @@ -36,7 +36,7 @@ import static org.thingsboard.server.dao.model.ModelConstants.*; |
36 | 36 | public class TkEventKvCompositeKey implements Serializable { |
37 | 37 | @Enumerated(EnumType.STRING) |
38 | 38 | @Column(name = EVENT_TYPE_COLUMN) |
39 | - private TkEventType eventType; | |
39 | + private DeviceEventTypeEnum eventType; | |
40 | 40 | @Column(name = ENTITY_ID_COLUMN, columnDefinition = "uuid") |
41 | 41 | private UUID entityId; |
42 | 42 | @Column(name = EVENT_IDENTIFIER_COLUMN) | ... | ... |
... | ... | @@ -20,7 +20,7 @@ import org.springframework.data.jpa.repository.Query; |
20 | 20 | import org.springframework.data.repository.CrudRepository; |
21 | 21 | import org.springframework.data.repository.query.Param; |
22 | 22 | import org.springframework.transaction.annotation.Transactional; |
23 | -import org.thingsboard.server.common.data.yunteng.enums.TkEventType; | |
23 | +import org.thingsboard.server.common.data.yunteng.enums.DeviceEventTypeEnum; | |
24 | 24 | import org.thingsboard.server.dao.yunteng.jpa.entity.events.TkEventKvCompositeKey; |
25 | 25 | import org.thingsboard.server.dao.yunteng.jpa.entity.events.TkEventKvEntity; |
26 | 26 | |
... | ... | @@ -31,7 +31,7 @@ public interface EventKvRepository extends CrudRepository<TkEventKvEntity, TkEve |
31 | 31 | |
32 | 32 | @Query("SELECT a FROM TkEventKvEntity a WHERE a.id.eventType = :eventType " + |
33 | 33 | "AND a.id.entityId = :entityId " ) |
34 | - List<TkEventKvEntity> findAllByEventTypeAndEntityId(@Param("eventType") TkEventType eventType, | |
34 | + List<TkEventKvEntity> findAllByEventTypeAndEntityId(@Param("eventType") DeviceEventTypeEnum eventType, | |
35 | 35 | @Param("entityId") UUID entityId); |
36 | 36 | |
37 | 37 | @Transactional |
... | ... | @@ -40,7 +40,7 @@ public interface EventKvRepository extends CrudRepository<TkEventKvEntity, TkEve |
40 | 40 | "AND a.id.entityId = :entityId " + |
41 | 41 | "AND a.id.eventIdentifier = :eventIdentifier " + |
42 | 42 | "AND a.id.eventKey = :eventKey") |
43 | - void delete(@Param("eventType") TkEventType eventType, | |
43 | + void delete(@Param("eventType") DeviceEventTypeEnum eventType, | |
44 | 44 | @Param("entityId") UUID entityId, |
45 | 45 | @Param("eventIdentifier") String eventIdentifier, |
46 | 46 | @Param("eventKey") String eventKey); | ... | ... |
... | ... | @@ -27,7 +27,7 @@ import org.thingsboard.server.common.data.id.DeviceProfileId; |
27 | 27 | import org.thingsboard.server.common.data.id.EntityId; |
28 | 28 | import org.thingsboard.server.common.data.id.TenantId; |
29 | 29 | import org.thingsboard.server.common.data.yunteng.dto.TkEventKvEntry; |
30 | -import org.thingsboard.server.common.data.yunteng.enums.TkEventType; | |
30 | +import org.thingsboard.server.common.data.yunteng.enums.DeviceEventTypeEnum; | |
31 | 31 | import org.thingsboard.server.common.stats.StatsFactory; |
32 | 32 | import org.thingsboard.server.dao.DaoUtil; |
33 | 33 | import org.thingsboard.server.dao.sql.JpaAbstractDaoListeningExecutorService; |
... | ... | @@ -109,7 +109,7 @@ public class JpaEventDao extends JpaAbstractDaoListeningExecutorService implemen |
109 | 109 | } |
110 | 110 | |
111 | 111 | @Override |
112 | - public ListenableFuture<Optional<TkEventKvEntry>> find(TenantId tenantId, EntityId entityId, TkEventType eventType, String attributeKey) { | |
112 | + public ListenableFuture<Optional<TkEventKvEntry>> find(TenantId tenantId, EntityId entityId, DeviceEventTypeEnum eventType, String attributeKey) { | |
113 | 113 | TkEventKvCompositeKey compositeKey = |
114 | 114 | getEventKvCompositeKey(eventType,entityId,null, attributeKey,null); |
115 | 115 | return Futures.immediateFuture( |
... | ... | @@ -117,7 +117,7 @@ public class JpaEventDao extends JpaAbstractDaoListeningExecutorService implemen |
117 | 117 | } |
118 | 118 | |
119 | 119 | @Override |
120 | - public ListenableFuture<List<TkEventKvEntry>> find(TenantId tenantId, EntityId entityId, TkEventType eventType, Collection<String> attributeKeys) { | |
120 | + public ListenableFuture<List<TkEventKvEntry>> find(TenantId tenantId, EntityId entityId, DeviceEventTypeEnum eventType, Collection<String> attributeKeys) { | |
121 | 121 | List<TkEventKvCompositeKey> compositeKeys = |
122 | 122 | attributeKeys |
123 | 123 | .stream() |
... | ... | @@ -129,7 +129,7 @@ public class JpaEventDao extends JpaAbstractDaoListeningExecutorService implemen |
129 | 129 | } |
130 | 130 | |
131 | 131 | @Override |
132 | - public ListenableFuture<List<TkEventKvEntry>> findAll(TenantId tenantId, EntityId entityId, TkEventType eventType) { | |
132 | + public ListenableFuture<List<TkEventKvEntry>> findAll(TenantId tenantId, EntityId entityId, DeviceEventTypeEnum eventType) { | |
133 | 133 | return Futures.immediateFuture( |
134 | 134 | DaoUtil.convertDataList(Lists.newArrayList( |
135 | 135 | eventKvRepository.findAllByEventTypeAndEntityId( |
... | ... | @@ -153,7 +153,7 @@ public class JpaEventDao extends JpaAbstractDaoListeningExecutorService implemen |
153 | 153 | } |
154 | 154 | |
155 | 155 | @Override |
156 | - public ListenableFuture<Void> save(TenantId tenantId, DeviceProfileId profileId,EntityId entityId,TkEventType eventType, String eventIdentifier, TkEventKvEntry attribute) { | |
156 | + public ListenableFuture<Void> save(TenantId tenantId, DeviceProfileId profileId,EntityId entityId,DeviceEventTypeEnum eventType, String eventIdentifier, TkEventKvEntry attribute) { | |
157 | 157 | TkEventKvEntity entity = new TkEventKvEntity(); |
158 | 158 | entity.setId(new TkEventKvCompositeKey(eventType, entityId.getId(), eventIdentifier, attribute.getEventTime(),attribute.getKey())); |
159 | 159 | entity.setDeviceProfileId(profileId.getId()); |
... | ... | @@ -170,7 +170,7 @@ public class JpaEventDao extends JpaAbstractDaoListeningExecutorService implemen |
170 | 170 | } |
171 | 171 | |
172 | 172 | @Override |
173 | - public ListenableFuture<List<Void>> removeAll(TenantId tenantId, EntityId entityId, String eventId,TkEventType eventType,List<String> keys) { | |
173 | + public ListenableFuture<List<Void>> removeAll(TenantId tenantId, EntityId entityId, String eventId,DeviceEventTypeEnum eventType,List<String> keys) { | |
174 | 174 | return service.submit(() -> { |
175 | 175 | keys.forEach(key -> |
176 | 176 | eventKvRepository.delete(eventType,entityId.getId(), eventId,key) |
... | ... | @@ -179,7 +179,7 @@ public class JpaEventDao extends JpaAbstractDaoListeningExecutorService implemen |
179 | 179 | }); |
180 | 180 | } |
181 | 181 | |
182 | - private TkEventKvCompositeKey getEventKvCompositeKey(TkEventType eventType,EntityId entityId, String eventIdentifier,String eventKey, Long eventTime) { | |
182 | + private TkEventKvCompositeKey getEventKvCompositeKey(DeviceEventTypeEnum eventType,EntityId entityId, String eventIdentifier,String eventKey, Long eventTime) { | |
183 | 183 | return new TkEventKvCompositeKey( |
184 | 184 | eventType, |
185 | 185 | entityId.getId(), | ... | ... |
... | ... | @@ -24,7 +24,7 @@ import org.thingsboard.server.common.data.kv.AttributeKvEntry; |
24 | 24 | import org.thingsboard.server.common.data.kv.DeleteTsKvQuery; |
25 | 25 | import org.thingsboard.server.common.data.kv.TsKvEntry; |
26 | 26 | import org.thingsboard.server.common.data.yunteng.dto.TkEventKvEntry; |
27 | -import org.thingsboard.server.common.data.yunteng.enums.TkEventType; | |
27 | +import org.thingsboard.server.common.data.yunteng.enums.DeviceEventTypeEnum; | |
28 | 28 | |
29 | 29 | import java.util.Collection; |
30 | 30 | import java.util.List; |
... | ... | @@ -45,7 +45,7 @@ public interface RuleEngineTelemetryService { |
45 | 45 | void saveAndNotify(TenantId tenantId, EntityId entityId, String scope, List<AttributeKvEntry> attributes, boolean notifyDevice, FutureCallback<Void> callback); |
46 | 46 | |
47 | 47 | //Thingskit function |
48 | - void saveAndNotify(TenantId tenantId, DeviceProfileId profileId,EntityId entityId, String eventId, TkEventType eventType, List<TkEventKvEntry> attributes, FutureCallback<Void> callback); | |
48 | + void saveAndNotify(TenantId tenantId, DeviceProfileId profileId, EntityId entityId, String eventId, DeviceEventTypeEnum eventType, List<TkEventKvEntry> attributes, FutureCallback<Void> callback); | |
49 | 49 | |
50 | 50 | void saveLatestAndNotify(TenantId tenantId, EntityId entityId, List<TsKvEntry> ts, FutureCallback<Void> callback); |
51 | 51 | ... | ... |
... | ... | @@ -23,7 +23,7 @@ import org.thingsboard.rule.engine.telemetry.TelemetryNodeCallback; |
23 | 23 | import org.thingsboard.server.common.data.id.DeviceProfileId; |
24 | 24 | import org.thingsboard.server.common.data.plugin.ComponentType; |
25 | 25 | import org.thingsboard.server.common.data.yunteng.dto.TkEventKvEntry; |
26 | -import org.thingsboard.server.common.data.yunteng.enums.TkEventType; | |
26 | +import org.thingsboard.server.common.data.yunteng.enums.DeviceEventTypeEnum; | |
27 | 27 | import org.thingsboard.server.common.msg.TbMsg; |
28 | 28 | import org.thingsboard.server.common.msg.session.SessionMsgType; |
29 | 29 | import org.thingsboard.server.common.transport.adaptor.JsonConverter; |
... | ... | @@ -64,7 +64,7 @@ public class TkMsgEventNode implements TbNode { |
64 | 64 | Set<TkEventKvEntry> events = JsonConverter.convertToEvents(new JsonParser().parse(src)); |
65 | 65 | String eventIdentifier = msg.getMetaData().getValue(EVENT_IDENTIFIER_COLUMN); |
66 | 66 | String deviceProfileId = msg.getMetaData().getValue(DEVICE_DEVICE_PROFILE_ID_PROPERTY); |
67 | - TkEventType eventType = TkEventType.valueOf(msg.getMetaData().getValue(EVENT_TYPE_COLUMN)); | |
67 | + DeviceEventTypeEnum eventType = DeviceEventTypeEnum.valueOf(msg.getMetaData().getValue(EVENT_TYPE_COLUMN)); | |
68 | 68 | ctx.getTelemetryService().saveAndNotify( |
69 | 69 | ctx.getTenantId(),new DeviceProfileId(UUID.fromString(deviceProfileId)), |
70 | 70 | msg.getOriginator(), | ... | ... |