private List<AlertDefinition> getDefinitions(RootComponent component) {
    List<AlertDefinition> definitions = new ArrayList<>();

    InputStream inputStream = ClassLoader.getSystemResourceAsStream("alerts.json");
    InputStreamReader reader = new InputStreamReader(inputStream);

    try {
      Set<AlertDefinition> allDefinitions = m_factory.getAlertDefinitions(
          reader, RootService.AMBARI.name());

      String componentName = component.name();

      for (AlertDefinition definition : allDefinitions) {
        if (componentName.equals(definition.getComponentName())) {
          definitions.add(definition);
        }
      }

    } catch (Exception exception) {
      LOG.error("Unable to load the Ambari alerts JSON file", exception);
    }

    return definitions;
  }
Loads the definitions for the {@code AMBARI} service for the specified
component.

@param component
         the component (not {@code null}).
@return the alert definitions for {@code AMBARI} service for the given
        component.
ambari-server/src/main/java/org/apache/ambari/server/metadata/AmbariServiceAlertDefinitions.java