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