From 3c45f9af116de9f3a8e7298b1201c67440a89f32 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Wed, 25 Jan 2017 22:15:03 +0530 Subject: [PATCH] fixed api Id issue for subscription --- .../extension/APIManagementProviderServiceImpl.java | 7 +++++-- .../org.wso2.carbon.apimgt.integration.client/pom.xml | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java index fdeccb2aca9..6575585b76e 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java @@ -101,11 +101,14 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe if (apiList.getList() != null && apiList.getList().size() > 0) { for (APIInfo apiInfo : apiList.getList()) { Subscription subscription = new Subscription(); - subscription.setApiIdentifier(apiInfo.getId()); + //fix for APIMANAGER-5566 admin-AT-tenant1.com-Tenant1API1-1.0.0 + String id = apiInfo.getProvider().replace("@", "-AT-") + + "-" + apiInfo.getName()+ "-" + apiInfo.getVersion(); + subscription.setApiIdentifier(id); subscription.setApplicationId(application.getApplicationId()); subscription.tier(ApiApplicationConstants.DEFAULT_TIER); SubscriptionList subscriptionList = storeClient.getSubscriptions().subscriptionsGet - (apiInfo.getId(), application.getApplicationId(), "", 0, 100, CONTENT_TYPE, null); + (id, application.getApplicationId(), "", 0, 100, CONTENT_TYPE, null); boolean subscriptionExist = false; if (subscriptionList.getList() != null && subscriptionList.getList().size() > 0) { for (Subscription subs : subscriptionList.getList()) { diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml index 5d73fdd0538..392a6e364c5 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml @@ -67,7 +67,9 @@ org.wso2.carbon.utils, com.fasterxml.jackson.annotation, io.swagger.annotations, - org.wso2.carbon.core.util + org.wso2.carbon.core.util, + javax.xml, + org.wso2.carbon.base jsr311-api,