Search in sources :

Example 6 with DisabledDeviceProfileProvisionConfiguration

use of org.thingsboard.server.common.data.device.profile.DisabledDeviceProfileProvisionConfiguration in project thingsboard by thingsboard.

the class DeviceProfileServiceImpl method doCreateDefaultDeviceProfile.

private DeviceProfile doCreateDefaultDeviceProfile(TenantId tenantId, String profileName, boolean defaultProfile) {
    validateId(tenantId, INCORRECT_TENANT_ID + tenantId);
    DeviceProfile deviceProfile = new DeviceProfile();
    deviceProfile.setTenantId(tenantId);
    deviceProfile.setDefault(defaultProfile);
    deviceProfile.setName(profileName);
    deviceProfile.setType(DeviceProfileType.DEFAULT);
    deviceProfile.setTransportType(DeviceTransportType.DEFAULT);
    deviceProfile.setProvisionType(DeviceProfileProvisionType.DISABLED);
    deviceProfile.setDescription("Default device profile");
    DeviceProfileData deviceProfileData = new DeviceProfileData();
    DefaultDeviceProfileConfiguration configuration = new DefaultDeviceProfileConfiguration();
    DefaultDeviceProfileTransportConfiguration transportConfiguration = new DefaultDeviceProfileTransportConfiguration();
    DisabledDeviceProfileProvisionConfiguration provisionConfiguration = new DisabledDeviceProfileProvisionConfiguration(null);
    deviceProfileData.setConfiguration(configuration);
    deviceProfileData.setTransportConfiguration(transportConfiguration);
    deviceProfileData.setProvisionConfiguration(provisionConfiguration);
    deviceProfile.setProfileData(deviceProfileData);
    return saveDeviceProfile(deviceProfile);
}
Also used : DefaultDeviceProfileConfiguration(org.thingsboard.server.common.data.device.profile.DefaultDeviceProfileConfiguration) DeviceProfile(org.thingsboard.server.common.data.DeviceProfile) DefaultDeviceProfileTransportConfiguration(org.thingsboard.server.common.data.device.profile.DefaultDeviceProfileTransportConfiguration) DeviceProfileData(org.thingsboard.server.common.data.device.profile.DeviceProfileData) DisabledDeviceProfileProvisionConfiguration(org.thingsboard.server.common.data.device.profile.DisabledDeviceProfileProvisionConfiguration)

Aggregations

DeviceProfile (org.thingsboard.server.common.data.DeviceProfile)6 DefaultDeviceProfileConfiguration (org.thingsboard.server.common.data.device.profile.DefaultDeviceProfileConfiguration)6 DeviceProfileData (org.thingsboard.server.common.data.device.profile.DeviceProfileData)6 DisabledDeviceProfileProvisionConfiguration (org.thingsboard.server.common.data.device.profile.DisabledDeviceProfileProvisionConfiguration)6 AllowCreateNewDevicesDeviceProfileProvisionConfiguration (org.thingsboard.server.common.data.device.profile.AllowCreateNewDevicesDeviceProfileProvisionConfiguration)2 CheckPreProvisionedDevicesDeviceProfileProvisionConfiguration (org.thingsboard.server.common.data.device.profile.CheckPreProvisionedDevicesDeviceProfileProvisionConfiguration)2 DefaultDeviceProfileTransportConfiguration (org.thingsboard.server.common.data.device.profile.DefaultDeviceProfileTransportConfiguration)2 DeviceProfileProvisionConfiguration (org.thingsboard.server.common.data.device.profile.DeviceProfileProvisionConfiguration)2 JsonTransportPayloadConfiguration (org.thingsboard.server.common.data.device.profile.JsonTransportPayloadConfiguration)2 ProtoTransportPayloadConfiguration (org.thingsboard.server.common.data.device.profile.ProtoTransportPayloadConfiguration)2 TransportPayloadTypeConfiguration (org.thingsboard.server.common.data.device.profile.TransportPayloadTypeConfiguration)2 Customer (org.thingsboard.server.common.data.Customer)1 Tenant (org.thingsboard.server.common.data.Tenant)1 AlarmCondition (org.thingsboard.server.common.data.device.profile.AlarmCondition)1 AlarmConditionFilter (org.thingsboard.server.common.data.device.profile.AlarmConditionFilter)1 AlarmConditionFilterKey (org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey)1 AlarmRule (org.thingsboard.server.common.data.device.profile.AlarmRule)1 CoapDeviceProfileTransportConfiguration (org.thingsboard.server.common.data.device.profile.CoapDeviceProfileTransportConfiguration)1 CoapDeviceTypeConfiguration (org.thingsboard.server.common.data.device.profile.CoapDeviceTypeConfiguration)1 DefaultCoapDeviceTypeConfiguration (org.thingsboard.server.common.data.device.profile.DefaultCoapDeviceTypeConfiguration)1