cleaned up components/apimgt-extensions

kernel-4.6.x
Amalka Subasinghe 4 years ago
parent c33e13b04c
commit 3ea79ecf77

@ -48,42 +48,10 @@
<artifactId>cxf-bundle-jaxrs</artifactId>
<scope>provided</scope>
</dependency>
<!--CXF -->
<!--<dependency>-->
<!--<groupId>org.apache.cxf</groupId>-->
<!--<artifactId>cxf-rt-frontend-jaxws</artifactId>-->
<!--<scope>provided</scope>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.apache.cxf</groupId>-->
<!--<artifactId>cxf-rt-frontend-jaxrs</artifactId>-->
<!--<scope>provided</scope>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.apache.cxf</groupId>-->
<!--<artifactId>cxf-rt-transports-http</artifactId>-->
<!--<scope>provided</scope>-->
<!--</dependency>-->
<!--JAX-RS -->
<!--<dependency>-->
<!--<groupId>org.codehaus.jackson</groupId>-->
<!--<artifactId>jackson-core-asl</artifactId>-->
<!--</dependency>-->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
</dependency>
<!--<dependency>-->
<!--<groupId>javax</groupId>-->
<!--<artifactId>javaee-web-api</artifactId>-->
<!--<scope>provided</scope>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>javax.ws.rs</groupId>-->
<!--<artifactId>jsr311-api</artifactId>-->
<!--<scope>provided</scope>-->
<!--</dependency>-->
<dependency>
<groupId>commons-httpclient.wso2</groupId>
<artifactId>commons-httpclient</artifactId>

@ -27,8 +27,6 @@ import org.wso2.carbon.apimgt.application.extension.api.util.RegistrationProfile
import org.wso2.carbon.apimgt.application.extension.constants.ApiApplicationConstants;
import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey;
import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException;
//import org.wso2.carbon.apimgt.integration.client.OAuthRequestInterceptor;
//import org.wso2.carbon.apimgt.integration.client.store.StoreClient;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;

@ -51,23 +51,13 @@
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.logging</artifactId>
</dependency>
<!--<dependency>-->
<!--<groupId>org.wso2.carbon.devicemgt</groupId>-->
<!--<artifactId>org.wso2.carbon.apimgt.integration.client</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.wso2.carbon.devicemgt</groupId>-->
<!--<artifactId>org.wso2.carbon.apimgt.integration.generated.client</artifactId>-->
<!--</dependency>-->
<dependency>
<groupId>org.wso2.carbon.apimgt</groupId>
<artifactId>org.wso2.carbon.apimgt.api</artifactId>
<version>9.0.5</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.apimgt</groupId>
<artifactId>org.wso2.carbon.apimgt.impl</artifactId>
<version>9.0.5</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -117,24 +107,30 @@
<Bundle-Description>API Management Application Bundle</Bundle-Description>
<Private-Package>org.wso2.carbon.apimgt.application.extension.internal</Private-Package>
<Import-Packages>
org.apache.commons.lang;version="[2.6,3)",org.apache.c
ommons.logging;version="[1.2,2)",org.json.simple,org.osgi.framework;v
ersion="${imp.package.version.osgi.framework}",org.osgi.service.component;version="${imp.package.version.osgi.service}",org.wso
2.carbon.apimgt.api;version="[9.0,10)",org.wso2.carbon.apimgt.api.dto
;version="[9.0,10)",org.wso2.carbon.apimgt.api.model;version="[9.0,10
)",org.wso2.carbon.apimgt.application.extension.bean,org.wso2.carbon.
apimgt.application.extension.dto,org.wso2.carbon.apimgt.application.e
xtension.exception,org.wso2.carbon.apimgt.impl;version="[9.0,10)",org
.wso2.carbon.apimgt.impl.utils;version="[9.0,10)",org.wso2.carbon.con
text;version="[4.6,5)",org.wso2.carbon.device.mgt.core.config.ui;vers
ion="[4.1,5)",org.wso2.carbon.identity.jwt.client.extension,org.wso2.
carbon.identity.jwt.client.extension.dto,org.wso2.carbon.identity.jwt
.client.extension.exception,org.wso2.carbon.identity.jwt.client.exten
sion.service,org.wso2.carbon.registry.core.exceptions;version="[1.0,2
)",org.wso2.carbon.registry.core.service;version="[1.0,2)",org.wso2.c
arbon.registry.indexing.service;version="[4.7,5)",org.wso2.carbon.use
r.api;version="[1.0,2)",org.wso2.carbon.user.core.service;version="[4
.6,5)",org.wso2.carbon.user.core.tenant;version="[4.6,5)"
org.apache.commons.lang;version="[2.6,3)",
org.apache.commons.logging;version="[1.2,2)",
org.json.simple,org.osgi.framework;version="${imp.package.version.osgi.framework}",
org.osgi.service.component;version="${imp.package.version.osgi.service}",
org.wso2.carbon.apimgt.api;version="[9.0,10)",
org.wso2.carbon.apimgt.api.dto;version="[9.0,10)",
org.wso2.carbon.apimgt.api.model;version="[9.0,10)",
org.wso2.carbon.apimgt.application.extension.bean,
org.wso2.carbon.apimgt.application.extension.dto,
org.wso2.carbon.apimgt.application.extension.exception,
org.wso2.carbon.apimgt.impl;version="[9.0,10)",
org.wso2.carbon.apimgt.impl.utils;version="[9.0,10)",
org.wso2.carbon.context;version="[4.6,5)",
org.wso2.carbon.device.mgt.core.config.ui;version="[4.1,5)",
org.wso2.carbon.identity.jwt.client.extension,
org.wso2.carbon.identity.jwt.client.extension.dto,
org.wso2.carbon.identity.jwt.client.extension.exception,
org.wso2.carbon.identity.jwt.client.extension.service,
org.wso2.carbon.registry.core.exceptions;version="[1.0,2)",
org.wso2.carbon.registry.core.service;version="[1.0,2)",
org.wso2.carbon.registry.indexing.service;version="[4.7,5)",
org.wso2.carbon.user.api;version="[1.0,2)",
org.wso2.carbon.user.core.service;version="[4.6,5)",
org.wso2.carbon.user.core.tenant;version="[4.6,5)"
</Import-Packages>
<Export-Package>
!org.wso2.carbon.apimgt.application.extension.internal,

@ -21,8 +21,6 @@ package org.wso2.carbon.apimgt.application.extension;
import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey;
import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException;
import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo;
//import org.wso2.carbon.apimgt.integration.client.store.StoreClient;
//import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo;
/**
* This comprise on operation that is been done with api manager from CDMF. This service needs to be implemented in APIM.
@ -62,11 +60,10 @@ public interface APIManagementProviderService {
* @param username to whom the application is created
* @param isAllowedAllDomains application is allowed to all the tenants
* @param validityTime validity period of the application
// * @param storeClient Specified store client
* @param scopes scopes
* @return consumerkey and secrete of the created application.
* @throws APIManagerException
*/
ApiApplicationKey generateAndRetrieveApplicationKeys(String apiApplicationName,
String tags[],
String keyType,

@ -18,20 +18,17 @@
package org.wso2.carbon.apimgt.application.extension;
//import feign.FeignException;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.apimgt.api.APIAdmin;
import org.wso2.carbon.apimgt.api.APIConsumer;
import org.wso2.carbon.apimgt.api.APIManagementException;
import org.wso2.carbon.apimgt.api.APIProvider;
import org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO;
import org.wso2.carbon.apimgt.api.model.API;
import org.wso2.carbon.apimgt.api.model.APIKey;
import org.wso2.carbon.apimgt.api.model.ApiTypeWrapper;
import org.wso2.carbon.apimgt.api.model.Application;
import org.wso2.carbon.apimgt.api.model.KeyManagerConfiguration;
import org.wso2.carbon.apimgt.api.model.SubscribedAPI;
import org.wso2.carbon.apimgt.api.model.Subscriber;
import org.wso2.carbon.apimgt.application.extension.bean.APIRegistrationProfile;
@ -43,17 +40,6 @@ import org.wso2.carbon.apimgt.application.extension.util.APIManagerUtil;
import org.wso2.carbon.apimgt.impl.APIAdminImpl;
import org.wso2.carbon.apimgt.impl.APIConstants;
import org.wso2.carbon.apimgt.impl.APIManagerFactory;
//import org.wso2.carbon.apimgt.integration.client.OAuthRequestInterceptor;
//import org.wso2.carbon.apimgt.integration.client.store.StoreClient;
//import org.wso2.carbon.apimgt.integration.generated.client.store.model.APIInfo;
//import org.wso2.carbon.apimgt.integration.generated.client.store.model.APIList;
//import org.wso2.carbon.apimgt.integration.generated.client.store.model.Application;
//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationInfo;
//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationKey;
//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationKeyGenerateRequest;
//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationList;
//import org.wso2.carbon.apimgt.integration.generated.client.store.model.Subscription;
//import org.wso2.carbon.apimgt.integration.generated.client.store.model.SubscriptionList;
import org.wso2.carbon.apimgt.impl.utils.APIUtil;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.core.config.ui.UIConfiguration;
@ -66,7 +52,6 @@ import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@ -78,66 +63,34 @@ import java.util.Set;
public class APIManagementProviderServiceImpl implements APIManagementProviderService {
private static final Log log = LogFactory.getLog(APIManagementProviderServiceImpl.class);
private static final String CONTENT_TYPE = "application/json";
private static final int MAX_API_PER_TAG = 200;
private static final String APP_TIER_TYPE = "application";
public static final APIManagerFactory API_MANAGER_FACTORY = APIManagerFactory.getInstance();
@Override
public boolean isTierLoaded() {
// StoreClient storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService()
// .getStoreClient();
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext()
.getTenantDomain();
// String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
// try {
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
try {
APIUtil.getTiers(APIConstants.TIER_APPLICATION_TYPE, tenantDomain);
return true;
} catch (APIManagementException e) {
log.error("APIs not ready", e);
}
// storeClient.getIndividualTier().tiersTierLevelTierNameGet(ApiApplicationConstants.DEFAULT_TIER,
// APP_TIER_TYPE,
// tenantDomain, CONTENT_TYPE, null, null);
return true;
// } catch (FeignException e) {
// log.error("Feign Exception", e);
// if (e.status() == 401) {
// OAuthRequestInterceptor oAuthRequestInterceptor = new OAuthRequestInterceptor();
// String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
// oAuthRequestInterceptor.removeToken(username, tenantDomain);
// try {
// storeClient.getIndividualTier().tiersTierLevelTierNameGet(ApiApplicationConstants.DEFAULT_TIER,
// APP_TIER_TYPE, tenantDomain, CONTENT_TYPE, null, null);
// } catch (FeignException ex) {
// log.error("Invalid Attempt : " + ex);
// }
// }
// } catch (Exception e) {
// log.error("APIs not ready", e);
// }
// return false;
return false;
}
@Override
public void removeAPIApplication(String applicationName, String username) throws APIManagerException {
// StoreClient storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService()
// .getStoreClient();
// ApplicationList applicationList = storeClient.getApplications()
// .applicationsGet("", applicationName, 1, 0, CONTENT_TYPE, null);
try {
APIConsumer apiConsumer = API_MANAGER_FACTORY.getAPIConsumer(username);
Application application = apiConsumer.getApplicationsByName(username, applicationName, "");
if (application != null) {
// ApplicationInfo applicationInfo = applicationList.getList().get(0);
// storeClient.getIndividualApplication().applicationsApplicationIdDelete(applicationInfo.getApplicationId(),
// null, null);
apiConsumer.removeApplication(application, username);
}
} catch (APIManagementException e) {
//todo:amalka
e.printStackTrace();
throw new APIManagerException("Failed to remove api application : " + applicationName, e);
}
@ -148,9 +101,8 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
*/
@Override
public synchronized ApiApplicationKey generateAndRetrieveApplicationKeys(String applicationName, String tags[],
String keyType, String username,
boolean isAllowedAllDomains,
String validityTime, String scopes) throws APIManagerException {
String keyType, String username, boolean isAllowedAllDomains, String validityTime, String scopes)
throws APIManagerException {
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
if (StringUtils.isEmpty(username)) {

@ -18,7 +18,6 @@
package org.wso2.carbon.apimgt.application.extension.internal;
import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService;
//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService;
import org.wso2.carbon.registry.core.service.TenantRegistryLoader;
@ -35,7 +34,6 @@ public class APIApplicationManagerExtensionDataHolder {
private TenantManager tenantManager;
private TenantRegistryLoader tenantRegistryLoader;
private TenantIndexingLoader indexLoader;
// private IntegrationClientService integrationClientService;
private JWTClientManagerService jwtClientManagerService;
private APIApplicationManagerExtensionDataHolder() {
@ -94,15 +92,6 @@ public class APIApplicationManagerExtensionDataHolder {
return indexLoader;
}
// public IntegrationClientService getIntegrationClientService() {
// return integrationClientService;
// }
//
// public void setIntegrationClientService(
// IntegrationClientService integrationClientService) {
// this.integrationClientService = integrationClientService;
// }
public JWTClientManagerService getJwtClientManagerService() {
if (jwtClientManagerService == null) {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();

@ -23,7 +23,6 @@ import org.osgi.framework.BundleContext;
import org.osgi.service.component.ComponentContext;;
import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService;
import org.wso2.carbon.apimgt.application.extension.APIManagementProviderServiceImpl;
//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
import org.wso2.carbon.registry.core.service.TenantRegistryLoader;
import org.wso2.carbon.registry.indexing.service.TenantIndexingLoader;
import org.wso2.carbon.user.core.service.RealmService;
@ -91,17 +90,6 @@ public class APIApplicationManagerExtensionServiceComponent {
APIApplicationManagerExtensionDataHolder.getInstance().setIndexLoaderService(null);
}
// protected void setIntegrationClientService(IntegrationClientService integrationClientService) {
// if (integrationClientService != null && log.isDebugEnabled()) {
// log.debug("integrationClientService initialized");
// }
// APIApplicationManagerExtensionDataHolder.getInstance().setIntegrationClientService(integrationClientService);
// }
//
// protected void unsetIntegrationClientService(IntegrationClientService integrationClientService) {
// APIApplicationManagerExtensionDataHolder.getInstance().setIntegrationClientService(null);
// }
/**
* Sets Realm Service.
*

@ -47,39 +47,46 @@
org.wso2.carbon.apimgt.integration.client.*,
!org.wso2.carbon.apimgt.integration.client.internal
</Export-Package>
<!--<Import-Package>-->
<!--feign;version="9.3",feign.auth;version="9.3",feign.cod-->
<!--ec;version="9.3",feign.gson;version="9.3",feign.jaxrs;version="9.3",f-->
<!--eign.okhttp;version="9.3",feign.slf4j;version="10.7",javax.net.ssl,ja-->
<!--vax.ws.rs,javax.xml,javax.xml.bind;version="2.3",javax.xml.bind.annot-->
<!--ation;version="2.3",javax.xml.parsers,okhttp3,org.apache.commons.lang-->
<!--;version="2.4",org.apache.commons.logging;version="1.2",org.osgi.fram-->
<!--ework;version="1.7",org.osgi.service.component;version="1.2",org.w3c.-->
<!--dom,org.wso2.carbon.apimgt.integration.client,org.wso2.carbon.apimgt.-->
<!--integration.client.configs,org.wso2.carbon.apimgt.integration.client.-->
<!--exception,org.wso2.carbon.apimgt.integration.client.internal,org.wso2-->
<!--.carbon.apimgt.integration.client.model,org.wso2.carbon.apimgt.integr-->
<!--ation.client.publisher,org.wso2.carbon.apimgt.integration.client.serv-->
<!--ice,org.wso2.carbon.apimgt.integration.client.store,org.wso2.carbon.a-->
<!--pimgt.integration.client.util,org.wso2.carbon.base;version="1.0",org.-->
<!--wso2.carbon.context;version="4.6",org.wso2.carbon.core.util;version="-->
<!--4.6",org.wso2.carbon.identity.jwt.client.extension,org.wso2.carbon.id-->
<!--entity.jwt.client.extension.dto,org.wso2.carbon.identity.jwt.client.e-->
<!--xtension.exception,org.wso2.carbon.identity.jwt.client.extension.serv-->
<!--ice,org.wso2.carbon.utils;version="4.6"-->
<!--org.osgi.framework.*;version="${imp.package.version.osgi.framework}",-->
<!--org.osgi.service.*;version="${imp.package.version.osgi.service}",-->
<!--</Import-Package>-->
<!--<Embed-Dependency>-->
<!--jsr311-api,-->
<!--feign-jaxrs,-->
<!--feign-okhttp,-->
<!--okhttp,-->
<!--okio-->
<!--</Embed-Dependency>-->
<Import-Package>
org.osgi.framework,
org.osgi.service.component,
feign,
feign.codec,
feign.auth,
feign.gson,
feign.slf4j,
org.wso2.carbon.apimgt.integration.generated.client.publisher.api,
org.wso2.carbon.apimgt.integration.generated.client.store.api,
javax.xml.bind,
javax.xml.bind.annotation,
javax.xml.parsers;resolution:=optional,
org.apache.commons.logging,
org.w3c.dom,
org.wso2.carbon.context,
org.wso2.carbon.identity.jwt.client.*,
org.wso2.carbon.user.api,
org.wso2.carbon.utils,
com.fasterxml.jackson.annotation,
io.swagger.annotations,
org.wso2.carbon.core.util,
javax.xml,
org.wso2.carbon.base,
javax.net.ssl,
org.apache.commons.lang,
android.util;resolution:=optional,
javax.annotation;resolution:=optional,
javax.net;resolution:=optional,
javax.security.auth.x500;resolution:=optional,
javax.crypto;resolution:=optional,
javax.crypto.spec;resolution:=optional
</Import-Package>
<Embed-Dependency>
jsr311-api,
feign-jaxrs,
feign-okhttp,
okhttp,
okio
</Embed-Dependency>
</instructions>
</configuration>
</plugin>
@ -113,60 +120,55 @@
</build>
<dependencies>
<!--<dependency>-->
<!--<groupId>com.squareup.okhttp3</groupId>-->
<!--<artifactId>okhttp</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.squareup.okio</groupId>-->
<!--<artifactId>okio</artifactId>-->
<!--</dependency>-->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-okhttp</artifactId>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-slf4j</artifactId>
<version>10.7.2</version>
</dependency>
<!--<dependency>-->
<!--<groupId>org.wso2.carbon</groupId>-->
<!--<artifactId>org.wso2.carbon.logging</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.osgi</groupId>-->
<!--<artifactId>org.eclipse.osgi</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.osgi</groupId>-->
<!--<artifactId>org.eclipse.osgi.services</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.google.code.gson</groupId>-->
<!--<artifactId>gson</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>javax.ws.rs</groupId>-->
<!--<artifactId>jsr311-api</artifactId>-->
<!--</dependency>-->
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.logging</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
</dependency>
<!--<dependency>-->
<!--<groupId>io.swagger</groupId>-->
<!--<artifactId>swagger-annotations</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>junit</groupId>-->
<!--<artifactId>junit</artifactId>-->
<!--</dependency>-->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-core</artifactId>
</dependency>
<!--<dependency>-->
<!--<groupId>io.github.openfeign</groupId>-->
<!--<artifactId>feign-jackson</artifactId>-->
<!--</dependency>-->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-jaxrs</artifactId>
@ -176,10 +178,10 @@
<artifactId>feign-gson</artifactId>
</dependency>
<!--<dependency>-->
<!--<groupId>org.testng</groupId>-->
<!--<artifactId>testng</artifactId>-->
<!--</dependency>-->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.identity.jwt.client.extension</artifactId>

@ -27,8 +27,7 @@ import feign.slf4j.Slf4jLogger;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.apimgt.integration.client.configs.APIMConfigReader;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.ApIsApi;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.ApiLifecycleApi;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.*;
import org.wso2.carbon.core.util.Utils;
/**
@ -37,15 +36,13 @@ import org.wso2.carbon.core.util.Utils;
public class PublisherClient {
private static final Log log = LogFactory.getLog(PublisherClient.class);
private ApIsApi apIsApi = null;
private ApiLifecycleApi apiLifecycleApi = null;
// private APIIndividualApi api = null;
// private APICollectionApi apis = null;
// private DocumentIndividualApi document = null;
// private ApplicationIndividualApi application = null;
// private EnvironmentCollectionApi environments = null;
// private SubscriptionApi subscriptions = null;
// private ThrottlingTierCollectionApi tiers = null;
private APIIndividualApi api = null;
private APICollectionApi apis = null;
private DocumentIndividualApi document = null;
private ApplicationIndividualApi application = null;
private EnvironmentCollectionApi environments = null;
private SubscriptionCollectionApi subscriptions = null;
private ThrottlingTierCollectionApi tiers = null;
/**
@ -60,50 +57,40 @@ public class PublisherClient {
.requestInterceptor(requestInterceptor).encoder(new GsonEncoder()).decoder(new GsonDecoder());
String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getPublisherEndpoint());
apIsApi = builder.target(ApIsApi.class, basePath);
apiLifecycleApi = builder.target(ApiLifecycleApi.class, basePath);
// api = builder.target(APIIndividualApi.class, basePath);
// apis = builder.target(APICollectionApi.class, basePath);
// document = builder.target(DocumentIndividualApi.class, basePath);
// application = builder.target(ApplicationIndividualApi.class, basePath);
// environments = builder.target(EnvironmentCollectionApi.class, basePath);
// subscriptions = builder.target(SubscriptionCollectionApi.class, basePath);
// tiers = builder.target(ThrottlingTierCollectionApi.class, basePath);
api = builder.target(APIIndividualApi.class, basePath);
apis = builder.target(APICollectionApi.class, basePath);
document = builder.target(DocumentIndividualApi.class, basePath);
application = builder.target(ApplicationIndividualApi.class, basePath);
environments = builder.target(EnvironmentCollectionApi.class, basePath);
subscriptions = builder.target(SubscriptionCollectionApi.class, basePath);
tiers = builder.target(ThrottlingTierCollectionApi.class, basePath);
}
public ApIsApi getApIsApi() {
return apIsApi;
public APIIndividualApi getApi() {
return api;
}
public ApiLifecycleApi getApiLifecycleApi() {
return apiLifecycleApi;
public APICollectionApi getApis() {
return apis;
}
// public APIIndividualApi getApi() {
// return api;
// }
//
// public APICollectionApi getApis() {
// return apis;
// }
//
// public DocumentIndividualApi getDocument() {
// return document;
// }
//
// public ApplicationIndividualApi getApplication() {
// return application;
// }
//
// public EnvironmentCollectionApi getEnvironments() {
// return environments;
// }
//
// public SubscriptionCollectionApi getSubscriptions() {
// return subscriptions;
// }
//
// public ThrottlingTierCollectionApi getTiers() {
// return tiers;
// }
public DocumentIndividualApi getDocument() {
return document;
}
public ApplicationIndividualApi getApplication() {
return application;
}
public EnvironmentCollectionApi getEnvironments() {
return environments;
}
public SubscriptionCollectionApi getSubscriptions() {
return subscriptions;
}
public ThrottlingTierCollectionApi getTiers() {
return tiers;
}
}

@ -39,17 +39,16 @@ import java.util.concurrent.TimeUnit;
public class StoreClient {
private static final org.apache.commons.logging.Log log = LogFactory.getLog(StoreClient.class);
private ApplicationsApi applicationsApi = null;
// private APICollectionApi apis = null;
// private ApIsApi individualApi = null;
// private ApplicationsApi applications = null;
// private ApplicationIndividualApi individualApplication = null;
// private SubscriptionCollectionApi subscriptions = null;
// private SubscriptionIndividualApi individualSubscription = null;
// private SubscriptionMultitpleApi subscriptionMultitpleApi = null;
// private ThrottlingTierIndividualApi individualTier = null;
// private TagsApi tags = null;
// private ThrottlingTierCollectionApi tiers = null;
private APICollectionApi apis = null;
private APIIndividualApi individualApi = null;
private ApplicationCollectionApi applications = null;
private ApplicationIndividualApi individualApplication = null;
private SubscriptionCollectionApi subscriptions = null;
private SubscriptionIndividualApi individualSubscription = null;
private SubscriptionMultitpleApi subscriptionMultitpleApi = null;
private ThrottlingTierIndividualApi individualTier = null;
private TagCollectionApi tags = null;
private ThrottlingTierCollectionApi tiers = null;
public StoreClient(RequestInterceptor requestInterceptor) {
@ -61,59 +60,58 @@ public class StoreClient {
.requestInterceptor(requestInterceptor).encoder(new GsonEncoder()).decoder(new GsonDecoder());
String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getStoreEndpoint());
applicationsApi = builder.target(ApplicationsApi.class, basePath);
// apis = builder.target(APICollectionApi.class, basePath);
// individualApi = builder.target(ApIsApi.class, basePath);
// applications = builder.target(ApplicationCollectionApi.class, basePath);
// individualApplication = builder.target(ApplicationIndividualApi.class, basePath);
// subscriptions = builder.target(SubscriptionCollectionApi.class, basePath);
// individualSubscription = builder.target(SubscriptionIndividualApi.class, basePath);
// subscriptionMultitpleApi = builder.target(SubscriptionMultitpleApi.class, basePath);
// tags = builder.target(TagCollectionApi.class, basePath);
// individualTier = builder.target(ThrottlingTierIndividualApi.class, basePath);
// tiers = builder.retryer(new Retryer.Default(100L, TimeUnit.SECONDS.toMillis(1L), 1))
// .options(new Request.Options(10000, 5000))
// .target(ThrottlingTierCollectionApi.class, basePath);
apis = builder.target(APICollectionApi.class, basePath);
individualApi = builder.target(APIIndividualApi.class, basePath);
applications = builder.target(ApplicationCollectionApi.class, basePath);
individualApplication = builder.target(ApplicationIndividualApi.class, basePath);
subscriptions = builder.target(SubscriptionCollectionApi.class, basePath);
individualSubscription = builder.target(SubscriptionIndividualApi.class, basePath);
subscriptionMultitpleApi = builder.target(SubscriptionMultitpleApi.class, basePath);
tags = builder.target(TagCollectionApi.class, basePath);
individualTier = builder.target(ThrottlingTierIndividualApi.class, basePath);
tiers = builder.retryer(new Retryer.Default(100L, TimeUnit.SECONDS.toMillis(1L), 1))
.options(new Request.Options(10000, 5000))
.target(ThrottlingTierCollectionApi.class, basePath);
}
// public APICollectionApi getApis() {
// return apis;
// }
//
// public APIIndividualApi getIndividualApi() {
// return individualApi;
// }
//
// public ApplicationCollectionApi getApplications() {
// return applications;
// }
//
// public ApplicationIndividualApi getIndividualApplication() {
// return individualApplication;
// }
//
// public SubscriptionCollectionApi getSubscriptions() {
// return subscriptions;
// }
//
// public SubscriptionIndividualApi getIndividualSubscription() {
// return individualSubscription;
// }
//
// public ThrottlingTierIndividualApi getIndividualTier() {
// return individualTier;
// }
//
// public TagCollectionApi getTags() {
// return tags;
// }
//
// public ThrottlingTierCollectionApi getTiers() {
// return tiers;
// }
//
// public SubscriptionMultitpleApi getSubscriptionMultitpleApi() {
// return subscriptionMultitpleApi;
// }
public APICollectionApi getApis() {
return apis;
}
public APIIndividualApi getIndividualApi() {
return individualApi;
}
public ApplicationCollectionApi getApplications() {
return applications;
}
public ApplicationIndividualApi getIndividualApplication() {
return individualApplication;
}
public SubscriptionCollectionApi getSubscriptions() {
return subscriptions;
}
public SubscriptionIndividualApi getIndividualSubscription() {
return individualSubscription;
}
public ThrottlingTierIndividualApi getIndividualTier() {
return individualTier;
}
public TagCollectionApi getTags() {
return tags;
}
public ThrottlingTierCollectionApi getTiers() {
return tiers;
}
public SubscriptionMultitpleApi getSubscriptionMultitpleApi() {
return subscriptionMultitpleApi;
}
}

@ -26,12 +26,12 @@
<url>http://wso2.org</url>
<build>
<plugins>
<!--swagger yaml is used to generate code-->
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>5.0.0</version>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<phase>process-resources</phase>
@ -41,11 +41,12 @@
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/publisher-api.yaml</inputSpec>
<generatorName>java</generatorName>
<language>java</language>
<configOptions>
<apiPackage>${project.artifactId}.publisher.api</apiPackage>
<modelPackage>${project.artifactId}.publisher.model</modelPackage>
</configOptions>
<library>feign</library>
</configuration>
</execution>
<execution>
@ -55,12 +56,13 @@
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/devportal-api.yaml</inputSpec>
<generatorName>java</generatorName>
<inputSpec>${project.basedir}/src/main/resources/store-api.yaml</inputSpec>
<language>java</language>
<configOptions>
<apiPackage>${project.artifactId}.store.api</apiPackage>
<modelPackage>${project.artifactId}.store.model</modelPackage>
</configOptions>
<library>feign</library>
</configuration>
</execution>
</executions>
@ -73,12 +75,12 @@
<!-- Replace java code that is generated from swagger to fix swagger client generation issues. -->
<execution>
<phase>process-resources</phase>
<id>replace-for-openapi-genenerated-code-publisher</id>
<id>replace-for-swagger-genenerated-code-publisher</id>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<file>${project.basedir}/target/generated-sources/openapi/src/main/java/org/wso2/carbon/apimgt/integration/generated/client/publisher/model/API.java</file>
<file>${project.basedir}/target/generated-sources/swagger/src/main/java/org/wso2/carbon/apimgt/integration/generated/client/publisher/model/API.java</file>
<replacements>
<replacement>
<token>CURRENT_TENANT</token>
@ -114,32 +116,27 @@
org.wso2.carbon.apimgt.integration.generated.client.store.model.*
</Export-Package>
<Import-Package>
com.google.gson;version="[2.8,3)",
com.google.gson.annotations;version="[2.8,3)",
com.google.gson.internal.bind.util,
com.google.gson.reflect;version="[2.8,3)",
com.google.gson.stream;version="[2.8,3)",
io.gsonfire;version="[1.8,2)",
io.swagger.annotations;version="[1.5,2)",
javax.annotation;version="[3.0,4)",
feign;version="${io.github.openfeign.version.range}",
feign.jackson;version="${io.github.openfeign.version.range}",
feign.codec;version="${io.github.openfeign.version.range}",
feign.auth;version="${io.github.openfeign.version.range}",
feign.gson;version="${io.github.openfeign.version.range}",
feign.slf4j;version="${io.github.openfeign.version.range}",
com.google.gson,
com.fasterxml.jackson.core;resolution:=optional,
com.fasterxml.jackson.annotation,
com.fasterxml.jackson.databind;resolution:=optional,
io.swagger.annotations,
javax.net.ssl,
okhttp3,
okhttp3.internal.http,
okhttp3.internal.tls,
okhttp3.logging,
okio,
org.apache.oltu.oauth2.client;version="[1.0,2)",
org.apache.oltu.oauth2.client.request;version="[1.0,2)",
org.apache.oltu.oauth2.client.response;version="[1.0,2)",
org.apache.oltu.oauth2.common.exception;version="[1.0,2)",
org.apache.oltu.oauth2.common.message.types;version="[1.0,2)",
org.threeten.bp;version="[1.5,2)",
org.threeten.bp.format;version="[1.5,2)",
org.threeten.bp.temporal;version="[1.5,2)",
org.wso2.carbon.apimgt.integration.generated.client.publisher.model,
org.wso2.carbon.apimgt.integration.generated.client.store.model
com.fasterxml.jackson.datatype.joda;resolution:=optional,
org.apache.oltu.oauth2.client.*;resolution:=optional,
org.apache.oltu.oauth2.common.*;resolution:=optional,
org.junit;resolution:=optional,
</Import-Package>
<Embed-Dependency>
jsr311-api,
feign-jaxrs
</Embed-Dependency>
</instructions>
</configuration>
</plugin>
@ -148,105 +145,60 @@
</build>
<dependencies>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.1.7</version>
</dependency>
<!---->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<!--<dependency>-->
<!--<groupId>javax.ws.rs</groupId>-->
<!--<artifactId>jsr311-api</artifactId>-->
<!--</dependency>-->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.1</version>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.apache.oltu.oauth2</groupId>
<artifactId>org.apache.oltu.oauth2.client</artifactId>
<version>1.0.1</version>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-core</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>4.9.1</version>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-jackson</artifactId>
</dependency>
<dependency>
<groupId>org.threeten</groupId>
<artifactId>threetenbp</artifactId>
<version>1.5.0</version>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-jaxrs</artifactId>
</dependency>
<dependency>
<groupId>io.gsonfire</groupId>
<artifactId>gson-fire</artifactId>
<version>1.8.5</version>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-gson</artifactId>
</dependency>
<dependency>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser</artifactId>
<version>2.0.25</version>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</dependency>
<dependency>
<groupId>org.apache.oltu.oauth2</groupId>
<artifactId>org.apache.oltu.oauth2.client</artifactId>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.orbit.com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-databind.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
</dependency>
<!--<dependency>-->
<!--<groupId>junit</groupId>-->
<!--<artifactId>junit</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>io.github.openfeign</groupId>-->
<!--<artifactId>feign-core</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>io.github.openfeign</groupId>-->
<!--<artifactId>feign-jackson</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>io.github.openfeign</groupId>-->
<!--<artifactId>feign-jaxrs</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>io.github.openfeign</groupId>-->
<!--<artifactId>feign-gson</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.testng</groupId>-->
<!--<artifactId>testng</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.apache.oltu.oauth2</groupId>-->
<!--<artifactId>org.apache.oltu.oauth2.client</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>io.github.openfeign</groupId>-->
<!--<artifactId>feign-slf4j</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.wso2.orbit.com.fasterxml.jackson.core</groupId>-->
<!--<artifactId>jackson-databind</artifactId>-->
<!--<version>${jackson-databind.version}</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.fasterxml.jackson.datatype</groupId>-->
<!--<artifactId>jackson-datatype-joda</artifactId>-->
<!--</dependency>-->
</dependencies>
<properties>
<maven.javadoc.skip>true</maven.javadoc.skip>

@ -43,22 +43,10 @@
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.testng</groupId>
@ -67,166 +55,68 @@
<dependency>
<groupId>org.wso2.tomcat</groupId>
<artifactId>tomcat</artifactId>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.core</artifactId>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.logging</artifactId>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.utils</artifactId>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.axis2.wso2</groupId>
<artifactId>axis2</artifactId>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.orbit.org.scannotation</groupId>
<artifactId>scannotation</artifactId>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.apimgt.annotations</artifactId>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.carbon.governance</groupId>
<artifactId>org.wso2.carbon.governance.api</artifactId>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.carbon.governance</groupId>
<artifactId>org.wso2.carbon.governance.lcm</artifactId>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.carbon.apimgt</groupId>
<artifactId>org.wso2.carbon.apimgt.api</artifactId>
<scope>provided</scope>
<version>9.0.5</version>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.carbon.apimgt</groupId>
<artifactId>org.wso2.carbon.apimgt.impl</artifactId>
<version>9.0.5</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.h2database.wso2</groupId>
@ -260,61 +150,75 @@
org.wso2.carbon.apimgt.webapp.publisher.*
</Export-Package>
<Import-Package>
com.google.gson;version="2.3",com.google.gson.reflect;
version="2.3",io.swagger.annotations,javax.servlet;version="2.6",javax.xml,javax.xml.bind,javax.xml.bind.annotat
ion,javax.xml.parsers,org.apache.catalina;version="9.0",org.apache.ca
talina.core;version="9.0",org.apache.commons.logging;version="1.2",org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",org.scannotation;version="1.0",org.scannotation.archiveiterator;ve
rsion="1.0",org.w3c.dom,org.wso2.carbon.apimgt.annotations.api,org.ws
o2.carbon.apimgt.api,org.wso2.carbon.apimgt.api.model,org.wso2.carbon
.apimgt.impl,org.wso2.carbon.apimgt.webapp.publisher,org.wso2.carbon.
apimgt.webapp.publisher.config,org.wso2.carbon.apimgt.webapp.publishe
r.dto,org.wso2.carbon.apimgt.webapp.publisher.exception,org.wso2.carb
on.apimgt.webapp.publisher.lifecycle.listener,org.wso2.carbon.apimgt.
webapp.publisher.lifecycle.util,org.wso2.carbon.base;version="1.0",or
g.wso2.carbon.context;version="4.6",org.wso2.carbon.core;version="4.6
",org.wso2.carbon.core.util;version="4.6",org.wso2.carbon.registry.co
re.service;version="1.0",org.wso2.carbon.user.api;version="1.0",org.w
so2.carbon.user.core.service;version="4.6",org.wso2.carbon.user.core.
tenant;version="4.6",org.wso2.carbon.utils;version="4.6",org.wso2.car
bon.utils.multitenancy;version="4.6"
com.google.gson;version="2.3",
com.google.gson.reflect;version="2.3",
io.swagger.annotations,
javax.servlet;version="2.6",
javax.xml,
javax.xml.bind,
javax.xml.bind.annotation,
javax.xml.parsers,
org.apache.catalina;version="9.0",
org.apache.catalina.core;version="9.0",
org.apache.commons.logging;version="1.2",
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.scannotation;version="1.0",
org.scannotation.archiveiterator;version="1.0",
org.w3c.dom,
org.wso2.carbon.apimgt.annotations.api,
org.wso2.carbon.apimgt.api,
org.wso2.carbon.apimgt.api.model,
org.wso2.carbon.apimgt.impl,
org.wso2.carbon.apimgt.webapp.publisher,
org.wso2.carbon.apimgt.webapp.publisher.config,
org.wso2.carbon.apimgt.webapp.publisher.dto,
org.wso2.carbon.apimgt.webapp.publisher.exception,
org.wso2.carbon.apimgt.webapp.publisher.lifecycle.listener,
org.wso2.carbon.apimgt.webapp.publisher.lifecycle.util,
org.wso2.carbon.base;version="1.0",
org.wso2.carbon.context;version="4.6",
org.wso2.carbon.core;version="4.6",
org.wso2.carbon.core.util;version="4.6",
org.wso2.carbon.registry.core.service;version="1.0",
org.wso2.carbon.user.api;version="1.0",
org.wso2.carbon.user.core.service;version="4.6",
org.wso2.carbon.user.core.tenant;version="4.6",
org.wso2.carbon.utils;version="4.6",
org.wso2.carbon.utils.multitenancy;version="4.6"
</Import-Package>
<Embed-Dependency>
<!--javax.ws.rs;scope=compile|runtime;inline=false-->
jsr311-api;scope=compile|runtime;inline=false
<!--scribe;scope=compile|runtime;inline=false;-->
</Embed-Dependency>
<!--<DynamicImport-Package>*</DynamicImport-Package>-->
</instructions>
</configuration>
</plugin>
<!--<plugin>-->
<!--<groupId>org.jacoco</groupId>-->
<!--<artifactId>jacoco-maven-plugin</artifactId>-->
<!--<configuration>-->
<!--<destFile>${basedir}/target/coverage-reports/jacoco-unit.exec</destFile>-->
<!--</configuration>-->
<!--<executions>-->
<!--<execution>-->
<!--<id>jacoco-initialize</id>-->
<!--<goals>-->
<!--<goal>prepare-agent</goal>-->
<!--</goals>-->
<!--</execution>-->
<!--<execution>-->
<!--<id>jacoco-site</id>-->
<!--<phase>test</phase>-->
<!--<goals>-->
<!--<goal>report</goal>-->
<!--</goals>-->
<!--<configuration>-->
<!--<dataFile>${basedir}/target/coverage-reports/jacoco-unit.exec</dataFile>-->
<!--<outputDirectory>${basedir}/target/coverage-reports/site</outputDirectory>-->
<!--</configuration>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<destFile>${basedir}/target/coverage-reports/jacoco-unit.exec</destFile>
</configuration>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-site</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${basedir}/target/coverage-reports/jacoco-unit.exec</dataFile>
<outputDirectory>${basedir}/target/coverage-reports/site</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

@ -44,9 +44,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.Set;
//import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.*;
//import org.wso2.carbon.apimgt.integration.client.publisher.PublisherClient;
/**
* This class represents the concrete implementation of the APIPublisherService that corresponds to providing all
* API publishing related operations.
@ -54,8 +51,6 @@ import java.util.Set;
public class APIPublisherServiceImpl implements APIPublisherService {
private static final String UNLIMITED_TIER = "Unlimited";
private static final String API_PUBLISH_ENVIRONMENT = "Production and Sandbox";
private static final String CONTENT_TYPE = "application/json";
private static final String PUBLISHED_STATUS = "PUBLISHED";
private static final String CREATED_STATUS = "CREATED";
private static final String PUBLISH_ACTION = "Publish";
public static final APIManagerFactory API_MANAGER_FACTORY = APIManagerFactory.getInstance();
@ -118,7 +113,6 @@ public class APIPublisherServiceImpl implements APIPublisherService {
String context = config.getContext();
context = context.startsWith("/") ? context : ("/" + context);
api.setContext(context + "/" + config.getVersion());
// api.setContext(context);
api.setStatus(CREATED_STATUS);
api.setWsdlUrl(null);
api.setResponseCache("Disabled");
@ -172,8 +166,6 @@ public class APIPublisherServiceImpl implements APIPublisherService {
api.setSubscriptionAvailability(APIConstants.SUBSCRIPTION_TO_CURRENT_TENANT);
api.setVisibility(APIConstants.API_PRIVATE_VISIBILITY);
}
// String endpointConfig = "{\"production_endpoints\":{\"url\":\"" + config.getEndpoint() +
// "\",\"config\":null},\"endpoint_type\":\"http\"}";
String endpointConfig = "{ \"endpoint_type\": \"http\", \"sandbox_endpoints\": { \"url\": \" " +
config.getEndpoint() + "\" }, \"production_endpoints\": { \"url\": \" "+ config.getEndpoint()+"\" } }";

@ -18,7 +18,6 @@
*/
package org.wso2.carbon.apimgt.webapp.publisher.internal;
//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
import org.wso2.carbon.apimgt.webapp.publisher.APIConfig;
import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherService;
import org.wso2.carbon.registry.core.service.RegistryService;
@ -37,8 +36,6 @@ public class APIPublisherDataHolder {
private RegistryService registryService;
private boolean isServerStarted;
private Stack<APIConfig> unpublishedApis = new Stack<>();
// private IntegrationClientService integrationClientService;
private static APIPublisherDataHolder thisInstance = new APIPublisherDataHolder();
private APIPublisherDataHolder() {
@ -117,12 +114,4 @@ public class APIPublisherDataHolder {
this.unpublishedApis = unpublishedApis;
}
// public IntegrationClientService getIntegrationClientService() {
// return integrationClientService;
// }
// public void setIntegrationClientService(
// IntegrationClientService integrationClientService) {
// this.integrationClientService = integrationClientService;
// }
}

@ -22,7 +22,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.framework.BundleContext;
import org.osgi.service.component.ComponentContext;
//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherService;
import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherServiceImpl;
import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherStartupHandler;
@ -45,7 +44,6 @@ import org.wso2.carbon.user.core.service.RealmService;
* policy="dynamic"
* bind="setRegistryService"
* unbind="unsetRegistryService"
*/
public class APIPublisherServiceComponent {
@ -116,14 +114,4 @@ public class APIPublisherServiceComponent {
APIPublisherDataHolder.getInstance().setRegistryService(null);
}
// protected void setIntegrationClientService(IntegrationClientService integrationClientService) {
// if (integrationClientService != null && log.isDebugEnabled()) {
// log.debug("integrationClientService initialized");
// }
// APIPublisherDataHolder.getInstance().setIntegrationClientService(integrationClientService);
// }
//
// protected void unsetIntegrationClientService(IntegrationClientService integrationClientService) {
// APIPublisherDataHolder.getInstance().setIntegrationClientService(null);
// }
}

@ -34,13 +34,10 @@
<url>http://wso2.org</url>
<modules>
<!--<module>org.wso2.carbon.apimgt.integration.generated.client</module>-->
<!--<module>org.wso2.carbon.apimgt.integration.client</module>-->
<module>org.wso2.carbon.apimgt.webapp.publisher</module>
<module>org.wso2.carbon.apimgt.application.extension</module>
<module>org.wso2.carbon.apimgt.application.extension.api</module>
<module>org.wso2.carbon.apimgt.annotations</module>
<!--<module>org.wso2.carbon.apimgt.handlers</module>-->
</modules>
<build>

@ -912,6 +912,16 @@
<artifactId>org.wso2.carbon.apimgt.keymgt</artifactId>
<version>${carbon.api.mgt.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.apimgt</groupId>
<artifactId>org.wso2.carbon.apimgt.api</artifactId>
<version>${carbon.api.mgt.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.apimgt</groupId>
<artifactId>org.wso2.carbon.apimgt.impl</artifactId>
<version>${carbon.api.mgt.version}</version>
</dependency>
<!-- End of API Management dependencies -->
<!-- Tomcat dependencies -->

Loading…
Cancel
Save