Search in sources :

Example 1 with FaultGatewaysException

use of org.wso2.carbon.apimgt.api.FaultGatewaysException in project carbon-apimgt by wso2.

the class APIProviderImplTest method testUpdateAPIforStateChange_ToPublished.

@Test
public void testUpdateAPIforStateChange_ToPublished() throws RegistryException, UserStoreException, APIManagementException, FaultGatewaysException, APIPersistenceException, XMLStreamException {
    APIIdentifier apiId = new APIIdentifier("admin", "API1", "1.0.0");
    Set<String> environments = new HashSet<String>();
    environments.add("Production");
    environments.add("Sandbox");
    API api = new API(apiId);
    api.setContext("/test");
    api.setStatus(APIConstants.CREATED);
    api.setAsDefaultVersion(true);
    api.setEnvironments(environments);
    api.setOrganization("carbon.super");
    Mockito.when(apimgtDAO.getPublishedDefaultVersion(apiId)).thenReturn("1.0.0");
    Map<String, String> failedGWEnv = new HashMap<String, String>();
    APIProviderImplWrapper apiProvider = new APIProviderImplWrapper(apiPersistenceInstance, apimgtDAO, scopesDAO, null, null);
    Mockito.when(artifactManager.newGovernanceArtifact(any(QName.class))).thenReturn(artifact);
    Mockito.when(APIUtil.createAPIArtifactContent(artifact, api)).thenReturn(artifact);
    RegistryService registryService = Mockito.mock(RegistryService.class);
    UserRegistry userRegistry = Mockito.mock(UserRegistry.class);
    ServiceReferenceHolder serviceReferenceHolder = TestUtils.getServiceReferenceHolder();
    RealmService realmService = Mockito.mock(RealmService.class);
    TenantManager tenantManager = Mockito.mock(TenantManager.class);
    PowerMockito.when(ServiceReferenceHolder.getInstance()).thenReturn(serviceReferenceHolder);
    Mockito.when(serviceReferenceHolder.getRegistryService()).thenReturn(registryService);
    Mockito.when(registryService.getConfigSystemRegistry(Mockito.anyInt())).thenReturn(userRegistry);
    Mockito.when(serviceReferenceHolder.getRealmService()).thenReturn(realmService);
    Mockito.when(realmService.getTenantManager()).thenReturn(tenantManager);
    PublisherAPI publisherAPI = Mockito.mock(PublisherAPI.class);
    PowerMockito.when(apiPersistenceInstance.addAPI(any(Organization.class), any(PublisherAPI.class))).thenReturn(publisherAPI);
    apiProvider.addAPI(api);
    // Mock Updating API
    Resource apiSourceArtifact = Mockito.mock(Resource.class);
    Mockito.when(apiSourceArtifact.getUUID()).thenReturn("12640983654");
    String apiSourcePath = "path";
    PowerMockito.when(APIUtil.getAPIPath(api.getId())).thenReturn(apiSourcePath);
    PowerMockito.when(apiProvider.registry.get(apiSourcePath)).thenReturn(apiSourceArtifact);
    Mockito.when(artifact.getAttribute(APIConstants.API_OVERVIEW_STATUS)).thenReturn("CREATED");
    Mockito.when(artifactManager.getGenericArtifact(apiSourceArtifact.getUUID())).thenReturn(artifact);
    PowerMockito.when(APIUtil.createAPIArtifactContent(artifact, api)).thenReturn(artifact);
    Mockito.when(artifact.getId()).thenReturn("12640983654");
    PowerMockito.when(GovernanceUtils.getArtifactPath(apiProvider.registry, "12640983654")).thenReturn(apiSourcePath);
    Mockito.doNothing().when(artifactManager).updateGenericArtifact(artifact);
    apiProvider.updateAPIforStateChange(api, APIConstants.CREATED, APIConstants.PUBLISHED);
    // From the 2 environments, only 1 was successful
    Assert.assertEquals(2, api.getEnvironments().size());
}
Also used : ServiceReferenceHolder(org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder) Organization(org.wso2.carbon.apimgt.persistence.dto.Organization) HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) Resource(org.wso2.carbon.registry.core.Resource) UserRegistry(org.wso2.carbon.registry.core.session.UserRegistry) RealmService(org.wso2.carbon.user.core.service.RealmService) PublisherAPI(org.wso2.carbon.apimgt.persistence.dto.PublisherAPI) APIIdentifier(org.wso2.carbon.apimgt.api.model.APIIdentifier) ImportExportAPI(org.wso2.carbon.apimgt.impl.importexport.ImportExportAPI) SubscribedAPI(org.wso2.carbon.apimgt.api.model.SubscribedAPI) PublisherAPI(org.wso2.carbon.apimgt.persistence.dto.PublisherAPI) API(org.wso2.carbon.apimgt.api.model.API) RegistryService(org.wso2.carbon.registry.core.service.RegistryService) TenantManager(org.wso2.carbon.user.core.tenant.TenantManager) HashSet(java.util.HashSet) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 2 with FaultGatewaysException

use of org.wso2.carbon.apimgt.api.FaultGatewaysException in project carbon-apimgt by wso2.

the class APIProviderImplTest method testUpdateAPIforStateChange_ToRetired.

@Test
public void testUpdateAPIforStateChange_ToRetired() throws RegistryException, UserStoreException, APIManagementException, FaultGatewaysException, WorkflowException, APIPersistenceException, XMLStreamException {
    APIIdentifier apiId = new APIIdentifier("admin", "API1", "1.0.0");
    Set<String> environments = new HashSet<String>();
    environments.add("Production");
    environments.add("Sandbox");
    API api = new API(apiId);
    api.setContext("/test");
    api.setStatus(APIConstants.CREATED);
    api.setAsDefaultVersion(true);
    api.setEnvironments(environments);
    api.setOrganization("carbon.super");
    Mockito.when(apimgtDAO.getPublishedDefaultVersion(apiId)).thenReturn("1.0.0");
    Map<String, String> failedGWEnv = new HashMap<String, String>();
    APIProviderImplWrapper apiProvider = new APIProviderImplWrapper(apiPersistenceInstance, apimgtDAO, scopesDAO, null, null);
    Mockito.when(artifactManager.newGovernanceArtifact(any(QName.class))).thenReturn(artifact);
    Mockito.when(APIUtil.createAPIArtifactContent(artifact, api)).thenReturn(artifact);
    RegistryService registryService = Mockito.mock(RegistryService.class);
    UserRegistry userRegistry = Mockito.mock(UserRegistry.class);
    ServiceReferenceHolder serviceReferenceHolder = TestUtils.getServiceReferenceHolder();
    RealmService realmService = Mockito.mock(RealmService.class);
    TenantManager tenantManager = Mockito.mock(TenantManager.class);
    PowerMockito.when(ServiceReferenceHolder.getInstance()).thenReturn(serviceReferenceHolder);
    Mockito.when(serviceReferenceHolder.getRegistryService()).thenReturn(registryService);
    Mockito.when(registryService.getConfigSystemRegistry(Mockito.anyInt())).thenReturn(userRegistry);
    Mockito.when(serviceReferenceHolder.getRealmService()).thenReturn(realmService);
    Mockito.when(realmService.getTenantManager()).thenReturn(tenantManager);
    PublisherAPI publisherAPI = Mockito.mock(PublisherAPI.class);
    PowerMockito.when(apiPersistenceInstance.addAPI(any(Organization.class), any(PublisherAPI.class))).thenReturn(publisherAPI);
    apiProvider.addAPI(api);
    // Mock Updating API
    Resource apiSourceArtifact = Mockito.mock(Resource.class);
    Mockito.when(apiSourceArtifact.getUUID()).thenReturn("12640983654");
    String apiSourcePath = "path";
    PowerMockito.when(APIUtil.getAPIPath(api.getId())).thenReturn(apiSourcePath);
    PowerMockito.when(apiProvider.registry.get(apiSourcePath)).thenReturn(apiSourceArtifact);
    Mockito.when(artifact.getAttribute(APIConstants.API_OVERVIEW_STATUS)).thenReturn("CREATED");
    Mockito.when(artifactManager.getGenericArtifact(apiSourceArtifact.getUUID())).thenReturn(artifact);
    PowerMockito.when(APIUtil.createAPIArtifactContent(artifact, api)).thenReturn(artifact);
    Mockito.when(artifact.getId()).thenReturn("12640983654");
    PowerMockito.when(GovernanceUtils.getArtifactPath(apiProvider.registry, "12640983654")).thenReturn(apiSourcePath);
    Mockito.doNothing().when(artifactManager).updateGenericArtifact(artifact);
    WorkflowExecutorFactory wfe = PowerMockito.mock(WorkflowExecutorFactory.class);
    Mockito.when(WorkflowExecutorFactory.getInstance()).thenReturn(wfe);
    boolean status = apiProvider.updateAPIforStateChange(api, APIConstants.CREATED, APIConstants.RETIRED);
    Assert.assertEquals(2, api.getEnvironments().size());
    Assert.assertEquals(true, status);
}
Also used : ServiceReferenceHolder(org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder) Organization(org.wso2.carbon.apimgt.persistence.dto.Organization) HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) WorkflowExecutorFactory(org.wso2.carbon.apimgt.impl.workflow.WorkflowExecutorFactory) Resource(org.wso2.carbon.registry.core.Resource) UserRegistry(org.wso2.carbon.registry.core.session.UserRegistry) RealmService(org.wso2.carbon.user.core.service.RealmService) PublisherAPI(org.wso2.carbon.apimgt.persistence.dto.PublisherAPI) APIIdentifier(org.wso2.carbon.apimgt.api.model.APIIdentifier) ImportExportAPI(org.wso2.carbon.apimgt.impl.importexport.ImportExportAPI) SubscribedAPI(org.wso2.carbon.apimgt.api.model.SubscribedAPI) PublisherAPI(org.wso2.carbon.apimgt.persistence.dto.PublisherAPI) API(org.wso2.carbon.apimgt.api.model.API) RegistryService(org.wso2.carbon.registry.core.service.RegistryService) TenantManager(org.wso2.carbon.user.core.tenant.TenantManager) HashSet(java.util.HashSet) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 3 with FaultGatewaysException

use of org.wso2.carbon.apimgt.api.FaultGatewaysException in project carbon-apimgt by wso2.

the class APIProviderImplTest method prepareForChangeLifeCycleStatus.

/**
 * This method can be used when invoking changeLifeCycleStatus()
 */
private void prepareForChangeLifeCycleStatus(APIProviderImplWrapper apiProvider, ApiMgtDAO apimgtDAO, APIIdentifier apiId, GenericArtifact apiArtifact) throws GovernanceException, APIManagementException, FaultGatewaysException, WorkflowException, XMLStreamException {
    Mockito.when(APIUtil.getAPIArtifact(apiId, apiProvider.registry)).thenReturn(apiArtifact);
    Mockito.when(apiArtifact.getAttribute(APIConstants.API_OVERVIEW_PROVIDER)).thenReturn("admin");
    Mockito.when(apiArtifact.getAttribute(APIConstants.API_OVERVIEW_NAME)).thenReturn("API1");
    Mockito.when(apiArtifact.getAttribute(APIConstants.API_OVERVIEW_VERSION)).thenReturn("1.0.0");
    Mockito.when(apiArtifact.getLifecycleState()).thenReturn("CREATED");
    Mockito.when(apimgtDAO.getAPIID(apiUUID)).thenReturn(1);
    // Workflow has not started, this will trigger the executor
    WorkflowDTO wfDTO1 = Mockito.mock(WorkflowDTO.class);
    Mockito.when(wfDTO1.getStatus()).thenReturn(null);
    WorkflowDTO wfDTO2 = Mockito.mock(WorkflowDTO.class);
    Mockito.when(wfDTO2.getStatus()).thenReturn(WorkflowStatus.APPROVED);
    Mockito.when(apimgtDAO.retrieveWorkflowFromInternalReference("1", WorkflowConstants.WF_TYPE_AM_API_STATE)).thenReturn(wfDTO1, wfDTO2);
    ServiceReferenceHolder sh = TestUtils.getServiceReferenceHolder();
    APIManagerConfigurationService amConfigService = Mockito.mock(APIManagerConfigurationService.class);
    APIManagerConfiguration amConfig = Mockito.mock(APIManagerConfiguration.class);
    PowerMockito.when(sh.getAPIManagerConfigurationService()).thenReturn(amConfigService);
    PowerMockito.when(amConfigService.getAPIManagerConfiguration()).thenReturn(amConfig);
    WorkflowProperties workflowProperties = Mockito.mock(WorkflowProperties.class);
    Mockito.when(workflowProperties.getWorkflowCallbackAPI()).thenReturn("");
    Mockito.when(amConfig.getWorkflowProperties()).thenReturn(workflowProperties);
    WorkflowExecutorFactory wfe = PowerMockito.mock(WorkflowExecutorFactory.class);
    Mockito.when(WorkflowExecutorFactory.getInstance()).thenReturn(wfe);
    WorkflowExecutor apiStateWFExecutor = new APIStateChangeSimpleWorkflowExecutor();
    Mockito.when(wfe.getWorkflowExecutor(WorkflowConstants.WF_TYPE_AM_API_STATE)).thenReturn(apiStateWFExecutor);
    Mockito.when(APIUtil.isAnalyticsEnabled()).thenReturn(false);
}
Also used : ServiceReferenceHolder(org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder) WorkflowDTO(org.wso2.carbon.apimgt.impl.dto.WorkflowDTO) WorkflowExecutorFactory(org.wso2.carbon.apimgt.impl.workflow.WorkflowExecutorFactory) APIStateChangeSimpleWorkflowExecutor(org.wso2.carbon.apimgt.impl.workflow.APIStateChangeSimpleWorkflowExecutor) WorkflowExecutor(org.wso2.carbon.apimgt.impl.workflow.WorkflowExecutor) APIStateChangeSimpleWorkflowExecutor(org.wso2.carbon.apimgt.impl.workflow.APIStateChangeSimpleWorkflowExecutor) WorkflowProperties(org.wso2.carbon.apimgt.impl.dto.WorkflowProperties)

Example 4 with FaultGatewaysException

use of org.wso2.carbon.apimgt.api.FaultGatewaysException in project carbon-apimgt by wso2.

the class APIProviderImpl method updateAPIProductForStateChange.

/**
 * Update API Product in registry for lifecycle state change
 *
 * @param apiProduct    API Product Object
 * @param currentStatus Current state of API Product
 * @param newStatus     New state of API Product
 * @return boolean indicates success or failure
 * @throws APIManagementException if there is an error when updating API Product for lifecycle state
 * @throws FaultGatewaysException if there is an error when updating API Product for lifecycle state
 */
public void updateAPIProductForStateChange(APIProduct apiProduct, String currentStatus, String newStatus) throws APIManagementException, FaultGatewaysException {
    String provider = apiProduct.getId().getProviderName();
    boolean isTenantFlowStarted = false;
    try {
        String tenantDomain = MultitenantUtils.getTenantDomain(APIUtil.replaceEmailDomainBack(provider));
        if (tenantDomain != null && !MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) {
            isTenantFlowStarted = true;
            PrivilegedCarbonContext.startTenantFlow();
            PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true);
        }
        if (!currentStatus.equals(newStatus)) {
            apiProduct.setState(newStatus);
            // If API status changed to publish we should add it to recently added APIs list
            // this should happen in store-publisher cluster domain if deployment is distributed
            // IF new API published we will add it to recently added APIs
            Caching.getCacheManager(APIConstants.API_MANAGER_CACHE_MANAGER).getCache(APIConstants.RECENTLY_ADDED_API_CACHE_NAME).removeAll();
            if (APIConstants.RETIRED.equals(newStatus)) {
                cleanUpPendingSubscriptionCreationProcessesByAPI(apiProduct.getUuid());
                apiMgtDAO.removeAllSubscriptions(apiProduct.getUuid());
                deleteAPIProductRevisions(apiProduct.getUuid(), tenantDomain);
            }
            PublisherAPIProduct publisherAPIProduct = APIProductMapper.INSTANCE.toPublisherApiProduct(apiProduct);
            try {
                apiPersistenceInstance.updateAPIProduct(new Organization(apiProduct.getOrganization()), publisherAPIProduct);
            } catch (APIPersistenceException e) {
                handleException("Error while persisting the updated API Product", e);
            }
        }
    } finally {
        if (isTenantFlowStarted) {
            PrivilegedCarbonContext.endTenantFlow();
        }
    }
}
Also used : APIPersistenceException(org.wso2.carbon.apimgt.persistence.exceptions.APIPersistenceException) Organization(org.wso2.carbon.apimgt.persistence.dto.Organization) PublisherAPIProduct(org.wso2.carbon.apimgt.persistence.dto.PublisherAPIProduct)

Example 5 with FaultGatewaysException

use of org.wso2.carbon.apimgt.api.FaultGatewaysException in project carbon-apimgt by wso2.

the class APIProviderImpl method updateAPI.

/**
 * Updates an existing API
 *
 * @param api API
 * @throws org.wso2.carbon.apimgt.api.APIManagementException if failed to update API
 * @throws org.wso2.carbon.apimgt.api.FaultGatewaysException on Gateway Failure
 */
@Override
public void updateAPI(API api) throws APIManagementException, FaultGatewaysException {
    boolean isValid = isAPIUpdateValid(api);
    if (!isValid) {
        throw new APIManagementException(" User doesn't have permission for update");
    }
    API oldApi = getAPIbyUUID(api.getUuid(), api.getOrganization());
    String organization = api.getOrganization();
    if (!oldApi.getStatus().equals(api.getStatus())) {
        // Use changeAPIStatus for that kind of updates.
        throw new APIManagementException("Invalid API update operation involving API status changes");
    }
    validateKeyManagers(api);
    Gson gson = new Gson();
    Map<String, String> oldMonetizationProperties = gson.fromJson(oldApi.getMonetizationProperties().toString(), HashMap.class);
    if (oldMonetizationProperties != null && !oldMonetizationProperties.isEmpty()) {
        Map<String, String> newMonetizationProperties = gson.fromJson(api.getMonetizationProperties().toString(), HashMap.class);
        if (newMonetizationProperties != null) {
            for (Map.Entry<String, String> entry : oldMonetizationProperties.entrySet()) {
                String newValue = newMonetizationProperties.get(entry.getKey());
                if (StringUtils.isAllBlank(newValue)) {
                    newMonetizationProperties.put(entry.getKey(), entry.getValue());
                }
            }
            JSONParser parser = new JSONParser();
            try {
                JSONObject jsonObj = (JSONObject) parser.parse(gson.toJson(newMonetizationProperties));
                api.setMonetizationProperties(jsonObj);
            } catch (ParseException e) {
                throw new APIManagementException("Error when parsing monetization properties ", e);
            }
        }
    }
    String publishedDefaultVersion = getPublishedDefaultVersion(api.getId());
    // Update WSDL in the registry
    if (api.getWsdlUrl() != null && api.getWsdlResource() == null) {
        updateWsdlFromUrl(api);
    }
    if (api.getWsdlResource() != null) {
        updateWsdlFromResourceFile(api);
    }
    boolean updatePermissions = false;
    if (APIUtil.isAccessControlEnabled()) {
        if (!oldApi.getAccessControl().equals(api.getAccessControl()) || (APIConstants.API_RESTRICTED_VISIBILITY.equals(oldApi.getAccessControl()) && !api.getAccessControlRoles().equals(oldApi.getAccessControlRoles())) || !oldApi.getVisibility().equals(api.getVisibility()) || (APIConstants.API_RESTRICTED_VISIBILITY.equals(oldApi.getVisibility()) && !api.getVisibleRoles().equals(oldApi.getVisibleRoles()))) {
            updatePermissions = true;
        }
    } else if (!oldApi.getVisibility().equals(api.getVisibility()) || (APIConstants.API_RESTRICTED_VISIBILITY.equals(oldApi.getVisibility()) && !api.getVisibleRoles().equals(oldApi.getVisibleRoles()))) {
        updatePermissions = true;
    }
    updateEndpointSecurity(oldApi, api);
    String apiUUid = updateApiArtifact(api, true, updatePermissions);
    api.setUuid(apiUUid);
    if (!oldApi.getContext().equals(api.getContext())) {
        api.setApiHeaderChanged(true);
    }
    int tenantId;
    String tenantDomain = MultitenantUtils.getTenantDomain(APIUtil.replaceEmailDomainBack(api.getId().getProviderName()));
    try {
        tenantId = ServiceReferenceHolder.getInstance().getRealmService().getTenantManager().getTenantId(tenantDomain);
    } catch (UserStoreException e) {
        throw new APIManagementException("Error in retrieving Tenant Information while updating api :" + api.getId().getApiName(), e);
    }
    validateResourceThrottlingTiers(api, tenantDomain);
    // get product resource mappings on API before updating the API. Update uri templates on api will remove all
    // product mappings as well.
    List<APIProductResource> productResources = apiMgtDAO.getProductMappingsForAPI(api);
    updateAPI(api, tenantId, userNameWithoutChange);
    updateProductResourceMappings(api, organization, productResources);
    if (log.isDebugEnabled()) {
        log.debug("Successfully updated the API: " + api.getId() + " in the database");
    }
    JSONObject apiLogObject = new JSONObject();
    apiLogObject.put(APIConstants.AuditLogConstants.NAME, api.getId().getApiName());
    apiLogObject.put(APIConstants.AuditLogConstants.CONTEXT, api.getContext());
    apiLogObject.put(APIConstants.AuditLogConstants.VERSION, api.getId().getVersion());
    apiLogObject.put(APIConstants.AuditLogConstants.PROVIDER, api.getId().getProviderName());
    APIUtil.logAuditMessage(APIConstants.AuditLogConstants.API, apiLogObject.toString(), APIConstants.AuditLogConstants.UPDATED, this.username);
    // update doc visibility
    List<Documentation> docsList = getAllDocumentation(api.getId());
    if (docsList != null) {
        Iterator it = docsList.iterator();
        while (it.hasNext()) {
            Object docsObject = it.next();
            Documentation docs = (Documentation) docsObject;
            updateDocVisibility(api, docs);
        }
    }
    // notify key manager with API update
    registerOrUpdateResourceInKeyManager(api, tenantDomain);
    int apiId = apiMgtDAO.getAPIID(api.getUuid());
    if (publishedDefaultVersion != null) {
        if (api.isPublishedDefaultVersion() && !api.getId().getVersion().equals(publishedDefaultVersion)) {
            APIIdentifier previousDefaultVersionIdentifier = new APIIdentifier(api.getId().getProviderName(), api.getId().getApiName(), publishedDefaultVersion);
            sendUpdateEventToPreviousDefaultVersion(previousDefaultVersionIdentifier, organization);
        }
    }
    APIEvent apiEvent = new APIEvent(UUID.randomUUID().toString(), System.currentTimeMillis(), APIConstants.EventType.API_UPDATE.name(), tenantId, tenantDomain, api.getId().getApiName(), apiId, api.getUuid(), api.getId().getVersion(), api.getType(), api.getContext(), APIUtil.replaceEmailDomainBack(api.getId().getProviderName()), api.getStatus());
    APIUtil.sendNotification(apiEvent, APIConstants.NotifierType.API.name());
    // Extracting API details for the recommendation system
    if (recommendationEnvironment != null) {
        RecommenderEventPublisher extractor = new RecommenderDetailsExtractor(api, tenantDomain, APIConstants.ADD_API);
        Thread recommendationThread = new Thread(extractor);
        recommendationThread.start();
    }
}
Also used : RecommenderDetailsExtractor(org.wso2.carbon.apimgt.impl.recommendationmgt.RecommenderDetailsExtractor) Documentation(org.wso2.carbon.apimgt.api.model.Documentation) Gson(com.google.gson.Gson) APIManagementException(org.wso2.carbon.apimgt.api.APIManagementException) JSONObject(org.json.simple.JSONObject) APIEvent(org.wso2.carbon.apimgt.impl.notifier.events.APIEvent) APIProductResource(org.wso2.carbon.apimgt.api.model.APIProductResource) UserStoreException(org.wso2.carbon.user.api.UserStoreException) Iterator(java.util.Iterator) RecommenderEventPublisher(org.wso2.carbon.apimgt.impl.recommendationmgt.RecommenderEventPublisher) API(org.wso2.carbon.apimgt.api.model.API) ImportExportAPI(org.wso2.carbon.apimgt.impl.importexport.ImportExportAPI) SubscribedAPI(org.wso2.carbon.apimgt.api.model.SubscribedAPI) PublisherAPI(org.wso2.carbon.apimgt.persistence.dto.PublisherAPI) JSONParser(org.json.simple.parser.JSONParser) JSONObject(org.json.simple.JSONObject) APIIdentifier(org.wso2.carbon.apimgt.api.model.APIIdentifier) ParseException(org.json.simple.parser.ParseException) Map(java.util.Map) TreeMap(java.util.TreeMap) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap)

Aggregations

API (org.wso2.carbon.apimgt.api.model.API)26 APIManagementException (org.wso2.carbon.apimgt.api.APIManagementException)25 FaultGatewaysException (org.wso2.carbon.apimgt.api.FaultGatewaysException)20 SubscribedAPI (org.wso2.carbon.apimgt.api.model.SubscribedAPI)18 ImportExportAPI (org.wso2.carbon.apimgt.impl.importexport.ImportExportAPI)18 APIIdentifier (org.wso2.carbon.apimgt.api.model.APIIdentifier)17 APIProvider (org.wso2.carbon.apimgt.api.APIProvider)16 HashMap (java.util.HashMap)11 APIProduct (org.wso2.carbon.apimgt.api.model.APIProduct)11 Test (org.junit.Test)10 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)10 PublisherAPI (org.wso2.carbon.apimgt.persistence.dto.PublisherAPI)10 Map (java.util.Map)8 Organization (org.wso2.carbon.apimgt.persistence.dto.Organization)8 ArrayList (java.util.ArrayList)7 List (java.util.List)7 JSONObject (org.json.simple.JSONObject)6 APIProductIdentifier (org.wso2.carbon.apimgt.api.model.APIProductIdentifier)6 ServiceReferenceHolder (org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder)6 HashSet (java.util.HashSet)5