remove isolated tb-core
This commit is contained in:
parent
adab546ab9
commit
8b6664c096
@ -128,7 +128,6 @@ public class TenantProfileController extends BaseController {
|
|||||||
"{\n" +
|
"{\n" +
|
||||||
" \"name\": \"Default\",\n" +
|
" \"name\": \"Default\",\n" +
|
||||||
" \"description\": \"Default tenant profile\",\n" +
|
" \"description\": \"Default tenant profile\",\n" +
|
||||||
" \"isolatedTbCore\": false,\n" +
|
|
||||||
" \"isolatedTbRuleEngine\": false,\n" +
|
" \"isolatedTbRuleEngine\": false,\n" +
|
||||||
" \"profileData\": {\n" +
|
" \"profileData\": {\n" +
|
||||||
" \"configuration\": {\n" +
|
" \"configuration\": {\n" +
|
||||||
|
|||||||
@ -195,22 +195,6 @@ public class DefaultSystemDataLoaderService implements SystemDataLoaderService {
|
|||||||
public void createDefaultTenantProfiles() throws Exception {
|
public void createDefaultTenantProfiles() throws Exception {
|
||||||
tenantProfileService.findOrCreateDefaultTenantProfile(TenantId.SYS_TENANT_ID);
|
tenantProfileService.findOrCreateDefaultTenantProfile(TenantId.SYS_TENANT_ID);
|
||||||
|
|
||||||
TenantProfileData tenantProfileData = new TenantProfileData();
|
|
||||||
tenantProfileData.setConfiguration(new DefaultTenantProfileConfiguration());
|
|
||||||
|
|
||||||
TenantProfile isolatedTbCoreProfile = new TenantProfile();
|
|
||||||
isolatedTbCoreProfile.setDefault(false);
|
|
||||||
isolatedTbCoreProfile.setName("Isolated TB Core");
|
|
||||||
isolatedTbCoreProfile.setDescription("Isolated TB Core tenant profile");
|
|
||||||
isolatedTbCoreProfile.setIsolatedTbCore(true);
|
|
||||||
isolatedTbCoreProfile.setIsolatedTbRuleEngine(false);
|
|
||||||
isolatedTbCoreProfile.setProfileData(tenantProfileData);
|
|
||||||
try {
|
|
||||||
tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, isolatedTbCoreProfile);
|
|
||||||
} catch (DataValidationException e) {
|
|
||||||
log.warn(e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
TenantProfileData isolatedRuleEngineTenantProfileData = new TenantProfileData();
|
TenantProfileData isolatedRuleEngineTenantProfileData = new TenantProfileData();
|
||||||
isolatedRuleEngineTenantProfileData.setConfiguration(new DefaultTenantProfileConfiguration());
|
isolatedRuleEngineTenantProfileData.setConfiguration(new DefaultTenantProfileConfiguration());
|
||||||
|
|
||||||
@ -239,7 +223,6 @@ public class DefaultSystemDataLoaderService implements SystemDataLoaderService {
|
|||||||
isolatedTbRuleEngineProfile.setDefault(false);
|
isolatedTbRuleEngineProfile.setDefault(false);
|
||||||
isolatedTbRuleEngineProfile.setName("Isolated TB Rule Engine");
|
isolatedTbRuleEngineProfile.setName("Isolated TB Rule Engine");
|
||||||
isolatedTbRuleEngineProfile.setDescription("Isolated TB Rule Engine tenant profile");
|
isolatedTbRuleEngineProfile.setDescription("Isolated TB Rule Engine tenant profile");
|
||||||
isolatedTbRuleEngineProfile.setIsolatedTbCore(false);
|
|
||||||
isolatedTbRuleEngineProfile.setIsolatedTbRuleEngine(true);
|
isolatedTbRuleEngineProfile.setIsolatedTbRuleEngine(true);
|
||||||
isolatedTbRuleEngineProfile.setProfileData(isolatedRuleEngineTenantProfileData);
|
isolatedTbRuleEngineProfile.setProfileData(isolatedRuleEngineTenantProfileData);
|
||||||
|
|
||||||
@ -248,20 +231,6 @@ public class DefaultSystemDataLoaderService implements SystemDataLoaderService {
|
|||||||
} catch (DataValidationException e) {
|
} catch (DataValidationException e) {
|
||||||
log.warn(e.getMessage());
|
log.warn(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
TenantProfile isolatedTbCoreAndTbRuleEngineProfile = new TenantProfile();
|
|
||||||
isolatedTbCoreAndTbRuleEngineProfile.setDefault(false);
|
|
||||||
isolatedTbCoreAndTbRuleEngineProfile.setName("Isolated TB Core and TB Rule Engine");
|
|
||||||
isolatedTbCoreAndTbRuleEngineProfile.setDescription("Isolated TB Core and TB Rule Engine tenant profile");
|
|
||||||
isolatedTbCoreAndTbRuleEngineProfile.setIsolatedTbCore(true);
|
|
||||||
isolatedTbCoreAndTbRuleEngineProfile.setIsolatedTbRuleEngine(true);
|
|
||||||
isolatedTbCoreAndTbRuleEngineProfile.setProfileData(isolatedRuleEngineTenantProfileData);
|
|
||||||
|
|
||||||
try {
|
|
||||||
tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, isolatedTbCoreAndTbRuleEngineProfile);
|
|
||||||
} catch (DataValidationException e) {
|
|
||||||
log.warn(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -45,7 +45,7 @@ public class DefaultTenantRoutingInfoService implements TenantRoutingInfoService
|
|||||||
Tenant tenant = tenantService.findTenantById(tenantId);
|
Tenant tenant = tenantService.findTenantById(tenantId);
|
||||||
if (tenant != null) {
|
if (tenant != null) {
|
||||||
TenantProfile tenantProfile = tenantProfileCache.get(tenant.getTenantProfileId());
|
TenantProfile tenantProfile = tenantProfileCache.get(tenant.getTenantProfileId());
|
||||||
return new TenantRoutingInfo(tenantId, tenantProfile.isIsolatedTbCore(), tenantProfile.isIsolatedTbRuleEngine());
|
return new TenantRoutingInfo(tenantId, tenantProfile.isIsolatedTbRuleEngine());
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("Tenant not found!");
|
throw new RuntimeException("Tenant not found!");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -397,7 +397,6 @@ public abstract class BaseDeviceProfileControllerTest extends AbstractController
|
|||||||
tenantProfile.setDefault(false);
|
tenantProfile.setDefault(false);
|
||||||
tenantProfile.setName("Isolated TB Rule Engine");
|
tenantProfile.setName("Isolated TB Rule Engine");
|
||||||
tenantProfile.setDescription("Isolated TB Rule Engine tenant profile");
|
tenantProfile.setDescription("Isolated TB Rule Engine tenant profile");
|
||||||
tenantProfile.setIsolatedTbCore(false);
|
|
||||||
tenantProfile.setIsolatedTbRuleEngine(true);
|
tenantProfile.setIsolatedTbRuleEngine(true);
|
||||||
|
|
||||||
TenantProfileQueueConfiguration mainQueueConfiguration = new TenantProfileQueueConfiguration();
|
TenantProfileQueueConfiguration mainQueueConfiguration = new TenantProfileQueueConfiguration();
|
||||||
|
|||||||
@ -66,7 +66,6 @@ public abstract class BaseTenantProfileControllerTest extends AbstractController
|
|||||||
Assert.assertEquals(tenantProfile.getDescription(), savedTenantProfile.getDescription());
|
Assert.assertEquals(tenantProfile.getDescription(), savedTenantProfile.getDescription());
|
||||||
Assert.assertEquals(tenantProfile.getProfileData(), savedTenantProfile.getProfileData());
|
Assert.assertEquals(tenantProfile.getProfileData(), savedTenantProfile.getProfileData());
|
||||||
Assert.assertEquals(tenantProfile.isDefault(), savedTenantProfile.isDefault());
|
Assert.assertEquals(tenantProfile.isDefault(), savedTenantProfile.isDefault());
|
||||||
Assert.assertEquals(tenantProfile.isIsolatedTbCore(), savedTenantProfile.isIsolatedTbCore());
|
|
||||||
Assert.assertEquals(tenantProfile.isIsolatedTbRuleEngine(), savedTenantProfile.isIsolatedTbRuleEngine());
|
Assert.assertEquals(tenantProfile.isIsolatedTbRuleEngine(), savedTenantProfile.isIsolatedTbRuleEngine());
|
||||||
|
|
||||||
testBroadcastEntityStateChangeEventTimeManyTimeTenantProfile(savedTenantProfile, ComponentLifecycleEvent.CREATED, 1);
|
testBroadcastEntityStateChangeEventTimeManyTimeTenantProfile(savedTenantProfile, ComponentLifecycleEvent.CREATED, 1);
|
||||||
@ -182,22 +181,6 @@ public abstract class BaseTenantProfileControllerTest extends AbstractController
|
|||||||
testBroadcastEntityStateChangeEventNeverTenantProfile();
|
testBroadcastEntityStateChangeEventNeverTenantProfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testSaveSameTenantProfileWithDifferentIsolatedTbCore() throws Exception {
|
|
||||||
loginSysAdmin();
|
|
||||||
TenantProfile tenantProfile = this.createTenantProfile("Tenant Profile");
|
|
||||||
TenantProfile savedTenantProfile = doPost("/api/tenantProfile", tenantProfile, TenantProfile.class);
|
|
||||||
|
|
||||||
Mockito.reset(tbClusterService);
|
|
||||||
|
|
||||||
savedTenantProfile.setIsolatedTbCore(true);
|
|
||||||
doPost("/api/tenantProfile", savedTenantProfile)
|
|
||||||
.andExpect(status().isBadRequest())
|
|
||||||
.andExpect(statusReason(containsString("Can't update isolatedTbCore property")));
|
|
||||||
|
|
||||||
testBroadcastEntityStateChangeEventNeverTenantProfile();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDeleteTenantProfileWithExistingTenant() throws Exception {
|
public void testDeleteTenantProfileWithExistingTenant() throws Exception {
|
||||||
loginSysAdmin();
|
loginSysAdmin();
|
||||||
@ -352,7 +335,6 @@ public abstract class BaseTenantProfileControllerTest extends AbstractController
|
|||||||
tenantProfileData.setConfiguration(new DefaultTenantProfileConfiguration());
|
tenantProfileData.setConfiguration(new DefaultTenantProfileConfiguration());
|
||||||
tenantProfile.setProfileData(tenantProfileData);
|
tenantProfile.setProfileData(tenantProfileData);
|
||||||
tenantProfile.setDefault(false);
|
tenantProfile.setDefault(false);
|
||||||
tenantProfile.setIsolatedTbCore(false);
|
|
||||||
tenantProfile.setIsolatedTbRuleEngine(false);
|
tenantProfile.setIsolatedTbRuleEngine(false);
|
||||||
return tenantProfile;
|
return tenantProfile;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -273,7 +273,6 @@ message GetTenantRoutingInfoRequestMsg {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message GetTenantRoutingInfoResponseMsg {
|
message GetTenantRoutingInfoResponseMsg {
|
||||||
bool isolatedTbCore = 1;
|
|
||||||
bool isolatedTbRuleEngine = 2;
|
bool isolatedTbRuleEngine = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,13 +53,10 @@ public class TenantProfile extends SearchTextBased<TenantProfileId> implements H
|
|||||||
private String description;
|
private String description;
|
||||||
@ApiModelProperty(position = 5, value = "Default Tenant profile to be used.", example = "true")
|
@ApiModelProperty(position = 5, value = "Default Tenant profile to be used.", example = "true")
|
||||||
private boolean isDefault;
|
private boolean isDefault;
|
||||||
@ApiModelProperty(position = 6, value = "If enabled, will push all messages related to this tenant and processed by core platform services into separate queue. " +
|
@ApiModelProperty(position = 6, value = "If enabled, will push all messages related to this tenant and processed by the rule engine into separate queue. " +
|
||||||
"Useful for complex microservices deployments, to isolate processing of the data for specific tenants", example = "true")
|
|
||||||
private boolean isolatedTbCore;
|
|
||||||
@ApiModelProperty(position = 7, value = "If enabled, will push all messages related to this tenant and processed by the rule engine into separate queue. " +
|
|
||||||
"Useful for complex microservices deployments, to isolate processing of the data for specific tenants", example = "true")
|
"Useful for complex microservices deployments, to isolate processing of the data for specific tenants", example = "true")
|
||||||
private boolean isolatedTbRuleEngine;
|
private boolean isolatedTbRuleEngine;
|
||||||
@ApiModelProperty(position = 8, value = "Complex JSON object that contains profile settings: queue configs, max devices, max assets, rate limits, etc.")
|
@ApiModelProperty(position = 7, value = "Complex JSON object that contains profile settings: queue configs, max devices, max assets, rate limits, etc.")
|
||||||
private transient TenantProfileData profileData;
|
private transient TenantProfileData profileData;
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
private byte[] profileDataBytes;
|
private byte[] profileDataBytes;
|
||||||
@ -77,7 +74,6 @@ public class TenantProfile extends SearchTextBased<TenantProfileId> implements H
|
|||||||
this.name = tenantProfile.getName();
|
this.name = tenantProfile.getName();
|
||||||
this.description = tenantProfile.getDescription();
|
this.description = tenantProfile.getDescription();
|
||||||
this.isDefault = tenantProfile.isDefault();
|
this.isDefault = tenantProfile.isDefault();
|
||||||
this.isolatedTbCore = tenantProfile.isIsolatedTbCore();
|
|
||||||
this.isolatedTbRuleEngine = tenantProfile.isIsolatedTbRuleEngine();
|
this.isolatedTbRuleEngine = tenantProfile.isIsolatedTbRuleEngine();
|
||||||
this.setProfileData(tenantProfile.getProfileData());
|
this.setProfileData(tenantProfile.getProfileData());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -399,8 +399,6 @@ public class HashPartitionService implements PartitionService {
|
|||||||
throw new RuntimeException("Tenant not found!");
|
throw new RuntimeException("Tenant not found!");
|
||||||
}
|
}
|
||||||
switch (serviceType) {
|
switch (serviceType) {
|
||||||
case TB_CORE:
|
|
||||||
return routingInfo.isIsolatedTbCore();
|
|
||||||
case TB_RULE_ENGINE:
|
case TB_RULE_ENGINE:
|
||||||
return routingInfo.isIsolatedTbRuleEngine();
|
return routingInfo.isIsolatedTbRuleEngine();
|
||||||
default:
|
default:
|
||||||
|
|||||||
@ -21,6 +21,5 @@ import org.thingsboard.server.common.data.id.TenantId;
|
|||||||
@Data
|
@Data
|
||||||
public class TenantRoutingInfo {
|
public class TenantRoutingInfo {
|
||||||
private final TenantId tenantId;
|
private final TenantId tenantId;
|
||||||
private final boolean isolatedTbCore;
|
|
||||||
private final boolean isolatedTbRuleEngine;
|
private final boolean isolatedTbRuleEngine;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@ public class TransportTenantRoutingInfoService implements TenantRoutingInfoServi
|
|||||||
@Override
|
@Override
|
||||||
public TenantRoutingInfo getRoutingInfo(TenantId tenantId) {
|
public TenantRoutingInfo getRoutingInfo(TenantId tenantId) {
|
||||||
TenantProfile profile = tenantProfileCache.get(tenantId);
|
TenantProfile profile = tenantProfileCache.get(tenantId);
|
||||||
return new TenantRoutingInfo(tenantId, profile.isIsolatedTbCore(), profile.isIsolatedTbRuleEngine());
|
return new TenantRoutingInfo(tenantId, profile.isIsolatedTbRuleEngine());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,9 +53,6 @@ public final class TenantProfileEntity extends BaseSqlEntity<TenantProfile> impl
|
|||||||
@Column(name = ModelConstants.TENANT_PROFILE_IS_DEFAULT_PROPERTY)
|
@Column(name = ModelConstants.TENANT_PROFILE_IS_DEFAULT_PROPERTY)
|
||||||
private boolean isDefault;
|
private boolean isDefault;
|
||||||
|
|
||||||
@Column(name = ModelConstants.TENANT_PROFILE_ISOLATED_TB_CORE)
|
|
||||||
private boolean isolatedTbCore;
|
|
||||||
|
|
||||||
@Column(name = ModelConstants.TENANT_PROFILE_ISOLATED_TB_RULE_ENGINE)
|
@Column(name = ModelConstants.TENANT_PROFILE_ISOLATED_TB_RULE_ENGINE)
|
||||||
private boolean isolatedTbRuleEngine;
|
private boolean isolatedTbRuleEngine;
|
||||||
|
|
||||||
@ -75,7 +72,6 @@ public final class TenantProfileEntity extends BaseSqlEntity<TenantProfile> impl
|
|||||||
this.name = tenantProfile.getName();
|
this.name = tenantProfile.getName();
|
||||||
this.description = tenantProfile.getDescription();
|
this.description = tenantProfile.getDescription();
|
||||||
this.isDefault = tenantProfile.isDefault();
|
this.isDefault = tenantProfile.isDefault();
|
||||||
this.isolatedTbCore = tenantProfile.isIsolatedTbCore();
|
|
||||||
this.isolatedTbRuleEngine = tenantProfile.isIsolatedTbRuleEngine();
|
this.isolatedTbRuleEngine = tenantProfile.isIsolatedTbRuleEngine();
|
||||||
this.profileData = JacksonUtil.convertValue(tenantProfile.getProfileData(), ObjectNode.class);
|
this.profileData = JacksonUtil.convertValue(tenantProfile.getProfileData(), ObjectNode.class);
|
||||||
}
|
}
|
||||||
@ -101,7 +97,6 @@ public final class TenantProfileEntity extends BaseSqlEntity<TenantProfile> impl
|
|||||||
tenantProfile.setName(name);
|
tenantProfile.setName(name);
|
||||||
tenantProfile.setDescription(description);
|
tenantProfile.setDescription(description);
|
||||||
tenantProfile.setDefault(isDefault);
|
tenantProfile.setDefault(isDefault);
|
||||||
tenantProfile.setIsolatedTbCore(isolatedTbCore);
|
|
||||||
tenantProfile.setIsolatedTbRuleEngine(isolatedTbRuleEngine);
|
tenantProfile.setIsolatedTbRuleEngine(isolatedTbRuleEngine);
|
||||||
tenantProfile.setProfileData(JacksonUtil.convertValue(profileData, TenantProfileData.class));
|
tenantProfile.setProfileData(JacksonUtil.convertValue(profileData, TenantProfileData.class));
|
||||||
return tenantProfile;
|
return tenantProfile;
|
||||||
|
|||||||
@ -100,8 +100,6 @@ public class TenantProfileDataValidator extends DataValidator<TenantProfile> {
|
|||||||
throw new DataValidationException("Can't update non existing tenant profile!");
|
throw new DataValidationException("Can't update non existing tenant profile!");
|
||||||
} else if (old.isIsolatedTbRuleEngine() != tenantProfile.isIsolatedTbRuleEngine()) {
|
} else if (old.isIsolatedTbRuleEngine() != tenantProfile.isIsolatedTbRuleEngine()) {
|
||||||
throw new DataValidationException("Can't update isolatedTbRuleEngine property!");
|
throw new DataValidationException("Can't update isolatedTbRuleEngine property!");
|
||||||
} else if (old.isIsolatedTbCore() != tenantProfile.isIsolatedTbCore()) {
|
|
||||||
throw new DataValidationException("Can't update isolatedTbCore property!");
|
|
||||||
}
|
}
|
||||||
return old;
|
return old;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -153,7 +153,6 @@ public class TenantProfileServiceImpl extends AbstractCachedEntityService<Tenant
|
|||||||
profileData.setConfiguration(new DefaultTenantProfileConfiguration());
|
profileData.setConfiguration(new DefaultTenantProfileConfiguration());
|
||||||
defaultTenantProfile.setProfileData(profileData);
|
defaultTenantProfile.setProfileData(profileData);
|
||||||
defaultTenantProfile.setDescription("Default tenant profile");
|
defaultTenantProfile.setDescription("Default tenant profile");
|
||||||
defaultTenantProfile.setIsolatedTbCore(false);
|
|
||||||
defaultTenantProfile.setIsolatedTbRuleEngine(false);
|
defaultTenantProfile.setIsolatedTbRuleEngine(false);
|
||||||
defaultTenantProfile = saveTenantProfile(tenantId, defaultTenantProfile);
|
defaultTenantProfile = saveTenantProfile(tenantId, defaultTenantProfile);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,7 +51,6 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest {
|
|||||||
tenantProfile.setDefault(false);
|
tenantProfile.setDefault(false);
|
||||||
tenantProfile.setName("Isolated TB Rule Engine");
|
tenantProfile.setName("Isolated TB Rule Engine");
|
||||||
tenantProfile.setDescription("Isolated TB Rule Engine tenant profile");
|
tenantProfile.setDescription("Isolated TB Rule Engine tenant profile");
|
||||||
tenantProfile.setIsolatedTbCore(false);
|
|
||||||
tenantProfile.setIsolatedTbRuleEngine(true);
|
tenantProfile.setIsolatedTbRuleEngine(true);
|
||||||
|
|
||||||
TenantProfileQueueConfiguration mainQueueConfiguration = new TenantProfileQueueConfiguration();
|
TenantProfileQueueConfiguration mainQueueConfiguration = new TenantProfileQueueConfiguration();
|
||||||
|
|||||||
@ -85,7 +85,6 @@ public abstract class BaseTenantProfileServiceTest extends AbstractServiceTest {
|
|||||||
Assert.assertEquals(tenantProfile.getDescription(), savedTenantProfile.getDescription());
|
Assert.assertEquals(tenantProfile.getDescription(), savedTenantProfile.getDescription());
|
||||||
Assert.assertEquals(tenantProfile.getProfileData(), savedTenantProfile.getProfileData());
|
Assert.assertEquals(tenantProfile.getProfileData(), savedTenantProfile.getProfileData());
|
||||||
Assert.assertEquals(tenantProfile.isDefault(), savedTenantProfile.isDefault());
|
Assert.assertEquals(tenantProfile.isDefault(), savedTenantProfile.isDefault());
|
||||||
Assert.assertEquals(tenantProfile.isIsolatedTbCore(), savedTenantProfile.isIsolatedTbCore());
|
|
||||||
Assert.assertEquals(tenantProfile.isIsolatedTbRuleEngine(), savedTenantProfile.isIsolatedTbRuleEngine());
|
Assert.assertEquals(tenantProfile.isIsolatedTbRuleEngine(), savedTenantProfile.isIsolatedTbRuleEngine());
|
||||||
|
|
||||||
savedTenantProfile.setName("New tenant profile");
|
savedTenantProfile.setName("New tenant profile");
|
||||||
@ -177,14 +176,6 @@ public abstract class BaseTenantProfileServiceTest extends AbstractServiceTest {
|
|||||||
tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, savedTenantProfile);
|
tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, savedTenantProfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = DataValidationException.class)
|
|
||||||
public void testSaveSameTenantProfileWithDifferentIsolatedTbCore() {
|
|
||||||
TenantProfile tenantProfile = this.createTenantProfile("Tenant Profile");
|
|
||||||
TenantProfile savedTenantProfile = tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, tenantProfile);
|
|
||||||
savedTenantProfile.setIsolatedTbCore(true);
|
|
||||||
tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, savedTenantProfile);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(expected = DataValidationException.class)
|
@Test(expected = DataValidationException.class)
|
||||||
public void testDeleteTenantProfileWithExistingTenant() {
|
public void testDeleteTenantProfileWithExistingTenant() {
|
||||||
TenantProfile tenantProfile = this.createTenantProfile("Tenant Profile");
|
TenantProfile tenantProfile = this.createTenantProfile("Tenant Profile");
|
||||||
@ -298,7 +289,6 @@ public abstract class BaseTenantProfileServiceTest extends AbstractServiceTest {
|
|||||||
profileData.setConfiguration(new DefaultTenantProfileConfiguration());
|
profileData.setConfiguration(new DefaultTenantProfileConfiguration());
|
||||||
tenantProfile.setProfileData(profileData);
|
tenantProfile.setProfileData(profileData);
|
||||||
tenantProfile.setDefault(false);
|
tenantProfile.setDefault(false);
|
||||||
tenantProfile.setIsolatedTbCore(false);
|
|
||||||
tenantProfile.setIsolatedTbRuleEngine(false);
|
tenantProfile.setIsolatedTbRuleEngine(false);
|
||||||
return tenantProfile;
|
return tenantProfile;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -309,7 +309,6 @@ public abstract class BaseTenantServiceTest extends AbstractServiceTest {
|
|||||||
profileData.setConfiguration(new DefaultTenantProfileConfiguration());
|
profileData.setConfiguration(new DefaultTenantProfileConfiguration());
|
||||||
tenantProfile.setProfileData(profileData);
|
tenantProfile.setProfileData(profileData);
|
||||||
tenantProfile.setDefault(false);
|
tenantProfile.setDefault(false);
|
||||||
tenantProfile.setIsolatedTbCore(true);
|
|
||||||
tenantProfile.setIsolatedTbRuleEngine(true);
|
tenantProfile.setIsolatedTbRuleEngine(true);
|
||||||
TenantProfile isolatedTenantProfile = tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, tenantProfile);
|
TenantProfile isolatedTenantProfile = tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, tenantProfile);
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,6 @@ public class VersionControlTenantRoutingInfoService implements TenantRoutingInfo
|
|||||||
@Override
|
@Override
|
||||||
public TenantRoutingInfo getRoutingInfo(TenantId tenantId) {
|
public TenantRoutingInfo getRoutingInfo(TenantId tenantId) {
|
||||||
//This dummy implementation is ok since Version Control service does not produce any rule engine messages.
|
//This dummy implementation is ok since Version Control service does not produce any rule engine messages.
|
||||||
return new TenantRoutingInfo(tenantId, false, false);
|
return new TenantRoutingInfo(tenantId, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -631,7 +631,6 @@ export class ImportExportService {
|
|||||||
private validateImportedTenantProfile(tenantProfile: TenantProfile): boolean {
|
private validateImportedTenantProfile(tenantProfile: TenantProfile): boolean {
|
||||||
return isDefined(tenantProfile.name)
|
return isDefined(tenantProfile.name)
|
||||||
&& isDefined(tenantProfile.profileData)
|
&& isDefined(tenantProfile.profileData)
|
||||||
&& isDefined(tenantProfile.isolatedTbCore)
|
|
||||||
&& isDefined(tenantProfile.isolatedTbRuleEngine);
|
&& isDefined(tenantProfile.isolatedTbRuleEngine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -59,10 +59,6 @@
|
|||||||
</mat-error>
|
</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<div fxLayout="column">
|
<div fxLayout="column">
|
||||||
<mat-checkbox class="hinted-checkbox" formControlName="isolatedTbCore">
|
|
||||||
<div>{{ 'tenant.isolated-tb-core' | translate }}</div>
|
|
||||||
<div class="tb-hint">{{'tenant.isolated-tb-core-details' | translate}}</div>
|
|
||||||
</mat-checkbox>
|
|
||||||
<mat-checkbox class="hinted-checkbox" formControlName="isolatedTbRuleEngine">
|
<mat-checkbox class="hinted-checkbox" formControlName="isolatedTbRuleEngine">
|
||||||
<div>{{ 'tenant.isolated-tb-rule-engine' | translate }}</div>
|
<div>{{ 'tenant.isolated-tb-rule-engine' | translate }}</div>
|
||||||
<div class="tb-hint">{{'tenant.isolated-tb-rule-engine-details' | translate}}</div>
|
<div class="tb-hint">{{'tenant.isolated-tb-rule-engine-details' | translate}}</div>
|
||||||
|
|||||||
@ -81,7 +81,6 @@ export class TenantProfileComponent extends EntityComponent<TenantProfile> {
|
|||||||
const formGroup = this.fb.group(
|
const formGroup = this.fb.group(
|
||||||
{
|
{
|
||||||
name: [entity ? entity.name : '', [Validators.required, Validators.maxLength(255)]],
|
name: [entity ? entity.name : '', [Validators.required, Validators.maxLength(255)]],
|
||||||
isolatedTbCore: [entity ? entity.isolatedTbCore : false, []],
|
|
||||||
isolatedTbRuleEngine: [entity ? entity.isolatedTbRuleEngine : false, []],
|
isolatedTbRuleEngine: [entity ? entity.isolatedTbRuleEngine : false, []],
|
||||||
profileData: this.fb.group({
|
profileData: this.fb.group({
|
||||||
configuration: [entity && !this.isAdd ? entity?.profileData.configuration
|
configuration: [entity && !this.isAdd ? entity?.profileData.configuration
|
||||||
@ -107,7 +106,6 @@ export class TenantProfileComponent extends EntityComponent<TenantProfile> {
|
|||||||
|
|
||||||
updateForm(entity: TenantProfile) {
|
updateForm(entity: TenantProfile) {
|
||||||
this.entityForm.patchValue({name: entity.name}, {emitEvent: false});
|
this.entityForm.patchValue({name: entity.name}, {emitEvent: false});
|
||||||
this.entityForm.patchValue({isolatedTbCore: entity.isolatedTbCore}, {emitEvent: false});
|
|
||||||
this.entityForm.patchValue({isolatedTbRuleEngine: entity.isolatedTbRuleEngine}, {emitEvent: false});
|
this.entityForm.patchValue({isolatedTbRuleEngine: entity.isolatedTbRuleEngine}, {emitEvent: false});
|
||||||
this.entityForm.get('profileData').patchValue({
|
this.entityForm.get('profileData').patchValue({
|
||||||
configuration: !this.isAdd ? entity.profileData?.configuration : createTenantProfileConfiguration(TenantProfileType.DEFAULT)
|
configuration: !this.isAdd ? entity.profileData?.configuration : createTenantProfileConfiguration(TenantProfileType.DEFAULT)
|
||||||
@ -121,7 +119,6 @@ export class TenantProfileComponent extends EntityComponent<TenantProfile> {
|
|||||||
if (this.isEditValue) {
|
if (this.isEditValue) {
|
||||||
this.entityForm.enable({emitEvent: false});
|
this.entityForm.enable({emitEvent: false});
|
||||||
if (!this.isAdd) {
|
if (!this.isAdd) {
|
||||||
this.entityForm.get('isolatedTbCore').disable({emitEvent: false});
|
|
||||||
this.entityForm.get('isolatedTbRuleEngine').disable({emitEvent: false});
|
this.entityForm.get('isolatedTbRuleEngine').disable({emitEvent: false});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -137,7 +137,6 @@ export interface TenantProfile extends BaseData<TenantProfileId> {
|
|||||||
name: string;
|
name: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
default?: boolean;
|
default?: boolean;
|
||||||
isolatedTbCore?: boolean;
|
|
||||||
isolatedTbRuleEngine?: boolean;
|
isolatedTbRuleEngine?: boolean;
|
||||||
profileData?: TenantProfileData;
|
profileData?: TenantProfileData;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2550,9 +2550,7 @@
|
|||||||
"tenant-required": "Tenant je povinný",
|
"tenant-required": "Tenant je povinný",
|
||||||
"search": "Vyhledat tenanty",
|
"search": "Vyhledat tenanty",
|
||||||
"selected-tenants": "Vybráno { count, plural, 1 {1 tenantů} other {# tenantů} }",
|
"selected-tenants": "Vybráno { count, plural, 1 {1 tenantů} other {# tenantů} }",
|
||||||
"isolated-tb-core": "Zpracování v izolovaném kontejneru ThingsBoard Core",
|
|
||||||
"isolated-tb-rule-engine": "Zpracování v izolovaném kontejneru ThingsBoard Rule Engine",
|
"isolated-tb-rule-engine": "Zpracování v izolovaném kontejneru ThingsBoard Rule Engine",
|
||||||
"isolated-tb-core-details": "Vyžaduje samostatnou mikroslužbu(y) pro každého izolovaného tenanta",
|
|
||||||
"isolated-tb-rule-engine-details": "Vyžaduje samostatnou mikroslužbu(y) pro každého izolovaného tenanta"
|
"isolated-tb-rule-engine-details": "Vyžaduje samostatnou mikroslužbu(y) pro každého izolovaného tenanta"
|
||||||
},
|
},
|
||||||
"tenant-profile": {
|
"tenant-profile": {
|
||||||
|
|||||||
@ -3053,9 +3053,7 @@
|
|||||||
"tenant-required": "Tenant is required",
|
"tenant-required": "Tenant is required",
|
||||||
"search": "Search tenants",
|
"search": "Search tenants",
|
||||||
"selected-tenants": "{ count, plural, 1 {1 tenant} other {# tenants} } selected",
|
"selected-tenants": "{ count, plural, 1 {1 tenant} other {# tenants} } selected",
|
||||||
"isolated-tb-core": "Processing in isolated ThingsBoard Core container",
|
|
||||||
"isolated-tb-rule-engine": "Processing in isolated ThingsBoard Rule Engine container",
|
"isolated-tb-rule-engine": "Processing in isolated ThingsBoard Rule Engine container",
|
||||||
"isolated-tb-core-details": "Requires separate microservice(s) per isolated Tenant",
|
|
||||||
"isolated-tb-rule-engine-details": "Requires separate microservice(s) per isolated Tenant"
|
"isolated-tb-rule-engine-details": "Requires separate microservice(s) per isolated Tenant"
|
||||||
},
|
},
|
||||||
"tenant-profile": {
|
"tenant-profile": {
|
||||||
|
|||||||
@ -3029,9 +3029,7 @@
|
|||||||
"tenant-required": "Propietario requerido",
|
"tenant-required": "Propietario requerido",
|
||||||
"search": "Buscar propietarios",
|
"search": "Buscar propietarios",
|
||||||
"selected-tenants": "{ count, plural, 1 {1 propietario} other {# propietarios} } seleccionados",
|
"selected-tenants": "{ count, plural, 1 {1 propietario} other {# propietarios} } seleccionados",
|
||||||
"isolated-tb-core": "Procesando en contenedor aislado",
|
|
||||||
"isolated-tb-rule-engine": "Procesando en contenedor Motor de Reglas aislado",
|
"isolated-tb-rule-engine": "Procesando en contenedor Motor de Reglas aislado",
|
||||||
"isolated-tb-core-details": "Requiere microservicios separados por propietario aislado",
|
|
||||||
"isolated-tb-rule-engine-details": "Requiere microservicios separados por propietario aislado"
|
"isolated-tb-rule-engine-details": "Requiere microservicios separados por propietario aislado"
|
||||||
},
|
},
|
||||||
"tenant-profile": {
|
"tenant-profile": {
|
||||||
|
|||||||
@ -1997,9 +1997,7 @@
|
|||||||
"tenant-required": "테넌트가 필요합니다.",
|
"tenant-required": "테넌트가 필요합니다.",
|
||||||
"search": "테넌트 검색",
|
"search": "테넌트 검색",
|
||||||
"selected-tenants": "{ count, plural, 1 {1 개 테넌트} other {# 개 테넌트} } 선택됨",
|
"selected-tenants": "{ count, plural, 1 {1 개 테넌트} other {# 개 테넌트} } 선택됨",
|
||||||
"isolated-tb-core": "Processing in isolated ThingsBoard Core container",
|
|
||||||
"isolated-tb-rule-engine": "Processing in isolated ThingsBoard Rule Engine container",
|
"isolated-tb-rule-engine": "Processing in isolated ThingsBoard Rule Engine container",
|
||||||
"isolated-tb-core-details": "Requires separate microservice(s) per isolated Tenant",
|
|
||||||
"isolated-tb-rule-engine-details": "Requires separate microservice(s) per isolated Tenant"
|
"isolated-tb-rule-engine-details": "Requires separate microservice(s) per isolated Tenant"
|
||||||
},
|
},
|
||||||
"tenant-profile": {
|
"tenant-profile": {
|
||||||
|
|||||||
@ -1659,9 +1659,7 @@
|
|||||||
"tenant-required": "O locatário é obrigatório",
|
"tenant-required": "O locatário é obrigatório",
|
||||||
"search": "Pesquisar locatários",
|
"search": "Pesquisar locatários",
|
||||||
"selected-tenants": "{ count, plural, 1 {1 tenant} other {# tenants} } selecionado(s)",
|
"selected-tenants": "{ count, plural, 1 {1 tenant} other {# tenants} } selecionado(s)",
|
||||||
"isolated-tb-core": "Processamento em contêiner isolado do ThingsBoard Core",
|
|
||||||
"isolated-tb-rule-engine": "Processamento em contêiner isolado do ThingsBoard Rule Engine",
|
"isolated-tb-rule-engine": "Processamento em contêiner isolado do ThingsBoard Rule Engine",
|
||||||
"isolated-tb-core-details": "Exige microsserviço(s) separado(s) para cada locatário isolado",
|
|
||||||
"isolated-tb-rule-engine-details": "Exige microsserviço(s) separado(s) para cada locatário isolado"
|
"isolated-tb-rule-engine-details": "Exige microsserviço(s) separado(s) para cada locatário isolado"
|
||||||
},
|
},
|
||||||
"timeinterval": {
|
"timeinterval": {
|
||||||
|
|||||||
@ -1997,9 +1997,7 @@
|
|||||||
"tenant-required": "Najemnik je obvezen",
|
"tenant-required": "Najemnik je obvezen",
|
||||||
"search": "Iskanje najemnikov",
|
"search": "Iskanje najemnikov",
|
||||||
"selected-tenants": "{ count, plural, 1 {1 tenant} other {# tenants} } izbran",
|
"selected-tenants": "{ count, plural, 1 {1 tenant} other {# tenants} } izbran",
|
||||||
"isolated-tb-core": "Obdelava v izoliranem odlagališču ThingsBoard Core",
|
|
||||||
"isolated-tb-rule-engine": "Obdelava v izoliranem odlagališču ThingsBoard Rule Engine",
|
"isolated-tb-rule-engine": "Obdelava v izoliranem odlagališču ThingsBoard Rule Engine",
|
||||||
"isolated-tb-core-details": "Zahteva ločene mikro storitve na izoliranega najemnika",
|
|
||||||
"isolated-tb-rule-engine-details": "Zahteva ločene mikro storitve na izoliranega najemnika"
|
"isolated-tb-rule-engine-details": "Zahteva ločene mikro storitve na izoliranega najemnika"
|
||||||
},
|
},
|
||||||
"tenant-profile": {
|
"tenant-profile": {
|
||||||
|
|||||||
@ -2569,9 +2569,7 @@
|
|||||||
"tenant-required": "Tenant gerekli",
|
"tenant-required": "Tenant gerekli",
|
||||||
"search": "Tenantları ara",
|
"search": "Tenantları ara",
|
||||||
"selected-tenants": "{ count, plural, 1 {1 tenant} other {# tenant} } seçildi",
|
"selected-tenants": "{ count, plural, 1 {1 tenant} other {# tenant} } seçildi",
|
||||||
"isolated-tb-core": "ThingsBoard soyutlanmış merkezi konteynerda işlensin",
|
|
||||||
"isolated-tb-rule-engine": "ThingsBoard soyutlanmış kural yönetimi konteynerda işlensin",
|
"isolated-tb-rule-engine": "ThingsBoard soyutlanmış kural yönetimi konteynerda işlensin",
|
||||||
"isolated-tb-core-details": "Her soyutlanmış tenant ayrı bir mikro servis gerektirir",
|
|
||||||
"isolated-tb-rule-engine-details": "Her soyutlanmış tenant ayrı bir mikro servis gerektirir"
|
"isolated-tb-rule-engine-details": "Her soyutlanmış tenant ayrı bir mikro servis gerektirir"
|
||||||
},
|
},
|
||||||
"tenant-profile": {
|
"tenant-profile": {
|
||||||
|
|||||||
@ -2476,8 +2476,6 @@
|
|||||||
"details": "详情",
|
"details": "详情",
|
||||||
"events": "事件",
|
"events": "事件",
|
||||||
"idCopiedMessage": "租户ID已经复制到粘贴板",
|
"idCopiedMessage": "租户ID已经复制到粘贴板",
|
||||||
"isolated-tb-core": "隔离板芯容器中的加工",
|
|
||||||
"isolated-tb-core-details": "每个独立租户需要单独的微服务",
|
|
||||||
"isolated-tb-rule-engine": "在独立的ThingsBoard规则引擎容器中处理",
|
"isolated-tb-rule-engine": "在独立的ThingsBoard规则引擎容器中处理",
|
||||||
"isolated-tb-rule-engine-details": "每个独立租户需要单独的微服务",
|
"isolated-tb-rule-engine-details": "每个独立租户需要单独的微服务",
|
||||||
"manage-tenant-admins": "管理租户管理员",
|
"manage-tenant-admins": "管理租户管理员",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user