use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.APICategoryListDTO in project carbon-apimgt by wso2.
the class ApiCategoriesApiServiceImpl method getAllAPICategories.
public Response getAllAPICategories(MessageContext messageContext) {
try {
String tenantDomain = RestApiCommonUtil.getLoggedInUserTenantDomain();
List<APICategory> categoryList = APIUtil.getAllAPICategoriesOfOrganization(tenantDomain);
APICategoryListDTO categoryListDTO = APICategoryMappingUtil.fromCategoryListToCategoryListDTO(categoryList);
return Response.ok().entity(categoryListDTO).build();
} catch (APIManagementException e) {
String errorMessage = "Error while retrieving API categories";
RestApiUtil.handleInternalServerError(errorMessage, e, log);
}
return null;
}
use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.APICategoryListDTO in project carbon-apimgt by wso2.
the class APICategoryMappingUtil method fromCategoryListToCategoryListDTO.
/**
* Convert list of API Categories to CategoryListDTO.
*
* @param categories List of api categories
* @return CategoryListDTO list containing api category data
*/
public static APICategoryListDTO fromCategoryListToCategoryListDTO(List<APICategory> categories) {
APICategoryListDTO categoryListDTO = new APICategoryListDTO();
categoryListDTO.setCount(categories.size());
categoryListDTO.setList(fromCategoryListToCategoryDTOList(categories));
return categoryListDTO;
}
use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.APICategoryListDTO in project carbon-apimgt by wso2.
the class APICategoryMappingUtil method fromCategoryListToCategoryListDTO.
/**
* Convert list of API Categories to CategoryListDTO
*
* @param categories List of api categories
* @return CategoryListDTO list containing api category data
*/
public static APICategoryListDTO fromCategoryListToCategoryListDTO(List<APICategory> categories) {
APICategoryListDTO categoryListDTO = new APICategoryListDTO();
categoryListDTO.setCount(categories.size());
categoryListDTO.setList(fromCategoryListToCategoryDTOList(categories));
return categoryListDTO;
}
Aggregations