diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java index 5c4ecc9dd0cc..619088c1f04d 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java @@ -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)); diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java index 8988bdd80b52..45ee8c47dd52 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java @@ -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")); @@ -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")); @@ -1544,7 +1544,7 @@ public Set 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")); @@ -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; @@ -16773,7 +16773,7 @@ public List 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; } @@ -18962,7 +18962,7 @@ public Set 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")); @@ -18997,7 +18997,7 @@ public Set 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")); diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/SubscriptionValidationDAO.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/SubscriptionValidationDAO.java index 442db79662c8..3dfacdf2167a 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/SubscriptionValidationDAO.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/SubscriptionValidationDAO.java @@ -431,7 +431,7 @@ public List 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); @@ -1131,7 +1131,7 @@ public List 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); @@ -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)) { @@ -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); @@ -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); @@ -1547,7 +1547,7 @@ public List 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);