Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
Original file line number Diff line number Diff line change
Expand Up @@ -3065,30 +3065,33 @@ public static void activateTenant(String tenantDomain) throws RestAPIException {
int tenantId;
try {
tenantId = tenantManager.getTenantId(tenantDomain);
if(tenantId != -1) {
try {
TenantMgtUtil.activateTenant(tenantDomain, tenantManager, tenantId);

} catch (Exception e) {
String msg = "Error in activating Tenant :" + tenantDomain;
log.error(msg, e);
throw new RestAPIException(msg, e);
}

//Notify tenant activation all listeners
try {
TenantMgtUtil.triggerTenantActivation(tenantId);
} catch (StratosException e) {
String msg = "Error in notifying tenant activate.";
log.error(msg, e);
throw new RestAPIException(msg, e);
}
} else {
String msg = "The tenant with domain name: " + tenantDomain + " does not exist.";
throw new RestAPIException(msg);
}
} catch (UserStoreException e) {
String msg = "Error in retrieving the tenant id for the tenant domain: " + tenantDomain + ".";
log.error(msg, e);
throw new RestAPIException(msg, e);
}

try {
TenantMgtUtil.activateTenant(tenantDomain, tenantManager, tenantId);

} catch (Exception e) {
String msg="Error in activating Tenant :"+tenantDomain;
log.error(msg,e);
throw new RestAPIException(msg,e);
}

//Notify tenant activation all listeners
try {
TenantMgtUtil.triggerTenantActivation(tenantId);
} catch (StratosException e) {
String msg = "Error in notifying tenant activate.";
log.error(msg, e);
throw new RestAPIException(msg, e);
}
}

/**
Expand Down