Description
When going through the code I noticed that there is inconsistency at times in the code. For example, in [1] and [2] tenantdomain and domain appear to be the same parameter, but it has been referred to by two names.
[1]
@DELETE
@Path("/tenant/
")
@Consumes("application/json")
@Produces("application/json")
@AuthorizationAction("/permission/protected/manage/monitor/tenants")
@SuperTenantService(true)
public Response deleteTenant(@PathParam("tenantDomain") String tenantDomain) throws RestAPIException {
TenantManager tenantManager = ServiceHolder.getTenantManager();
int tenantId = 0;
try
catch (org.wso2.carbon.user.api.UserStoreException e)
{ String msg = "Error in deleting tenant " + tenantDomain; log.error(msg, e); //throw new RestAPIException(msg); return Response.status(Response.Status.NOT_FOUND).build(); }try
{ //TODO: billing related info cleanup TenantMgtUtil.deleteTenantRegistryData(tenantId); TenantMgtUtil.deleteTenantUMData(tenantId); tenantManager.deleteTenant(tenantId); log.info("Deleted tenant with domain: " + tenantDomain + " and tenant id: " + tenantId + " from the system."); }catch (Exception e)
{ String msg = "Error deleting tenant with domain: " + tenantDomain + " and tenant id: " + tenantId + "."; log.error(msg, e); throw new RestAPIException(msg); } return Response.noContent().build();
}
[2]
@GET
@Path("tenant/search/
")
@Consumes("application/json")
@Produces("application/json")
@AuthorizationAction("/permission/protected/manage/monitor/tenants")
@SuperTenantService(true)
public TenantInfoBean[] retrievePartialSearchTenants(@PathParam("domain") String domain) throws RestAPIException {
List<TenantInfoBean> tenantList = null;
try
catch (Exception e)
{ String msg = "Error in getting information for tenant " + domain; log.error(msg, e); throw new RestAPIException(msg); } return tenantList.toArray(new TenantInfoBean[tenantList.size()]);
}