Skip to content

Commit

Permalink
Merge pull request #12532 from msm1992/master-3076
Browse files Browse the repository at this point in the history
Add Ignore Case String check for APIProduct Type
  • Loading branch information
msm1992 committed Sep 3, 2024
2 parents 4c54b2c + d0ee9de commit 37622cc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7004,7 +7004,7 @@ public ApiTypeWrapper getAPIorAPIProductByUUID(String uuid, String requestedTena
APIInfo apiInfo = apiMgtDAO.getAPIInfoByUUID(uuid);
if (apiInfo != null) {
if (apiInfo.getOrganization().equals(requestedTenantDomain)) {
if (APIConstants.API_PRODUCT.equals(apiInfo.getApiType())) {
if (APIConstants.API_PRODUCT.equalsIgnoreCase(apiInfo.getApiType())) {
return new ApiTypeWrapper(getAPIProductbyUUID(uuid, requestedTenantDomain));
} else {
return new ApiTypeWrapper(getAPIbyUUID(uuid, requestedTenantDomain));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ public SubscribedAPI getSubscriptionById(int subscriptionId) throws APIManagemen
if (resultSet.next()) {
int applicationId = resultSet.getInt("APPLICATION_ID");
Application application = getLightweightApplicationById(conn, applicationId);
if (APIConstants.API_PRODUCT.equals(resultSet.getString("API_TYPE"))) {
if (APIConstants.API_PRODUCT.equalsIgnoreCase(resultSet.getString("API_TYPE"))) {
APIProductIdentifier apiProductIdentifier = new APIProductIdentifier(
APIUtil.replaceEmailDomain(resultSet.getString("API_PROVIDER")),
resultSet.getString("API_NAME"), resultSet.getString("API_VERSION"));
Expand Down Expand Up @@ -983,7 +983,7 @@ public SubscribedAPI getSubscriptionByUUID(String uuid) throws APIManagementExce
if (resultSet.next()) {
Identifier identifier;

if (APIConstants.API_PRODUCT.equals(resultSet.getString("API_TYPE"))) {
if (APIConstants.API_PRODUCT.equalsIgnoreCase(resultSet.getString("API_TYPE"))) {
identifier = new APIProductIdentifier(
APIUtil.replaceEmailDomain(resultSet.getString("API_PROVIDER")),
resultSet.getString("API_NAME"), resultSet.getString("API_VERSION"));
Expand Down Expand Up @@ -1544,7 +1544,7 @@ public Set<SubscribedAPI> getSubscribedAPIs(String organization, Subscriber subs
while (result.next()) {
String apiType = result.getString("TYPE");

if (APIConstants.API_PRODUCT.toString().equals(apiType)) {
if (APIConstants.API_PRODUCT.equalsIgnoreCase(apiType)) {
APIProductIdentifier identifier =
new APIProductIdentifier(APIUtil.replaceEmailDomain(result.getString("API_PROVIDER")),
result.getString("API_NAME"), result.getString("API_VERSION"));
Expand Down Expand Up @@ -10004,7 +10004,7 @@ public APIInfo getAPIInfoByUUID(String apiId) throws APIManagementException {
String context = resultSet.getString("CONTEXT");
String apiType = resultSet.getString("API_TYPE");
String version = resultSet.getString("API_VERSION");
if (APIConstants.API_PRODUCT.equals(apiType)
if (APIConstants.API_PRODUCT.equalsIgnoreCase(apiType)
&& APIConstants.API_PRODUCT_VERSION_1_0_0.equals(version)
&& StringUtils.isBlank(contextTemplate)) {
context = context + "/" + APIConstants.API_PRODUCT_VERSION_1_0_0;
Expand Down Expand Up @@ -16773,7 +16773,7 @@ public List<API> getAllAPIVersions(String apiName, String apiProvider) throws AP
String contextTemplate = resultSet.getString("CONTEXT_TEMPLATE");

String uuid = resultSet.getString("API_UUID");
if (APIConstants.API_PRODUCT.equals(resultSet.getString("API_TYPE"))) {
if (APIConstants.API_PRODUCT.equalsIgnoreCase(resultSet.getString("API_TYPE"))) {
// skip api products
continue;
}
Expand Down Expand Up @@ -18962,7 +18962,7 @@ public Set<SubscribedAPI> getSubscribedAPIsByApplication(Application application
try (ResultSet result = ps.executeQuery()) {
while (result.next()) {
String apiType = result.getString("TYPE");
if (!APIConstants.API_PRODUCT.toString().equals(apiType)) {
if (!APIConstants.API_PRODUCT.equalsIgnoreCase(apiType)) {
APIIdentifier identifier = new APIIdentifier(APIUtil.replaceEmailDomain(result.getString
("API_PROVIDER")), result.getString("API_NAME"),
result.getString("API_VERSION"));
Expand Down Expand Up @@ -18997,7 +18997,7 @@ public Set<SubscribedAPI> getPaginatedSubscribedAPIsByApplication(Application ap
if (index >= offset && index < limit) {
String apiType = result.getString("TYPE");

if (APIConstants.API_PRODUCT.toString().equals(apiType)) {
if (APIConstants.API_PRODUCT.equalsIgnoreCase(apiType)) {
APIProductIdentifier identifier = new APIProductIdentifier(
APIUtil.replaceEmailDomain(result.getString("API_PROVIDER")),
result.getString("API_NAME"), result.getString("API_VERSION"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ public List<API> getAllApis(String organization, boolean isExpand) {
if (isExpand) {
String revision = resultSet.getString("REVISION_UUID");
api.setPolicy(getAPILevelTier(connection, apiUuid, revision));
if (APIConstants.API_PRODUCT.equals(apiType)) {
if (APIConstants.API_PRODUCT.equalsIgnoreCase(apiType)) {
attachURlMappingDetailsOfApiProduct(connection, api, revision);
} else {
attachURLMappingDetails(connection, revision, api);
Expand Down Expand Up @@ -1131,7 +1131,7 @@ public List<API> getAllApis(String organization, String deployment, boolean isEx
if (isExpand) {
String revision = resultSet.getString("REVISION_UUID");
api.setPolicy(getAPILevelTier(connection, apiUuid, revision));
if (APIConstants.API_PRODUCT.equals(apiType)) {
if (APIConstants.API_PRODUCT.equalsIgnoreCase(apiType)) {
attachURlMappingDetailsOfApiProduct(connection, api, revision);
} else {
attachURLMappingDetails(connection, revision, api);
Expand All @@ -1157,7 +1157,7 @@ private static void setDefaultVersionContext(String apiType, API api, String ver
api.setIsDefaultVersion(true);
}

if (APIConstants.API_PRODUCT.equals(apiType)
if (APIConstants.API_PRODUCT.equalsIgnoreCase(apiType)
&& APIConstants.API_PRODUCT_VERSION_1_0_0.equals(version)
&& StringUtils.isBlank(contextTemplate)) {
if (StringUtils.isBlank(publishedDefaultApiVersion)) {
Expand Down Expand Up @@ -1246,7 +1246,7 @@ public API getAPIByContextAndVersion(String context, String version, String depl
api.setIsDefaultVersion(isAPIDefaultVersion(connection, provider, name, version));
if (isExpand) {
api.setPolicy(getAPILevelTier(connection, apiUuid, revision));
if (APIConstants.API_PRODUCT.equals(apiType)) {
if (APIConstants.API_PRODUCT.equalsIgnoreCase(apiType)) {
attachURlMappingDetailsOfApiProduct(connection, api, revision);
} else {
attachURLMappingDetails(connection, revision, api);
Expand Down Expand Up @@ -1458,7 +1458,7 @@ public API getApiByUUID(String apiId, String deployment, String organization, bo
contextTemplate);
if (isExpand) {
api.setPolicy(getAPILevelTier(connection, apiUuid, revision));
if (APIConstants.API_PRODUCT.equals(apiType)) {
if (APIConstants.API_PRODUCT.equalsIgnoreCase(apiType)) {
attachURlMappingDetailsOfApiProduct(connection, api, revision);
} else {
attachURLMappingDetails(connection, revision, api);
Expand Down Expand Up @@ -1547,7 +1547,7 @@ public List<API> getAllApisByLabel(String gatewayLabel, Boolean expand) {

if (expand) {
api.setPolicy(getAPILevelTier(connection, apiUuid, revision));
if (APIConstants.API_PRODUCT.equals(apiType)) {
if (APIConstants.API_PRODUCT.equalsIgnoreCase(apiType)) {
attachURlMappingDetailsOfApiProduct(connection, api, revision);
} else {
attachURLMappingDetails(connection, revision, api);
Expand Down

0 comments on commit 37622cc

Please sign in to comment.