use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.AlertTypesListDTO in project carbon-apimgt by wso2.
the class AlertTypesApiServiceImpl method getAdminAlertTypes.
@Override
public Response getAdminAlertTypes(MessageContext messageContext) throws APIManagementException {
try {
AdminAlertConfigurator adminAlertConfigurator = (AdminAlertConfigurator) AlertConfigManager.getInstance().getAlertConfigurator(AlertMgtConstants.ADMIN_DASHBOARD_AGENT);
List<org.wso2.carbon.apimgt.impl.dto.AlertTypeDTO> alertTypes = adminAlertConfigurator.getSupportedAlertTypes();
AlertTypesListDTO alertTypesListDTO = AlertsMappingUtil.fromAlertTypesListToAlertTypeListDTO(alertTypes);
return Response.status(Response.Status.OK).entity(alertTypesListDTO).build();
} catch (APIManagementException e) {
RestApiUtil.handleInternalServerError("Internal Server Error Occurred while retrieving alert types", e, log);
} catch (AlertManagementException e) {
log.warn("API Manager Analytics is not enabled", e);
return Response.status(Response.Status.NO_CONTENT).build();
}
return Response.status(Response.Status.NO_CONTENT).build();
}
use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.AlertTypesListDTO in project carbon-apimgt by wso2.
the class AlertsMappingUtil method fromAlertTypesListToAlertTypeListDTO.
/**
* Map AlertTypeDTO list to AlertTypesListDTO
*
* @param alertTypes
* @return
*/
public static AlertTypesListDTO fromAlertTypesListToAlertTypeListDTO(List<org.wso2.carbon.apimgt.impl.dto.AlertTypeDTO> alertTypes) {
AlertTypesListDTO alertTypesListDTO = new AlertTypesListDTO();
List<AlertTypeDTO> alertTypeDTOList = fromAlertTypesListToAlertTypeDTOList(alertTypes);
alertTypesListDTO.setAlerts(alertTypeDTOList);
alertTypesListDTO.setCount(alertTypeDTOList.size());
return alertTypesListDTO;
}
Aggregations