Commit 416432e3edf72207b4df810bfb62980caadc0a27

Authored by Igor Kulikov
2 parents bcbc0894 77ccf037

Merge branch 'develop/3.0' of github.com:thingsboard/thingsboard into develop/3.0

@@ -221,6 +221,11 @@ @@ -221,6 +221,11 @@
221 <scope>test</scope> 221 <scope>test</scope>
222 </dependency> 222 </dependency>
223 <dependency> 223 <dependency>
  224 + <groupId>org.thingsboard</groupId>
  225 + <artifactId>rest-client</artifactId>
  226 + <scope>test</scope>
  227 + </dependency>
  228 + <dependency>
224 <groupId>org.springframework.boot</groupId> 229 <groupId>org.springframework.boot</groupId>
225 <artifactId>spring-boot-starter-test</artifactId> 230 <artifactId>spring-boot-starter-test</artifactId>
226 <scope>test</scope> 231 <scope>test</scope>
@@ -221,10 +221,6 @@ public class SqlDatabaseUpgradeService implements DatabaseEntitiesUpgradeService @@ -221,10 +221,6 @@ public class SqlDatabaseUpgradeService implements DatabaseEntitiesUpgradeService
221 } 221 }
222 } 222 }
223 } 223 }
224 - try {  
225 - conn.createStatement().execute("ALTER TABLE dashboard ALTER COLUMN configuration SET DATA TYPE varchar(100000000);"); //NOSONAR, ignoring because method used to execute thingsboard database upgrade script  
226 - } catch (Exception e) {  
227 - }  
228 log.info("Schema updated."); 224 log.info("Schema updated.");
229 } 225 }
230 break; 226 break;
@@ -85,10 +85,10 @@ public class PsqlInsertTsRepository extends AbstractInsertRepository implements @@ -85,10 +85,10 @@ public class PsqlInsertTsRepository extends AbstractInsertRepository implements
85 } else { 85 } else {
86 ps.setNull(7, Types.DOUBLE); 86 ps.setNull(7, Types.DOUBLE);
87 ps.setNull(12, Types.DOUBLE); 87 ps.setNull(12, Types.DOUBLE);
88 -  
89 - ps.setString(8, replaceNullChars(tsKvEntity.getJsonValue()));  
90 - ps.setString(13, replaceNullChars(tsKvEntity.getJsonValue()));  
91 } 88 }
  89 +
  90 + ps.setString(8, replaceNullChars(tsKvEntity.getJsonValue()));
  91 + ps.setString(13, replaceNullChars(tsKvEntity.getJsonValue()));
92 } 92 }
93 93
94 @Override 94 @Override
@@ -108,7 +108,7 @@ CREATE TABLE IF NOT EXISTS customer ( @@ -108,7 +108,7 @@ CREATE TABLE IF NOT EXISTS customer (
108 108
109 CREATE TABLE IF NOT EXISTS dashboard ( 109 CREATE TABLE IF NOT EXISTS dashboard (
110 id varchar(31) NOT NULL CONSTRAINT dashboard_pkey PRIMARY KEY, 110 id varchar(31) NOT NULL CONSTRAINT dashboard_pkey PRIMARY KEY,
111 - configuration varchar(100000000), 111 + configuration varchar(10000000),
112 assigned_customers varchar(1000000), 112 assigned_customers varchar(1000000),
113 search_text varchar(255), 113 search_text varchar(255),
114 tenant_id varchar(31), 114 tenant_id varchar(31),
@@ -90,6 +90,10 @@ @@ -90,6 +90,10 @@
90 <groupId>org.thingsboard</groupId> 90 <groupId>org.thingsboard</groupId>
91 <artifactId>tools</artifactId> 91 <artifactId>tools</artifactId>
92 </dependency> 92 </dependency>
  93 + <dependency>
  94 + <groupId>org.thingsboard</groupId>
  95 + <artifactId>rest-client</artifactId>
  96 + </dependency>
93 </dependencies> 97 </dependencies>
94 98
95 <build> 99 <build>
@@ -38,7 +38,7 @@ import org.junit.rules.TestRule; @@ -38,7 +38,7 @@ import org.junit.rules.TestRule;
38 import org.junit.rules.TestWatcher; 38 import org.junit.rules.TestWatcher;
39 import org.junit.runner.Description; 39 import org.junit.runner.Description;
40 import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; 40 import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
41 -import org.thingsboard.client.tools.RestClient; 41 +import org.thingsboard.rest.client.RestClient;
42 import org.thingsboard.server.common.data.Device; 42 import org.thingsboard.server.common.data.Device;
43 import org.thingsboard.server.common.data.EntityType; 43 import org.thingsboard.server.common.data.EntityType;
44 import org.thingsboard.server.common.data.id.DeviceId; 44 import org.thingsboard.server.common.data.id.DeviceId;
@@ -106,6 +106,7 @@ @@ -106,6 +106,7 @@
106 <module>tools</module> 106 <module>tools</module>
107 <module>application</module> 107 <module>application</module>
108 <module>msa</module> 108 <module>msa</module>
  109 + <module>rest-client</module>
109 </modules> 110 </modules>
110 111
111 <profiles> 112 <profiles>
@@ -434,6 +435,12 @@ @@ -434,6 +435,12 @@
434 </dependency> 435 </dependency>
435 <dependency> 436 <dependency>
436 <groupId>org.thingsboard</groupId> 437 <groupId>org.thingsboard</groupId>
  438 + <artifactId>rest-client</artifactId>
  439 + <version>${project.version}</version>
  440 + <scope>test</scope>
  441 + </dependency>
  442 + <dependency>
  443 + <groupId>org.thingsboard</groupId>
437 <artifactId>dao</artifactId> 444 <artifactId>dao</artifactId>
438 <version>${project.version}</version> 445 <version>${project.version}</version>
439 <type>test-jar</type> 446 <type>test-jar</type>
  1 +<!--
  2 +
  3 + Copyright © 2016-2020 The Thingsboard Authors
  4 +
  5 + Licensed under the Apache License, Version 2.0 (the "License");
  6 + you may not use this file except in compliance with the License.
  7 + You may obtain a copy of the License at
  8 +
  9 + http://www.apache.org/licenses/LICENSE-2.0
  10 +
  11 + Unless required by applicable law or agreed to in writing, software
  12 + distributed under the License is distributed on an "AS IS" BASIS,
  13 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 + See the License for the specific language governing permissions and
  15 + limitations under the License.
  16 +
  17 +-->
  18 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  19 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  20 + <modelVersion>4.0.0</modelVersion>
  21 + <parent>
  22 + <groupId>org.thingsboard</groupId>
  23 + <version>3.0.0-SNAPSHOT</version>
  24 + <artifactId>thingsboard</artifactId>
  25 + </parent>
  26 + <artifactId>rest-client</artifactId>
  27 + <packaging>jar</packaging>
  28 +
  29 + <name>Thingsboard Rest Client</name>
  30 + <url>https://thingsboard.io</url>
  31 +
  32 + <properties>
  33 + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  34 + <main.dir>${basedir}/..</main.dir>
  35 + </properties>
  36 +
  37 + <dependencies>
  38 + <dependency>
  39 + <groupId>org.thingsboard.common</groupId>
  40 + <artifactId>data</artifactId>
  41 + </dependency>
  42 + <dependency>
  43 + <groupId>org.springframework</groupId>
  44 + <artifactId>spring-web</artifactId>
  45 + </dependency>
  46 + </dependencies>
  47 +
  48 +</project>
rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java renamed from tools/src/main/java/org/thingsboard/client/tools/RestClient.java
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.thingsboard.client.tools; 16 +package org.thingsboard.rest.client;
17 17
18 import com.fasterxml.jackson.databind.JsonNode; 18 import com.fasterxml.jackson.databind.JsonNode;
19 import com.fasterxml.jackson.databind.ObjectMapper; 19 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -31,7 +31,7 @@ import org.springframework.http.client.support.HttpRequestWrapper; @@ -31,7 +31,7 @@ import org.springframework.http.client.support.HttpRequestWrapper;
31 import org.springframework.util.StringUtils; 31 import org.springframework.util.StringUtils;
32 import org.springframework.web.client.HttpClientErrorException; 32 import org.springframework.web.client.HttpClientErrorException;
33 import org.springframework.web.client.RestTemplate; 33 import org.springframework.web.client.RestTemplate;
34 -import org.thingsboard.client.tools.utils.RestJsonConverter; 34 +import org.thingsboard.rest.client.utils.RestJsonConverter;
35 import org.thingsboard.server.common.data.AdminSettings; 35 import org.thingsboard.server.common.data.AdminSettings;
36 import org.thingsboard.server.common.data.ClaimRequest; 36 import org.thingsboard.server.common.data.ClaimRequest;
37 import org.thingsboard.server.common.data.Customer; 37 import org.thingsboard.server.common.data.Customer;
rest-client/src/main/java/org/thingsboard/rest/client/utils/RestJsonConverter.java renamed from tools/src/main/java/org/thingsboard/client/tools/utils/RestJsonConverter.java
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.thingsboard.client.tools.utils; 16 +package org.thingsboard.rest.client.utils;
17 17
18 import com.fasterxml.jackson.databind.JsonNode; 18 import com.fasterxml.jackson.databind.JsonNode;
19 import org.springframework.util.CollectionUtils; 19 import org.springframework.util.CollectionUtils;