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

Exclude system apps in applications GET impl #6026

Merged
merged 5 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -126,6 +126,7 @@ private ApplicationConstants() {
public static final String MYACCOUNT_PORTAL_PATH = "MyAccount.AppBaseName";
public static final String AUTHORIZE_ALL_SCOPES = "OAuth.AuthorizeAllScopes";
public static final String RBAC = "RBAC";
public static final String SYSTEM_PORTALS = "SystemPortals";

/**
* Group the constants related to logs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,14 @@ public ApplicationBasicInfo[] getApplicationBasicInfo(String tenantDomain, Strin
int offset, int limit)
throws IdentityApplicationManagementException {

return getApplicationBasicInfo(tenantDomain, username, filter, offset, limit, false);
}

@Override
public ApplicationBasicInfo[] getApplicationBasicInfo(String tenantDomain, String username, String filter,
int offset, int limit, Boolean excludeSystemPortals)
throws IdentityApplicationManagementException {

return new ApplicationBasicInfo[0];
JeethJJ marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,26 @@ public ApplicationBasicInfo[] getApplicationBasicInfo(String tenantDomain, Strin
int offset, int limit)
throws IdentityApplicationManagementException {

return getApplicationBasicInfo(tenantDomain, username, filter, offset, limit, false);
}

/**
* Get all basic application information for a matching filter with pagination based on the offset and limit.
*
* @param tenantDomain Tenant Domain.
* @param username User name.
* @param filter Application name filter.
* @param offset Starting index of the count.
* @param limit Counting value.
* @param excludeSystemPortals Exclude system portals.
* @return An array of {@link ApplicationBasicInfo} instances within the limit.
* @throws IdentityApplicationManagementException Error in retrieving basic application information.
*/
@Override
public ApplicationBasicInfo[] getApplicationBasicInfo(String tenantDomain, String username, String filter,
int offset, int limit, Boolean excludeSystemPortals)
throws IdentityApplicationManagementException {

ApplicationBasicInfo[] applicationBasicInfoArray;

try {
Expand All @@ -583,7 +603,7 @@ public ApplicationBasicInfo[] getApplicationBasicInfo(String tenantDomain, Strin
}

applicationBasicInfoArray = ((PaginatableFilterableApplicationDAO) appDAO).
getApplicationBasicInfo(filter, offset, limit);
getApplicationBasicInfo(filter, offset, limit, excludeSystemPortals);

// Invoking post listeners.
for (ApplicationMgtListener listener : listeners) {
Expand Down Expand Up @@ -674,11 +694,29 @@ public int getCountOfAllApplications(String tenantDomain, String username)
public int getCountOfApplications(String tenantDomain, String username, String filter) throws
IdentityApplicationManagementException {

return getCountOfApplications(tenantDomain, username, filter, false);
}

/**
* Get count of all basic application information for a matching filter.
*
* @param tenantDomain Tenant Domain
* @param username User Name
* @param filter Application name filter
* @param excludeSystemPortals Exclude system portals
* @return int
* @throws IdentityApplicationManagementException
*/
@Override
public int getCountOfApplications(String tenantDomain, String username, String filter, Boolean excludeSystemPortals)
throws IdentityApplicationManagementException {

try {
startTenantFlow(tenantDomain, username);
ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO();
if (appDAO instanceof PaginatableFilterableApplicationDAO) {
return ((PaginatableFilterableApplicationDAO) appDAO).getCountOfApplications(filter);
return ((PaginatableFilterableApplicationDAO) appDAO)
.getCountOfApplications(filter, excludeSystemPortals);
} else {
throw new UnsupportedOperationException("Application count is not supported. " + "Tenant domain: " +
tenantDomain);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,28 @@ ApplicationBasicInfo[] getPaginatedApplicationBasicInfo(String tenantDomain, Str
* @param limit Counting value.
* @return An array of {@link ApplicationBasicInfo} instances matching the given filter within the given limit.
* @throws IdentityApplicationManagementException Error in retrieving basic application information.
* @Deprecated This is being deprecated as introducing excludeSystemPortals to exclude system portals in response
* use {@link ApplicationPaginationAndSearching#getApplicationBasicInfo(String, String, String, int, int, Boolean)}.
JeethJJ marked this conversation as resolved.
Show resolved Hide resolved
*/
ApplicationBasicInfo[] getApplicationBasicInfo(String tenantDomain, String username, String filter, int offset,
int limit) throws IdentityApplicationManagementException;

/**
* Get all basic application information for a matching filter with pagination based on the offset and limit.
*
* @param tenantDomain Tenant Domain.
* @param username User name.
* @param filter Application name filter.
* @param offset Starting index of the count.
* @param limit Counting value.
* @param excludeSystemPortals Exclude system portals
* @return An array of {@link ApplicationBasicInfo} instances matching the given filter within the given limit.
* @throws IdentityApplicationManagementException Error in retrieving basic application information.
*/
ApplicationBasicInfo[] getApplicationBasicInfo(String tenantDomain, String username, String filter, int offset,
JeethJJ marked this conversation as resolved.
Show resolved Hide resolved
int limit, Boolean excludeSystemPortals)
throws IdentityApplicationManagementException;

/**
* Get count of all Application Basic Information.
*
Expand All @@ -117,8 +135,23 @@ int getCountOfAllApplications(String tenantDomain, String username)
* @param filter Application name filter
* @return int
* @throws org.wso2.carbon.identity.application.common.IdentityApplicationManagementException
* @Deprecated This is being deprecated as introducing excludeSystemPortals to exclude system portals in response
* use {@link ApplicationPaginationAndSearching#getCountOfApplications(String, String, String, Boolean)}.
*/
int getCountOfApplications(String tenantDomain, String username, String filter)
throws IdentityApplicationManagementException;

/**
* Get count of all basic application information for a matching filter.
*
* @param tenantDomain Tenant Domain
* @param username User Name
* @param filter Application name filter
* @param excludeSystemPortals Exclude system portals
* @return int
* @throws org.wso2.carbon.identity.application.common.IdentityApplicationManagementException
*/
int getCountOfApplications(String tenantDomain, String username, String filter, Boolean excludeSystemPortals)
JeethJJ marked this conversation as resolved.
Show resolved Hide resolved
throws IdentityApplicationManagementException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,23 @@ ApplicationBasicInfo[] getAllPaginatedApplicationBasicInfo(int pageNumber) throw
* @param limit Count value.
* @return An array of {@link ApplicationBasicInfo} instances within the limit.
* @throws IdentityApplicationManagementException Error in retrieving basic application information.
* @Deprecated This is being deprecated as introducing excludeSystemPortals to exclude system portals in response
* use {@link PaginatableFilterableApplicationDAO#getApplicationBasicInfo(int, int, Boolean)}.
JeethJJ marked this conversation as resolved.
Show resolved Hide resolved
*/
ApplicationBasicInfo[] getApplicationBasicInfo(int offset, int limit) throws IdentityApplicationManagementException;

/**
* Get all the basic application information based on the offset and the limit.
*
* @param offset Starting index of the count.
* @param limit Count value.
* @param excludeSystemPortals Exclude system portals.
JeethJJ marked this conversation as resolved.
Show resolved Hide resolved
* @return An array of {@link ApplicationBasicInfo} instances within the limit.
* @throws IdentityApplicationManagementException Error in retrieving basic application information.
*/
ApplicationBasicInfo[] getApplicationBasicInfo(int offset, int limit, Boolean excludeSystemPortals)
JeethJJ marked this conversation as resolved.
Show resolved Hide resolved
throws IdentityApplicationManagementException;

/**
* Get all basic application information for a matching filter that falls under the given page number.
*
Expand All @@ -70,10 +84,27 @@ ApplicationBasicInfo[] getPaginatedApplicationBasicInfo(int pageNumber, String f
* @return An array of {@link ApplicationBasicInfo} instances matching the given filter within the given limit.
* @throws IdentityApplicationManagementException Error in retrieving basic application information based on the
* given filter within the given limit.
* @Deprecated This is being deprecated as introducing excludeSystemPortals to exclude system portals in response
* use {@link PaginatableFilterableApplicationDAO#getApplicationBasicInfo(String, int, int, Boolean)}.
*/
ApplicationBasicInfo[] getApplicationBasicInfo(String filter, int offset, int limit) throws
IdentityApplicationManagementException;

/**
* Get all basic application information for a matching filter based on the offset and the limit.
*
* @param filter Application name filter.
* @param offset Starting index of the count.
* @param limit Count value.
* @param excludeSystemPortals Exclude system portals
* @return An array of {@link ApplicationBasicInfo} instances matching the given filter within the given limit.
* @throws IdentityApplicationManagementException Error in retrieving basic application information based on the
* given filter within the given limit.
*
*/
ApplicationBasicInfo[] getApplicationBasicInfo(String filter, int offset, int limit, Boolean excludeSystemPortals)
throws IdentityApplicationManagementException;

/**
* Get count of applications.
*
Expand All @@ -88,9 +119,22 @@ ApplicationBasicInfo[] getApplicationBasicInfo(String filter, int offset, int li
* @param filter application search filter
* @return matched application count in a int value
* @throws IdentityApplicationManagementException
* @Deprecated This is being deprecated as introducing excludeSystemPortals to exclude system portals in response
* use {@link PaginatableFilterableApplicationDAO#getCountOfApplications(String, Boolean)}.
*/
int getCountOfApplications(String filter) throws IdentityApplicationManagementException;

/**
* Get count of applications matching the filter.
*
* @param filter application search filter
* @param excludeSystemPortals Exclude system portals
* @return matched application count in a int value
* @throws IdentityApplicationManagementException
*/
int getCountOfApplications(String filter, Boolean excludeSystemPortals) throws
IdentityApplicationManagementException;

/**
* Get all basic application information for a matching filter.
*
Expand Down
Loading
Loading