public ComponentInfo getComponentByName(String componentName) {
    for (ComponentInfo componentInfo : getComponents()) {
      if (componentInfo.getName().equals(componentName)) {
        return componentInfo;
      }
    }
    return null;
  }
Finds ComponentInfo by component name

@param componentName name of the component
@return ComponentInfo componentName or null
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java