Skip to content

Commit

Permalink
Fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hwupathum committed Oct 14, 2024
1 parent 2645153 commit cab5ddc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public enum ErrorMessage {
"Maximum number of allowed tenants have been reached."),
ERROR_CODE_OWNER_NOT_FOUND("TM-60020",
"Unable to retrieve the tenant owner.",
"Tenant owner cannot be found for the provided id: %s."),
"Tenant owner cannot be found for the provided tenant id: %s."),
ERROR_CODE_PARTIALLY_CREATED_OR_UPDATED("TM-60021",
"Tenant creation / update was completed with errors.",
"Tenant creation / update was completed with error: %s"),
Expand All @@ -73,11 +73,11 @@ public enum ErrorMessage {
"Unable to check availability of domain.",
"Server encountered an error while checking for tenant domain"),
ERROR_CODE_DELETE_TENANT_METADATA("TM-65008", "Error while deleting the tenant metadata.",
"Server encountered an error while deleting the tenant metadata identified by %s ."),
"Server encountered an error while deleting the tenant metadata identified by %s."),
ERROR_CODE_ERROR_RETRIEVING_OWNER("TM-65009", "Error while retrieving the owner.",
"Server encountered an error while retrieving the owner identified by %s ."),
"Server encountered an error while retrieving the owner identified by tenant id %s."),
ERROR_CODE_ERROR_UPDATING_OWNER("TM-65010", "Error while updating the owner.",
"Server encountered an error while updating the owner identified by %s .");
"Server encountered an error while updating the owner identified by tenant id %s.");

private final String code;
private final String message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ public OwnerInfoResponse getOwner(String tenantUniqueID, String ownerID, String
Tenant tenant = TenantManagementServiceHolder.getTenantMgtService().getTenant(tenantUniqueID);
if (tenant.getAdminUserId() == null || !tenant.getAdminUserId().equals(ownerID)) {
throw handleException(Response.Status.NOT_FOUND, TenantManagementConstants.ErrorMessage.
ERROR_CODE_OWNER_NOT_FOUND, ownerID);
ERROR_CODE_OWNER_NOT_FOUND, tenantUniqueID);
}
String[] claimsList = StringUtils.split(additionalClaims, ",");
return createOwnerInfoResponse(tenant, claimsList);
} catch (TenantMgtException e) {
throw handleTenantManagementException(e, TenantManagementConstants.ErrorMessage.
ERROR_CODE_ERROR_RETRIEVING_OWNER, ownerID);
ERROR_CODE_ERROR_RETRIEVING_OWNER, tenantUniqueID);
}
}

Expand All @@ -222,7 +222,7 @@ public void updateOwner(String tenantUniqueID, String ownerID, OwnerPutModel own
TenantManagementServiceHolder.getTenantMgtService().updateOwner(tenant);
} catch (TenantMgtException e) {
throw handleTenantManagementException(e, TenantManagementConstants.ErrorMessage.
ERROR_CODE_ERROR_UPDATING_OWNER, ownerID);
ERROR_CODE_ERROR_UPDATING_OWNER, tenantUniqueID);
}
}

Expand Down Expand Up @@ -280,7 +280,7 @@ private Tenant createTenantInfoBean(String tenantUniqueID, String ownerID, Owner
Tenant tenant = TenantManagementServiceHolder.getTenantMgtService().getTenant(tenantUniqueID);
if (tenant.getAdminUserId() == null || !tenant.getAdminUserId().equals(ownerID)) {
throw handleException(Response.Status.NOT_FOUND, TenantManagementConstants.ErrorMessage.
ERROR_CODE_OWNER_NOT_FOUND, ownerID);
ERROR_CODE_OWNER_NOT_FOUND, tenantUniqueID);
}
if (StringUtils.isNotBlank(ownerPutModel.getFirstname())) {
tenant.setAdminFirstName(ownerPutModel.getFirstname());
Expand Down Expand Up @@ -318,7 +318,7 @@ private OwnerInfoResponse createOwnerInfoResponse(Tenant tenant, String[] claims
} catch (UserStoreException e) {
if (e.getMessage().startsWith(TenantManagementConstants.NON_EXISTING_USER_CODE)) {
throw handleException(Response.Status.NOT_FOUND, TenantManagementConstants.ErrorMessage.
ERROR_CODE_OWNER_NOT_FOUND, tenant.getAdminUserId());
ERROR_CODE_OWNER_NOT_FOUND, tenant.getTenantUniqueID());
}
throw new TenantMgtException(e.getMessage());
}
Expand Down

0 comments on commit cab5ddc

Please sign in to comment.