if(!TenantManager.getInstance().isInitialized()) {
return false;
}
// Parse complete message and build event
TenantUpdatedEvent event = (TenantUpdatedEvent) Util.jsonToObject(message, TenantUpdatedEvent.class);
try {
TenantManager.acquireWriteLock();
Tenant tenant = TenantManager.getInstance().getTenant(event.getTenantId());
if(tenant == null) {
if(log.isWarnEnabled()) {
log.warn(String.format("Tenant not found: [tenant-id] %d", event.getTenantId()));
}
return false;
}
tenant.setTenantDomain(event.getTenantDomain());
if(log.isInfoEnabled()) {
log.info(String.format("Tenant updated: [tenant-id] %d [tenant-domain] %s", tenant.getTenantId(), tenant.getTenantDomain()));
}