Skip to content

Commit

Permalink
update the method name
Browse files Browse the repository at this point in the history
  • Loading branch information
asha15 committed Sep 18, 2024
1 parent e9cc3e6 commit 77c7640
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ default Map<String, String> getChildAppIds(String parentAppId, String parentOrgI
* @return List of DiscoverableApplicationBasicInfo of applications matching the given criteria.
* @throws OrganizationManagementException If an error occurred when retrieving the discoverable applications.
*/
default List<ApplicationBasicInfo> getDiscoverableApplicationBasicInfo(int limit, int offset, String filter,
default List<ApplicationBasicInfo> getDiscoverableSharedApplicationBasicInfo(int limit, int offset, String filter,
String sortOrder,
String sortBy, String tenantDomain)
throws OrganizationManagementException {
Expand All @@ -205,7 +205,7 @@ default List<ApplicationBasicInfo> getDiscoverableApplicationBasicInfo(int limit
* @throws OrganizationManagementException If an error occurred when retrieving the count of
* discoverable applications.
*/
default int getCountOfDiscoverableApplications(String filter, String tenantDomain)
default int getCountOfDiscoverableSharedApplications(String filter, String tenantDomain)
throws OrganizationManagementException {

return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
import org.wso2.carbon.identity.organization.management.application.model.SharedApplicationDO;
import org.wso2.carbon.identity.organization.management.ext.Constants;
import org.wso2.carbon.identity.organization.management.service.OrganizationManager;
import org.wso2.carbon.identity.organization.management.service.OrganizationManagerImpl;
import org.wso2.carbon.identity.organization.management.service.constant.OrganizationManagementConstants;
import org.wso2.carbon.identity.organization.management.service.exception.OrganizationManagementClientException;
import org.wso2.carbon.identity.organization.management.service.exception.OrganizationManagementException;
Expand Down Expand Up @@ -712,26 +711,24 @@ public Map<String, String> getChildAppIds(String parentAppId, String parentOrgId
}

@Override
public List<ApplicationBasicInfo> getDiscoverableApplicationBasicInfo(int limit, int offset, String filter,
public List<ApplicationBasicInfo> getDiscoverableSharedApplicationBasicInfo(int limit, int offset, String filter,
String sortOrder, String sortBy,
String tenantDomain)
throws OrganizationManagementException {

OrganizationManagerImpl organizationManager = new OrganizationManagerImpl();
String rootOrgId = organizationManager.getPrimaryOrganizationId(tenantDomain);
String rootOrgId = getOrganizationManager().getParentOrganizationId(tenantDomain);

return getOrgApplicationMgtDAO().getDiscoverableApplicationBasicInfo(limit, offset, filter, sortOrder,
return getOrgApplicationMgtDAO().getDiscoverableSharedApplicationBasicInfo(limit, offset, filter, sortOrder,
sortBy, tenantDomain, rootOrgId);
}

@Override
public int getCountOfDiscoverableApplications(String filter, String tenantDomain)
public int getCountOfDiscoverableSharedApplications(String filter, String tenantDomain)
throws OrganizationManagementException {

OrganizationManagerImpl organizationManager = new OrganizationManagerImpl();
String rootOrgId = organizationManager.getPrimaryOrganizationId(tenantDomain);
String rootOrgId = getOrganizationManager().getParentOrganizationId(tenantDomain);

return getOrgApplicationMgtDAO().getCountOfDiscoverableApplications(filter, tenantDomain, rootOrgId);
return getOrgApplicationMgtDAO().getCountOfDiscoverableSharedApplications(filter, tenantDomain, rootOrgId);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class SQLConstants {
SQLPlaceholders.DB_SCHEMA_COLUMN_NAME_OWNER_ORG_ID + "; AND SHARED_ORG_ID IN (" +
SQLPlaceholders.SHARED_ORG_ID_LIST_PLACEHOLDER + ")";

public static final String LOAD_DISCOVERABLE_APPS_BY_TENANT_MYSQL =
public static final String LOAD_DISCOVERABLE_SHARED_APPS_BY_TENANT_MYSQL =
"WITH DiscoverableApps AS ( SELECT sa.ID, sa.APP_NAME, sa.DESCRIPTION, sa.UUID, sa.IMAGE_URL, " +
"sa.ACCESS_URL, sa.USERNAME, sa.USER_STORE, sa.TENANT_ID, ROW_NUMBER() OVER ( PARTITION BY sa.APP_NAME " +
"ORDER BY CASE WHEN sa.UUID = ssa.SHARED_APP_ID THEN 1 ELSE 2 END, sa.ID DESC ) AS rn FROM SP_APP sa " +
Expand All @@ -82,7 +82,7 @@ public class SQLConstants {
"DESCRIPTION, UUID, IMAGE_URL, ACCESS_URL, USERNAME, USER_STORE, TENANT_ID FROM DiscoverableApps WHERE " +
"rn = 1 ORDER BY ID DESC LIMIT ?, ?";

public static final String LOAD_DISCOVERABLE_APPS_BY_TENANT_POSTGRES =
public static final String LOAD_DISCOVERABLE_SHARED_APPS_BY_TENANT_POSTGRES =
"WITH DiscoverableApps AS ( SELECT sa.ID, sa.APP_NAME, sa.DESCRIPTION, sa.UUID, sa.IMAGE_URL, " +
"sa.ACCESS_URL, sa.USERNAME, sa.USER_STORE, sa.TENANT_ID, ROW_NUMBER() OVER ( PARTITION BY sa.APP_NAME " +
"ORDER BY CASE WHEN sa.UUID = ssa.SHARED_APP_ID THEN 1 ELSE 2 END, sa.ID DESC ) AS rn FROM SP_APP sa " +
Expand All @@ -91,7 +91,7 @@ public class SQLConstants {
"DESCRIPTION, UUID, IMAGE_URL, ACCESS_URL, USERNAME, USER_STORE, TENANT_ID FROM DiscoverableApps WHERE " +
"rn = 1 ORDER BY ID DESC OFFSET ? LIMIT ?";

public static final String LOAD_DISCOVERABLE_APPS_BY_TENANT_ORACLE =
public static final String LOAD_DISCOVERABLE_SHARED_APPS_BY_TENANT_ORACLE =
"WITH DiscoverableApps AS ( SELECT sa.ID, sa.APP_NAME, sa.DESCRIPTION, sa.UUID, sa.IMAGE_URL, " +
"sa.ACCESS_URL, sa.USERNAME, sa.USER_STORE, sa.TENANT_ID, ROW_NUMBER() OVER ( PARTITION BY " +
"sa.APP_NAME ORDER BY CASE WHEN sa.UUID = ssa.SHARED_APP_ID THEN 1 ELSE 2 END, sa.ID DESC ) AS rn " +
Expand All @@ -100,7 +100,7 @@ public class SQLConstants {
"DESCRIPTION, UUID, IMAGE_URL, ACCESS_URL, USERNAME, USER_STORE, TENANT_ID FROM DiscoverableApps WHERE " +
"rn = 1 BETWEEN ? AND ? ORDER BY ID DESC";

public static final String LOAD_DISCOVERABLE_APPS_BY_TENANT_MSSQL =
public static final String LOAD_DISCOVERABLE_SHARED_APPS_BY_TENANT_MSSQL =
"WITH DiscoverableApps AS ( SELECT sa.ID, sa.APP_NAME, sa.DESCRIPTION, sa.UUID, sa.IMAGE_URL, " +
"sa.ACCESS_URL, sa.USERNAME, sa.USER_STORE, sa.TENANT_ID, ROW_NUMBER() OVER ( PARTITION BY sa.APP_NAME " +
"ORDER BY CASE WHEN sa.UUID = ssa.SHARED_APP_ID THEN 1 ELSE 2 END, sa.ID DESC ) AS rn FROM SP_APP sa " +
Expand All @@ -109,7 +109,7 @@ public class SQLConstants {
"DESCRIPTION, UUID, IMAGE_URL, ACCESS_URL, USERNAME, USER_STORE, TENANT_ID FROM DiscoverableApps WHERE " +
"rn = 1 ORDER BY ID DESC OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";

public static final String LOAD_DISCOVERABLE_APPS_BY_TENANT_INFORMIX =
public static final String LOAD_DISCOVERABLE_SHARED_APPS_BY_TENANT_INFORMIX =
"WITH DiscoverableApps AS ( SELECT sa.ID, sa.APP_NAME, sa.DESCRIPTION, sa.UUID, sa.IMAGE_URL, " +
"sa.ACCESS_URL, sa.USERNAME, sa.USER_STORE, sa.TENANT_ID, ROW_NUMBER() OVER ( PARTITION BY sa.APP_NAME " +
"ORDER BY CASE WHEN sa.UUID = ssa.SHARED_APP_ID THEN 1 ELSE 2 END, sa.ID DESC ) AS rn FROM SP_APP sa " +
Expand All @@ -118,7 +118,7 @@ public class SQLConstants {
"DESCRIPTION, UUID, IMAGE_URL, ACCESS_URL, USERNAME, USER_STORE, TENANT_ID FROM DiscoverableApps WHERE " +
"rn = 1 ORDER BY ID DESC SKIP ? LIMIT ?";

public static final String LOAD_DISCOVERABLE_APPS_BY_TENANT_AND_APP_NAME_MYSQL =
public static final String LOAD_DISCOVERABLE_SHARED_APPS_BY_TENANT_AND_APP_NAME_MYSQL =
"WITH DiscoverableApps AS ( SELECT sa.ID, sa.APP_NAME, sa.DESCRIPTION, sa.UUID, sa.IMAGE_URL, " +
"sa.ACCESS_URL, sa.USERNAME, sa.USER_STORE, sa.TENANT_ID, ROW_NUMBER() OVER ( PARTITION BY sa.APP_NAME " +
"ORDER BY CASE WHEN sa.UUID = ssa.SHARED_APP_ID THEN 1 ELSE 2 END, sa.ID DESC ) AS rn FROM SP_APP sa " +
Expand All @@ -127,7 +127,7 @@ public class SQLConstants {
"SELECT ID, APP_NAME, DESCRIPTION, UUID, IMAGE_URL, ACCESS_URL, USERNAME, USER_STORE, TENANT_ID FROM " +
"DiscoverableApps WHERE rn = 1 ORDER BY ID DESC LIMIT ?, ?";

public static final String LOAD_DISCOVERABLE_APPS_BY_TENANT_AND_APP_NAME_POSTGRESL =
public static final String LOAD_DISCOVERABLE_SHARED_APPS_BY_TENANT_AND_APP_NAME_POSTGRESL =
"WITH DiscoverableApps AS ( SELECT sa.ID, sa.APP_NAME, sa.DESCRIPTION, sa.UUID, sa.IMAGE_URL, " +
"sa.ACCESS_URL, sa.USERNAME, sa.USER_STORE, sa.TENANT_ID, ROW_NUMBER() OVER ( PARTITION BY sa.APP_NAME " +
"ORDER BY CASE WHEN sa.UUID = ssa.SHARED_APP_ID THEN 1 ELSE 2 END, sa.ID DESC ) AS rn FROM SP_APP sa " +
Expand All @@ -136,7 +136,7 @@ public class SQLConstants {
"SELECT ID, APP_NAME, DESCRIPTION, UUID, IMAGE_URL, ACCESS_URL, USERNAME, USER_STORE, TENANT_ID FROM " +
"DiscoverableApps WHERE rn = 1 ORDER BY ID DESC OFFSET ? LIMIT ?";

public static final String LOAD_DISCOVERABLE_APPS_BY_TENANT_AND_APP_NAME_ORACLE =
public static final String LOAD_DISCOVERABLE_SHARED_APPS_BY_TENANT_AND_APP_NAME_ORACLE =
"WITH DiscoverableApps AS ( SELECT sa.ID, sa.APP_NAME, sa.DESCRIPTION, sa.UUID, sa.IMAGE_URL, " +
"sa.ACCESS_URL, sa.USERNAME, sa.USER_STORE, sa.TENANT_ID, ROW_NUMBER() OVER ( PARTITION BY sa.APP_NAME " +
"ORDER BY CASE WHEN sa.UUID = ssa.SHARED_APP_ID THEN 1 ELSE 2 END, sa.ID DESC ) AS rn FROM SP_APP sa " +
Expand All @@ -145,7 +145,7 @@ public class SQLConstants {
"SELECT ID, APP_NAME, DESCRIPTION, UUID, IMAGE_URL, ACCESS_URL, USERNAME, USER_STORE, TENANT_ID FROM " +
"DiscoverableApps WHERE rn = 1 BETWEEN ? AND ? ORDER BY ID DESC";

public static final String LOAD_DISCOVERABLE_APPS_BY_TENANT_AND_APP_NAME_MSSQL =
public static final String LOAD_DISCOVERABLE_SHARED_APPS_BY_TENANT_AND_APP_NAME_MSSQL =
"WITH DiscoverableApps AS ( SELECT sa.ID, sa.APP_NAME, sa.DESCRIPTION, sa.UUID, sa.IMAGE_URL, " +
"sa.ACCESS_URL, sa.USERNAME, sa.USER_STORE, sa.TENANT_ID, ROW_NUMBER() OVER ( PARTITION BY sa.APP_NAME " +
"ORDER BY CASE WHEN sa.UUID = ssa.SHARED_APP_ID THEN 1 ELSE 2 END, sa.ID DESC ) AS rn FROM SP_APP sa " +
Expand All @@ -154,7 +154,7 @@ public class SQLConstants {
"SELECT ID, APP_NAME, DESCRIPTION, UUID, IMAGE_URL, ACCESS_URL, USERNAME, USER_STORE, TENANT_ID FROM " +
"DiscoverableApps WHERE rn = 1 ORDER BY ID DESC OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";

public static final String LOAD_DISCOVERABLE_APPS_BY_TENANT_AND_APP_NAME_INFORMIX =
public static final String LOAD_DISCOVERABLE_SHARED_APPS_BY_TENANT_AND_APP_NAME_INFORMIX =
"WITH DiscoverableApps AS ( SELECT sa.ID, sa.APP_NAME, sa.DESCRIPTION, sa.UUID, sa.IMAGE_URL, " +
"sa.ACCESS_URL, sa.USERNAME, sa.USER_STORE, sa.TENANT_ID, ROW_NUMBER() OVER ( PARTITION BY sa.APP_NAME " +
"ORDER BY CASE WHEN sa.UUID = ssa.SHARED_APP_ID THEN 1 ELSE 2 END, sa.ID DESC ) AS rn FROM SP_APP sa " +
Expand All @@ -163,14 +163,14 @@ public class SQLConstants {
"SELECT ID, APP_NAME, DESCRIPTION, UUID, IMAGE_URL, ACCESS_URL, USERNAME, USER_STORE, TENANT_ID FROM " +
"DiscoverableApps WHERE rn = 1 ORDER BY ID DESC SKIP ? LIMIT ?";

public static final String LOAD_DISCOVERABLE_APP_COUNT_BY_TENANT =
public static final String LOAD_DISCOVERABLE_SHARED_APP_COUNT_BY_TENANT =
"WITH DiscoverableApps AS ( SELECT sa.UUID, ROW_NUMBER() OVER ( PARTITION BY sa.APP_NAME " +
"ORDER BY CASE WHEN sa.UUID = ssa.SHARED_APP_ID THEN 1 ELSE 2 END, sa.ID DESC ) AS rn FROM SP_APP sa " +
"JOIN SP_SHARED_APP ssa ON sa.UUID = ssa.SHARED_APP_ID OR sa.UUID = ssa.MAIN_APP_ID WHERE " +
"ssa.SHARED_ORG_ID = ? AND sa.IS_DISCOVERABLE = '1' AND ssa.OWNER_ORG_ID = ? ) SELECT count(UUID) " +
"FROM DiscoverableApps WHERE rn = 1";

public static final String LOAD_DISCOVERABLE_APP_COUNT_BY_APP_NAME_AND_TENANT =
public static final String LOAD_DISCOVERABLE_SHARED_APP_COUNT_BY_APP_NAME_AND_TENANT =
"WITH DiscoverableApps AS ( SELECT sa.UUID, ROW_NUMBER() OVER ( PARTITION BY sa.APP_NAME ORDER BY CASE " +
"WHEN sa.UUID = ssa.SHARED_APP_ID THEN 1 ELSE 2 END, sa.ID DESC ) AS rn FROM SP_APP sa JOIN " +
"SP_SHARED_APP ssa ON sa.UUID = ssa.SHARED_APP_ID OR sa.UUID = ssa.MAIN_APP_ID WHERE " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,10 @@ default List<SharedApplicationDO> getSharedApplications(String mainAppId, String
* @throws OrganizationManagementException The server exception is thrown in a failure when retrieving the
* discoverable applications.
*/
default List<ApplicationBasicInfo> getDiscoverableApplicationBasicInfo(int limit, int offset, String filter,
List<ApplicationBasicInfo> getDiscoverableSharedApplicationBasicInfo(int limit, int offset, String filter,
String sortOrder, String sortBy,
String tenantDomain, String rootOrgId)
throws OrganizationManagementException {

return null;
}
throws OrganizationManagementException;

/*
* Returns the count of discoverable applications matching given filter.
Expand All @@ -170,9 +167,6 @@ default List<ApplicationBasicInfo> getDiscoverableApplicationBasicInfo(int limit
* @throws OrganizationManagementException The server exception is thrown in a failure when retrieving the
* discoverable applications count.
*/
default int getCountOfDiscoverableApplications(String filter, String tenantDomain, String rootOrgId)
throws OrganizationManagementException {

return 0;
}
int getCountOfDiscoverableSharedApplications(String filter, String tenantDomain, String rootOrgId)
throws OrganizationManagementException;
}
Loading

0 comments on commit 77c7640

Please sign in to comment.