use of org.thingsboard.server.common.data.id.TenantId in project thingsboard by thingsboard.
the class PluginMetaDataEntity method toData.
@Override
public PluginMetaData toData() {
PluginMetaData data = new PluginMetaData(new PluginId(id));
data.setTenantId(new TenantId(tenantId));
data.setCreatedTime(UUIDs.unixTimestamp(id));
data.setName(name);
data.setConfiguration(configuration);
data.setClazz(clazz);
data.setPublicAccess(publicAccess);
data.setState(state);
data.setApiToken(apiToken);
data.setAdditionalInfo(additionalInfo);
return data;
}
use of org.thingsboard.server.common.data.id.TenantId in project thingsboard by thingsboard.
the class RuleMetaDataEntity method toData.
@Override
public RuleMetaData toData() {
RuleMetaData rule = new RuleMetaData(new RuleId(id));
rule.setTenantId(new TenantId(tenantId));
rule.setName(name);
rule.setState(state);
rule.setWeight(weight);
rule.setCreatedTime(UUIDs.unixTimestamp(id));
rule.setPluginToken(pluginToken);
rule.setFilters(filters);
rule.setProcessor(processor);
rule.setAction(action);
rule.setAdditionalInfo(additionalInfo);
return rule;
}
use of org.thingsboard.server.common.data.id.TenantId in project thingsboard by thingsboard.
the class TenantEntity method toData.
@Override
public Tenant toData() {
Tenant tenant = new Tenant(new TenantId(id));
tenant.setCreatedTime(UUIDs.unixTimestamp(id));
tenant.setTitle(title);
tenant.setRegion(region);
tenant.setCountry(country);
tenant.setState(state);
tenant.setCity(city);
tenant.setAddress(address);
tenant.setAddress2(address2);
tenant.setZip(zip);
tenant.setPhone(phone);
tenant.setEmail(email);
tenant.setAdditionalInfo(additionalInfo);
return tenant;
}
use of org.thingsboard.server.common.data.id.TenantId in project thingsboard by thingsboard.
the class UserEntity method toData.
@Override
public User toData() {
User user = new User(new UserId(id));
user.setCreatedTime(UUIDs.unixTimestamp(id));
user.setAuthority(authority);
if (tenantId != null) {
user.setTenantId(new TenantId(tenantId));
}
if (customerId != null) {
user.setCustomerId(new CustomerId(customerId));
}
user.setEmail(email);
user.setFirstName(firstName);
user.setLastName(lastName);
user.setAdditionalInfo(additionalInfo);
return user;
}
use of org.thingsboard.server.common.data.id.TenantId in project thingsboard by thingsboard.
the class WidgetsBundleEntity method toData.
@Override
public WidgetsBundle toData() {
WidgetsBundle widgetsBundle = new WidgetsBundle(new WidgetsBundleId(id));
widgetsBundle.setCreatedTime(UUIDs.unixTimestamp(id));
if (tenantId != null) {
widgetsBundle.setTenantId(new TenantId(tenantId));
}
widgetsBundle.setAlias(alias);
widgetsBundle.setTitle(title);
if (image != null) {
byte[] imageByteArray = new byte[image.remaining()];
image.get(imageByteArray);
widgetsBundle.setImage(imageByteArray);
}
return widgetsBundle;
}
Aggregations