Commit 8fe6c956c8968761d007578eafd0aab19261f9f0

Authored by Igor Kulikov
1 parent 65505209

Version set to 3.3.0-SNAPSHOT. Code style improvements.

@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>thingsboard</artifactId> 24 <artifactId>thingsboard</artifactId>
25 </parent> 25 </parent>
26 <artifactId>application</artifactId> 26 <artifactId>application</artifactId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>common</artifactId> 24 <artifactId>common</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.common</groupId> 26 <groupId>org.thingsboard.common</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>common</artifactId> 24 <artifactId>common</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.common</groupId> 26 <groupId>org.thingsboard.common</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>common</artifactId> 24 <artifactId>common</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.common</groupId> 26 <groupId>org.thingsboard.common</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>common</artifactId> 24 <artifactId>common</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.common</groupId> 26 <groupId>org.thingsboard.common</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>thingsboard</artifactId> 24 <artifactId>thingsboard</artifactId>
25 </parent> 25 </parent>
26 <artifactId>common</artifactId> 26 <artifactId>common</artifactId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>common</artifactId> 24 <artifactId>common</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.common</groupId> 26 <groupId>org.thingsboard.common</groupId>
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 <modelVersion>4.0.0</modelVersion> 22 <modelVersion>4.0.0</modelVersion>
23 <parent> 23 <parent>
24 <groupId>org.thingsboard</groupId> 24 <groupId>org.thingsboard</groupId>
25 - <version>3.2.2-SNAPSHOT</version> 25 + <version>3.3.0-SNAPSHOT</version>
26 <artifactId>common</artifactId> 26 <artifactId>common</artifactId>
27 </parent> 27 </parent>
28 <groupId>org.thingsboard.common</groupId> 28 <groupId>org.thingsboard.common</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard.common</groupId> 22 <groupId>org.thingsboard.common</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>transport</artifactId> 24 <artifactId>transport</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.common.transport</groupId> 26 <groupId>org.thingsboard.common.transport</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard.common</groupId> 22 <groupId>org.thingsboard.common</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>transport</artifactId> 24 <artifactId>transport</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.common.transport</groupId> 26 <groupId>org.thingsboard.common.transport</groupId>
@@ -15,24 +15,6 @@ @@ -15,24 +15,6 @@
15 limitations under the License. 15 limitations under the License.
16 16
17 --> 17 -->
18 -  
19 -<!--  
20 -  
21 - Copyright © 2016-2020 The Thingsboard Authors  
22 -  
23 - Licensed under the Apache License, Version 2.0 (the "License");  
24 - you may not use this file except in compliance with the License.  
25 - You may obtain a copy of the License at  
26 -  
27 - http://www.apache.org/licenses/LICENSE-2.0  
28 -  
29 - Unless required by applicable law or agreed to in writing, software  
30 - distributed under the License is distributed on an "AS IS" BASIS,  
31 - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
32 - See the License for the specific language governing permissions and  
33 - limitations under the License.  
34 -  
35 --->  
36 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 18 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
37 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 19 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
38 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
@@ -38,6 +38,7 @@ import org.eclipse.leshan.server.californium.LeshanServer; @@ -38,6 +38,7 @@ import org.eclipse.leshan.server.californium.LeshanServer;
38 import org.eclipse.leshan.server.registration.Registration; 38 import org.eclipse.leshan.server.registration.Registration;
39 import org.springframework.context.annotation.Lazy; 39 import org.springframework.context.annotation.Lazy;
40 import org.springframework.stereotype.Service; 40 import org.springframework.stereotype.Service;
  41 +import org.thingsboard.common.util.JacksonUtil;
41 import org.thingsboard.server.common.data.Device; 42 import org.thingsboard.server.common.data.Device;
42 import org.thingsboard.server.common.data.DeviceProfile; 43 import org.thingsboard.server.common.data.DeviceProfile;
43 import org.thingsboard.server.common.transport.TransportService; 44 import org.thingsboard.server.common.transport.TransportService;
@@ -470,10 +471,8 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { @@ -470,10 +471,8 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService {
470 // #3 471 // #3
471 else { 472 else {
472 lwM2MClient.getPendingRequests().addAll(clientObjects); 473 lwM2MClient.getPendingRequests().addAll(clientObjects);
473 - clientObjects.forEach(path -> {  
474 - lwM2mTransportRequest.sendAllRequest(registration, path, GET_TYPE_OPER_READ, ContentFormat.TLV.getName(),  
475 - null, null, this.lwM2mTransportContextServer.getLwM2MTransportConfigServer().getTimeout());  
476 - }); 474 + clientObjects.forEach(path -> lwM2mTransportRequest.sendAllRequest(registration, path, GET_TYPE_OPER_READ, ContentFormat.TLV.getName(),
  475 + null, null, this.lwM2mTransportContextServer.getLwM2MTransportConfigServer().getTimeout()));
477 } 476 }
478 } 477 }
479 // #1 478 // #1
@@ -589,38 +588,29 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { @@ -589,38 +588,29 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService {
589 * @param registration - 588 * @param registration -
590 */ 589 */
591 private void initReadAttrTelemetryObserveToClient(Registration registration, LwM2mClient lwM2MClient, String typeOper) { 590 private void initReadAttrTelemetryObserveToClient(Registration registration, LwM2mClient lwM2MClient, String typeOper) {
592 - try {  
593 - LwM2mClientProfile lwM2MClientProfile = lwM2mClientContext.getProfile(registration);  
594 - Set<String> clientInstances = this.getAllInstancesInClient(registration);  
595 - Set<String> result;  
596 - if (GET_TYPE_OPER_READ.equals(typeOper)) {  
597 - result = new ObjectMapper().readValue(lwM2MClientProfile.getPostAttributeProfile().getAsJsonArray().toString().getBytes(), new TypeReference<>() {  
598 - });  
599 - result.addAll(new ObjectMapper().readValue(lwM2MClientProfile.getPostTelemetryProfile().getAsJsonArray().toString().getBytes(), new TypeReference<>() {  
600 - }));  
601 - } else {  
602 - result = new ObjectMapper().readValue(lwM2MClientProfile.getPostObserveProfile().getAsJsonArray().toString().getBytes(), new TypeReference<>() {  
603 - });  
604 - }  
605 - Set<String> pathSent = ConcurrentHashMap.newKeySet();  
606 - result.forEach(target -> {  
607 - // #1.1  
608 - String[] resPath = target.split("/");  
609 - String instance = "/" + resPath[1] + "/" + resPath[2];  
610 - if (clientInstances != null && clientInstances.size() > 0 && clientInstances.contains(instance)) {  
611 - pathSent.add(target);  
612 - }  
613 - });  
614 - lwM2MClient.getPendingRequests().addAll(pathSent);  
615 - pathSent.forEach(target -> {  
616 - lwM2mTransportRequest.sendAllRequest(registration, target, typeOper, ContentFormat.TLV.getName(),  
617 - null, null, this.lwM2mTransportContextServer.getLwM2MTransportConfigServer().getTimeout());  
618 - });  
619 - if (GET_TYPE_OPER_OBSERVE.equals(typeOper)) {  
620 - lwM2MClient.initValue(this, null); 591 + LwM2mClientProfile lwM2MClientProfile = lwM2mClientContext.getProfile(registration);
  592 + Set<String> clientInstances = this.getAllInstancesInClient(registration);
  593 + Set<String> result;
  594 + if (GET_TYPE_OPER_READ.equals(typeOper)) {
  595 + result = JacksonUtil.fromString(lwM2MClientProfile.getPostAttributeProfile().toString(), new TypeReference<>() {});
  596 + result.addAll(JacksonUtil.fromString(lwM2MClientProfile.getPostTelemetryProfile().toString(), new TypeReference<>() {}));
  597 + } else {
  598 + result = JacksonUtil.fromString(lwM2MClientProfile.getPostObserveProfile().toString(), new TypeReference<>() {});
  599 + }
  600 + Set<String> pathSent = ConcurrentHashMap.newKeySet();
  601 + result.forEach(target -> {
  602 + // #1.1
  603 + String[] resPath = target.split("/");
  604 + String instance = "/" + resPath[1] + "/" + resPath[2];
  605 + if (clientInstances != null && clientInstances.size() > 0 && clientInstances.contains(instance)) {
  606 + pathSent.add(target);
621 } 607 }
622 - } catch (IOException e) {  
623 - e.printStackTrace(); 608 + });
  609 + lwM2MClient.getPendingRequests().addAll(pathSent);
  610 + pathSent.forEach(target -> lwM2mTransportRequest.sendAllRequest(registration, target, typeOper, ContentFormat.TLV.getName(),
  611 + null, null, this.lwM2mTransportContextServer.getLwM2MTransportConfigServer().getTimeout()));
  612 + if (GET_TYPE_OPER_OBSERVE.equals(typeOper)) {
  613 + lwM2MClient.initValue(this, null);
624 } 614 }
625 } 615 }
626 616
@@ -796,9 +786,9 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { @@ -796,9 +786,9 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService {
796 if (lwM2mClientContext.addUpdateProfileParameters(deviceProfile)) { 786 if (lwM2mClientContext.addUpdateProfileParameters(deviceProfile)) {
797 // #1 787 // #1
798 JsonArray attributeOld = lwM2MClientProfileOld.getPostAttributeProfile(); 788 JsonArray attributeOld = lwM2MClientProfileOld.getPostAttributeProfile();
799 - Set attributeSetOld = this.convertJsonArrayToSet (attributeOld); 789 + Set<String> attributeSetOld = this.convertJsonArrayToSet (attributeOld);
800 JsonArray telemetryOld = lwM2MClientProfileOld.getPostTelemetryProfile(); 790 JsonArray telemetryOld = lwM2MClientProfileOld.getPostTelemetryProfile();
801 - Set telemetrySetOld = this.convertJsonArrayToSet (telemetryOld); 791 + Set<String> telemetrySetOld = this.convertJsonArrayToSet (telemetryOld);
802 JsonArray observeOld = lwM2MClientProfileOld.getPostObserveProfile(); 792 JsonArray observeOld = lwM2MClientProfileOld.getPostObserveProfile();
803 JsonObject keyNameOld = lwM2MClientProfileOld.getPostKeyNameProfile(); 793 JsonObject keyNameOld = lwM2MClientProfileOld.getPostKeyNameProfile();
804 794
@@ -806,7 +796,7 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { @@ -806,7 +796,7 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService {
806 JsonArray attributeNew = lwM2MClientProfileNew.getPostAttributeProfile(); 796 JsonArray attributeNew = lwM2MClientProfileNew.getPostAttributeProfile();
807 Set<String> attributeSetNew = this.convertJsonArrayToSet (attributeNew); 797 Set<String> attributeSetNew = this.convertJsonArrayToSet (attributeNew);
808 JsonArray telemetryNew = lwM2MClientProfileNew.getPostTelemetryProfile(); 798 JsonArray telemetryNew = lwM2MClientProfileNew.getPostTelemetryProfile();
809 - Set telemetrySetNew = this.convertJsonArrayToSet (telemetryNew); 799 + Set<String> telemetrySetNew = this.convertJsonArrayToSet (telemetryNew);
810 JsonArray observeNew = lwM2MClientProfileNew.getPostObserveProfile(); 800 JsonArray observeNew = lwM2MClientProfileNew.getPostObserveProfile();
811 JsonObject keyNameNew = lwM2MClientProfileNew.getPostKeyNameProfile(); 801 JsonObject keyNameNew = lwM2MClientProfileNew.getPostKeyNameProfile();
812 802
@@ -1036,7 +1026,7 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { @@ -1036,7 +1026,7 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService {
1036 private SessionInfoProto getNewSessionInfoProto(LwM2mClient lwM2MClient) { 1026 private SessionInfoProto getNewSessionInfoProto(LwM2mClient lwM2MClient) {
1037 if (lwM2MClient != null) { 1027 if (lwM2MClient != null) {
1038 TransportProtos.ValidateDeviceCredentialsResponseMsg msg = lwM2MClient.getCredentialsResponse(); 1028 TransportProtos.ValidateDeviceCredentialsResponseMsg msg = lwM2MClient.getCredentialsResponse();
1039 - if (msg == null || msg.getDeviceInfo() == null) { 1029 + if (msg == null) {
1040 log.error("[{}] [{}]", lwM2MClient.getEndpoint(), CLIENT_NOT_AUTHORIZED); 1030 log.error("[{}] [{}]", lwM2MClient.getEndpoint(), CLIENT_NOT_AUTHORIZED);
1041 this.closeClientSession(lwM2MClient.getRegistration()); 1031 this.closeClientSession(lwM2MClient.getRegistration());
1042 return null; 1032 return null;
@@ -1126,9 +1116,8 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { @@ -1126,9 +1116,8 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService {
1126 */ 1116 */
1127 private List<String> getNamesAttrFromProfileIsWritable(LwM2mClient lwM2MClient) { 1117 private List<String> getNamesAttrFromProfileIsWritable(LwM2mClient lwM2MClient) {
1128 LwM2mClientProfile profile = lwM2mClientContext.getProfile(lwM2MClient.getProfileId()); 1118 LwM2mClientProfile profile = lwM2mClientContext.getProfile(lwM2MClient.getProfileId());
1129 - Set attrSet = new Gson().fromJson(profile.getPostAttributeProfile(), Set.class);  
1130 - ConcurrentMap<String, String> keyNamesMap = new Gson().fromJson(profile.getPostKeyNameProfile().toString(), new TypeToken<ConcurrentHashMap<String, String>>() {  
1131 - }.getType()); 1119 + Set<String> attrSet = new Gson().fromJson(profile.getPostAttributeProfile(), new TypeToken<>() {}.getType());
  1120 + ConcurrentMap<String, String> keyNamesMap = new Gson().fromJson(profile.getPostKeyNameProfile().toString(), new TypeToken<ConcurrentHashMap<String, String>>() {}.getType());
1132 1121
1133 ConcurrentMap<String, String> keyNamesIsWritable = keyNamesMap.entrySet() 1122 ConcurrentMap<String, String> keyNamesIsWritable = keyNamesMap.entrySet()
1134 .stream() 1123 .stream()
@@ -21,9 +21,9 @@ import org.eclipse.californium.elements.EndpointContext; @@ -21,9 +21,9 @@ import org.eclipse.californium.elements.EndpointContext;
21 import org.eclipse.leshan.core.observation.Observation; 21 import org.eclipse.leshan.core.observation.Observation;
22 import org.eclipse.leshan.core.util.NamedThreadFactory; 22 import org.eclipse.leshan.core.util.NamedThreadFactory;
23 import org.eclipse.leshan.core.util.Validate; 23 import org.eclipse.leshan.core.util.Validate;
24 -import org.eclipse.leshan.server.Destroyable;  
25 -import org.eclipse.leshan.server.Startable;  
26 -import org.eclipse.leshan.server.Stoppable; 24 +import org.eclipse.leshan.core.Destroyable;
  25 +import org.eclipse.leshan.core.Startable;
  26 +import org.eclipse.leshan.core.Stoppable;
27 import org.eclipse.leshan.server.californium.observation.ObserveUtil; 27 import org.eclipse.leshan.server.californium.observation.ObserveUtil;
28 import org.eclipse.leshan.server.californium.registration.CaliforniumRegistrationStore; 28 import org.eclipse.leshan.server.californium.registration.CaliforniumRegistrationStore;
29 import org.eclipse.leshan.server.redis.JedisLock; 29 import org.eclipse.leshan.server.redis.JedisLock;
@@ -278,8 +278,8 @@ public class TbLwM2mRedisRegistrationStore implements CaliforniumRegistrationSto @@ -278,8 +278,8 @@ public class TbLwM2mRedisRegistrationStore implements CaliforniumRegistrationSto
278 278
279 protected class RedisIterator implements Iterator<Registration> { 279 protected class RedisIterator implements Iterator<Registration> {
280 280
281 - private RedisConnectionFactory connectionFactory;  
282 - private ScanParams scanParams; 281 + private final RedisConnectionFactory connectionFactory;
  282 + private final ScanParams scanParams;
283 283
284 private String cursor; 284 private String cursor;
285 private List<Registration> scanResult; 285 private List<Registration> scanResult;
@@ -552,17 +552,16 @@ public class TbLwM2mRedisRegistrationStore implements CaliforniumRegistrationSto @@ -552,17 +552,16 @@ public class TbLwM2mRedisRegistrationStore implements CaliforniumRegistrationSto
552 @Override 552 @Override
553 public org.eclipse.californium.core.observe.Observation putIfAbsent(Token token, 553 public org.eclipse.californium.core.observe.Observation putIfAbsent(Token token,
554 org.eclipse.californium.core.observe.Observation obs) throws ObservationStoreException { 554 org.eclipse.californium.core.observe.Observation obs) throws ObservationStoreException {
555 - return add(token, obs, true); 555 + return add(obs, true);
556 } 556 }
557 557
558 @Override 558 @Override
559 public org.eclipse.californium.core.observe.Observation put(Token token, 559 public org.eclipse.californium.core.observe.Observation put(Token token,
560 org.eclipse.californium.core.observe.Observation obs) throws ObservationStoreException { 560 org.eclipse.californium.core.observe.Observation obs) throws ObservationStoreException {
561 - return add(token, obs, false); 561 + return add(obs, false);
562 } 562 }
563 563
564 - private org.eclipse.californium.core.observe.Observation add(Token token,  
565 - org.eclipse.californium.core.observe.Observation obs, boolean ifAbsent) throws ObservationStoreException { 564 + private org.eclipse.californium.core.observe.Observation add(org.eclipse.californium.core.observe.Observation obs, boolean ifAbsent) throws ObservationStoreException {
566 String endpoint = ObserveUtil.validateCoapObservation(obs); 565 String endpoint = ObserveUtil.validateCoapObservation(obs);
567 org.eclipse.californium.core.observe.Observation previousObservation = null; 566 org.eclipse.californium.core.observe.Observation previousObservation = null;
568 567
@@ -577,7 +576,7 @@ public class TbLwM2mRedisRegistrationStore implements CaliforniumRegistrationSto @@ -577,7 +576,7 @@ public class TbLwM2mRedisRegistrationStore implements CaliforniumRegistrationSto
577 throw new ObservationStoreException("no registration for this Id"); 576 throw new ObservationStoreException("no registration for this Id");
578 byte[] key = toKey(OBS_TKN, obs.getRequest().getToken().getBytes()); 577 byte[] key = toKey(OBS_TKN, obs.getRequest().getToken().getBytes());
579 byte[] serializeObs = serializeObs(obs); 578 byte[] serializeObs = serializeObs(obs);
580 - byte[] previousValue = null; 579 + byte[] previousValue;
581 if (ifAbsent) { 580 if (ifAbsent) {
582 previousValue = j.get(key); 581 previousValue = j.get(key);
583 if (previousValue == null || previousValue.length == 0) { 582 if (previousValue == null || previousValue.length == 0) {
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard.common</groupId> 22 <groupId>org.thingsboard.common</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>transport</artifactId> 24 <artifactId>transport</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.common.transport</groupId> 26 <groupId>org.thingsboard.common.transport</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>common</artifactId> 24 <artifactId>common</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.common</groupId> 26 <groupId>org.thingsboard.common</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard.common</groupId> 22 <groupId>org.thingsboard.common</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>transport</artifactId> 24 <artifactId>transport</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.common.transport</groupId> 26 <groupId>org.thingsboard.common.transport</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>common</artifactId> 24 <artifactId>common</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.common</groupId> 26 <groupId>org.thingsboard.common</groupId>
@@ -57,6 +57,15 @@ public class JacksonUtil { @@ -57,6 +57,15 @@ public class JacksonUtil {
57 } 57 }
58 } 58 }
59 59
  60 + public static <T> T fromString(String string, TypeReference<T> valueTypeRef) {
  61 + try {
  62 + return string != null ? OBJECT_MAPPER.readValue(string, valueTypeRef) : null;
  63 + } catch (IOException e) {
  64 + throw new IllegalArgumentException("The given string value: "
  65 + + string + " cannot be transformed to Json object", e);
  66 + }
  67 + }
  68 +
60 public static String toString(Object value) { 69 public static String toString(Object value) {
61 try { 70 try {
62 return value != null ? OBJECT_MAPPER.writeValueAsString(value) : null; 71 return value != null ? OBJECT_MAPPER.writeValueAsString(value) : null;
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>thingsboard</artifactId> 24 <artifactId>thingsboard</artifactId>
25 </parent> 25 </parent>
26 <artifactId>dao</artifactId> 26 <artifactId>dao</artifactId>
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 21
22 <parent> 22 <parent>
23 <groupId>org.thingsboard</groupId> 23 <groupId>org.thingsboard</groupId>
24 - <version>3.2.2-SNAPSHOT</version> 24 + <version>3.3.0-SNAPSHOT</version>
25 <artifactId>msa</artifactId> 25 <artifactId>msa</artifactId>
26 </parent> 26 </parent>
27 <groupId>org.thingsboard.msa</groupId> 27 <groupId>org.thingsboard.msa</groupId>
1 { 1 {
2 "name": "thingsboard-js-executor", 2 "name": "thingsboard-js-executor",
3 "private": true, 3 "private": true,
4 - "version": "3.2.2", 4 + "version": "3.3.0",
5 "description": "ThingsBoard JavaScript Executor Microservice", 5 "description": "ThingsBoard JavaScript Executor Microservice",
6 "main": "server.js", 6 "main": "server.js",
7 "bin": "server.js", 7 "bin": "server.js",
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>msa</artifactId> 24 <artifactId>msa</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.msa</groupId> 26 <groupId>org.thingsboard.msa</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>thingsboard</artifactId> 24 <artifactId>thingsboard</artifactId>
25 </parent> 25 </parent>
26 <artifactId>msa</artifactId> 26 <artifactId>msa</artifactId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>msa</artifactId> 24 <artifactId>msa</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.msa</groupId> 26 <groupId>org.thingsboard.msa</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>msa</artifactId> 24 <artifactId>msa</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.msa</groupId> 26 <groupId>org.thingsboard.msa</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard.msa</groupId> 22 <groupId>org.thingsboard.msa</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>transport</artifactId> 24 <artifactId>transport</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.msa.transport</groupId> 26 <groupId>org.thingsboard.msa.transport</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard.msa</groupId> 22 <groupId>org.thingsboard.msa</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>transport</artifactId> 24 <artifactId>transport</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.msa.transport</groupId> 26 <groupId>org.thingsboard.msa.transport</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard.msa</groupId> 22 <groupId>org.thingsboard.msa</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>transport</artifactId> 24 <artifactId>transport</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.msa.transport</groupId> 26 <groupId>org.thingsboard.msa.transport</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>msa</artifactId> 24 <artifactId>msa</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.msa</groupId> 26 <groupId>org.thingsboard.msa</groupId>
1 { 1 {
2 "name": "thingsboard-web-ui", 2 "name": "thingsboard-web-ui",
3 "private": true, 3 "private": true,
4 - "version": "3.2.2", 4 + "version": "3.3.0",
5 "description": "ThingsBoard Web UI Microservice", 5 "description": "ThingsBoard Web UI Microservice",
6 "main": "server.js", 6 "main": "server.js",
7 "bin": "server.js", 7 "bin": "server.js",
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>msa</artifactId> 24 <artifactId>msa</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.msa</groupId> 26 <groupId>org.thingsboard.msa</groupId>
@@ -19,11 +19,11 @@ @@ -19,11 +19,11 @@
19 <modelVersion>4.0.0</modelVersion> 19 <modelVersion>4.0.0</modelVersion>
20 <parent> 20 <parent>
21 <groupId>org.thingsboard</groupId> 21 <groupId>org.thingsboard</groupId>
22 - <version>3.2.2-SNAPSHOT</version> 22 + <version>3.3.0-SNAPSHOT</version>
23 <artifactId>thingsboard</artifactId> 23 <artifactId>thingsboard</artifactId>
24 </parent> 24 </parent>
25 <artifactId>netty-mqtt</artifactId> 25 <artifactId>netty-mqtt</artifactId>
26 - <version>3.2.2-SNAPSHOT</version> 26 + <version>3.3.0-SNAPSHOT</version>
27 <packaging>jar</packaging> 27 <packaging>jar</packaging>
28 28
29 <name>Netty MQTT Client</name> 29 <name>Netty MQTT Client</name>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <groupId>org.thingsboard</groupId> 21 <groupId>org.thingsboard</groupId>
22 <artifactId>thingsboard</artifactId> 22 <artifactId>thingsboard</artifactId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <packaging>pom</packaging> 24 <packaging>pom</packaging>
25 25
26 <name>Thingsboard</name> 26 <name>Thingsboard</name>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>thingsboard</artifactId> 24 <artifactId>thingsboard</artifactId>
25 </parent> 25 </parent>
26 <artifactId>rest-client</artifactId> 26 <artifactId>rest-client</artifactId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>thingsboard</artifactId> 24 <artifactId>thingsboard</artifactId>
25 </parent> 25 </parent>
26 <artifactId>rule-engine</artifactId> 26 <artifactId>rule-engine</artifactId>
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 <modelVersion>4.0.0</modelVersion> 22 <modelVersion>4.0.0</modelVersion>
23 <parent> 23 <parent>
24 <groupId>org.thingsboard</groupId> 24 <groupId>org.thingsboard</groupId>
25 - <version>3.2.2-SNAPSHOT</version> 25 + <version>3.3.0-SNAPSHOT</version>
26 <artifactId>rule-engine</artifactId> 26 <artifactId>rule-engine</artifactId>
27 </parent> 27 </parent>
28 <groupId>org.thingsboard.rule-engine</groupId> 28 <groupId>org.thingsboard.rule-engine</groupId>
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 <modelVersion>4.0.0</modelVersion> 22 <modelVersion>4.0.0</modelVersion>
23 <parent> 23 <parent>
24 <groupId>org.thingsboard</groupId> 24 <groupId>org.thingsboard</groupId>
25 - <version>3.2.2-SNAPSHOT</version> 25 + <version>3.3.0-SNAPSHOT</version>
26 <artifactId>rule-engine</artifactId> 26 <artifactId>rule-engine</artifactId>
27 </parent> 27 </parent>
28 <groupId>org.thingsboard.rule-engine</groupId> 28 <groupId>org.thingsboard.rule-engine</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>thingsboard</artifactId> 24 <artifactId>thingsboard</artifactId>
25 </parent> 25 </parent>
26 <artifactId>tools</artifactId> 26 <artifactId>tools</artifactId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>transport</artifactId> 24 <artifactId>transport</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.transport</groupId> 26 <groupId>org.thingsboard.transport</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>transport</artifactId> 24 <artifactId>transport</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.transport</groupId> 26 <groupId>org.thingsboard.transport</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>transport</artifactId> 24 <artifactId>transport</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard.transport</groupId> 26 <groupId>org.thingsboard.transport</groupId>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>thingsboard</artifactId> 24 <artifactId>thingsboard</artifactId>
25 </parent> 25 </parent>
26 <artifactId>transport</artifactId> 26 <artifactId>transport</artifactId>
1 { 1 {
2 "name": "thingsboard", 2 "name": "thingsboard",
3 - "version": "3.2.2", 3 + "version": "3.3.0",
4 "scripts": { 4 "scripts": {
5 "ng": "ng", 5 "ng": "ng",
6 "start": "node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve --host 0.0.0.0 --open", 6 "start": "node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve --host 0.0.0.0 --open",
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 <parent> 21 <parent>
22 <groupId>org.thingsboard</groupId> 22 <groupId>org.thingsboard</groupId>
23 - <version>3.2.2-SNAPSHOT</version> 23 + <version>3.3.0-SNAPSHOT</version>
24 <artifactId>thingsboard</artifactId> 24 <artifactId>thingsboard</artifactId>
25 </parent> 25 </parent>
26 <groupId>org.thingsboard</groupId> 26 <groupId>org.thingsboard</groupId>