Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error constants related to adding organization discovery attribute #83

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ public String getParentOrganizationId(String organizationId) throws Organization
@Override
public boolean isPrimaryOrganization(String organizationId) throws OrganizationManagementServerException {

return Utils.getSubOrgStartLevel() == getOrganizationDepthInHierarchy(organizationId);
return Utils.getSubOrgStartLevel() - 1 == getOrganizationDepthInHierarchy(organizationId);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,21 @@ public enum ErrorMessages {
"Application cannot be created for the sub-organization with id: %s."),
ERROR_CODE_NO_PARENT_ORG("60079", "No parent organization.",
"No parent organization is available for the give organization id: %s."),
ERROR_CODE_DISCOVERY_CONFIG_DISABLED("60080", "Can't add organization discovery attribute.",
"The organization discovery configuration is disabled in the root organization with ID: %s."),
dewniMW marked this conversation as resolved.
Show resolved Hide resolved
ERROR_CODE_UNAUTHORIZED_ORG_ADDS_DISCOVERY_ATTRIBUTE("60081", "Can't add organization discovery " +
"attribute.", "Only the root organization is allowed to add the organization discovery " +
"attribute mappings."),
ERROR_CODE_DUPLICATE_DISCOVERY_ATTRIBUTE_TYPES("60082", "Invalid request body.", "The discovery " +
"attribute type: %s is duplicated."),
ERROR_CODE_DISCOVERY_ATTRIBUTE_TAKEN("60083", "Discovery attribute is already mapped in the " +
"organization hierarchy.", "The provided discovery attribute value is already associated with a " +
"different organization's discovery attribute of type %s."),
ERROR_CODE_UNSUPPORTED_DISCOVERY_ATTRIBUTE("60084", "Unsupported discovery attribute.",
"The discovery attribute type: %s is unsupported."),
ERROR_CODE_DISCOVERY_ATTRIBUTE_ALREADY_ADDED_FOR_ORGANIZATION("60085", "Discovery attribute(s) are " +
"already added for the organization.", "Discovery attribute(s) are already added for the " +
"organization with ID: %s."),

// Server errors.
ERROR_CODE_UNEXPECTED("65001", "Unexpected processing error",
Expand Down Expand Up @@ -598,7 +613,19 @@ public enum ErrorMessages {
"initializing SubOrganizationTenantDeletionHandler. Value not found for : %s."),
ERROR_CODE_GET_ANCESTOR_IN_DEPTH("65114", "Unable to retrieve the ancestor organization in depth.",
"Server encountered an error while retrieving the ancestor organization in depth %s for organization " +
"id: %s."),;
"ID: %s."),
ERROR_CODE_ERROR_ADDING_ORGANIZATION_DISCOVERY_ATTRIBUTE("65115", "Unable to add organization " +
"discovery attribute.", "Server encountered an error while adding organization discovery " +
"attribute for organization with ID: %s."),
ERROR_CODE_ERROR_CHECKING_ORGANIZATION_DISCOVERY_ATTRIBUTE_EXIST_IN_HIERARCHY("65116", "Error " +
"while checking if the organization discovery attribute exists.", "Server encountered an error" +
" while checking if the organization discovery attribute exists within the hierarchy."),
ERROR_CODE_ERROR_CHECKING_DISCOVERY_ATTRIBUTE_ADDED_IN_ORGANIZATION("65117", "Error while checking " +
"if the organization already has discovery attributes", "Server encountered an error while " +
"checking if the organization with ID: %s already has discovery attribute(s) added."),
dewniMW marked this conversation as resolved.
Show resolved Hide resolved
ERROR_CODE_ERROR_RETRIEVING_DISCOVERY_CONFIGURATION("65118", "Error while retrieving discovery " +
"configuration.", "Server encountered an error while retrieving discovery configuration for " +
"the root organization with ID: %s.");
dewniMW marked this conversation as resolved.
Show resolved Hide resolved

private final String code;
private final String message;
Expand Down
Loading