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

Introduce Generic Organization Resource Resolver #415

Merged
merged 21 commits into from
Dec 4, 2024
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a18f28c
Introduce organization resource hierarchy traverse service with the r…
dhaura Nov 21, 2024
6cbaa3d
Fix traverse service pom version.
dhaura Nov 21, 2024
941a2ae
Merge remote-tracking branch 'upstream/main' into DP-add-b2b-resource…
dhaura Nov 21, 2024
28341aa
Improve bundle packaging and extract ancestor org retrieval to a priv…
dhaura Nov 21, 2024
e9667be
Add unit tests and improve javadoc comments.
dhaura Nov 22, 2024
fc14805
Add unit test comments.
dhaura Nov 22, 2024
1577064
Improve OrgResourceResolverService comments.
dhaura Nov 22, 2024
1d653e0
Fix checkstyle issues and rename test class to OrgResourceResolverSer…
dhaura Nov 22, 2024
22415d3
Apply test name change in testng.xml.
dhaura Nov 22, 2024
b71a3cc
Add missing fullstops in comments.
dhaura Nov 22, 2024
4c93167
Improve assertResolvedResponse method.
dhaura Nov 22, 2024
7f071c1
Improve NotImplementedException comments.
dhaura Nov 25, 2024
c145e9f
Handle invalid organization ids as error scenarios.
dhaura Nov 26, 2024
b4aa7f9
Remove redundant org id list empty check.
dhaura Nov 29, 2024
3349bbd
Update pom version in traverse service.
dhaura Nov 29, 2024
938dc30
Improve javadoc comments and variable naming.
dhaura Nov 29, 2024
beca634
Fix data holder method comment.
dhaura Nov 29, 2024
e742138
Fix server error unit tests.
dhaura Dec 4, 2024
1a8702a
Merge branch 'main' into DP-add-b2b-resource-resolver
dhaura Dec 4, 2024
0507e26
Bump resource traverse version.
dhaura Dec 4, 2024
d2107a1
Merge remote-tracking branch 'origin/DP-add-b2b-resource-resolver' in…
dhaura Dec 4, 2024
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
Prev Previous commit
Next Next commit
Improve bundle packaging and extract ancestor org retrieval to a priv…
…ate method.
  • Loading branch information
dhaura committed Nov 21, 2024
commit 28341aac52dda7e533936bd48113be269347983f
Original file line number Diff line number Diff line change
@@ -89,7 +89,9 @@
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Private-Package>
org.wso2.carbon.identity.organization.resource.hierarchy.traverse.internal
org.wso2.carbon.identity.organization.resource.hierarchy.traverse.service.constant,
org.wso2.carbon.identity.organization.resource.hierarchy.traverse.service.internal,
org.wso2.carbon.identity.organization.resource.hierarchy.traverse.service.util
</Private-Package>
<Import-Package>
org.apache.commons.lang; version="${org.apache.commons.lang.imp.pkg.version.range}",
@@ -112,8 +114,12 @@
version="${org.wso2.identity.organization.mgt.core.imp.pkg.version.range}"
</Import-Package>
<Export-Package>
!org.wso2.carbon.identity.organization.resource.hierarchy.traverse.internal,
org.wso2.carbon.identity.organization.resource.hierarchy.traverse.*;
!org.wso2.carbon.identity.organization.resource.hierarchy.traverse.service.constant,
!org.wso2.carbon.identity.organization.resource.hierarchy.traverse.service.internal,
!org.wso2.carbon.identity.organization.resource.hierarchy.traverse.service.util,
org.wso2.carbon.identity.organization.resource.hierarchy.traverse.service,
org.wso2.carbon.identity.organization.resource.hierarchy.traverse.service.exception,
org.wso2.carbon.identity.organization.resource.hierarchy.traverse.service.strategy;
version="${project.version}"
</Export-Package>
</instructions>
Original file line number Diff line number Diff line change
@@ -47,9 +47,7 @@ public <T> T getResourcesFromOrgHierarchy(String organizationId, Function<String
throws OrgResourceHierarchyTraverseException {

try {
OrganizationManager organizationManager = OrgResourceHierarchyTraverseUtil.getOrganizationManager();
List<String> organizationIds = organizationManager.getAncestorOrganizationIds(organizationId);

List<String> organizationIds = getAncestorOrganizationsIds(organizationId);
if (CollectionUtils.isEmpty(organizationIds) || organizationIds.isEmpty()) {
return null;
}
@@ -69,9 +67,7 @@ public <T> T getResourcesFromOrgHierarchy(String organizationId, String applicat
throws OrgResourceHierarchyTraverseException {

try {
OrganizationManager organizationManager = OrgResourceHierarchyTraverseUtil.getOrganizationManager();
List<String> organizationIds = organizationManager.getAncestorOrganizationIds(organizationId);

List<String> organizationIds = getAncestorOrganizationsIds(organizationId);
if (CollectionUtils.isEmpty(organizationIds) || organizationIds.isEmpty()) {
return null;
}
@@ -95,6 +91,13 @@ public <T> T getResourcesFromOrgHierarchy(String organizationId, String applicat
}
}

private List<String> getAncestorOrganizationsIds(String organizationId)
throws OrganizationManagementException {

OrganizationManager organizationManager = OrgResourceHierarchyTraverseUtil.getOrganizationManager();
return organizationManager.getAncestorOrganizationIds(organizationId);
}

private ApplicationManagementService getApplicationManagementService() {

return OrgResourceHierarchyTraverseServiceDataHolder.getInstance().getApplicationManagementService();
Loading