use of org.thingsboard.server.common.data.device.credentials.lwm2m.LwM2MBootstrapClientCredential in project thingsboard by thingsboard.
the class DeviceCredentialsServiceImpl method validateLwM2MDeviceCredentials.
private void validateLwM2MDeviceCredentials(LwM2MDeviceCredentials lwM2MCredentials) {
if (lwM2MCredentials == null) {
throw new DeviceCredentialsValidationException("LwM2M credentials must be specified!");
}
LwM2MClientCredential clientCredentials = lwM2MCredentials.getClient();
if (clientCredentials == null) {
throw new DeviceCredentialsValidationException("LwM2M client credentials must be specified!");
}
validateLwM2MClientCredentials(clientCredentials);
LwM2MBootstrapClientCredentials bootstrapCredentials = lwM2MCredentials.getBootstrap();
if (bootstrapCredentials == null) {
throw new DeviceCredentialsValidationException("LwM2M bootstrap credentials must be specified!");
}
LwM2MBootstrapClientCredential bootstrapServerCredentials = bootstrapCredentials.getBootstrapServer();
if (bootstrapServerCredentials == null) {
throw new DeviceCredentialsValidationException("LwM2M bootstrap server credentials must be specified!");
}
validateServerCredentials(bootstrapServerCredentials, "Bootstrap server");
LwM2MBootstrapClientCredential lwm2MBootstrapClientCredential = bootstrapCredentials.getLwm2mServer();
if (lwm2MBootstrapClientCredential == null) {
throw new DeviceCredentialsValidationException("LwM2M lwm2m server credentials must be specified!");
}
validateServerCredentials(lwm2MBootstrapClientCredential, "LwM2M server");
}
Aggregations