Merge branch 'master' of github.com:thingsboard/thingsboard
This commit is contained in:
commit
fac8c9dfb6
@ -816,7 +816,6 @@ transport:
|
||||
downlink_pool_size: "${LWM2M_DOWNLINK_POOL_SIZE:10}"
|
||||
ota_pool_size: "${LWM2M_OTA_POOL_SIZE:10}"
|
||||
clean_period_in_sec: "${LWM2M_CLEAN_PERIOD_IN_SEC:2}"
|
||||
log_max_length: "${LWM2M_LOG_MAX_LENGTH:1024}"
|
||||
# Use redis for Security and Registration stores
|
||||
redis.enabled: "${LWM2M_REDIS_ENABLED:false}"
|
||||
snmp:
|
||||
|
||||
@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.thingsboard.server.common.data.device.profile.DeviceProfileData;
|
||||
import org.thingsboard.server.common.data.id.DashboardId;
|
||||
@ -39,6 +40,7 @@ import static org.thingsboard.server.common.data.SearchTextBasedWithAdditionalIn
|
||||
|
||||
@ApiModel
|
||||
@Data
|
||||
@ToString(exclude = {"image", "profileDataBytes"})
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Slf4j
|
||||
public class DeviceProfile extends SearchTextBased<DeviceProfileId> implements HasName, HasTenantId, HasOtaPackage {
|
||||
|
||||
@ -29,7 +29,7 @@ import java.util.UUID;
|
||||
|
||||
@Value
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@ToString(callSuper = true, exclude = "image")
|
||||
public class DeviceProfileInfo extends EntityInfo {
|
||||
|
||||
@ApiModelProperty(position = 3, value = "Either URL or Base64 data of the icon. Used in the mobile application to visualize set of device profiles in the grid view. ")
|
||||
|
||||
@ -125,7 +125,7 @@ public class DefaultTbApiUsageClient implements TbApiUsageClient {
|
||||
}));
|
||||
|
||||
if (!report.isEmpty()) {
|
||||
log.info("Reporting API usage statistics for {} tenants and customers", report.size());
|
||||
log.debug("Reporting API usage statistics for {} tenants and customers", report.size());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -90,10 +90,6 @@ public class LwM2MTransportServerConfig implements LwM2MSecureServerConfig {
|
||||
@Value("${transport.lwm2m.server.security.bind_port:}")
|
||||
private Integer securePort;
|
||||
|
||||
@Getter
|
||||
@Value("${transport.lwm2m.log_max_length:}")
|
||||
private int logMaxLength;
|
||||
|
||||
@Getter
|
||||
@Value("${transport.lwm2m.psm_activity_timer:10000}")
|
||||
private long psmActivityTimer;
|
||||
|
||||
@ -17,7 +17,6 @@ package org.thingsboard.server.transport.lwm2m.server;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.californium.elements.util.SslContextUtil;
|
||||
import org.eclipse.californium.scandium.config.DtlsConnectorConfig;
|
||||
import org.eclipse.californium.scandium.dtls.cipher.CipherSuite;
|
||||
import org.eclipse.leshan.core.node.codec.DefaultLwM2mNodeDecoder;
|
||||
@ -29,6 +28,7 @@ import org.springframework.stereotype.Component;
|
||||
import org.thingsboard.server.cache.ota.OtaPackageDataCache;
|
||||
import org.thingsboard.server.common.data.DataConstants;
|
||||
import org.thingsboard.server.common.transport.config.ssl.SslCredentials;
|
||||
import org.thingsboard.server.queue.util.AfterStartUp;
|
||||
import org.thingsboard.server.queue.util.TbLwM2mTransportComponent;
|
||||
import org.thingsboard.server.transport.lwm2m.config.LwM2MTransportServerConfig;
|
||||
import org.thingsboard.server.transport.lwm2m.secure.TbLwM2MAuthorizer;
|
||||
@ -37,10 +37,7 @@ import org.thingsboard.server.transport.lwm2m.server.store.TbSecurityStore;
|
||||
import org.thingsboard.server.transport.lwm2m.server.uplink.DefaultLwM2MUplinkMsgHandler;
|
||||
import org.thingsboard.server.transport.lwm2m.utils.LwM2mValueConverterImpl;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.PublicKey;
|
||||
import java.security.cert.X509Certificate;
|
||||
|
||||
import static org.eclipse.californium.scandium.dtls.cipher.CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256;
|
||||
@ -71,7 +68,7 @@ public class DefaultLwM2mTransportService implements LwM2MTransportService {
|
||||
|
||||
private LeshanServer server;
|
||||
|
||||
@PostConstruct
|
||||
@AfterStartUp
|
||||
public void init() {
|
||||
this.server = getLhServer();
|
||||
/*
|
||||
|
||||
@ -18,6 +18,7 @@ package org.thingsboard.server.transport.lwm2m.server.client;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.leshan.core.model.ObjectModel;
|
||||
import org.eclipse.leshan.core.model.ResourceModel;
|
||||
@ -64,6 +65,7 @@ import static org.thingsboard.server.transport.lwm2m.server.LwM2mTransportUtil.g
|
||||
|
||||
@Slf4j
|
||||
@EqualsAndHashCode(of = {"endpoint"})
|
||||
@ToString(of = "endpoint")
|
||||
public class LwM2mClient implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 8793482946289222623L;
|
||||
|
||||
@ -88,7 +88,7 @@ public class LwM2mClientContextImpl implements LwM2mClientContext {
|
||||
private final Map<String, LwM2mClient> lwM2mClientsByRegistrationId = new ConcurrentHashMap<>();
|
||||
private final Map<UUID, Lwm2mDeviceProfileTransportConfiguration> profiles = new ConcurrentHashMap<>();
|
||||
|
||||
@AfterStartUp
|
||||
@AfterStartUp(order = Integer.MAX_VALUE - 1)
|
||||
public void init() {
|
||||
String nodeId = context.getNodeId();
|
||||
Set<LwM2mClient> fetchedClients = clientStore.getAll();
|
||||
|
||||
@ -87,6 +87,12 @@ public class DefaultLwM2MRpcRequestHandler implements LwM2MRpcRequestHandler {
|
||||
return;
|
||||
}
|
||||
LwM2mClient client = clientContext.getClientBySessionInfo(sessionInfo);
|
||||
|
||||
if (client == null) {
|
||||
log.warn("Missing client for session: [{}]", sessionInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
if (client.getRegistration() == null) {
|
||||
this.sendErrorRpcResponse(sessionInfo, rpcRequest.getRequestId(), ResponseCode.INTERNAL_SERVER_ERROR, "Registration is empty");
|
||||
return;
|
||||
|
||||
@ -1184,7 +1184,7 @@ public class DefaultTransportService implements TransportService {
|
||||
|
||||
@Scheduled(fixedDelayString = "${transport.stats.print-interval-ms:60000}")
|
||||
public void printStats() {
|
||||
if (statsEnabled) {
|
||||
if (statsEnabled && !statsMap.isEmpty()) {
|
||||
String values = statsMap.entrySet().stream()
|
||||
.map(kv -> kv.getKey() + " [" + kv.getValue() + "]").collect(Collectors.joining(", "));
|
||||
log.info("Transport Stats: {}", values);
|
||||
|
||||
@ -199,7 +199,6 @@ transport:
|
||||
downlink_pool_size: "${LWM2M_DOWNLINK_POOL_SIZE:10}"
|
||||
ota_pool_size: "${LWM2M_OTA_POOL_SIZE:10}"
|
||||
clean_period_in_sec: "${LWM2M_CLEAN_PERIOD_IN_SEC:2}"
|
||||
log_max_length: "${LWM2M_LOG_MAX_LENGTH:1024}"
|
||||
psm_activity_timer: "${LWM2M_PSM_ACTIVITY_TIMER:10000}"
|
||||
paging_transmission_window: "${LWM2M_PAGING_TRANSMISSION_WINDOW:10000}"
|
||||
# Use redis for Security and Registration stores
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user