public String getComponentState(String serviceName, String componentName) {
    Map<String, Set<String>> serviceHostComponents = hostComponents.get(serviceName);
    if (serviceHostComponents != null) {

      for (Map.Entry<String, Set<String>> entry : serviceHostComponents.entrySet()) {
        String      hostName       = entry.getKey();
        Set<String> componentNames = entry.getValue();

        for (String name : componentNames) {
          if (name.equals(componentName)) {
            if (isClientOnlyComponent(componentName)) return "INSTALLED";
            if (stateProvider.getRunningState(hostName, componentName) != StateProvider.State.Running) {
              return "INSTALLED";
            }
          }
        }
      }
    }

    return "STARTED";
  }
Get the component state from the give service name and component name.

@param serviceName    the service name
@param componentName  the component name

@return the component state
contrib/ambari-scom/ambari-scom-server/src/main/java/org/apache/ambari/msi/ClusterDefinition.java