Commit 950907d3980f9602f8b10a53cf036f5e5698118b
1 parent
e86c0759
Refactoring according to comments from @YevhenBondarenko
Showing
5 changed files
with
3 additions
and
12 deletions
@@ -15,13 +15,11 @@ | @@ -15,13 +15,11 @@ | ||
15 | */ | 15 | */ |
16 | package org.thingsboard.server.dao.device.provision; | 16 | package org.thingsboard.server.dao.device.provision; |
17 | 17 | ||
18 | -import lombok.AllArgsConstructor; | ||
19 | import lombok.Data; | 18 | import lombok.Data; |
20 | import org.thingsboard.server.common.data.security.DeviceCredentials; | 19 | import org.thingsboard.server.common.data.security.DeviceCredentials; |
21 | 20 | ||
22 | @Data | 21 | @Data |
23 | -@AllArgsConstructor | ||
24 | public class ProvisionResponse { | 22 | public class ProvisionResponse { |
25 | - private DeviceCredentials deviceCredentials; | ||
26 | - private ProvisionResponseStatus responseStatus; | 23 | + private final DeviceCredentials deviceCredentials; |
24 | + private final ProvisionResponseStatus responseStatus; | ||
27 | } | 25 | } |
@@ -167,10 +167,6 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement | @@ -167,10 +167,6 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement | ||
167 | case PINGREQ: | 167 | case PINGREQ: |
168 | ctx.writeAndFlush(new MqttMessage(new MqttFixedHeader(PINGRESP, false, AT_MOST_ONCE, false, 0))); | 168 | ctx.writeAndFlush(new MqttMessage(new MqttFixedHeader(PINGRESP, false, AT_MOST_ONCE, false, 0))); |
169 | break; | 169 | break; |
170 | -// case SUBSCRIBE: | ||
171 | -// deviceSessionCtx.setDeviceInfo(TransportDeviceInfo); | ||
172 | -// processSubscribe(ctx, (MqttSubscribeMessage) msg); | ||
173 | -// break; | ||
174 | case DISCONNECT: | 170 | case DISCONNECT: |
175 | ctx.close(); | 171 | ctx.close(); |
176 | break; | 172 | break; |
@@ -417,8 +417,7 @@ public class JsonConverter { | @@ -417,8 +417,7 @@ public class JsonConverter { | ||
417 | if (toGateway) { | 417 | if (toGateway) { |
418 | result.addProperty("id", requestId); | 418 | result.addProperty("id", requestId); |
419 | } | 419 | } |
420 | - result.addProperty("deviceId", new DeviceId( | ||
421 | - new UUID(payload.getDeviceCredentials().getDeviceIdMSB(), payload.getDeviceCredentials().getDeviceIdLSB())).toString()); | 420 | + result.addProperty("deviceId", new UUID(payload.getDeviceCredentials().getDeviceIdMSB(), payload.getDeviceCredentials().getDeviceIdLSB()).toString()); |
422 | result.addProperty("credentialsType", payload.getDeviceCredentials().getCredentialsType().name()); | 421 | result.addProperty("credentialsType", payload.getDeviceCredentials().getCredentialsType().name()); |
423 | result.addProperty("credentialsId", payload.getDeviceCredentials().getCredentialsId()); | 422 | result.addProperty("credentialsId", payload.getDeviceCredentials().getCredentialsId()); |
424 | result.addProperty("credentialsValue", | 423 | result.addProperty("credentialsValue", |
@@ -22,7 +22,6 @@ import org.thingsboard.server.common.data.page.PageData; | @@ -22,7 +22,6 @@ import org.thingsboard.server.common.data.page.PageData; | ||
22 | import org.thingsboard.server.common.data.page.PageLink; | 22 | import org.thingsboard.server.common.data.page.PageLink; |
23 | import org.thingsboard.server.dao.Dao; | 23 | import org.thingsboard.server.dao.Dao; |
24 | 24 | ||
25 | -import java.util.Optional; | ||
26 | import java.util.UUID; | 25 | import java.util.UUID; |
27 | 26 | ||
28 | public interface DeviceProfileDao extends Dao<DeviceProfile> { | 27 | public interface DeviceProfileDao extends Dao<DeviceProfile> { |
@@ -29,7 +29,6 @@ import org.thingsboard.server.dao.model.sql.DeviceProfileEntity; | @@ -29,7 +29,6 @@ import org.thingsboard.server.dao.model.sql.DeviceProfileEntity; | ||
29 | import org.thingsboard.server.dao.sql.JpaAbstractSearchTextDao; | 29 | import org.thingsboard.server.dao.sql.JpaAbstractSearchTextDao; |
30 | 30 | ||
31 | import java.util.Objects; | 31 | import java.util.Objects; |
32 | -import java.util.Optional; | ||
33 | import java.util.UUID; | 32 | import java.util.UUID; |
34 | 33 | ||
35 | @Component | 34 | @Component |