Java Code Examples for org.wso2.carbon.apimgt.impl.utils.APIUtil#getDomainMappings()

The following examples show how to use org.wso2.carbon.apimgt.impl.utils.APIUtil#getDomainMappings() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SettingsMappingUtil.java    From carbon-apimgt with Apache License 2.0 5 votes vote down vote up
/**
 * This method feeds data into the settingsDTO
 * @param isUserAvailable check if user is logged in
 * @return SettingsDTO
 * @throws APIManagementException
 */
public SettingsDTO fromSettingstoDTO(Boolean isUserAvailable) throws APIManagementException {
    SettingsDTO settingsDTO = new SettingsDTO();
    EnvironmentListDTO environmentListDTO = new EnvironmentListDTO();
    if (isUserAvailable) {
        Map<String, Environment> environments = APIUtil.getEnvironments();
        if (environments != null) {
            environmentListDTO = EnvironmentMappingUtil.fromEnvironmentCollectionToDTO(environments.values());
        }
        settingsDTO.setEnvironment(environmentListDTO.getList());
        String storeUrl = APIUtil.getStoreUrl();
        String loggedInUserTenantDomain = RestApiUtil.getLoggedInUserTenantDomain();
        Map<String, String> domainMappings =
                APIUtil.getDomainMappings(loggedInUserTenantDomain, APIConstants.API_DOMAIN_MAPPINGS_STORE);
        if (domainMappings.size() != 0) {
            Iterator entries = domainMappings.entrySet().iterator();
            while (entries.hasNext()) {
                Map.Entry thisEntry = (Map.Entry) entries.next();
                storeUrl = "https://" + thisEntry.getValue();
                break;
            }
        }
        settingsDTO.setStoreUrl(storeUrl);
        settingsDTO.setMonetizationAttributes(getMonetizationAttributes());
        settingsDTO.setSecurityAuditProperties(getSecurityAuditProperties());
        settingsDTO.setExternalStoresEnabled(
                APIUtil.isExternalStoresEnabled(RestApiUtil.getLoggedInUserTenantDomain()));
        settingsDTO.setDocVisibilityEnabled(APIUtil.isDocVisibilityLevelsEnabled());
    }
    settingsDTO.setScopes(GetScopeList());
    return settingsDTO;
}
 
Example 2
Source File: AbstractAPIManager.java    From carbon-apimgt with Apache License 2.0 2 votes vote down vote up
/**
 * Returns a list of pre-defined # {@link org.wso2.carbon.apimgt.api.model.Tier} in the system.
 *
 * @return Map<String, String>
 */
public Map<String, String> getTenantDomainMappings(String tenantDomain, String apiType) throws APIManagementException {
    return APIUtil.getDomainMappings(tenantDomain, apiType);
}