Search in sources :

Example 21 with APIBuilder

use of org.wso2.carbon.apimgt.core.models.API.APIBuilder in project carbon-apimgt by wso2.

the class APIPublisherImplTestCase method testAddApiSandboxEndpoint.

@Test(description = "Test add api with sandbox endpoint")
public void testAddApiSandboxEndpoint() throws APIManagementException, LifecycleException {
    Map<String, Endpoint> endpointMap = new HashMap<>();
    Map<String, Endpoint> resourceEndpointMap = new HashMap<>();
    Map<String, UriTemplate> uriTemplateMap = new HashMap();
    UriTemplate.UriTemplateBuilder uriTemplateBuilder = new UriTemplate.UriTemplateBuilder();
    uriTemplateBuilder.endpoint(resourceEndpointMap);
    uriTemplateBuilder.templateId("getApisApiIdGet");
    uriTemplateBuilder.uriTemplate("/apis/");
    uriTemplateBuilder.authType(APIMgtConstants.AUTH_APPLICATION_LEVEL_TOKEN);
    uriTemplateBuilder.policy(APIUtils.getDefaultAPIPolicy());
    uriTemplateBuilder.httpVerb("GET");
    uriTemplateMap.put("getApisApiIdGet", uriTemplateBuilder.build());
    API.APIBuilder apiBuilder = SampleTestObjectCreator.createDefaultAPI().id("").endpoint(endpointMap).uriTemplates(uriTemplateMap);
    ApiDAO apiDAO = Mockito.mock(ApiDAO.class);
    APILifecycleManager apiLifecycleManager = Mockito.mock(APILifecycleManager.class);
    Mockito.when(apiLifecycleManager.addLifecycle(APIMgtConstants.API_LIFECYCLE, USER)).thenReturn(new LifecycleState());
    String endpointId = String.valueOf(apiBuilder.getEndpoint().get("sandbox"));
    Endpoint endpoint = new Endpoint.Builder().id(endpointId).name("testEndpoint").build();
    Mockito.when(apiDAO.getEndpoint(endpointId)).thenReturn(endpoint);
    GatewaySourceGenerator gatewaySourceGenerator = Mockito.mock(GatewaySourceGenerator.class);
    APIGateway gateway = Mockito.mock(APIGateway.class);
    PolicyDAO policyDAO = Mockito.mock(PolicyDAO.class);
    LabelDAO labelDao = Mockito.mock(LabelDAO.class);
    Mockito.when(policyDAO.getSimplifiedPolicyByLevelAndName(APIMgtAdminService.PolicyLevel.api, APIMgtConstants.DEFAULT_API_POLICY)).thenReturn(new APIPolicy(APIMgtConstants.DEFAULT_API_POLICY));
    Mockito.when(policyDAO.getSimplifiedPolicyByLevelAndName(APIMgtAdminService.PolicyLevel.subscription, GOLD_TIER)).thenReturn(new SubscriptionPolicy(GOLD_TIER));
    Mockito.when(policyDAO.getSimplifiedPolicyByLevelAndName(APIMgtAdminService.PolicyLevel.subscription, SILVER_TIER)).thenReturn(new SubscriptionPolicy(SILVER_TIER));
    Mockito.when(policyDAO.getSimplifiedPolicyByLevelAndName(APIMgtAdminService.PolicyLevel.subscription, BRONZE_TIER)).thenReturn(new SubscriptionPolicy(BRONZE_TIER));
    APIPublisherImpl apiPublisher = getApiPublisherImpl(null, apiDAO, null, null, policyDAO, apiLifecycleManager, labelDao, null, null, null, gatewaySourceGenerator, gateway);
    apiPublisher.addAPI(apiBuilder);
    Mockito.verify(apiDAO, Mockito.times(1)).addAPI(apiBuilder.build());
    Mockito.verify(apiLifecycleManager, Mockito.times(1)).addLifecycle(APIMgtConstants.API_LIFECYCLE, USER);
}
Also used : HashMap(java.util.HashMap) APIBuilder(org.wso2.carbon.apimgt.core.models.API.APIBuilder) LifecycleState(org.wso2.carbon.lcm.core.impl.LifecycleState) UriTemplate(org.wso2.carbon.apimgt.core.models.UriTemplate) LabelDAO(org.wso2.carbon.apimgt.core.dao.LabelDAO) GatewaySourceGenerator(org.wso2.carbon.apimgt.core.api.GatewaySourceGenerator) APILifecycleManager(org.wso2.carbon.apimgt.core.api.APILifecycleManager) Endpoint(org.wso2.carbon.apimgt.core.models.Endpoint) SubscriptionPolicy(org.wso2.carbon.apimgt.core.models.policy.SubscriptionPolicy) API(org.wso2.carbon.apimgt.core.models.API) APIGateway(org.wso2.carbon.apimgt.core.api.APIGateway) APIPolicy(org.wso2.carbon.apimgt.core.models.policy.APIPolicy) ApiDAO(org.wso2.carbon.apimgt.core.dao.ApiDAO) PolicyDAO(org.wso2.carbon.apimgt.core.dao.PolicyDAO) Test(org.testng.annotations.Test)

Example 22 with APIBuilder

use of org.wso2.carbon.apimgt.core.models.API.APIBuilder in project carbon-apimgt by wso2.

the class SampleTestObjectCreator method createDefaultAPI.

public static API.APIBuilder createDefaultAPI() {
    Set<String> transport = new HashSet<>();
    transport.add(HTTP);
    transport.add(HTTPS);
    Set<String> tags = new HashSet<>();
    tags.add(TAG_CLIMATE);
    Set<Policy> policies = new HashSet<>();
    policies.add(goldSubscriptionPolicy);
    policies.add(silverSubscriptionPolicy);
    policies.add(bronzeSubscriptionPolicy);
    BusinessInformation businessInformation = new BusinessInformation();
    businessInformation.setBusinessOwner(NAME_BUSINESS_OWNER_1);
    businessInformation.setBusinessOwnerEmail(EMAIL_BUSINESS_OWNER_1);
    businessInformation.setTechnicalOwner(NAME_TECHNICAL_OWNER_1);
    businessInformation.setTechnicalOwnerEmail(EMAIL_TECHNICAL_OWNER_1);
    String permissionJson = "[{\"groupId\" : \"developer\", \"permission\" : " + "[\"READ\",\"UPDATE\"]},{\"groupId\" : \"admin\", \"permission\" : [\"READ\",\"UPDATE\"," + "\"DELETE\", \"MANAGE_SUBSCRIPTION\"]}]";
    Set<String> visibleRoles = new HashSet<>();
    visibleRoles.add("testRple");
    List<String> labels = new ArrayList<>();
    labels.add("testLabel");
    CorsConfiguration corsConfiguration = new CorsConfiguration();
    corsConfiguration.setEnabled(true);
    corsConfiguration.setAllowMethods(Arrays.asList(APIMgtConstants.FunctionsConstants.GET, APIMgtConstants.FunctionsConstants.POST, APIMgtConstants.FunctionsConstants.DELETE));
    corsConfiguration.setAllowHeaders(Arrays.asList(ALLOWED_HEADER_AUTHORIZATION, ALLOWED_HEADER_CUSTOM));
    corsConfiguration.setAllowCredentials(true);
    corsConfiguration.setAllowOrigins(Arrays.asList("*"));
    Map<String, Endpoint> endpointMap = new HashMap<>();
    endpointMap.put("TestEndpoint", createMockEndpoint());
    API.APIBuilder apiBuilder = new API.APIBuilder(ADMIN, "WeatherAPI", API_VERSION).id(UUID.randomUUID().toString()).context("weather").description("Get Weather Info").lifeCycleStatus(APIStatus.CREATED.getStatus()).lifecycleInstanceId(UUID.randomUUID().toString()).endpoint(Collections.emptyMap()).wsdlUri("http://localhost:9443/echo?wsdl").isResponseCachingEnabled(false).cacheTimeout(60).isDefaultVersion(false).apiPolicy(unlimitedApiPolicy).transport(transport).tags(tags).policies(policies).visibility(API.Visibility.PUBLIC).visibleRoles(visibleRoles).businessInformation(businessInformation).corsConfiguration(corsConfiguration).createdTime(LocalDateTime.now()).createdBy(ADMIN).updatedBy(ADMIN).lastUpdatedTime(LocalDateTime.now()).apiPermission(permissionJson).uriTemplates(getMockUriTemplates()).apiDefinition(apiDefinition).workflowStatus(WORKFLOW_STATUS).labels(labels).endpoint(endpointMap);
    Map map = new HashMap();
    map.put(DEVELOPER_ROLE_ID, 6);
    map.put(ADMIN_ROLE_ID, 15);
    apiBuilder.permissionMap(map);
    return apiBuilder;
}
Also used : ApplicationPolicy(org.wso2.carbon.apimgt.core.models.policy.ApplicationPolicy) SubscriptionPolicy(org.wso2.carbon.apimgt.core.models.policy.SubscriptionPolicy) Policy(org.wso2.carbon.apimgt.core.models.policy.Policy) APIPolicy(org.wso2.carbon.apimgt.core.models.policy.APIPolicy) QuotaPolicy(org.wso2.carbon.apimgt.core.models.policy.QuotaPolicy) BusinessInformation(org.wso2.carbon.apimgt.core.models.BusinessInformation) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) CorsConfiguration(org.wso2.carbon.apimgt.core.models.CorsConfiguration) Endpoint(org.wso2.carbon.apimgt.core.models.Endpoint) CompositeAPI(org.wso2.carbon.apimgt.core.models.CompositeAPI) API(org.wso2.carbon.apimgt.core.models.API) HashMap(java.util.HashMap) Map(java.util.Map) HashSet(java.util.HashSet)

Example 23 with APIBuilder

use of org.wso2.carbon.apimgt.core.models.API.APIBuilder in project carbon-apimgt by wso2.

the class APIImportExportTestCase method createApi.

private static API.APIBuilder createApi(String provider, String apiId, String name, String version, String description, Map<String, Endpoint> endpointTypeToIdMap) throws APIManagementException {
    Set<String> transport = new HashSet<>();
    transport.add("http");
    Set<Policy> policies = new HashSet<>();
    policies.add(new SubscriptionPolicy("Silver"));
    policies.add(new SubscriptionPolicy("Bronze"));
    Set<String> tags = new HashSet<>();
    tags.add("food");
    tags.add("beverage");
    BusinessInformation businessInformation = new BusinessInformation();
    businessInformation.setBusinessOwner("John Doe");
    businessInformation.setBusinessOwnerEmail("john.doe@annonymous.com");
    businessInformation.setTechnicalOwner("Jane Doe");
    businessInformation.setBusinessOwnerEmail("jane.doe@annonymous.com");
    CorsConfiguration corsConfiguration = new CorsConfiguration();
    corsConfiguration.setEnabled(true);
    corsConfiguration.setAllowMethods(Arrays.asList("GET", "POST", "DELETE"));
    corsConfiguration.setAllowHeaders(Arrays.asList("Authorization", "X-Custom"));
    corsConfiguration.setAllowCredentials(true);
    corsConfiguration.setAllowOrigins(Collections.singletonList("*"));
    API.APIBuilder apiBuilder = new API.APIBuilder(provider, name, version).id(apiId).context(UUID.randomUUID().toString()).description(description).lifeCycleStatus("CREATED").apiDefinition(api1Definition).wsdlUri("http://www.webservicex.net/globalweather.asmx?op=GetWeather?wsdl").isResponseCachingEnabled(true).cacheTimeout(120).isDefaultVersion(true).apiPolicy(new APIPolicy("Gold")).transport(transport).tags(tags).policies(policies).visibility(API.Visibility.RESTRICTED).visibleRoles(new HashSet<>(Arrays.asList("customer", "manager", "employee"))).businessInformation(businessInformation).corsConfiguration(corsConfiguration).createdTime(LocalDateTime.now()).createdBy("Adam Doe").lastUpdatedTime(LocalDateTime.now()).endpoint(endpointTypeToIdMap);
    apiBuilder.uriTemplates(Collections.emptyMap());
    return apiBuilder;
}
Also used : SubscriptionPolicy(org.wso2.carbon.apimgt.core.models.policy.SubscriptionPolicy) Policy(org.wso2.carbon.apimgt.core.models.policy.Policy) APIPolicy(org.wso2.carbon.apimgt.core.models.policy.APIPolicy) BusinessInformation(org.wso2.carbon.apimgt.core.models.BusinessInformation) CorsConfiguration(org.wso2.carbon.apimgt.core.models.CorsConfiguration) SubscriptionPolicy(org.wso2.carbon.apimgt.core.models.policy.SubscriptionPolicy) API(org.wso2.carbon.apimgt.core.models.API) APIPolicy(org.wso2.carbon.apimgt.core.models.policy.APIPolicy) HashSet(java.util.HashSet)

Example 24 with APIBuilder

use of org.wso2.carbon.apimgt.core.models.API.APIBuilder in project carbon-apimgt by wso2.

the class TestMappingUtilTestCase method testAPItoAPIDTOMappingAndAPIDTOtoAPIMapping.

@Test(description = "APIDTO mapping test case")
void testAPItoAPIDTOMappingAndAPIDTOtoAPIMapping() throws IOException {
    API.APIBuilder apiBuilder = SampleTestObjectCreator.createDefaultAPI();
    API api = apiBuilder.build();
    List<String> userSpecificPermission = new ArrayList<>();
    userSpecificPermission.add("userPermissions");
    api.setUserSpecificApiPermissions(userSpecificPermission);
    // Test mappings from API to APIDTO
    APIDTO apidto = MappingUtil.toAPIDto(api);
    assertEquals(api.getId(), apidto.getId());
    assertEquals(api.getName(), apidto.getName());
    assertEquals(api.getVersion(), apidto.getVersion());
    assertEquals(api.getContext(), apidto.getContext());
    assertEquals(api.getDescription(), apidto.getDescription());
    assertEquals((Boolean) api.isDefaultVersion(), apidto.getIsDefaultVersion());
    assertEquals(api.getVisibility().name(), apidto.getVisibility().name());
    assertEquals(api.isResponseCachingEnabled(), Boolean.parseBoolean(apidto.getResponseCaching()));
    assertEquals((Integer) api.getCacheTimeout(), apidto.getCacheTimeout());
    assertEquals(api.getVisibleRoles().size(), apidto.getVisibleRoles().size());
    assertEquals(api.getProvider(), apidto.getProvider());
    assertEquals(api.getApiPermission(), apidto.getPermission());
    assertEquals(api.getLifeCycleStatus(), apidto.getLifeCycleStatus());
    assertEquals(api.getWorkflowStatus(), apidto.getWorkflowStatus());
    assertEquals(MappingUtil.mapSecuritySchemeIntToList(api.getSecurityScheme()), apidto.getSecurityScheme());
    assertEquals(api.getTags().size(), apidto.getTags().size());
    assertEquals(api.getLabels().size(), apidto.getLabels().size());
    assertEquals(api.getTransport().size(), apidto.getTransport().size());
    assertEquals(api.getUserSpecificApiPermissions().size(), apidto.getUserPermissionsForApi().size());
    assertEquals(api.getPolicies().size(), apidto.getPolicies().size());
    assertEquals(api.getBusinessInformation().getBusinessOwner(), apidto.getBusinessInformation().getBusinessOwner());
    assertEquals(api.getBusinessInformation().getBusinessOwnerEmail(), apidto.getBusinessInformation().getBusinessOwnerEmail());
    assertEquals(api.getBusinessInformation().getTechnicalOwner(), apidto.getBusinessInformation().getTechnicalOwner());
    assertEquals(api.getBusinessInformation().getTechnicalOwnerEmail(), apidto.getBusinessInformation().getTechnicalOwnerEmail());
    assertEquals((Boolean) api.getCorsConfiguration().isAllowCredentials(), apidto.getCorsConfiguration().getAccessControlAllowCredentials());
    assertEquals((Boolean) api.getCorsConfiguration().isEnabled(), apidto.getCorsConfiguration().getCorsConfigurationEnabled());
    assertEquals(api.getCorsConfiguration().getAllowHeaders(), apidto.getCorsConfiguration().getAccessControlAllowHeaders());
    assertEquals(api.getCorsConfiguration().getAllowMethods(), apidto.getCorsConfiguration().getAccessControlAllowMethods());
    assertEquals(api.getCorsConfiguration().getAllowOrigins(), apidto.getCorsConfiguration().getAccessControlAllowOrigins());
    assertEquals(api.getEndpoint().get("TestEndpoint").getId(), apidto.getEndpoint().get(0).getKey());
    assertEquals(api.getUriTemplates().get("getApisApiIdGet").getTemplateId(), apidto.getOperations().get(0).getId());
    assertEquals(api.getUriTemplates().get("getApisApiIdGet").getAuthType(), apidto.getOperations().get(0).getAuthType());
    assertEquals(api.getUriTemplates().get("getApisApiIdGet").getHttpVerb(), apidto.getOperations().get(0).getHttpVerb());
    assertEquals(api.getUriTemplates().get("getApisApiIdGet").getUriTemplate(), apidto.getOperations().get(0).getUritemplate());
    assertEquals(api.getUriTemplates().get("getApisApiIdGet").getPolicy().getPolicyName(), apidto.getOperations().get(0).getPolicy());
    assertEquals(api.getApiPolicy().getPolicyName(), apidto.getApiPolicy());
    assertEquals(api.getCreatedTime().toString(), apidto.getCreatedTime());
    assertEquals(api.getLastUpdatedTime().toString(), apidto.getLastUpdatedTime());
    // Test mappings from APIDTO to API
    API mappedAPI = MappingUtil.toAPI(apidto).build();
    assertEquals(apidto.getId(), mappedAPI.getId());
    assertEquals(apidto.getName(), mappedAPI.getName());
    assertEquals(apidto.getVersion(), mappedAPI.getVersion());
    assertEquals(apidto.getContext(), mappedAPI.getContext());
    assertEquals(apidto.getDescription(), mappedAPI.getDescription());
    assertEquals(apidto.getIsDefaultVersion(), (Boolean) mappedAPI.isDefaultVersion());
    assertEquals(apidto.getVisibility().name(), mappedAPI.getVisibility().name());
    assertEquals(Boolean.parseBoolean(apidto.getResponseCaching()), mappedAPI.isResponseCachingEnabled());
    assertEquals(apidto.getCacheTimeout(), (Integer) mappedAPI.getCacheTimeout());
    assertEquals(apidto.getVisibleRoles().size(), mappedAPI.getVisibleRoles().size());
    assertEquals(apidto.getProvider(), mappedAPI.getProvider());
    assertEquals(apidto.getPermission(), mappedAPI.getApiPermission());
    assertEquals(apidto.getLifeCycleStatus(), mappedAPI.getLifeCycleStatus());
    assertEquals(MappingUtil.mapSecuritySchemeListToInt(apidto.getSecurityScheme()), mappedAPI.getSecurityScheme());
    // Npt mapped it's intentional
    assertNull(mappedAPI.getWorkflowStatus());
    assertEquals(apidto.getTags().size(), mappedAPI.getTags().size());
    assertEquals(apidto.getLabels().size(), mappedAPI.getLabels().size());
    assertEquals(apidto.getTransport().size(), mappedAPI.getTransport().size());
    // Npt mapped it's intentional
    assertNull(mappedAPI.getUserSpecificApiPermissions());
    assertEquals(apidto.getPolicies().size(), mappedAPI.getPolicies().size());
    assertEquals(apidto.getBusinessInformation().getBusinessOwner(), mappedAPI.getBusinessInformation().getBusinessOwner());
    assertEquals(apidto.getBusinessInformation().getBusinessOwnerEmail(), mappedAPI.getBusinessInformation().getBusinessOwnerEmail());
    assertEquals(apidto.getBusinessInformation().getTechnicalOwner(), mappedAPI.getBusinessInformation().getTechnicalOwner());
    assertEquals(apidto.getBusinessInformation().getTechnicalOwnerEmail(), mappedAPI.getBusinessInformation().getTechnicalOwnerEmail());
    assertEquals(apidto.getCorsConfiguration().getAccessControlAllowCredentials(), (Boolean) mappedAPI.getCorsConfiguration().isAllowCredentials());
    assertEquals(apidto.getCorsConfiguration().getCorsConfigurationEnabled(), (Boolean) mappedAPI.getCorsConfiguration().isEnabled());
    assertEquals(apidto.getCorsConfiguration().getAccessControlAllowHeaders(), mappedAPI.getCorsConfiguration().getAllowHeaders());
    assertEquals(apidto.getCorsConfiguration().getAccessControlAllowMethods(), mappedAPI.getCorsConfiguration().getAllowMethods());
    assertEquals(apidto.getCorsConfiguration().getAccessControlAllowOrigins(), mappedAPI.getCorsConfiguration().getAllowOrigins());
    assertEquals(apidto.getEndpoint().get(0).getKey(), mappedAPI.getEndpoint().get("TestEndpoint").getId());
    assertEquals(apidto.getOperations().get(0).getId(), mappedAPI.getUriTemplates().get("getApisApiIdGet").getTemplateId());
    assertEquals(apidto.getOperations().get(0).getAuthType(), mappedAPI.getUriTemplates().get("getApisApiIdGet").getAuthType());
    assertEquals(apidto.getOperations().get(0).getHttpVerb(), mappedAPI.getUriTemplates().get("getApisApiIdGet").getHttpVerb());
    assertEquals(apidto.getOperations().get(0).getUritemplate(), mappedAPI.getUriTemplates().get("getApisApiIdGet").getUriTemplate());
    assertEquals(apidto.getOperations().get(0).getPolicy(), mappedAPI.getUriTemplates().get("getApisApiIdGet").getPolicy().getPolicyName());
    assertEquals(apidto.getApiPolicy(), mappedAPI.getApiPolicy().getPolicyName());
}
Also used : APIDTO(org.wso2.carbon.apimgt.rest.api.publisher.dto.APIDTO) ArrayList(java.util.ArrayList) API(org.wso2.carbon.apimgt.core.models.API) Test(org.testng.annotations.Test)

Example 25 with APIBuilder

use of org.wso2.carbon.apimgt.core.models.API.APIBuilder in project carbon-apimgt by wso2.

the class ApisApiServiceImplTestCase method testApisImportDefinitionPostWSDLFile.

@Test
public void testApisImportDefinitionPostWSDLFile() throws Exception {
    printTestMethodName();
    File file = new File(getClass().getClassLoader().getResource(WSDL_FILE_LOCATION).getFile());
    FileInputStream fis = new FileInputStream(file);
    FileInfo fileInfo = new FileInfo();
    fileInfo.setFileName(WSDL_FILE);
    ApisApiServiceImpl apisApiService = new ApisApiServiceImpl();
    APIPublisher apiPublisher = powerMockDefaultAPIPublisher();
    String apiId = UUID.randomUUID().toString();
    API.APIBuilder apiBuilder = SampleTestObjectCreator.createDefaultAPI().id(apiId);
    API api = apiBuilder.build();
    APIDTO apiDto = MappingUtil.toAPIDto(api);
    ObjectMapper objectMapper = new ObjectMapper();
    String additionalProperties = objectMapper.writeValueAsString(apiDto);
    Mockito.doReturn(api).doThrow(new IllegalArgumentException()).when(apiPublisher).getAPIbyUUID(apiId);
    Mockito.doReturn(apiId).when(apiPublisher).addAPIFromWSDLFile(Mockito.argThat(getAPIBuilderMatcher(apiBuilder)), Mockito.eq(fis), Mockito.eq(false));
    Response response = apisApiService.apisImportDefinitionPost(WSDL, fis, fileInfo, null, additionalProperties, null, null, null, getRequest());
    fis.close();
    assertEquals(response.getStatus(), 201);
    assertTrue(response.getEntity().toString().contains(apiId));
}
Also used : WorkflowResponse(org.wso2.carbon.apimgt.core.api.WorkflowResponse) GeneralWorkflowResponse(org.wso2.carbon.apimgt.core.workflow.GeneralWorkflowResponse) Response(javax.ws.rs.core.Response) APIDTO(org.wso2.carbon.apimgt.rest.api.publisher.dto.APIDTO) FileInfo(org.wso2.msf4j.formparam.FileInfo) APIPublisher(org.wso2.carbon.apimgt.core.api.APIPublisher) API(org.wso2.carbon.apimgt.core.models.API) File(java.io.File) FileInputStream(java.io.FileInputStream) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

API (org.wso2.carbon.apimgt.core.models.API)85 Test (org.testng.annotations.Test)49 APIGateway (org.wso2.carbon.apimgt.core.api.APIGateway)49 ApiDAO (org.wso2.carbon.apimgt.core.dao.ApiDAO)45 APIBuilder (org.wso2.carbon.apimgt.core.models.API.APIBuilder)44 HashMap (java.util.HashMap)43 APILifecycleManager (org.wso2.carbon.apimgt.core.api.APILifecycleManager)37 GatewaySourceGenerator (org.wso2.carbon.apimgt.core.api.GatewaySourceGenerator)32 SubscriptionPolicy (org.wso2.carbon.apimgt.core.models.policy.SubscriptionPolicy)30 Endpoint (org.wso2.carbon.apimgt.core.models.Endpoint)29 APIManagementException (org.wso2.carbon.apimgt.core.exception.APIManagementException)28 CompositeAPI (org.wso2.carbon.apimgt.core.models.CompositeAPI)27 APIPolicy (org.wso2.carbon.apimgt.core.models.policy.APIPolicy)26 LabelDAO (org.wso2.carbon.apimgt.core.dao.LabelDAO)24 LifecycleState (org.wso2.carbon.lcm.core.impl.LifecycleState)23 PolicyDAO (org.wso2.carbon.apimgt.core.dao.PolicyDAO)20 Policy (org.wso2.carbon.apimgt.core.models.policy.Policy)18 HashSet (java.util.HashSet)17 APIMgtDAOException (org.wso2.carbon.apimgt.core.exception.APIMgtDAOException)17 APISubscriptionDAO (org.wso2.carbon.apimgt.core.dao.APISubscriptionDAO)16