fixed api Id issue for subscription

revert-70aa11f8
ayyoob 8 years ago
parent 159e067fed
commit 3c45f9af11

@ -101,11 +101,14 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
if (apiList.getList() != null && apiList.getList().size() > 0) { if (apiList.getList() != null && apiList.getList().size() > 0) {
for (APIInfo apiInfo : apiList.getList()) { for (APIInfo apiInfo : apiList.getList()) {
Subscription subscription = new Subscription(); 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.setApplicationId(application.getApplicationId());
subscription.tier(ApiApplicationConstants.DEFAULT_TIER); subscription.tier(ApiApplicationConstants.DEFAULT_TIER);
SubscriptionList subscriptionList = storeClient.getSubscriptions().subscriptionsGet 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; boolean subscriptionExist = false;
if (subscriptionList.getList() != null && subscriptionList.getList().size() > 0) { if (subscriptionList.getList() != null && subscriptionList.getList().size() > 0) {
for (Subscription subs : subscriptionList.getList()) { for (Subscription subs : subscriptionList.getList()) {

@ -67,7 +67,9 @@
org.wso2.carbon.utils, org.wso2.carbon.utils,
com.fasterxml.jackson.annotation, com.fasterxml.jackson.annotation,
io.swagger.annotations, io.swagger.annotations,
org.wso2.carbon.core.util org.wso2.carbon.core.util,
javax.xml,
org.wso2.carbon.base
</Import-Package> </Import-Package>
<Embed-Dependency> <Embed-Dependency>
jsr311-api, jsr311-api,

Loading…
Cancel
Save